summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--core/modules/announcements_feed/tests/src/FunctionalJavascript/AccessAnnouncementTest.php4
-rw-r--r--core/modules/announcements_feed/tests/src/FunctionalJavascript/AlertsJsonFeedTest.php4
-rw-r--r--core/modules/announcements_feed/tests/src/Kernel/AnnounceRendererTest.php4
-rw-r--r--core/modules/announcements_feed/tests/src/Unit/AnnounceFetcherUnitTest.php2
-rw-r--r--core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php2
-rw-r--r--core/modules/ban/tests/src/Kernel/Migrate/d7/MigrateBlockedIpsTest.php2
-rw-r--r--core/modules/ban/tests/src/Unit/BanMiddlewareTest.php4
-rw-r--r--core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php14
-rw-r--r--core/modules/big_pipe/tests/src/Functional/BigPipeTest.php8
-rw-r--r--core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipePreviewTest.php2
-rw-r--r--core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipeRegressionTest.php8
-rw-r--r--core/modules/big_pipe/tests/src/Kernel/BigPipeInterfacePreviewThemeSuggestionsTest.php2
-rw-r--r--core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php4
-rw-r--r--core/modules/big_pipe/tests/src/Unit/Render/FiberPlaceholderTest.php2
-rw-r--r--core/modules/big_pipe/tests/src/Unit/Render/ManyPlaceholderTest.php2
-rw-r--r--core/modules/big_pipe/tests/src/Unit/Render/Placeholder/BigPipeStrategyTest.php2
-rw-r--r--core/modules/big_pipe/tests/src/Unit/StackMiddleware/ContentLengthTest.php2
-rw-r--r--core/modules/block/tests/src/Functional/BlockAdminThemeTest.php4
-rw-r--r--core/modules/block/tests/src/Functional/BlockCacheTest.php10
-rw-r--r--core/modules/block/tests/src/Functional/BlockDemoTest.php2
-rw-r--r--core/modules/block/tests/src/Functional/BlockFormInBlockTest.php4
-rw-r--r--core/modules/block/tests/src/Functional/BlockHiddenRegionTest.php2
-rw-r--r--core/modules/block/tests/src/Functional/BlockHookOperationTest.php2
-rw-r--r--core/modules/block/tests/src/Functional/BlockHtmlTest.php2
-rw-r--r--core/modules/block/tests/src/Functional/BlockInstallTest.php2
-rw-r--r--core/modules/block/tests/src/Functional/BlockInvalidRegionTest.php2
-rw-r--r--core/modules/block/tests/src/Functional/BlockLanguageCacheTest.php2
-rw-r--r--core/modules/block/tests/src/Functional/BlockLanguageTest.php6
-rw-r--r--core/modules/block/tests/src/Functional/BlockRenderOrderTest.php2
-rw-r--r--core/modules/block/tests/src/Functional/BlockSystemBrandingTest.php2
-rw-r--r--core/modules/block/tests/src/Functional/BlockTest.php28
-rw-r--r--core/modules/block/tests/src/Functional/BlockUiTest.php20
-rw-r--r--core/modules/block/tests/src/Functional/BlockXssTest.php8
-rw-r--r--core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php2
-rw-r--r--core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php12
-rw-r--r--core/modules/block/tests/src/FunctionalJavascript/BlockAddTest.php2
-rw-r--r--core/modules/block/tests/src/FunctionalJavascript/BlockContextualLinksTest.php2
-rw-r--r--core/modules/block/tests/src/FunctionalJavascript/BlockDragTest.php2
-rw-r--r--core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php2
-rw-r--r--core/modules/block/tests/src/Kernel/BlockConfigSchemaTest.php2
-rw-r--r--core/modules/block/tests/src/Kernel/BlockInterfaceTest.php2
-rw-r--r--core/modules/block/tests/src/Kernel/BlockRebuildTest.php6
-rw-r--r--core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php4
-rw-r--r--core/modules/block/tests/src/Kernel/BlockTemplateSuggestionsTest.php2
-rw-r--r--core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php8
-rw-r--r--core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockContentTranslationTest.php2
-rw-r--r--core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php2
-rw-r--r--core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php2
-rw-r--r--core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php2
-rw-r--r--core/modules/block/tests/src/Kernel/NewDefaultThemeBlocksTest.php4
-rw-r--r--core/modules/block/tests/src/Unit/BlockConfigEntityUnitTest.php2
-rw-r--r--core/modules/block/tests/src/Unit/BlockFormTest.php2
-rw-r--r--core/modules/block/tests/src/Unit/BlockRepositoryTest.php4
-rw-r--r--core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php2
-rw-r--r--core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php4
-rw-r--r--core/modules/block/tests/src/Unit/Plugin/DisplayVariant/BlockPageVariantTest.php4
-rw-r--r--core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockRegionTest.php4
-rw-r--r--core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockSettingsTest.php2
-rw-r--r--core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockVisibilityTest.php12
-rw-r--r--core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php2
-rw-r--r--core/modules/block_content/tests/src/Functional/BlockContentContextualLinksTest.php2
-rw-r--r--core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php14
-rw-r--r--core/modules/block_content/tests/src/Functional/BlockContentListTest.php2
-rw-r--r--core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php2
-rw-r--r--core/modules/block_content/tests/src/Functional/BlockContentPageViewTest.php2
-rw-r--r--core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php2
-rw-r--r--core/modules/block_content/tests/src/Functional/BlockContentSaveTest.php6
-rw-r--r--core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php10
-rw-r--r--core/modules/block_content/tests/src/Functional/PageEditTest.php2
-rw-r--r--core/modules/block_content/tests/src/Functional/UnpublishedBlockTest.php2
-rw-r--r--core/modules/block_content/tests/src/Functional/Views/BlockContentFieldFilterTest.php2
-rw-r--r--core/modules/block_content/tests/src/Functional/Views/BlockContentIntegrationTest.php2
-rw-r--r--core/modules/block_content/tests/src/Functional/Views/BlockContentRedirectTest.php2
-rw-r--r--core/modules/block_content/tests/src/Functional/Views/BlockContentWizardTest.php2
-rw-r--r--core/modules/block_content/tests/src/Kernel/BlockContentAccessHandlerTest.php2
-rw-r--r--core/modules/block_content/tests/src/Kernel/BlockContentDeletionTest.php2
-rw-r--r--core/modules/block_content/tests/src/Kernel/BlockContentDeriverTest.php2
-rw-r--r--core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php6
-rw-r--r--core/modules/block_content/tests/src/Kernel/BlockContentPermissionsTest.php2
-rw-r--r--core/modules/block_content/tests/src/Kernel/BlockTemplateSuggestionsTest.php2
-rw-r--r--core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentBodyFieldTest.php2
-rw-r--r--core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityDisplayTest.php2
-rw-r--r--core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityFormDisplayTest.php2
-rw-r--r--core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentStubTest.php4
-rw-r--r--core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentTypeTest.php2
-rw-r--r--core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateBlockContentTest.php2
-rw-r--r--core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateCustomBlockContentTranslationTest.php2
-rw-r--r--core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockContentTranslationTest.php2
-rw-r--r--core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockTest.php2
-rw-r--r--core/modules/block_content/tests/src/Kernel/Views/RevisionRelationshipsTest.php2
-rw-r--r--core/modules/block_content/tests/src/Kernel/Views/RevisionUserTest.php2
-rw-r--r--core/modules/block_content/tests/src/Unit/Access/AccessGroupAndTest.php2
-rw-r--r--core/modules/block_content/tests/src/Unit/Access/DependentAccessTest.php6
-rw-r--r--core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php2
-rw-r--r--core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php8
-rw-r--r--core/modules/breakpoint/tests/src/Unit/BreakpointTest.php12
-rw-r--r--core/modules/ckeditor5/tests/src/Functional/AddedStylesheetsTest.php2
-rw-r--r--core/modules/ckeditor5/tests/src/Functional/ImageUploadAccessTest.php2
-rw-r--r--core/modules/ckeditor5/tests/src/Functional/ImageUploadTest.php6
-rw-r--r--core/modules/ckeditor5/tests/src/Functional/MediaEntityMetadataApiTest.php2
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/AdminUiTest.php10
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5AllowedTagsTest.php12
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5DialogTest.php2
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5FragmentLinkTest.php2
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5OffCanvasTest.php2
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5ReadOnlyModeTest.php2
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5Test.php16
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/EmphasisTest.php4
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTest.php2
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php10
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaLibraryTest.php6
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaLinkabilityTest.php4
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaPreviewTest.php8
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php22
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/SourceEditingTest.php4
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/StyleTest.php4
-rw-r--r--core/modules/ckeditor5/tests/src/FunctionalJavascript/TableTest.php4
-rw-r--r--core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php6
-rw-r--r--core/modules/ckeditor5/tests/src/Kernel/CKEditor5StylesheetsTest.php2
-rw-r--r--core/modules/ckeditor5/tests/src/Kernel/ConfigurablePluginTest.php2
-rw-r--r--core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php4
-rw-r--r--core/modules/comment/tests/src/Functional/CommentAccessTest.php4
-rw-r--r--core/modules/comment/tests/src/Functional/CommentAdminTest.php10
-rw-r--r--core/modules/comment/tests/src/Functional/CommentAnonymousTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentBlockTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentCSSTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentCacheTagsTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentDisplayConfigurableTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentEntityReferenceTest.php4
-rw-r--r--core/modules/comment/tests/src/Functional/CommentEntityTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentFieldsTest.php8
-rw-r--r--core/modules/comment/tests/src/Functional/CommentInterfaceTest.php8
-rw-r--r--core/modules/comment/tests/src/Functional/CommentLanguageTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentLinksTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentNodeAccessTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentNodeChangesTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentNonNodeTest.php6
-rw-r--r--core/modules/comment/tests/src/Functional/CommentPagerTest.php10
-rw-r--r--core/modules/comment/tests/src/Functional/CommentPreviewTest.php6
-rw-r--r--core/modules/comment/tests/src/Functional/CommentRssTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentStatisticsTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentThreadingTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentTitleTest.php4
-rw-r--r--core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentTranslationUITest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/CommentTypeTest.php6
-rw-r--r--core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php4
-rw-r--r--core/modules/comment/tests/src/Functional/Rest/CommentXmlAnonTest.php4
-rw-r--r--core/modules/comment/tests/src/Functional/Rest/CommentXmlBasicAuthTest.php4
-rw-r--r--core/modules/comment/tests/src/Functional/Rest/CommentXmlCookieTest.php4
-rw-r--r--core/modules/comment/tests/src/Functional/Views/CommentAdminTest.php4
-rw-r--r--core/modules/comment/tests/src/Functional/Views/CommentApproveLinkTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/Views/CommentEditTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/Views/CommentOperationsTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/Views/CommentRowTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/Views/DefaultViewRecentCommentsTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php4
-rw-r--r--core/modules/comment/tests/src/Functional/Views/RowRssTest.php2
-rw-r--r--core/modules/comment/tests/src/Functional/Views/WizardTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/CommentBaseFieldTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/CommentBundlesTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/CommentDefaultFormatterCacheTagsTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/CommentHostnameTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php4
-rw-r--r--core/modules/comment/tests/src/Kernel/CommentItemTest.php4
-rw-r--r--core/modules/comment/tests/src/Kernel/CommentOrphanTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/CommentStringIdEntitiesTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/CommentUninstallTest.php4
-rw-r--r--core/modules/comment/tests/src/Kernel/CommentValidationTest.php4
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityDisplayTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplaySubjectTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplayTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldInstanceTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php4
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/d7/CommentEntityTranslationCheckRequirementsTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplayTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php4
-rw-r--r--core/modules/comment/tests/src/Kernel/Plugin/migrate/source/CommentTypeRequirementsTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Views/CommentAdminViewTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Views/CommentDepthTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Views/CommentFieldNameTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php4
-rw-r--r--core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Views/CommentViewsFieldAccessTest.php2
-rw-r--r--core/modules/comment/tests/src/Kernel/Views/FilterAndArgumentUserUidTest.php2
-rw-r--r--core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php2
-rw-r--r--core/modules/comment/tests/src/Unit/CommentManagerTest.php2
-rw-r--r--core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php2
-rw-r--r--core/modules/comment/tests/src/Unit/Entity/CommentLockTest.php2
-rw-r--r--core/modules/comment/tests/src/Unit/Plugin/views/field/CommentBulkFormTest.php2
-rw-r--r--core/modules/config/tests/src/Functional/CacheabilityMetadataConfigOverrideIntegrationTest.php2
-rw-r--r--core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php2
-rw-r--r--core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php2
-rw-r--r--core/modules/config/tests/src/Functional/ConfigEntityFormOverrideTest.php2
-rw-r--r--core/modules/config/tests/src/Functional/ConfigEntityListMultilingualTest.php2
-rw-r--r--core/modules/config/tests/src/Functional/ConfigEntityListTest.php6
-rw-r--r--core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php2
-rw-r--r--core/modules/config/tests/src/Functional/ConfigEntityTest.php4
-rw-r--r--core/modules/config/tests/src/Functional/ConfigExportImportUITest.php4
-rw-r--r--core/modules/config/tests/src/Functional/ConfigExportUITest.php2
-rw-r--r--core/modules/config/tests/src/Functional/ConfigFormOverrideTest.php2
-rw-r--r--core/modules/config/tests/src/Functional/ConfigImportAllTest.php2
-rw-r--r--core/modules/config/tests/src/Functional/ConfigImportInstallProfileTest.php2
-rw-r--r--core/modules/config/tests/src/Functional/ConfigImportUITest.php20
-rw-r--r--core/modules/config/tests/src/Functional/ConfigImportUploadTest.php2
-rw-r--r--core/modules/config/tests/src/Functional/ConfigInstallProfileOverrideTest.php2
-rw-r--r--core/modules/config/tests/src/Functional/ConfigInstallProfileUnmetDependenciesTest.php2
-rw-r--r--core/modules/config/tests/src/Functional/ConfigInstallWebTest.php8
-rw-r--r--core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php2
-rw-r--r--core/modules/config/tests/src/Functional/ConfigSingleImportExportTest.php6
-rw-r--r--core/modules/config/tests/src/Functional/LanguageNegotiationFormOverrideTest.php2
-rw-r--r--core/modules/config/tests/src/Functional/SchemaConfigListenerWebTest.php2
-rw-r--r--core/modules/config/tests/src/Functional/TransformedConfigExportImportUITest.php2
-rw-r--r--core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php2
-rw-r--r--core/modules/config/tests/src/FunctionalJavascript/ConfigExportTest.php2
-rw-r--r--core/modules/config/tests/src/Kernel/ConfigUninstallViaCliImportTest.php2
-rw-r--r--core/modules/config/tests/src/Unit/Menu/ConfigLocalTasksTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Functional/ConfigTranslationCacheTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Functional/ConfigTranslationDateFormatUiTest.php4
-rw-r--r--core/modules/config_translation/tests/src/Functional/ConfigTranslationInstallTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php8
-rw-r--r--core/modules/config_translation/tests/src/Functional/ConfigTranslationUiModulesTest.php14
-rw-r--r--core/modules/config_translation/tests/src/Functional/ConfigTranslationUiSiteInformationTest.php4
-rw-r--r--core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php16
-rw-r--r--core/modules/config_translation/tests/src/Functional/ConfigTranslationUiThemeTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Functional/ConfigTranslationViewListUiTest.php4
-rw-r--r--core/modules/config_translation/tests/src/FunctionalJavascript/ConfigTranslationUiTest.php4
-rw-r--r--core/modules/config_translation/tests/src/Kernel/ConfigMapperTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Kernel/ConfigTranslationFormTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateSystemMaintenanceTranslationTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateSystemSiteTranslationTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTranslationTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldInstanceTranslationTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserProfileTranslationRollbackTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateSystemMaintenanceTranslationTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateSystemSiteTranslationTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateUserConfigsTranslationTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php12
-rw-r--r--core/modules/config_translation/tests/src/Unit/ConfigFieldMapperTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php2
-rw-r--r--core/modules/config_translation/tests/src/Unit/ConfigNamesMapperTest.php60
-rw-r--r--core/modules/contact/tests/src/Functional/ContactLanguageTest.php2
-rw-r--r--core/modules/contact/tests/src/Functional/ContactPersonalTest.php8
-rw-r--r--core/modules/contact/tests/src/Functional/ContactSitewideTest.php4
-rw-r--r--core/modules/contact/tests/src/Functional/ContactStorageTest.php2
-rw-r--r--core/modules/contact/tests/src/Functional/Rest/MessageResourceTestBase.php6
-rw-r--r--core/modules/contact/tests/src/Functional/Views/ContactLinkTest.php2
-rw-r--r--core/modules/contact/tests/src/Kernel/MessageEntityTest.php2
-rw-r--r--core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php2
-rw-r--r--core/modules/contact/tests/src/Kernel/Migrate/d6/MigrateContactSettingsTest.php2
-rw-r--r--core/modules/contact/tests/src/Kernel/Migrate/d7/MigrateContactSettingsTest.php2
-rw-r--r--core/modules/contact/tests/src/Kernel/Views/ContactFieldsTest.php2
-rw-r--r--core/modules/contact/tests/src/Unit/MailHandlerTest.php4
-rw-r--r--core/modules/content_moderation/tests/src/Functional/ContentModerationWorkflowTypeTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Functional/DefaultModerationStateTest.php4
-rw-r--r--core/modules/content_moderation/tests/src/Functional/LayoutBuilderContentModerationIntegrationTest.php4
-rw-r--r--core/modules/content_moderation/tests/src/Functional/ModeratedContentLocalTaskTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php4
-rw-r--r--core/modules/content_moderation/tests/src/Functional/ModerationActionsTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Functional/ModerationContentTranslationTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php12
-rw-r--r--core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php8
-rw-r--r--core/modules/content_moderation/tests/src/Functional/ModerationRevisionRevertTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Functional/ModerationStateAccessTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Functional/ModerationStateBlockTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTest.php8
-rw-r--r--core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php6
-rw-r--r--core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php6
-rw-r--r--core/modules/content_moderation/tests/src/Functional/WorkspaceContentModerationIntegrationTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ContentModerationAccessTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ContentModerationPermissionsTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ContentModerationResaveTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ContentModerationStateAccessControlHandlerTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ContentModerationStateResourceTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ContentModerationStateStorageSchemaTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php30
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ContentModerationSyncingTest.php10
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ContentModerationWorkflowConfigTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ContentModerationWorkflowTypeApiTest.php8
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/DefaultRevisionStateTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php6
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php16
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php8
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/InitialStateTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php12
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php36
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ModerationStateWidgetTest.php4
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/StateFormatterTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ViewsDataIntegrationTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php8
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateSortTest.php4
-rw-r--r--core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php12
-rw-r--r--core/modules/content_moderation/tests/src/Unit/ContentModerationRouteSubscriberTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Unit/ContentPreprocessTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Unit/LatestRevisionCheckTest.php2
-rw-r--r--core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php8
-rw-r--r--core/modules/content_moderation/tests/src/Unit/StateTransitionValidationTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationDisableSettingTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationEnableTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php2
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php4
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationLinkTagTest.php4
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationMetadataFieldsTest.php4
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationNewTranslationWithExistingRevisionsTest.php4
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php4
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationOutdatedRevisionTranslationTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationRevisionTranslationDeletionTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php8
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationStandardFieldsTest.php4
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationUISkipTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php2
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationUntranslatableFieldsTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Functional/Views/ContentTranslationViewsUITest.php2
-rw-r--r--core/modules/content_translation/tests/src/Functional/Views/TranslationLinkTest.php2
-rw-r--r--core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationConfigUITest.php2
-rw-r--r--core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationContextualLinksTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Kernel/ContentTranslationEntityBundleInfoTest.php8
-rw-r--r--core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php4
-rw-r--r--core/modules/content_translation/tests/src/Kernel/ContentTranslationHandlerTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Kernel/ContentTranslationModuleInstallTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Kernel/ContentTranslationPermissionsTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Kernel/ContentTranslationSyncUnitTest.php6
-rw-r--r--core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTranslationTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Kernel/Migrate/d7/MigrateEntityTranslationSettingsTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Unit/Access/ContentTranslationManageAccessCheckTest.php2
-rw-r--r--core/modules/content_translation/tests/src/Unit/Menu/ContentTranslationLocalTasksTest.php2
-rw-r--r--core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php4
-rw-r--r--core/modules/contextual/tests/src/FunctionalJavascript/ContextualLinksTest.php8
-rw-r--r--core/modules/contextual/tests/src/FunctionalJavascript/DuplicateContextualLinksTest.php2
-rw-r--r--core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php2
-rw-r--r--core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php4
-rw-r--r--core/modules/datetime/tests/src/Functional/DateFilterTest.php2
-rw-r--r--core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php12
-rw-r--r--core/modules/datetime/tests/src/Functional/DateTimeTimeAgoFormatterTest.php2
-rw-r--r--core/modules/datetime/tests/src/Functional/DateTimeWidgetTest.php2
-rw-r--r--core/modules/datetime/tests/src/Functional/Views/FilterDateTest.php4
-rw-r--r--core/modules/datetime/tests/src/Kernel/DateTimeFormInjectionTest.php2
-rw-r--r--core/modules/datetime/tests/src/Kernel/DateTimeItemTest.php12
-rw-r--r--core/modules/datetime/tests/src/Kernel/Views/ArgumentDateTimeTest.php14
-rw-r--r--core/modules/datetime/tests/src/Kernel/Views/DateTimeSchemaTest.php2
-rw-r--r--core/modules/datetime/tests/src/Kernel/Views/FilterDateTest.php4
-rw-r--r--core/modules/datetime/tests/src/Kernel/Views/FilterDateTimeTest.php2
-rw-r--r--core/modules/datetime/tests/src/Kernel/Views/SortDateTimeTest.php2
-rw-r--r--core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php4
-rw-r--r--core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php14
-rw-r--r--core/modules/datetime_range/tests/src/Kernel/DateRangeItemTest.php2
-rw-r--r--core/modules/datetime_range/tests/src/Kernel/SeparatorTranslationTest.php2
-rw-r--r--core/modules/datetime_range/tests/src/Kernel/Views/EntityTypeWithoutViewsDataTest.php2
-rw-r--r--core/modules/datetime_range/tests/src/Kernel/Views/FilterDateTest.php2
-rw-r--r--core/modules/dblog/tests/src/Functional/DbLogTest.php24
-rw-r--r--core/modules/dblog/tests/src/Functional/DbLogViewsTest.php2
-rw-r--r--core/modules/dblog/tests/src/Kernel/ConnectionFailureTest.php2
-rw-r--r--core/modules/dblog/tests/src/Kernel/DbLogControllerTest.php4
-rw-r--r--core/modules/dblog/tests/src/Kernel/DbLogFormInjectionTest.php2
-rw-r--r--core/modules/dblog/tests/src/Kernel/DbLogTest.php4
-rw-r--r--core/modules/dblog/tests/src/Kernel/Migrate/d6/MigrateDblogConfigsTest.php2
-rw-r--r--core/modules/dblog/tests/src/Kernel/Migrate/d7/MigrateDblogConfigsTest.php2
-rw-r--r--core/modules/dblog/tests/src/Kernel/Views/ViewsIntegrationTest.php6
-rw-r--r--core/modules/dynamic_page_cache/tests/src/Functional/DynamicPageCacheIntegrationTest.php2
-rw-r--r--core/modules/editor/tests/src/Functional/EditorAdminTest.php10
-rw-r--r--core/modules/editor/tests/src/Functional/EditorLoadingTest.php4
-rw-r--r--core/modules/editor/tests/src/Functional/EditorPrivateFileReferenceFilterTest.php2
-rw-r--r--core/modules/editor/tests/src/Functional/EditorSecurityTest.php6
-rw-r--r--core/modules/editor/tests/src/FunctionalJavascript/EditorAdminTest.php4
-rw-r--r--core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php2
-rw-r--r--core/modules/editor/tests/src/Kernel/EditorFileUsageTest.php4
-rw-r--r--core/modules/editor/tests/src/Kernel/EditorFilterIntegrationTest.php2
-rw-r--r--core/modules/editor/tests/src/Kernel/EditorManagerTest.php2
-rw-r--r--core/modules/editor/tests/src/Kernel/EntityUpdateTest.php2
-rw-r--r--core/modules/editor/tests/src/Unit/EditorConfigEntityUnitTest.php2
-rw-r--r--core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php4
-rw-r--r--core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php4
-rw-r--r--core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php2
-rw-r--r--core/modules/field/tests/src/Functional/Email/EmailFieldTest.php2
-rw-r--r--core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php6
-rw-r--r--core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php6
-rw-r--r--core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php4
-rw-r--r--core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php2
-rw-r--r--core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFileUploadTest.php2
-rw-r--r--core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php2
-rw-r--r--core/modules/field/tests/src/Functional/EntityReference/EntityReferenceXSSTest.php2
-rw-r--r--core/modules/field/tests/src/Functional/EntityReference/Views/SelectionTest.php2
-rw-r--r--core/modules/field/tests/src/Functional/FieldAccessTest.php2
-rw-r--r--core/modules/field/tests/src/Functional/FieldDefaultValueCallbackTest.php2
-rw-r--r--core/modules/field/tests/src/Functional/FieldHelpTest.php2
-rw-r--r--core/modules/field/tests/src/Functional/FieldImportDeleteUninstallUiTest.php2
-rw-r--r--core/modules/field/tests/src/Functional/FormTest.php28
-rw-r--r--core/modules/field/tests/src/Functional/FunctionalString/StringFieldTest.php2
-rw-r--r--core/modules/field/tests/src/Functional/NestedFormTest.php4
-rw-r--r--core/modules/field/tests/src/Functional/Number/NumberFieldTest.php10
-rw-r--r--core/modules/field/tests/src/Functional/ReEnableModuleFieldTest.php2
-rw-r--r--core/modules/field/tests/src/Functional/TranslationWebTest.php2
-rw-r--r--core/modules/field/tests/src/Functional/Views/FieldUITest.php6
-rw-r--r--core/modules/field/tests/src/FunctionalJavascript/Boolean/BooleanFormatterSettingsTest.php2
-rw-r--r--core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php2
-rw-r--r--core/modules/field/tests/src/FunctionalJavascript/MultipleValueWidgetTest.php4
-rw-r--r--core/modules/field/tests/src/FunctionalJavascript/Number/NumberFieldTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Boolean/BooleanItemTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/BulkDeleteTest.php8
-rw-r--r--core/modules/field/tests/src/Kernel/ConfigFieldDefinitionTest.php4
-rw-r--r--core/modules/field/tests/src/Kernel/DisplayApiTest.php6
-rw-r--r--core/modules/field/tests/src/Kernel/DisplayModeUpdateTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Email/EmailItemTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Entity/Update/SqlContentEntityStorageSchemaColumnTest.php4
-rw-r--r--core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php14
-rw-r--r--core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php18
-rw-r--r--core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php4
-rw-r--r--core/modules/field/tests/src/Kernel/EntityReference/Views/EntityReferenceRelationshipTest.php10
-rw-r--r--core/modules/field/tests/src/Kernel/EntityReference/Views/SelectionTest.php4
-rw-r--r--core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php10
-rw-r--r--core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php14
-rw-r--r--core/modules/field/tests/src/Kernel/FieldCrudTest.php14
-rw-r--r--core/modules/field/tests/src/Kernel/FieldDataCountTest.php4
-rw-r--r--core/modules/field/tests/src/Kernel/FieldDefinitionIntegrityTest.php4
-rw-r--r--core/modules/field/tests/src/Kernel/FieldDisplayTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/FieldFormatterTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/FieldImportChangeTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/FieldImportCreateTest.php4
-rw-r--r--core/modules/field/tests/src/Kernel/FieldImportDeleteTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/FieldImportDeleteUninstallTest.php4
-rw-r--r--core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php20
-rw-r--r--core/modules/field/tests/src/Kernel/FieldTypeCategoryDiscoveryTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/FieldTypePluginManagerTest.php10
-rw-r--r--core/modules/field/tests/src/Kernel/FieldValidationTest.php4
-rw-r--r--core/modules/field/tests/src/Kernel/FormatterPluginManagerTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/KernelString/RawStringFormatterTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/KernelString/StringFormatterTest.php4
-rw-r--r--core/modules/field/tests/src/Kernel/KernelString/UuidFormatterTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/KernelString/UuidItemTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldFormatterSettingsTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceLabelDescriptionTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceOptionTranslationTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceTest.php4
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldOptionTranslationTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceLabelDescriptionTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceOptionTranslationTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldOptionTranslationTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php4
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d7/MigrateViewModesTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d7/RollbackFieldInstanceTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d7/RollbackFieldTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d7/RollbackViewModesTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Number/NumberItemTest.php4
-rw-r--r--core/modules/field/tests/src/Kernel/ShapeItemTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/TestItemTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/TestItemWithDependenciesTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/TestObjectItemTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php4
-rw-r--r--core/modules/field/tests/src/Kernel/Timestamp/TimestampItemTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/TranslationTest.php4
-rw-r--r--core/modules/field/tests/src/Kernel/Uri/UriItemTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/Views/HandlerFieldFieldTest.php2
-rw-r--r--core/modules/field/tests/src/Kernel/WidgetPluginManagerTest.php4
-rw-r--r--core/modules/field/tests/src/Unit/FieldConfigAccessControlHandlerTest.php2
-rw-r--r--core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php10
-rw-r--r--core/modules/field/tests/src/Unit/FieldStorageConfigAccessControlHandlerTest.php2
-rw-r--r--core/modules/field/tests/src/Unit/FieldStorageConfigEntityUnitTest.php8
-rw-r--r--core/modules/field/tests/src/Unit/FieldUninstallValidatorTest.php6
-rw-r--r--core/modules/field/tests/src/Unit/Plugin/migrate/process/ProcessFieldTest.php2
-rw-r--r--core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldInstanceSettingsTest.php2
-rw-r--r--core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldSettingsTest.php2
-rw-r--r--core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php4
-rw-r--r--core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php2
-rw-r--r--core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php2
-rw-r--r--core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldTypeDefaultsTest.php2
-rw-r--r--core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php4
-rw-r--r--core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php10
-rw-r--r--core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php2
-rw-r--r--core/modules/field_layout/tests/src/Kernel/FieldLayoutUninstallTest.php2
-rw-r--r--core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php8
-rw-r--r--core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php6
-rw-r--r--core/modules/field_ui/tests/src/Functional/EntityDisplayTest.php2
-rw-r--r--core/modules/field_ui/tests/src/Functional/FieldTypeCategoriesIntegrationTest.php2
-rw-r--r--core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php2
-rw-r--r--core/modules/field_ui/tests/src/Functional/FieldUIIndentationTest.php2
-rw-r--r--core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php4
-rw-r--r--core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php12
-rw-r--r--core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php24
-rw-r--r--core/modules/field_ui/tests/src/Functional/ManageFieldsLifecycleTest.php2
-rw-r--r--core/modules/field_ui/tests/src/Functional/ManageFieldsMultipleTypesTest.php4
-rw-r--r--core/modules/field_ui/tests/src/Functional/ManageFieldsTest.php16
-rw-r--r--core/modules/field_ui/tests/src/FunctionalJavascript/DefaultValueWidgetTest.php2
-rw-r--r--core/modules/field_ui/tests/src/FunctionalJavascript/DisplayModeBundleSelectionTest.php2
-rw-r--r--core/modules/field_ui/tests/src/FunctionalJavascript/EntityDisplayTest.php6
-rw-r--r--core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php6
-rw-r--r--core/modules/field_ui/tests/src/FunctionalJavascript/ManageFieldsTest.php14
-rw-r--r--core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php26
-rw-r--r--core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php12
-rw-r--r--core/modules/field_ui/tests/src/Unit/FieldConfigEditFormTest.php2
-rw-r--r--core/modules/field_ui/tests/src/Unit/FieldUiTableTest.php2
-rw-r--r--core/modules/field_ui/tests/src/Unit/FieldUiTest.php6
-rw-r--r--core/modules/file/tests/src/Functional/DownloadTest.php6
-rw-r--r--core/modules/file/tests/src/Functional/FileFieldAnonymousSubmissionTest.php8
-rw-r--r--core/modules/file/tests/src/Functional/FileFieldDisplayTest.php8
-rw-r--r--core/modules/file/tests/src/Functional/FileFieldFormatterAccessTest.php2
-rw-r--r--core/modules/file/tests/src/Functional/FileFieldPathTest.php2
-rw-r--r--core/modules/file/tests/src/Functional/FileFieldRSSContentTest.php2
-rw-r--r--core/modules/file/tests/src/Functional/FileFieldRevisionTest.php2
-rw-r--r--core/modules/file/tests/src/Functional/FileFieldValidateTest.php8
-rw-r--r--core/modules/file/tests/src/Functional/FileFieldWidgetTest.php20
-rw-r--r--core/modules/file/tests/src/Functional/FileListingTest.php4
-rw-r--r--core/modules/file/tests/src/Functional/FileManagedFileElementTest.php10
-rw-r--r--core/modules/file/tests/src/Functional/FileOnTranslatedEntityTest.php4
-rw-r--r--core/modules/file/tests/src/Functional/FilePrivateTest.php2
-rw-r--r--core/modules/file/tests/src/Functional/FileTokenReplaceTest.php2
-rw-r--r--core/modules/file/tests/src/Functional/Formatter/FileAudioFormatterTest.php2
-rw-r--r--core/modules/file/tests/src/Functional/Formatter/FileVideoFormatterTest.php4
-rw-r--r--core/modules/file/tests/src/Functional/MultipleFileUploadTest.php2
-rw-r--r--core/modules/file/tests/src/Functional/PrivateFileOnTranslatedEntityTest.php2
-rw-r--r--core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php2
-rw-r--r--core/modules/file/tests/src/Functional/SaveUploadFormTest.php24
-rw-r--r--core/modules/file/tests/src/Functional/SaveUploadTest.php28
-rw-r--r--core/modules/file/tests/src/FunctionalJavascript/AjaxFileManagedMultipleTest.php2
-rw-r--r--core/modules/file/tests/src/FunctionalJavascript/FileFieldValidateTest.php2
-rw-r--r--core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php6
-rw-r--r--core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php2
-rw-r--r--core/modules/file/tests/src/FunctionalJavascript/MaximumFileSizeExceededUploadTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/AccessTest.php8
-rw-r--r--core/modules/file/tests/src/Kernel/ComputedFileUrlTest.php6
-rw-r--r--core/modules/file/tests/src/Kernel/CopyTest.php12
-rw-r--r--core/modules/file/tests/src/Kernel/DeleteTest.php6
-rw-r--r--core/modules/file/tests/src/Kernel/FileItemTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/FileItemValidationTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/FileManagedAccessTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/FileRepositoryTest.php16
-rw-r--r--core/modules/file/tests/src/Kernel/FileUriItemTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/FileUrlTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/Formatter/FileEntityFormatterTest.php12
-rw-r--r--core/modules/file/tests/src/Kernel/LoadTest.php12
-rw-r--r--core/modules/file/tests/src/Kernel/ManagedFileTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/Migrate/MigrateFileStubTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileConfigsTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadEntityDisplayTest.php4
-rw-r--r--core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadEntityFormDisplayTest.php4
-rw-r--r--core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadFieldTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadInstanceTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileConfigsTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/Migrate/d7/MigratePrivateFileTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/MoveTest.php14
-rw-r--r--core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileExtensionConstraintValidatorTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileImageDimensionsConstraintValidatorTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileIsImageConstraintValidatorTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileNameLengthConstraintValidatorTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileSizeLimitConstraintValidatorTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/SaveTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/SpaceUsedTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/UsageTest.php16
-rw-r--r--core/modules/file/tests/src/Kernel/Views/ExtensionViewsFieldTest.php2
-rw-r--r--core/modules/file/tests/src/Kernel/Views/FileViewsFieldAccessTest.php2
-rw-r--r--core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldTest.php4
-rw-r--r--core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php4
-rw-r--r--core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FieldFileTest.php2
-rw-r--r--core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FileUriTest.php10
-rw-r--r--core/modules/file/tests/src/Unit/SanitizeNameTest.php2
-rw-r--r--core/modules/filter/tests/src/Functional/FilterAdminTest.php10
-rw-r--r--core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php2
-rw-r--r--core/modules/filter/tests/src/Functional/FilterFormTest.php2
-rw-r--r--core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php6
-rw-r--r--core/modules/filter/tests/src/Functional/FilterHooksTest.php2
-rw-r--r--core/modules/filter/tests/src/Functional/FilterHtmlImageSecureTest.php2
-rw-r--r--core/modules/filter/tests/src/Functional/FilterSecurityTest.php4
-rw-r--r--core/modules/filter/tests/src/Kernel/FilterAPITest.php16
-rw-r--r--core/modules/filter/tests/src/Kernel/FilterCaptionTwigDebugTest.php2
-rw-r--r--core/modules/filter/tests/src/Kernel/FilterCrudTest.php4
-rw-r--r--core/modules/filter/tests/src/Kernel/FilterDefaultConfigTest.php4
-rw-r--r--core/modules/filter/tests/src/Kernel/FilterKernelTest.php20
-rw-r--r--core/modules/filter/tests/src/Kernel/FilterNoFormatTest.php2
-rw-r--r--core/modules/filter/tests/src/Kernel/Migrate/d6/FilterFormatPermissionTest.php2
-rw-r--r--core/modules/filter/tests/src/Kernel/Migrate/d6/MigrateFilterFormatTest.php2
-rw-r--r--core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterFormatTest.php2
-rw-r--r--core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterSettingsTest.php2
-rw-r--r--core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php2
-rw-r--r--core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterSettingsTest.php2
-rw-r--r--core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php2
-rw-r--r--core/modules/filter/tests/src/Unit/FilterHtmlTest.php4
-rw-r--r--core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php6
-rw-r--r--core/modules/help/tests/src/Functional/ExperimentalHelpTest.php2
-rw-r--r--core/modules/help/tests/src/Functional/HelpBlockTest.php2
-rw-r--r--core/modules/help/tests/src/Functional/HelpPageOrderTest.php2
-rw-r--r--core/modules/help/tests/src/Functional/HelpTest.php2
-rw-r--r--core/modules/help/tests/src/Functional/HelpTopicSearchTest.php6
-rw-r--r--core/modules/help/tests/src/Functional/HelpTopicTest.php4
-rw-r--r--core/modules/help/tests/src/Functional/HelpTopicTranslationTest.php2
-rw-r--r--core/modules/help/tests/src/Functional/HelpTopicsSyntaxTest.php2
-rw-r--r--core/modules/help/tests/src/Functional/NoHelpTest.php2
-rw-r--r--core/modules/help/tests/src/Kernel/HelpEmptyPageTest.php2
-rw-r--r--core/modules/help/tests/src/Kernel/HelpSearchPluginTest.php2
-rw-r--r--core/modules/help/tests/src/Unit/HelpTopicDiscoveryTest.php16
-rw-r--r--core/modules/help/tests/src/Unit/HelpTopicTwigLoaderTest.php6
-rw-r--r--core/modules/help/tests/src/Unit/HelpTopicTwigTest.php6
-rw-r--r--core/modules/history/tests/src/Functional/HistoryTest.php2
-rw-r--r--core/modules/history/tests/src/Kernel/Views/HistoryTimestampTest.php2
-rw-r--r--core/modules/image/tests/src/Functional/ImageAdminStylesTest.php14
-rw-r--r--core/modules/image/tests/src/Functional/ImageDimensionsTest.php2
-rw-r--r--core/modules/image/tests/src/Functional/ImageEffect/ConvertTest.php2
-rw-r--r--core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php4
-rw-r--r--core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php8
-rw-r--r--core/modules/image/tests/src/Functional/ImageFieldValidateTest.php8
-rw-r--r--core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php2
-rw-r--r--core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php2
-rw-r--r--core/modules/image/tests/src/Functional/ImageStyleDeleteTest.php2
-rw-r--r--core/modules/image/tests/src/Functional/ImageStyleDownloadAccessControlTest.php4
-rw-r--r--core/modules/image/tests/src/Functional/ImageStyleFlushTest.php2
-rw-r--r--core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php18
-rw-r--r--core/modules/image/tests/src/Functional/Rest/ImageStyleXmlAnonTest.php2
-rw-r--r--core/modules/image/tests/src/Functional/Rest/ImageStyleXmlBasicAuthTest.php2
-rw-r--r--core/modules/image/tests/src/Functional/Rest/ImageStyleXmlCookieTest.php2
-rw-r--r--core/modules/image/tests/src/FunctionalJavascript/ImageAdminStylesTest.php2
-rw-r--r--core/modules/image/tests/src/FunctionalJavascript/ImageFieldValidateTest.php4
-rw-r--r--core/modules/image/tests/src/Kernel/ImageEffectsTest.php20
-rw-r--r--core/modules/image/tests/src/Kernel/ImageFormatterTest.php6
-rw-r--r--core/modules/image/tests/src/Kernel/ImageImportTest.php2
-rw-r--r--core/modules/image/tests/src/Kernel/ImageItemTest.php6
-rw-r--r--core/modules/image/tests/src/Kernel/ImageStyleCustomStreamWrappersTest.php2
-rw-r--r--core/modules/image/tests/src/Kernel/ImageStyleIntegrationTest.php4
-rw-r--r--core/modules/image/tests/src/Kernel/ImageThemeFunctionTest.php6
-rw-r--r--core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageCacheTest.php8
-rw-r--r--core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageTest.php2
-rw-r--r--core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageSettingsTest.php2
-rw-r--r--core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageStylesTest.php2
-rw-r--r--core/modules/image/tests/src/Kernel/Views/ImageViewsDataTest.php2
-rw-r--r--core/modules/image/tests/src/Kernel/Views/RelationshipUserImageDataTest.php2
-rw-r--r--core/modules/image/tests/src/Unit/ImageStyleTest.php8
-rw-r--r--core/modules/image/tests/src/Unit/PageCache/DenyPrivateImageStyleDownloadTest.php2
-rw-r--r--core/modules/inline_form_errors/tests/src/Functional/FormErrorHandlerFileUploadTest.php2
-rw-r--r--core/modules/inline_form_errors/tests/src/FunctionalJavascript/FormErrorHandlerCKEditor5Test.php2
-rw-r--r--core/modules/inline_form_errors/tests/src/Kernel/FormElementInlineErrorTest.php2
-rw-r--r--core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php4
-rw-r--r--core/modules/jsonapi/tests/src/Functional/BlockContentTest.php2
-rw-r--r--core/modules/jsonapi/tests/src/Functional/CommentTest.php10
-rw-r--r--core/modules/jsonapi/tests/src/Functional/ConfigurableLanguageTest.php2
-rw-r--r--core/modules/jsonapi/tests/src/Functional/EntryPointTest.php2
-rw-r--r--core/modules/jsonapi/tests/src/Functional/ExternalNormalizersTest.php2
-rw-r--r--core/modules/jsonapi/tests/src/Functional/FileTest.php4
-rw-r--r--core/modules/jsonapi/tests/src/Functional/FileUploadTest.php30
-rw-r--r--core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php8
-rw-r--r--core/modules/jsonapi/tests/src/Functional/JsonApiFilterRegressionTest.php8
-rw-r--r--core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalDateFieldTest.php2
-rw-r--r--core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalMultilingualTest.php10
-rw-r--r--core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTest.php6
-rw-r--r--core/modules/jsonapi/tests/src/Functional/JsonApiPatchRegressionTest.php14
-rw-r--r--core/modules/jsonapi/tests/src/Functional/JsonApiRegressionTest.php32
-rw-r--r--core/modules/jsonapi/tests/src/Functional/MediaTest.php4
-rw-r--r--core/modules/jsonapi/tests/src/Functional/MenuLinkContentTest.php4
-rw-r--r--core/modules/jsonapi/tests/src/Functional/MessageTest.php14
-rw-r--r--core/modules/jsonapi/tests/src/Functional/NodeTest.php8
-rw-r--r--core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php16
-rw-r--r--core/modules/jsonapi/tests/src/Functional/RestExportJsonApiUnsupported.php2
-rw-r--r--core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php2
-rw-r--r--core/modules/jsonapi/tests/src/Functional/ShortcutTest.php2
-rw-r--r--core/modules/jsonapi/tests/src/Functional/TermTest.php6
-rw-r--r--core/modules/jsonapi/tests/src/Functional/UserTest.php26
-rw-r--r--core/modules/jsonapi/tests/src/Kernel/Context/FieldResolverTest.php8
-rw-r--r--core/modules/jsonapi/tests/src/Kernel/Controller/EntityResourceTest.php4
-rw-r--r--core/modules/jsonapi/tests/src/Kernel/Controller/FileUploadTest.php2
-rw-r--r--core/modules/jsonapi/tests/src/Kernel/EventSubscriber/ResourceObjectNormalizerCacherTest.php2
-rw-r--r--core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php18
-rw-r--r--core/modules/jsonapi/tests/src/Kernel/Normalizer/LinkCollectionNormalizerTest.php4
-rw-r--r--core/modules/jsonapi/tests/src/Kernel/Normalizer/RelationshipNormalizerTest.php2
-rw-r--r--core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php18
-rw-r--r--core/modules/jsonapi/tests/src/Kernel/ResourceType/RelatedResourceTypesTest.php6
-rw-r--r--core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php16
-rw-r--r--core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php10
-rw-r--r--core/modules/jsonapi/tests/src/Kernel/Serializer/SerializerTest.php2
-rw-r--r--core/modules/jsonapi/tests/src/Kernel/TestCoverageTest.php2
-rw-r--r--core/modules/jsonapi/tests/src/Unit/EventSubscriber/ResourceResponseValidatorTest.php2
-rw-r--r--core/modules/jsonapi/tests/src/Unit/JsonApiResource/LinkTest.php2
-rw-r--r--core/modules/jsonapi/tests/src/Unit/JsonApiSpecTest.php4
-rw-r--r--core/modules/jsonapi/tests/src/Unit/Normalizer/HttpExceptionNormalizerTest.php2
-rw-r--r--core/modules/jsonapi/tests/src/Unit/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php4
-rw-r--r--core/modules/jsonapi/tests/src/Unit/Normalizer/ResourceIdentifierNormalizerTest.php4
-rw-r--r--core/modules/jsonapi/tests/src/Unit/Query/EntityConditionGroupTest.php4
-rw-r--r--core/modules/jsonapi/tests/src/Unit/Query/EntityConditionTest.php4
-rw-r--r--core/modules/jsonapi/tests/src/Unit/Query/OffsetPageTest.php4
-rw-r--r--core/modules/jsonapi/tests/src/Unit/Query/SortTest.php4
-rw-r--r--core/modules/jsonapi/tests/src/Unit/Routing/RoutesTest.php12
-rw-r--r--core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php2
-rw-r--r--core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php6
-rw-r--r--core/modules/language/tests/src/Functional/EntityTypeWithoutLanguageFormTest.php2
-rw-r--r--core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php2
-rw-r--r--core/modules/language/tests/src/Functional/LanguageBreadcrumbTest.php2
-rw-r--r--core/modules/language/tests/src/Functional/LanguageBrowserDetectionAcceptLanguageTest.php2
-rw-r--r--core/modules/language/tests/src/Functional/LanguageBrowserDetectionTest.php2
-rw-r--r--core/modules/language/tests/src/Functional/LanguageConfigInstallOverrideExistingTest.php2
-rw-r--r--core/modules/language/tests/src/Functional/LanguageConfigOverrideImportTest.php4
-rw-r--r--core/modules/language/tests/src/Functional/LanguageConfigSchemaTest.php2
-rw-r--r--core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php10
-rw-r--r--core/modules/language/tests/src/Functional/LanguageConfigurationTest.php4
-rw-r--r--core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php2
-rw-r--r--core/modules/language/tests/src/Functional/LanguageEntityFieldAccessHookTest.php2
-rw-r--r--core/modules/language/tests/src/Functional/LanguageListModuleInstallTest.php2
-rw-r--r--core/modules/language/tests/src/Functional/LanguageListTest.php4
-rw-r--r--core/modules/language/tests/src/Functional/LanguageLocaleListTest.php2
-rw-r--r--core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php4
-rw-r--r--core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php4
-rw-r--r--core/modules/language/tests/src/Functional/LanguageNegotiationSessionTest.php2
-rw-r--r--core/modules/language/tests/src/Functional/LanguageNegotiationUrlTest.php2
-rw-r--r--core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php2
-rw-r--r--core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php4
-rw-r--r--core/modules/language/tests/src/Functional/LanguageSwitchingTest.php10
-rw-r--r--core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php10
-rw-r--r--core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php4
-rw-r--r--core/modules/language/tests/src/Functional/Rest/ConfigurableLanguageResourceTestBase.php2
-rw-r--r--core/modules/language/tests/src/Kernel/Condition/LanguageConditionTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/ConfigurableLanguageTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/EntityDefaultLanguageTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php4
-rw-r--r--core/modules/language/tests/src/Kernel/LanguageConfigFactoryOverrideTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/LanguageConfigOverrideInstallTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/LanguageDependencyInjectionTest.php4
-rw-r--r--core/modules/language/tests/src/Kernel/LanguageFallbackTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/LanguageNegotiatorPluginTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/LanguageSelectWidgetTest.php4
-rw-r--r--core/modules/language/tests/src/Kernel/Migrate/d6/MigrateDefaultLanguageTest.php6
-rw-r--r--core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentCommentSettingsTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentMenuSettingsTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentSettingsTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentTaxonomyVocabularySettingsTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageNegotiationSettingsTest.php8
-rw-r--r--core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/Migrate/d7/MigrateDefaultLanguageTest.php6
-rw-r--r--core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentCommentSettingsNoEntityTranslationTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentCommentSettingsTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentMenuSettingsTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentSettingsTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentTaxonomyVocabularySettingsTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php8
-rw-r--r--core/modules/language/tests/src/Kernel/OverriddenConfigImportTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/Views/ArgumentLanguageTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/Views/FieldLanguageTest.php2
-rw-r--r--core/modules/language/tests/src/Kernel/Views/FilterLanguageTest.php2
-rw-r--r--core/modules/language/tests/src/Unit/Config/LanguageConfigOverrideTest.php6
-rw-r--r--core/modules/language/tests/src/Unit/ConfigurableLanguageUnitTest.php4
-rw-r--r--core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php16
-rw-r--r--core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php6
-rw-r--r--core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php4
-rw-r--r--core/modules/language/tests/src/Unit/Plugin/LanguageNegotiation/LanguageNegotiationContentEntityTest.php6
-rw-r--r--core/modules/language/tests/src/Unit/process/LanguageDomainsTest.php2
-rw-r--r--core/modules/language/tests/src/Unit/process/LanguageNegotiationTest.php6
-rw-r--r--core/modules/language/tests/src/Unit/process/LanguageTypesTest.php6
-rw-r--r--core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php4
-rw-r--r--core/modules/layout_builder/tests/src/Functional/LayoutBuilderBlocksTest.php14
-rw-r--r--core/modules/layout_builder/tests/src/Functional/LayoutBuilderDefaultValuesTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Functional/LayoutBuilderFieldBlockEntityReferenceCacheTagsTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Functional/LayoutBuilderFormModeTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Functional/LayoutBuilderLocalTaskTest.php4
-rw-r--r--core/modules/layout_builder/tests/src/Functional/LayoutBuilderOverridesTest.php12
-rw-r--r--core/modules/layout_builder/tests/src/Functional/LayoutBuilderPrepareLayoutTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Functional/LayoutBuilderSectionStorageTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php34
-rw-r--r--core/modules/layout_builder/tests/src/Functional/LayoutBuilderThemeSuggestionsTest.php4
-rw-r--r--core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php4
-rw-r--r--core/modules/layout_builder/tests/src/Functional/LayoutBuilderViewModeTest.php6
-rw-r--r--core/modules/layout_builder/tests/src/Functional/LayoutDisplayTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php12
-rw-r--r--core/modules/layout_builder/tests/src/Functional/Rest/OverrideSectionsTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/AjaxBlockTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFilterTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/ContentPreviewToggleTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php4
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/FieldBlockTest.php4
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php20
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/ItemLayoutFieldBlockTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderNestedFormUiTest.php4
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderOptInTest.php4
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php6
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderToolbarTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php8
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/FunctionalJavascript/TestMultiWidthLayoutsTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Kernel/DefaultsSectionStorageTest.php12
-rw-r--r--core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php16
-rw-r--r--core/modules/layout_builder/tests/src/Kernel/LayoutBuilderBreadcrumbAlterTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php6
-rw-r--r--core/modules/layout_builder/tests/src/Kernel/LayoutBuilderFieldLayoutCompatibilityTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Kernel/LayoutBuilderInstallTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Kernel/LayoutEntityHelperTraitTest.php6
-rw-r--r--core/modules/layout_builder/tests/src/Kernel/LayoutSectionItemListTest.php4
-rw-r--r--core/modules/layout_builder/tests/src/Kernel/OverridesSectionStorageTest.php14
-rw-r--r--core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php18
-rw-r--r--core/modules/layout_builder/tests/src/Kernel/SectionListTraitTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Kernel/TranslatableFieldTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Unit/BlockComponentRenderArrayTest.php16
-rw-r--r--core/modules/layout_builder/tests/src/Unit/DefaultsSectionStorageTest.php10
-rw-r--r--core/modules/layout_builder/tests/src/Unit/InlineBlockUsageTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Unit/LayoutBuilderIsActiveCacheContextTest.php6
-rw-r--r--core/modules/layout_builder/tests/src/Unit/LayoutBuilderRoutesTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Unit/LayoutEntityHelperTraitTest.php4
-rw-r--r--core/modules/layout_builder/tests/src/Unit/LayoutSectionStorageParamConverterTest.php6
-rw-r--r--core/modules/layout_builder/tests/src/Unit/LayoutTempstoreRepositoryTest.php6
-rw-r--r--core/modules/layout_builder/tests/src/Unit/LayoutTempstoreRouteEnhancerTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Unit/OverridesSectionStorageTest.php4
-rw-r--r--core/modules/layout_builder/tests/src/Unit/SectionComponentTest.php2
-rw-r--r--core/modules/layout_builder/tests/src/Unit/SectionRenderTest.php12
-rw-r--r--core/modules/layout_builder/tests/src/Unit/SectionStorageManagerTest.php12
-rw-r--r--core/modules/layout_builder/tests/src/Unit/SectionTest.php32
-rw-r--r--core/modules/layout_discovery/tests/src/Kernel/LayoutTest.php4
-rw-r--r--core/modules/link/tests/src/Functional/LinkFieldTest.php4
-rw-r--r--core/modules/link/tests/src/Functional/LinkFieldUITest.php2
-rw-r--r--core/modules/link/tests/src/Functional/Views/LinkViewsTokensTest.php2
-rw-r--r--core/modules/link/tests/src/FunctionalJavascript/LinkFieldFormStatesTest.php2
-rw-r--r--core/modules/link/tests/src/Kernel/LinkItemSerializationTest.php4
-rw-r--r--core/modules/link/tests/src/Kernel/LinkItemTest.php2
-rw-r--r--core/modules/link/tests/src/Kernel/LinkItemUrlValidationTest.php2
-rw-r--r--core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldTest.php2
-rw-r--r--core/modules/link/tests/src/Unit/LinkFormatterTest.php6
-rw-r--r--core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkExternalProtocolsConstraintValidatorTest.php6
-rw-r--r--core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldTest.php2
-rw-r--r--core/modules/link/tests/src/Unit/Plugin/migrate/process/FieldLinkTest.php4
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php10
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php4
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleContentTest.php6
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleExportTest.php4
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php2
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php12
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php4
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php6
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleNonInteractiveInstallTest.php2
-rw-r--r--core/modules/locale/tests/src/Functional/LocalePathTest.php2
-rw-r--r--core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php6
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleTranslatedSchemaDefinitionTest.php4
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleTranslationChangeProjectVersionTest.php2
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleTranslationDownloadTest.php2
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php12
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php2
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php2
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php2
-rw-r--r--core/modules/locale/tests/src/Functional/LocaleUpdateTest.php16
-rw-r--r--core/modules/locale/tests/src/Kernel/LocaleBuildTest.php2
-rw-r--r--core/modules/locale/tests/src/Kernel/LocaleConfigManagerTest.php6
-rw-r--r--core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberForeignTest.php18
-rw-r--r--core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php14
-rw-r--r--core/modules/locale/tests/src/Kernel/LocaleConfigurableLanguageManagerTest.php2
-rw-r--r--core/modules/locale/tests/src/Kernel/LocaleStringIsSafeTest.php4
-rw-r--r--core/modules/locale/tests/src/Kernel/LocaleStringTest.php4
-rw-r--r--core/modules/locale/tests/src/Kernel/LocaleTranslationProjectsTest.php2
-rw-r--r--core/modules/locale/tests/src/Kernel/LocaleTranslationTest.php2
-rw-r--r--core/modules/locale/tests/src/Kernel/LocaleUpdateTest.php2
-rw-r--r--core/modules/locale/tests/src/Kernel/Migrate/MigrateLocaleConfigsTest.php2
-rw-r--r--core/modules/locale/tests/src/Unit/LocaleLookupTest.php12
-rw-r--r--core/modules/locale/tests/src/Unit/LocaleTranslationTest.php2
-rw-r--r--core/modules/locale/tests/src/Unit/Menu/LocaleLocalTasksTest.php2
-rw-r--r--core/modules/locale/tests/src/Unit/StringBaseTest.php4
-rw-r--r--core/modules/media/tests/src/Functional/FieldFormatter/MediaThumbnailFormatterTest.php2
-rw-r--r--core/modules/media/tests/src/Functional/FieldFormatter/OEmbedFormatterTest.php4
-rw-r--r--core/modules/media/tests/src/Functional/FieldWidget/OEmbedFieldWidgetTest.php2
-rw-r--r--core/modules/media/tests/src/Functional/MediaAccessTest.php10
-rw-r--r--core/modules/media/tests/src/Functional/MediaBulkFormTest.php2
-rw-r--r--core/modules/media/tests/src/Functional/MediaContextualLinksTest.php2
-rw-r--r--core/modules/media/tests/src/Functional/MediaInstallTest.php2
-rw-r--r--core/modules/media/tests/src/Functional/MediaOverviewPageTest.php2
-rw-r--r--core/modules/media/tests/src/Functional/MediaRequirementsTest.php2
-rw-r--r--core/modules/media/tests/src/Functional/MediaRevisionTest.php6
-rw-r--r--core/modules/media/tests/src/Functional/MediaSettingsTest.php2
-rw-r--r--core/modules/media/tests/src/Functional/MediaSourceFileTest.php4
-rw-r--r--core/modules/media/tests/src/Functional/MediaSourceImageTest.php2
-rw-r--r--core/modules/media/tests/src/Functional/MediaTemplateSuggestionsTest.php2
-rw-r--r--core/modules/media/tests/src/Functional/MediaTypeCreationTest.php2
-rw-r--r--core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php10
-rw-r--r--core/modules/media/tests/src/Functional/MediaUiReferenceWidgetTest.php2
-rw-r--r--core/modules/media/tests/src/Functional/ProviderRepositoryTest.php4
-rw-r--r--core/modules/media/tests/src/Functional/ResourceFetcherTest.php2
-rw-r--r--core/modules/media/tests/src/Functional/Rest/MediaResourceTestBase.php2
-rw-r--r--core/modules/media/tests/src/Functional/UrlResolverTest.php6
-rw-r--r--core/modules/media/tests/src/FunctionalJavascript/MediaDisplayTest.php2
-rw-r--r--core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiAddTest.php2
-rw-r--r--core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiEditTest.php2
-rw-r--r--core/modules/media/tests/src/FunctionalJavascript/MediaReferenceFieldHelpTest.php2
-rw-r--r--core/modules/media/tests/src/FunctionalJavascript/MediaSourceAudioVideoTest.php4
-rw-r--r--core/modules/media/tests/src/FunctionalJavascript/MediaSourceFileTest.php2
-rw-r--r--core/modules/media/tests/src/FunctionalJavascript/MediaSourceImageTest.php2
-rw-r--r--core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php4
-rw-r--r--core/modules/media/tests/src/FunctionalJavascript/MediaStandardProfileTest.php2
-rw-r--r--core/modules/media/tests/src/FunctionalJavascript/MediaTypeCreationTest.php6
-rw-r--r--core/modules/media/tests/src/FunctionalJavascript/MediaUiJavascriptTest.php2
-rw-r--r--core/modules/media/tests/src/FunctionalJavascript/MediaViewsWizardTest.php4
-rw-r--r--core/modules/media/tests/src/Kernel/MediaAccessControlHandlerTest.php4
-rw-r--r--core/modules/media/tests/src/Kernel/MediaCreationTest.php4
-rw-r--r--core/modules/media/tests/src/Kernel/MediaEmbedFilterDisabledIntegrationsTest.php2
-rw-r--r--core/modules/media/tests/src/Kernel/MediaEmbedFilterTest.php14
-rw-r--r--core/modules/media/tests/src/Kernel/MediaEmbedFilterTranslationTest.php2
-rw-r--r--core/modules/media/tests/src/Kernel/MediaLinkRelationsTest.php2
-rw-r--r--core/modules/media/tests/src/Kernel/MediaMappingsConstraintValidatorTest.php2
-rw-r--r--core/modules/media/tests/src/Kernel/MediaSourceFileTest.php4
-rw-r--r--core/modules/media/tests/src/Kernel/MediaSourceTest.php20
-rw-r--r--core/modules/media/tests/src/Kernel/MediaTest.php6
-rw-r--r--core/modules/media/tests/src/Kernel/MediaTranslationTest.php2
-rw-r--r--core/modules/media/tests/src/Kernel/OEmbedIframeControllerTest.php4
-rw-r--r--core/modules/media/tests/src/Kernel/OEmbedResourceConstraintValidatorTest.php4
-rw-r--r--core/modules/media/tests/src/Kernel/OEmbedSourceTest.php2
-rw-r--r--core/modules/media/tests/src/Kernel/Views/RevisionUserTest.php2
-rw-r--r--core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php2
-rw-r--r--core/modules/media/tests/src/Unit/ResourceTest.php2
-rw-r--r--core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php2
-rw-r--r--core/modules/media_library/tests/src/Functional/SettingsFormTest.php2
-rw-r--r--core/modules/media_library/tests/src/FunctionalJavascript/ContentModerationTest.php4
-rw-r--r--core/modules/media_library/tests/src/FunctionalJavascript/EmbeddedFormWidgetTest.php2
-rw-r--r--core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php8
-rw-r--r--core/modules/media_library/tests/src/FunctionalJavascript/FieldUiIntegrationTest.php2
-rw-r--r--core/modules/media_library/tests/src/FunctionalJavascript/MediaOverviewTest.php2
-rw-r--r--core/modules/media_library/tests/src/FunctionalJavascript/TranslationsTest.php2
-rw-r--r--core/modules/media_library/tests/src/FunctionalJavascript/ViewsUiIntegrationTest.php2
-rw-r--r--core/modules/media_library/tests/src/FunctionalJavascript/WidgetAccessTest.php4
-rw-r--r--core/modules/media_library/tests/src/FunctionalJavascript/WidgetAnonymousTest.php2
-rw-r--r--core/modules/media_library/tests/src/FunctionalJavascript/WidgetOEmbedTest.php4
-rw-r--r--core/modules/media_library/tests/src/FunctionalJavascript/WidgetUploadTest.php4
-rw-r--r--core/modules/media_library/tests/src/FunctionalJavascript/WidgetViewsTest.php2
-rw-r--r--core/modules/media_library/tests/src/FunctionalJavascript/WidgetWithoutTypesTest.php2
-rw-r--r--core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php10
-rw-r--r--core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php8
-rw-r--r--core/modules/media_library/tests/src/Kernel/MediaLibraryStateTest.php14
-rw-r--r--core/modules/media_library/tests/src/Kernel/MediaLibraryWidgetTest.php4
-rw-r--r--core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php2
-rw-r--r--core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php8
-rw-r--r--core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php4
-rw-r--r--core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php2
-rw-r--r--core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentDeriverTest.php2
-rw-r--r--core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php12
-rw-r--r--core/modules/menu_link_content/tests/src/Kernel/Migrate/MigrateMenuLinkContentStubTest.php2
-rw-r--r--core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkLocalizedTest.php2
-rw-r--r--core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTest.php2
-rw-r--r--core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTranslationTest.php2
-rw-r--r--core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkLocalizedTest.php2
-rw-r--r--core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php2
-rw-r--r--core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTranslationTest.php2
-rw-r--r--core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php2
-rw-r--r--core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php6
-rw-r--r--core/modules/menu_link_content/tests/src/Unit/MenuLinkContentEntityAccessTest.php2
-rw-r--r--core/modules/menu_link_content/tests/src/Unit/MenuLinkPluginTest.php2
-rw-r--r--core/modules/menu_ui/tests/src/Functional/MenuCacheTagsTest.php2
-rw-r--r--core/modules/menu_ui/tests/src/Functional/MenuLinkReorderTest.php2
-rw-r--r--core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php4
-rw-r--r--core/modules/menu_ui/tests/src/Functional/MenuUiContentTranslationTest.php2
-rw-r--r--core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php2
-rw-r--r--core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php6
-rw-r--r--core/modules/menu_ui/tests/src/Functional/MenuUiTest.php18
-rw-r--r--core/modules/menu_ui/tests/src/Functional/MenuUninstallTest.php2
-rw-r--r--core/modules/menu_ui/tests/src/FunctionalJavascript/MenuUiJavascriptTest.php2
-rw-r--r--core/modules/menu_ui/tests/src/Kernel/Migrate/MigrateMenuSettingsTest.php2
-rw-r--r--core/modules/migrate/tests/src/Functional/MigrateNoMigrateDrupalTest.php2
-rw-r--r--core/modules/migrate/tests/src/Functional/process/DownloadFunctionalTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/HighWaterTest.php8
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateBundleTest.php6
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateConfigRollbackTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateEmbeddedDataTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php8
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateEntityContentValidationTest.php6
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateEventsTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateExecutableTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateExternalTranslatedTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateInterruptionTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateLookupTest.php10
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateMessageTest.php6
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateProcessErrorMessagesTest.php4
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateRollbackEntityConfigTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateSkipRowTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateStatusTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrateStubTest.php12
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrationPluginManagerTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/MigrationTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/Plugin/EntityExistsTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/Plugin/EntityRevisionTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginConfigurationTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php8
-rw-r--r--core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php10
-rw-r--r--core/modules/migrate/tests/src/Kernel/Plugin/id_map/SqlTest.php4
-rw-r--r--core/modules/migrate/tests/src/Kernel/Plugin/source/MigrationSourceCacheTest.php4
-rw-r--r--core/modules/migrate/tests/src/Kernel/QueryBatchTest.php6
-rw-r--r--core/modules/migrate/tests/src/Kernel/SqlBaseTest.php4
-rw-r--r--core/modules/migrate/tests/src/Kernel/TrackChangesTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/process/DownloadTest.php6
-rw-r--r--core/modules/migrate/tests/src/Kernel/process/ExtractTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php14
-rw-r--r--core/modules/migrate/tests/src/Kernel/process/HandleMultiplesTest.php2
-rw-r--r--core/modules/migrate/tests/src/Kernel/process/RouteTest.php4
-rw-r--r--core/modules/migrate/tests/src/Unit/Event/EventBaseTest.php4
-rw-r--r--core/modules/migrate/tests/src/Unit/Event/MigrateImportEventTest.php4
-rw-r--r--core/modules/migrate/tests/src/Unit/Event/MigratePostRowSaveEventTest.php4
-rw-r--r--core/modules/migrate/tests/src/Unit/Event/MigratePreRowSaveEventTest.php2
-rw-r--r--core/modules/migrate/tests/src/Unit/Exception/RequirementsExceptionTest.php4
-rw-r--r--core/modules/migrate/tests/src/Unit/MigrateExecutableMemoryExceededTest.php6
-rw-r--r--core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php28
-rw-r--r--core/modules/migrate/tests/src/Unit/MigrateLookupTest.php6
-rw-r--r--core/modules/migrate/tests/src/Unit/MigrateSourceTest.php24
-rw-r--r--core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php4
-rw-r--r--core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php50
-rw-r--r--core/modules/migrate/tests/src/Unit/MigrateStubTest.php6
-rw-r--r--core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php4
-rw-r--r--core/modules/migrate/tests/src/Unit/MigrationTest.php14
-rw-r--r--core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/CheckRequirementsTest.php2
-rw-r--r--core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php6
-rw-r--r--core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php4
-rw-r--r--core/modules/migrate/tests/src/Unit/RowTest.php30
-rw-r--r--core/modules/migrate/tests/src/Unit/SqlBaseTest.php2
-rw-r--r--core/modules/migrate/tests/src/Unit/destination/ConfigTest.php4
-rw-r--r--core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php10
-rw-r--r--core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php2
-rw-r--r--core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php2
-rw-r--r--core/modules/migrate/tests/src/Unit/process/ArrayBuildTest.php10
-rw-r--r--core/modules/migrate/tests/src/Unit/process/CallbackTest.php6
-rw-r--r--core/modules/migrate/tests/src/Unit/process/ConcatTest.php6
-rw-r--r--core/modules/migrate/tests/src/Unit/process/DefaultValueTest.php2
-rw-r--r--core/modules/migrate/tests/src/Unit/process/ExplodeTest.php16
-rw-r--r--core/modules/migrate/tests/src/Unit/process/ExtractTest.php10
-rw-r--r--core/modules/migrate/tests/src/Unit/process/FileCopyTest.php2
-rw-r--r--core/modules/migrate/tests/src/Unit/process/FlattenTest.php4
-rw-r--r--core/modules/migrate/tests/src/Unit/process/FormatDateTest.php10
-rw-r--r--core/modules/migrate/tests/src/Unit/process/GetTest.php12
-rw-r--r--core/modules/migrate/tests/src/Unit/process/LogTest.php2
-rw-r--r--core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php8
-rw-r--r--core/modules/migrate/tests/src/Unit/process/MenuLinkParentTest.php4
-rw-r--r--core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php12
-rw-r--r--core/modules/migrate/tests/src/Unit/process/NullCoalesceTest.php6
-rw-r--r--core/modules/migrate/tests/src/Unit/process/ProcessPluginBaseTest.php2
-rw-r--r--core/modules/migrate/tests/src/Unit/process/SkipOnEmptyTest.php14
-rw-r--r--core/modules/migrate/tests/src/Unit/process/SkipRowIfNotSetTest.php4
-rw-r--r--core/modules/migrate/tests/src/Unit/process/StaticMapTest.php18
-rw-r--r--core/modules/migrate/tests/src/Unit/process/SubProcessTest.php6
-rw-r--r--core/modules/migrate/tests/src/Unit/process/SubstrTest.php8
-rw-r--r--core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/IdMapTableNoDummyTest.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php6
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/NodeMigrationTypePluginAlterTest.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/DestinationCategoryTest.php4
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityConstructorTest.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityTest.php10
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/StateFileExistsTest.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/d6/EntityContentBaseTest.php6
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php10
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/d6/FollowUpMigrationsTest.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php10
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/d6/MigrationProcessTest.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/d6/VariableTranslationCheckRequirementsTest.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php8
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/d7/FollowUpMigrationsTest.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php10
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/d7/MigrationProcessTest.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/Kernel/dependencies/MigrateDependenciesTest.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php8
-rw-r--r--core/modules/migrate_drupal/tests/src/Unit/MigrateFieldPluginManagerTest.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/Unit/MigrationConfigurationTraitTest.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/Unit/MigrationStateUnitTest.php2
-rw-r--r--core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php6
-rw-r--r--core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php8
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/CredentialFormTest.php2
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/MigrateAccessTest.php2
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/MigrateControllerTest.php2
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeFormStepsTest.php2
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php2
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/NoMultilingualReviewPageTestBase.php2
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/SourceProviderTest.php2
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php2
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/d6/NodeClassicTest.php2
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php2
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php2
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/d7/FilePathTest.php2
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/d7/IdConflictTest.php2
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php2
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/FunctionalJavascript/SettingsTest.php2
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Kernel/MigrationLabelExistTest.php2
-rw-r--r--core/modules/mysql/tests/src/Functional/InstallerIsolationLevelExistingSettingsTest.php2
-rw-r--r--core/modules/mysql/tests/src/Functional/InstallerIsolationLevelNoDatabaseSettingsTest.php2
-rw-r--r--core/modules/mysql/tests/src/Functional/RequirementsTest.php2
-rw-r--r--core/modules/mysql/tests/src/Kernel/mysql/Console/DbDumpCommandTest.php6
-rw-r--r--core/modules/mysql/tests/src/Kernel/mysql/DatabaseExceptionWrapperTest.php4
-rw-r--r--core/modules/mysql/tests/src/Kernel/mysql/DbDumpTest.php4
-rw-r--r--core/modules/mysql/tests/src/Kernel/mysql/MysqlDriverTest.php2
-rw-r--r--core/modules/mysql/tests/src/Kernel/mysql/PrefixInfoTest.php2
-rw-r--r--core/modules/mysql/tests/src/Kernel/mysql/TemporaryQueryTest.php2
-rw-r--r--core/modules/mysql/tests/src/Unit/InstallTasksTest.php2
-rw-r--r--core/modules/navigation/tests/src/Functional/NavigationLogoTest.php2
-rw-r--r--core/modules/navigation/tests/src/Functional/NavigationShortcutsBlockTest.php2
-rw-r--r--core/modules/navigation/tests/src/Functional/NavigationTopBarTest.php2
-rw-r--r--core/modules/navigation/tests/src/Functional/NavigationUserBlockTest.php2
-rw-r--r--core/modules/navigation/tests/src/Kernel/SystemMenuNavigationBlockTest.php4
-rw-r--r--core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeAccessCacheabilityTest.php4
-rw-r--r--core/modules/node/tests/src/Functional/NodeAccessCacheabilityWithNodeGrants.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeAccessFieldTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeAccessGrantsCacheContextTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeAccessMenuLinkTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeAccessPagerTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php4
-rw-r--r--core/modules/node/tests/src/Functional/NodeAdminTest.php6
-rw-r--r--core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeContextualLinksTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeCreationTest.php14
-rw-r--r--core/modules/node/tests/src/Functional/NodeEditFormTest.php6
-rw-r--r--core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php4
-rw-r--r--core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeHelpTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeLinksTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodePostSettingsTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodePreviewAnonymousTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeQueryAlterTest.php10
-rw-r--r--core/modules/node/tests/src/Functional/NodeRSSContentTest.php4
-rw-r--r--core/modules/node/tests/src/Functional/NodeRevisionsAllTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeRevisionsTest.php6
-rw-r--r--core/modules/node/tests/src/Functional/NodeRevisionsUiBypassAccessTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeRevisionsUiTest.php6
-rw-r--r--core/modules/node/tests/src/Functional/NodeRssCacheTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeSaveTest.php8
-rw-r--r--core/modules/node/tests/src/Functional/NodeSyndicateBlockTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeTitleTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeTitleXSSTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeTranslationUITest.php16
-rw-r--r--core/modules/node/tests/src/Functional/NodeTypeInitialLanguageTest.php4
-rw-r--r--core/modules/node/tests/src/Functional/NodeTypeTest.php12
-rw-r--r--core/modules/node/tests/src/Functional/NodeTypeTranslationTest.php4
-rw-r--r--core/modules/node/tests/src/Functional/NodeViewLanguageTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeViewTest.php6
-rw-r--r--core/modules/node/tests/src/Functional/PagePreviewTest.php8
-rw-r--r--core/modules/node/tests/src/Functional/PageViewTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/Rest/NodeResourceTestBase.php2
-rw-r--r--core/modules/node/tests/src/Functional/Rest/NodeXmlAnonTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/Rest/NodeXmlBasicAuthTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/Rest/NodeXmlCookieTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php4
-rw-r--r--core/modules/node/tests/src/Functional/Views/BulkFormTest.php4
-rw-r--r--core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/Views/FrontPageTest.php8
-rw-r--r--core/modules/node/tests/src/Functional/Views/NodeContextualLinksTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/Views/NodeFieldFilterTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/Views/NodeFieldTokensTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/Views/NodeIntegrationTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php4
-rw-r--r--core/modules/node/tests/src/Functional/Views/NodeViewsAnalyzeTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/Views/RevisionLinkTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/Views/StatusExtraTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/Views/Wizard/HiddenTaxonomyTermReferenceFieldWizardTest.php2
-rw-r--r--core/modules/node/tests/src/Functional/Views/Wizard/NodeRevisionWizardTest.php2
-rw-r--r--core/modules/node/tests/src/FunctionalJavascript/CollapsedSummariesTest.php2
-rw-r--r--core/modules/node/tests/src/FunctionalJavascript/ContextualLinksTest.php2
-rw-r--r--core/modules/node/tests/src/FunctionalJavascript/NodeDeleteConfirmTest.php4
-rw-r--r--core/modules/node/tests/src/FunctionalJavascript/NodePreviewLinkTest.php2
-rw-r--r--core/modules/node/tests/src/FunctionalJavascript/SettingSummariesContentTypeTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Config/NodeImportChangeTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Config/NodeImportCreateTest.php4
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/MigrateNodeStubTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeBundleSettingsTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeCompleteTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeConfigsTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeDeriverTest.php4
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeRevisionTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeSettingPromoteTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeSettingStatusTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeSettingStickyTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTypeTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d6/MigrateViewModesTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d6/NodeTranslationRedirectTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php4
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeDeriverTest.php6
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeSettingsTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTitleLabelTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d7/NodeTranslationRedirectTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareCombinationTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php6
-rw-r--r--core/modules/node/tests/src/Kernel/NodeAccessRecordsTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/NodeAccessTest.php4
-rw-r--r--core/modules/node/tests/src/Kernel/NodeBodyFieldStorageTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/NodeFieldAccessTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/NodeFieldOverridesTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/NodeListBuilderTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/NodeLoadMultipleTest.php4
-rw-r--r--core/modules/node/tests/src/Kernel/NodeOwnerTest.php4
-rw-r--r--core/modules/node/tests/src/Kernel/NodeTokenReplaceTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/NodeValidationTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/NodeViewBuilderTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/SummaryLengthTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Views/ArgumentNodeRevisionIdTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Views/ArgumentUidRevisionTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Views/FilterUidRevisionTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Views/NidArgumentTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Views/NodeViewsFieldAccessTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Views/RevisionCreateTimestampTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Views/RevisionRelationshipsTest.php2
-rw-r--r--core/modules/node/tests/src/Kernel/Views/RevisionUidTest.php2
-rw-r--r--core/modules/node/tests/src/Unit/NodeOperationAccessTest.php2
-rw-r--r--core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php2
-rw-r--r--core/modules/node/tests/src/Unit/Plugin/views/field/NodeBulkFormTest.php2
-rw-r--r--core/modules/options/tests/src/Functional/OptionsFieldUITest.php10
-rw-r--r--core/modules/options/tests/src/Functional/OptionsFloatFieldImportTest.php2
-rw-r--r--core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.php2
-rw-r--r--core/modules/options/tests/src/Functional/OptionsWidgetsTest.php16
-rw-r--r--core/modules/options/tests/src/FunctionalJavascript/OptionsFieldUITest.php6
-rw-r--r--core/modules/options/tests/src/Kernel/OptionsFieldTest.php4
-rw-r--r--core/modules/options/tests/src/Kernel/OptionsFormattersTest.php2
-rw-r--r--core/modules/options/tests/src/Kernel/Views/FileViewsDataTest.php2
-rw-r--r--core/modules/options/tests/src/Kernel/Views/OptionsListArgumentTest.php2
-rw-r--r--core/modules/options/tests/src/Kernel/Views/OptionsListFilterTest.php4
-rw-r--r--core/modules/options/tests/src/Kernel/Views/ViewsDataTest.php2
-rw-r--r--core/modules/page_cache/tests/src/Functional/PageCacheTagsIntegrationTest.php2
-rw-r--r--core/modules/page_cache/tests/src/Functional/PageCacheTest.php26
-rw-r--r--core/modules/path/tests/src/Functional/PathAdminTest.php2
-rw-r--r--core/modules/path/tests/src/Functional/PathAliasTest.php8
-rw-r--r--core/modules/path/tests/src/Functional/PathContentModerationTest.php4
-rw-r--r--core/modules/path/tests/src/Functional/PathLanguageTest.php2
-rw-r--r--core/modules/path/tests/src/Functional/PathLanguageUiTest.php8
-rw-r--r--core/modules/path/tests/src/Functional/PathMediaFormTest.php2
-rw-r--r--core/modules/path/tests/src/Functional/PathNodeFormTest.php2
-rw-r--r--core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php2
-rw-r--r--core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php4
-rw-r--r--core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTest.php2
-rw-r--r--core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTestBase.php2
-rw-r--r--core/modules/path/tests/src/Kernel/PathItemTest.php2
-rw-r--r--core/modules/path/tests/src/Kernel/PathNoCanonicalLinkTest.php2
-rw-r--r--core/modules/path/tests/src/Unit/Field/PathFieldDefinitionTest.php2
-rw-r--r--core/modules/path/tests/src/Unit/migrate/process/PathSetTranslatedTest.php2
-rw-r--r--core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php2
-rw-r--r--core/modules/path_alias/tests/src/Kernel/AliasTest.php12
-rw-r--r--core/modules/path_alias/tests/src/Kernel/PathHooksTest.php2
-rw-r--r--core/modules/path_alias/tests/src/Unit/AliasManagerTest.php24
-rw-r--r--core/modules/path_alias/tests/src/Unit/PathProcessor/AliasPathProcessorTest.php4
-rw-r--r--core/modules/pgsql/tests/src/Kernel/pgsql/DatabaseExceptionWrapperTest.php2
-rw-r--r--core/modules/pgsql/tests/src/Kernel/pgsql/KernelTestBaseTest.php2
-rw-r--r--core/modules/pgsql/tests/src/Kernel/pgsql/SchemaTest.php4
-rw-r--r--core/modules/pgsql/tests/src/Kernel/pgsql/TemporaryQueryTest.php2
-rw-r--r--core/modules/pgsql/tests/src/Unit/SchemaTest.php2
-rw-r--r--core/modules/phpass/tests/src/Unit/PasswordVerifyTest.php12
-rw-r--r--core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php2
-rw-r--r--core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php14
-rw-r--r--core/modules/responsive_image/tests/src/Functional/ViewsIntegrationTest.php2
-rw-r--r--core/modules/responsive_image/tests/src/FunctionalJavascript/ResponsiveImageFieldUiTest.php2
-rw-r--r--core/modules/responsive_image/tests/src/Kernel/Migrate/d7/MigrateResponsiveImageStylesTest.php2
-rw-r--r--core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php2
-rw-r--r--core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php14
-rw-r--r--core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php8
-rw-r--r--core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeXmlAnonTest.php2
-rw-r--r--core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeXmlBasicAuthTest.php2
-rw-r--r--core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeXmlCookieTest.php2
-rw-r--r--core/modules/rest/tests/src/Functional/EntityResource/XmlEntityNormalizationQuirksTrait.php4
-rw-r--r--core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php22
-rw-r--r--core/modules/rest/tests/src/Functional/ResourceTest.php8
-rw-r--r--core/modules/rest/tests/src/Functional/Views/ExcludedFieldTokenTest.php2
-rw-r--r--core/modules/rest/tests/src/Functional/Views/FieldCounterTest.php2
-rw-r--r--core/modules/rest/tests/src/Functional/Views/RestExportAuthTest.php2
-rw-r--r--core/modules/rest/tests/src/Functional/Views/StyleSerializerEntityTest.php14
-rw-r--r--core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php12
-rw-r--r--core/modules/rest/tests/src/Kernel/Entity/ConfigDependenciesTest.php8
-rw-r--r--core/modules/rest/tests/src/Kernel/Entity/RestPermissionsTest.php2
-rw-r--r--core/modules/rest/tests/src/Kernel/Entity/RestResourceConfigTest.php2
-rw-r--r--core/modules/rest/tests/src/Kernel/EntityResource/EntityResourceRestTestCoverageTest.php2
-rw-r--r--core/modules/rest/tests/src/Kernel/RequestHandlerTest.php2
-rw-r--r--core/modules/rest/tests/src/Kernel/Views/RestExportTest.php2
-rw-r--r--core/modules/rest/tests/src/Kernel/Views/StyleSerializerKernelTest.php2
-rw-r--r--core/modules/rest/tests/src/Unit/CollectRoutesTest.php2
-rw-r--r--core/modules/rest/tests/src/Unit/Entity/RestResourceConfigTest.php2
-rw-r--r--core/modules/rest/tests/src/Unit/EntityResourceValidationTraitTest.php4
-rw-r--r--core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php8
-rw-r--r--core/modules/rest/tests/src/Unit/Plugin/views/style/SerializerTest.php2
-rw-r--r--core/modules/search/tests/src/Functional/SearchAdminThemeTest.php2
-rw-r--r--core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php4
-rw-r--r--core/modules/search/tests/src/Functional/SearchBlockTest.php2
-rw-r--r--core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php2
-rw-r--r--core/modules/search/tests/src/Functional/SearchCommentTest.php6
-rw-r--r--core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php12
-rw-r--r--core/modules/search/tests/src/Functional/SearchDateIntervalTest.php2
-rw-r--r--core/modules/search/tests/src/Functional/SearchEmbedFormTest.php2
-rw-r--r--core/modules/search/tests/src/Functional/SearchExactTest.php2
-rw-r--r--core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php2
-rw-r--r--core/modules/search/tests/src/Functional/SearchLanguageTest.php4
-rw-r--r--core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php2
-rw-r--r--core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php2
-rw-r--r--core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php2
-rw-r--r--core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php4
-rw-r--r--core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php2
-rw-r--r--core/modules/search/tests/src/Functional/SearchNumbersTest.php2
-rw-r--r--core/modules/search/tests/src/Functional/SearchPageCacheTagsTest.php4
-rw-r--r--core/modules/search/tests/src/Functional/SearchPageOverrideTest.php2
-rw-r--r--core/modules/search/tests/src/Functional/SearchPageTextTest.php4
-rw-r--r--core/modules/search/tests/src/Functional/SearchPreprocessLangcodeTest.php4
-rw-r--r--core/modules/search/tests/src/Functional/SearchQueryAlterTest.php2
-rw-r--r--core/modules/search/tests/src/Functional/SearchRankingTest.php4
-rw-r--r--core/modules/search/tests/src/Kernel/Migrate/d6/MigrateSearchPageTest.php2
-rw-r--r--core/modules/search/tests/src/Kernel/Migrate/d6/MigrateSearchSettingsTest.php2
-rw-r--r--core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php6
-rw-r--r--core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchSettingsTest.php2
-rw-r--r--core/modules/search/tests/src/Kernel/SearchExcerptTest.php4
-rw-r--r--core/modules/search/tests/src/Kernel/SearchIndexTest.php2
-rw-r--r--core/modules/search/tests/src/Kernel/SearchMatchTest.php2
-rw-r--r--core/modules/search/tests/src/Kernel/SearchTextProcessorTest.php4
-rw-r--r--core/modules/search/tests/src/Kernel/SearchTokenizerTest.php4
-rw-r--r--core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php16
-rw-r--r--core/modules/search/tests/src/Unit/SearchPluginCollectionTest.php4
-rw-r--r--core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php22
-rw-r--r--core/modules/serialization/tests/src/Kernel/FieldItemSerializationTest.php6
-rw-r--r--core/modules/serialization/tests/src/Kernel/MapDataNormalizerTest.php4
-rw-r--r--core/modules/serialization/tests/src/Kernel/SerializationTest.php2
-rw-r--r--core/modules/serialization/tests/src/Unit/CompilerPass/RegisterSerializationClassesCompilerPassTest.php2
-rw-r--r--core/modules/serialization/tests/src/Unit/Encoder/JsonEncoderTest.php2
-rw-r--r--core/modules/serialization/tests/src/Unit/Encoder/XmlEncoderTest.php10
-rw-r--r--core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php10
-rw-r--r--core/modules/serialization/tests/src/Unit/EntityResolver/UuidResolverTest.php8
-rw-r--r--core/modules/serialization/tests/src/Unit/EventSubscriber/DefaultExceptionSubscriberTest.php2
-rw-r--r--core/modules/serialization/tests/src/Unit/Normalizer/ComplexDataNormalizerTest.php6
-rw-r--r--core/modules/serialization/tests/src/Unit/Normalizer/ConfigEntityNormalizerTest.php4
-rw-r--r--core/modules/serialization/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php6
-rw-r--r--core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php16
-rw-r--r--core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php14
-rw-r--r--core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php12
-rw-r--r--core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php26
-rw-r--r--core/modules/serialization/tests/src/Unit/Normalizer/ListNormalizerTest.php4
-rw-r--r--core/modules/serialization/tests/src/Unit/Normalizer/NormalizerBaseTest.php2
-rw-r--r--core/modules/serialization/tests/src/Unit/Normalizer/NullNormalizerTest.php4
-rw-r--r--core/modules/serialization/tests/src/Unit/Normalizer/PrimitiveDataNormalizerTest.php6
-rw-r--r--core/modules/serialization/tests/src/Unit/Normalizer/TimestampItemNormalizerTest.php8
-rw-r--r--core/modules/serialization/tests/src/Unit/Normalizer/TimestampNormalizerTest.php10
-rw-r--r--core/modules/serialization/tests/src/Unit/Normalizer/TypedDataNormalizerTest.php4
-rw-r--r--core/modules/settings_tray/tests/src/Functional/SettingsTrayTest.php4
-rw-r--r--core/modules/settings_tray/tests/src/FunctionalJavascript/ConfigAccessTest.php2
-rw-r--r--core/modules/settings_tray/tests/src/FunctionalJavascript/OverriddenConfigurationTest.php4
-rw-r--r--core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php6
-rw-r--r--core/modules/settings_tray/tests/src/Unit/Access/BlockPluginHasSettingsTrayFormAccessCheckTest.php2
-rw-r--r--core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php4
-rw-r--r--core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php20
-rw-r--r--core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php24
-rw-r--r--core/modules/shortcut/tests/src/Kernel/Migrate/MigrateShortcutStubTest.php2
-rw-r--r--core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetTest.php2
-rw-r--r--core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetUsersTest.php2
-rw-r--r--core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutTest.php2
-rw-r--r--core/modules/shortcut/tests/src/Kernel/ShortcutClaroIntegrationTest.php2
-rw-r--r--core/modules/shortcut/tests/src/Unit/Menu/ShortcutLocalTasksTest.php2
-rw-r--r--core/modules/sqlite/tests/src/Kernel/sqlite/DatabaseExceptionWrapperTest.php2
-rw-r--r--core/modules/sqlite/tests/src/Kernel/sqlite/TemporaryQueryTest.php2
-rw-r--r--core/modules/sqlite/tests/src/Unit/ConnectionTest.php2
-rw-r--r--core/modules/syslog/tests/src/Functional/SyslogTest.php2
-rw-r--r--core/modules/syslog/tests/src/Kernel/Migrate/d6/MigrateSyslogConfigsTest.php2
-rw-r--r--core/modules/syslog/tests/src/Kernel/Migrate/d7/MigrateSyslogConfigsTest.php2
-rw-r--r--core/modules/syslog/tests/src/Kernel/SyslogTest.php6
-rw-r--r--core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestComputedFieldNormalizerTest.php6
-rw-r--r--core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestTextItemNormalizerTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Ajax/FrameworkTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/Ajax/OffCanvasDialogTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Batch/PageTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/Batch/ProcessingTest.php16
-rw-r--r--core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Cache/ClearTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Cache/SessionExistsCacheContextTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Common/EarlyRenderingControllerTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Common/FormatDateTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Common/RenderWebTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Common/UrlTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Condition/ConditionFormTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/CsrfRequestHeaderTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Database/SelectPagerDefaultTest.php10
-rw-r--r--core/modules/system/tests/src/Functional/Database/SelectTableSortDefaultTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/Datetime/DrupalDateTimeTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/Datetime/TimeZoneAbbreviationRouteTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/DrupalKernel/ContainerRebuildWebTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/DrupalKernel/ContainerResetWebTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/DrupalKernel/ContentNegotiationTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Entity/EntityAddUITest.php4
-rw-r--r--core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php2
-rw-r--r--core/modules/system/tests/src/Functional/Entity/EntityComputedFieldTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Entity/EntityFormTest.php10
-rw-r--r--core/modules/system/tests/src/Functional/Entity/EntityListBuilderTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Entity/EntityReferenceFieldCreationTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/Entity/EntityTranslationFormTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/Entity/EntityWithUriCacheTagsTestBase.php2
-rw-r--r--core/modules/system/tests/src/Functional/File/ConfigTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/File/FileSaveHtaccessLoggingTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Form/AlterTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Form/ArbitraryRebuildTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/Form/CheckboxTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Form/ConfirmFormTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/Form/ElementTest.php20
-rw-r--r--core/modules/system/tests/src/Functional/Form/ElementsAccessTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Form/ElementsContainerTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Form/ElementsLabelsTest.php8
-rw-r--r--core/modules/system/tests/src/Functional/Form/ElementsTableSelectTest.php18
-rw-r--r--core/modules/system/tests/src/Functional/Form/ElementsVerticalTabsTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/Form/EmailTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Form/FormObjectTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/Form/FormTest.php32
-rw-r--r--core/modules/system/tests/src/Functional/Form/LanguageSelectElementTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/Form/MenuLinksetSettingsFormTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php12
-rw-r--r--core/modules/system/tests/src/Functional/Form/RebuildTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Form/RedirectTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/Form/ResponseTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Form/StateValuesCleanAdvancedTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Form/StateValuesCleanTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Form/StorageTest.php12
-rw-r--r--core/modules/system/tests/src/Functional/Form/SystemConfigFormTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Form/UrlTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Form/ValidationTest.php10
-rw-r--r--core/modules/system/tests/src/Functional/Lock/LockFunctionalTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/Menu/BreadcrumbFrontCacheContextsTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/Menu/LinksetControllerMultiLingualTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/Menu/LinksetControllerTest.php12
-rw-r--r--core/modules/system/tests/src/Functional/Menu/LocalActionTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/Menu/MenuAccessTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Menu/MenuLinkSecurityTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php8
-rw-r--r--core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php10
-rw-r--r--core/modules/system/tests/src/Functional/Module/DependencyTest.php22
-rw-r--r--core/modules/system/tests/src/Functional/Module/DeprecatedTemplateTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Module/HookRequirementsTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Module/UninstallTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/Module/VersionTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Page/DefaultMetatagsTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Pager/PagerTest.php8
-rw-r--r--core/modules/system/tests/src/Functional/ParamConverter/UpcastingTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/Render/AjaxPageStateTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/Render/DisplayVariantTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/Render/PlaceholderMessageTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Render/RenderArrayNonHtmlSubscriberTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Render/UrlBubbleableMetadataBubblingTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Routing/DestinationTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Routing/RouterPermissionTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Routing/RouterTest.php28
-rw-r--r--core/modules/system/tests/src/Functional/ServiceProvider/ServiceProviderWebTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Session/SessionAuthenticationTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Session/SessionTest.php16
-rw-r--r--core/modules/system/tests/src/Functional/Session/StackSessionHandlerIntegrationTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/System/AccessDeniedTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/System/AdminTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/System/CronRunTest.php10
-rw-r--r--core/modules/system/tests/src/Functional/System/DateFormatsLockedTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/System/DateFormatsMachineNameTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/System/DateTimeTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/System/DefaultMobileMetaTagsTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/System/FrontPageTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/System/HtaccessTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/System/IndexPhpTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/System/MainContentFallbackTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/System/PageNotFoundTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/System/PageTitleTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/System/PhpRequirementTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/System/ResponseGeneratorTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/System/ShutdownFunctionsTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/System/SitesDirectoryHardeningTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/System/StatusTest.php6
-rw-r--r--core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/System/ThemeTest.php18
-rw-r--r--core/modules/system/tests/src/Functional/System/TokenReplaceWebTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/System/TrustedHostsTest.php10
-rw-r--r--core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php14
-rw-r--r--core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Theme/FastTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Theme/HtmlAttributesTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Theme/ImageLoadingAttributeTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Theme/MaintenanceThemeUpdateRegistryTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Theme/ThemeEarlyInitializationTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/Theme/ThemeSuggestionsAlterTest.php10
-rw-r--r--core/modules/system/tests/src/Functional/Theme/ThemeTest.php22
-rw-r--r--core/modules/system/tests/src/Functional/Theme/ThemeTokenTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php10
-rw-r--r--core/modules/system/tests/src/Functional/Theme/ThemeUpdateTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Theme/ToolbarClaroOverridesTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Theme/TwigDebugMarkupTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Theme/TwigEnvironmentTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php12
-rw-r--r--core/modules/system/tests/src/Functional/Theme/TwigRegistryLoaderTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php8
-rw-r--r--core/modules/system/tests/src/Functional/Theme/TwigTransTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/BrokenCacheUpdateTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/DependencyHookInvocationTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/DependencyMissingTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/DependencyOrderingTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/EntityUpdateInitialTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/InvalidUpdateHookTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/NoPreExistingSchemaUpdateTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/RebuildScriptTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/UpdateCacheTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathLastRemovedTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathNewDependencyTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestBaseFilledTest.php4
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestJavaScriptTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathWithBrokenRoutingTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateExceptionTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateFailingTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/UpdateRemovedPostUpdateTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php2
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php18
-rw-r--r--core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php2
-rw-r--r--core/modules/system/tests/src/FunctionalJavascript/CopyFieldValueTest.php2
-rw-r--r--core/modules/system/tests/src/FunctionalJavascript/Form/ElementsTableSelectTest.php4
-rw-r--r--core/modules/system/tests/src/FunctionalJavascript/Form/RebuildTest.php2
-rw-r--r--core/modules/system/tests/src/FunctionalJavascript/Form/TriggeringElementTest.php4
-rw-r--r--core/modules/system/tests/src/FunctionalJavascript/FrameworkTest.php6
-rw-r--r--core/modules/system/tests/src/FunctionalJavascript/ModalRendererTest.php4
-rw-r--r--core/modules/system/tests/src/FunctionalJavascript/ModuleFilterTest.php2
-rw-r--r--core/modules/system/tests/src/FunctionalJavascript/ModuleUninstallFilterTest.php2
-rw-r--r--core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php4
-rw-r--r--core/modules/system/tests/src/FunctionalJavascript/System/DateFormatTest.php2
-rw-r--r--core/modules/system/tests/src/FunctionalJavascript/ThemeSettingsFormTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Action/ActionTest.php4
-rw-r--r--core/modules/system/tests/src/Kernel/Block/SystemMenuBlockTest.php6
-rw-r--r--core/modules/system/tests/src/Kernel/Common/AddFeedTest.php4
-rw-r--r--core/modules/system/tests/src/Kernel/Common/FormElementsRenderTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Common/PageRenderTest.php4
-rw-r--r--core/modules/system/tests/src/Kernel/Common/SystemListingTest.php4
-rw-r--r--core/modules/system/tests/src/Kernel/Common/UrlTest.php14
-rw-r--r--core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/DecoratedServiceTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Entity/EntityLabelTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php16
-rw-r--r--core/modules/system/tests/src/Kernel/Form/ElementsFieldsetTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Form/FileElementTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Form/FormElementLabelTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Form/FormElementMaxlengthTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php4
-rw-r--r--core/modules/system/tests/src/Kernel/Installer/InstallTranslationFilePatternTest.php4
-rw-r--r--core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Installer/UninstallKernelTest.php4
-rw-r--r--core/modules/system/tests/src/Kernel/Mail/MailTest.php12
-rw-r--r--core/modules/system/tests/src/Kernel/Menu/MenuStorageTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/MenuAccessControlHandlerTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Migrate/d6/MigrateActionConfigsTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Migrate/d6/MigrateActionsTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Migrate/d6/MigrateDateFormatTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Migrate/d6/MigrateMenuTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Migrate/d6/MigrateSystemConfigurationTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Migrate/d7/MigrateActionConfigsTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Migrate/d7/MigrateActionsTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Migrate/d7/MigrateGlobalThemeSettingsTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTranslationTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Migrate/d7/MigrateSystemConfigurationTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Migrate/d7/MigrateThemeSettingsTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Module/InstallTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/PermissionsTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/PhpStorage/PhpStorageFactoryTest.php6
-rw-r--r--core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php8
-rw-r--r--core/modules/system/tests/src/Kernel/Scripts/DbImportCommandTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Scripts/DbToolsApplicationTest.php4
-rw-r--r--core/modules/system/tests/src/Kernel/System/CronQueueTest.php6
-rw-r--r--core/modules/system/tests/src/Kernel/System/FloodTest.php6
-rw-r--r--core/modules/system/tests/src/Kernel/System/InfoAlterTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Theme/FunctionsTest.php10
-rw-r--r--core/modules/system/tests/src/Kernel/Theme/ThemeTest.php16
-rw-r--r--core/modules/system/tests/src/Kernel/Theme/TwigFilterTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Theme/TwigNamespaceTest.php4
-rw-r--r--core/modules/system/tests/src/Kernel/Theme/TwigRawTest.php4
-rw-r--r--core/modules/system/tests/src/Kernel/TimezoneResolverTest.php2
-rw-r--r--core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTest.php8
-rw-r--r--core/modules/system/tests/src/Unit/Batch/BatchControllerTest.php2
-rw-r--r--core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php16
-rw-r--r--core/modules/system/tests/src/Unit/Event/SecurityFileUploadEventSubscriberTest.php4
-rw-r--r--core/modules/system/tests/src/Unit/FileTransfer/FileTransferTest.php2
-rw-r--r--core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php2
-rw-r--r--core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php2
-rw-r--r--core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php12
-rw-r--r--core/modules/system/tests/src/Unit/Routing/AdminRouteSubscriberTest.php2
-rw-r--r--core/modules/system/tests/src/Unit/TraitAccessTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Rest/TermResourceTestBase.php4
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Rest/TermXmlAnonTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Rest/TermXmlBasicAuthTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Rest/TermXmlCookieTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/RssTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TaxonomyRevisionTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TaxonomyTermIndentationTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TaxonomyTermPagerTest.php4
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TermAccessTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TermAutocompleteTest.php4
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TermContextualLinksTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TermIndexTest.php4
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php6
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TermParentsTest.php8
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TermTest.php20
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TermTranslationTest.php4
-rw-r--r--core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php4
-rw-r--r--core/modules/taxonomy/tests/src/Functional/ThemeTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyDefaultArgumentTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldAllTermsTest.php4
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php10
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyParentUITest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyRelationshipTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TaxonomyVocabularyArgumentTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TermDisplayConfigurableTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TermNameFieldTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/TermTranslationViewsTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/VocabularyLanguageTest.php4
-rw-r--r--core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php6
-rw-r--r--core/modules/taxonomy/tests/src/Functional/VocabularySerializationTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php8
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/ContextProvider/TermContextTest.php4
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/LoadMultipleTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/MigrateTaxonomyConfigsTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/MigrateTaxonomyTermStubTest.php4
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/TaxonomyTermDeriverTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyVocabularyTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyVocabularyTranslationTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermLocalizedTranslationTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeComplete.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeRevisionTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTest.php4
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTranslationTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityDisplayTest.php4
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityFormDisplayTest.php4
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldInstanceTest.php4
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateNodeTaxonomyTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTranslationTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTermLocalizedTranslationTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/PendingRevisionTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/TermEntityQueryTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/TermEntityReferenceTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/TermHierarchyValidationTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php8
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/TermValidationTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/TokenReplaceTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Views/ArgumentTransformTermTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermNameTest.php4
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyDefaultArgumentTest.php6
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldTidTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldVidTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyIndexTidFilterTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyViewsFieldAccessTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/VocabularyCrudTest.php6
-rw-r--r--core/modules/taxonomy/tests/src/Unit/Menu/TaxonomyLocalTasksTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php2
-rw-r--r--core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php4
-rw-r--r--core/modules/telephone/tests/src/Kernel/TelephoneItemTest.php2
-rw-r--r--core/modules/text/tests/src/Functional/TextFieldTest.php10
-rw-r--r--core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php4
-rw-r--r--core/modules/text/tests/src/Kernel/Migrate/MigrateTextConfigsTest.php2
-rw-r--r--core/modules/text/tests/src/Kernel/TextFormatterTest.php2
-rw-r--r--core/modules/text/tests/src/Kernel/TextItemBaseTest.php4
-rw-r--r--core/modules/text/tests/src/Kernel/TextSummaryTest.php12
-rw-r--r--core/modules/text/tests/src/Kernel/TextWithSummaryItemTest.php2
-rw-r--r--core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php8
-rw-r--r--core/modules/text/tests/src/Unit/Plugin/migrate/field/d7/TextFieldTest.php2
-rw-r--r--core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php18
-rw-r--r--core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php4
-rw-r--r--core/modules/toolbar/tests/src/Functional/ToolbarHookToolbarTest.php2
-rw-r--r--core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php2
-rw-r--r--core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarActiveTrailTest.php2
-rw-r--r--core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarIntegrationTest.php4
-rw-r--r--core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarStoredStateTest.php2
-rw-r--r--core/modules/toolbar/tests/src/Unit/PageCache/AllowToolbarPathTest.php2
-rw-r--r--core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php2
-rw-r--r--core/modules/update/tests/src/Functional/UpdateContribTest.php28
-rw-r--r--core/modules/update/tests/src/Functional/UpdateManagerUpdateTest.php4
-rw-r--r--core/modules/update/tests/src/Functional/UpdateSemverCoreSecurityCoverageTest.php2
-rw-r--r--core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php10
-rw-r--r--core/modules/update/tests/src/Functional/UpdateSemverTestBaselineTrait.php10
-rw-r--r--core/modules/update/tests/src/Functional/UpdateSemverTestSecurityAvailabilityTrait.php2
-rw-r--r--core/modules/update/tests/src/Functional/UpdateSettingsFormTest.php2
-rw-r--r--core/modules/update/tests/src/Functional/UpdateUploadTest.php8
-rw-r--r--core/modules/update/tests/src/Kernel/Migrate/d6/MigrateUpdateConfigsTest.php2
-rw-r--r--core/modules/update/tests/src/Kernel/UpdateDeleteFileIfStaleTest.php2
-rw-r--r--core/modules/update/tests/src/Kernel/UpdateReportTest.php6
-rw-r--r--core/modules/update/tests/src/Kernel/UpdateStorageTest.php2
-rw-r--r--core/modules/update/tests/src/Unit/Menu/UpdateLocalTasksTest.php6
-rw-r--r--core/modules/update/tests/src/Unit/ProjectCoreCompatibilityTest.php2
-rw-r--r--core/modules/update/tests/src/Unit/UpdateFetcherTest.php6
-rw-r--r--core/modules/update/tests/src/Unit/UpdateMailTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/AccessRoleUITest.php2
-rw-r--r--core/modules/user/tests/src/Functional/Rest/UserResourceTestBase.php4
-rw-r--r--core/modules/user/tests/src/Functional/Rest/UserXmlAnonTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/Rest/UserXmlBasicAuthTest.php4
-rw-r--r--core/modules/user/tests/src/Functional/Rest/UserXmlCookieTest.php4
-rw-r--r--core/modules/user/tests/src/Functional/UserAccountLinksTest.php8
-rw-r--r--core/modules/user/tests/src/Functional/UserAdminLanguageTest.php8
-rw-r--r--core/modules/user/tests/src/Functional/UserAdminListingTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/UserAdminTest.php4
-rw-r--r--core/modules/user/tests/src/Functional/UserBlocksTest.php4
-rw-r--r--core/modules/user/tests/src/Functional/UserCancelTest.php30
-rw-r--r--core/modules/user/tests/src/Functional/UserCreateFailMailTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/UserCreateTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/UserEditTest.php14
-rw-r--r--core/modules/user/tests/src/Functional/UserEditedOwnAccountTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/UserLanguageCreationTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/UserLanguageTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/UserLoginHttpTest.php4
-rw-r--r--core/modules/user/tests/src/Functional/UserLoginTest.php14
-rw-r--r--core/modules/user/tests/src/Functional/UserPasswordResetTest.php20
-rw-r--r--core/modules/user/tests/src/Functional/UserPermissionsAdminTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/UserPermissionsTest.php12
-rw-r--r--core/modules/user/tests/src/Functional/UserPictureTest.php6
-rw-r--r--core/modules/user/tests/src/Functional/UserRegistrationRestTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/UserRegistrationTest.php14
-rw-r--r--core/modules/user/tests/src/Functional/UserRoleAdminTest.php4
-rw-r--r--core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php4
-rw-r--r--core/modules/user/tests/src/Functional/UserSearchTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/UserSubAdminTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/UserTimeZoneTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/UserTokenReplaceTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/UserTranslationUITest.php2
-rw-r--r--core/modules/user/tests/src/Functional/Views/AccessRoleTest.php4
-rw-r--r--core/modules/user/tests/src/Functional/Views/BulkFormAccessTest.php4
-rw-r--r--core/modules/user/tests/src/Functional/Views/BulkFormTest.php4
-rw-r--r--core/modules/user/tests/src/Functional/Views/FilterPermissionUiTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/Views/HandlerFieldRoleTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/Views/HandlerFieldUserNameTest.php4
-rw-r--r--core/modules/user/tests/src/Functional/Views/HandlerFilterUserNameTest.php6
-rw-r--r--core/modules/user/tests/src/Functional/Views/RolesRidArgumentTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/Views/UserChangedTest.php2
-rw-r--r--core/modules/user/tests/src/Functional/Views/UserFieldsAccessChangeTest.php4
-rw-r--r--core/modules/user/tests/src/FunctionalJavascript/PasswordConfirmWidgetTest.php6
-rw-r--r--core/modules/user/tests/src/FunctionalJavascript/PermissionFilterTest.php2
-rw-r--r--core/modules/user/tests/src/FunctionalJavascript/RegistrationWithUserFieldsTest.php2
-rw-r--r--core/modules/user/tests/src/FunctionalJavascript/UserPasswordResetTest.php2
-rw-r--r--core/modules/user/tests/src/FunctionalJavascript/UserPermissionsTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/ContextProvider/CurrentUserContextTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Controller/UserControllerTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Field/UserNameFormatterTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/MigrateUserAdminPassTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/MigrateUserStubTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d6/MigrateProfileFieldOptionTranslationTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserContactSettingsTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureD6FileTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileEntityDisplayTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileEntityFormDisplayTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldInstanceTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileValuesTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserRoleTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d6/ProfileFieldCheckRequirementsTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserFloodTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserMailTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureEntityDisplayTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureEntityFormDisplayTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureFieldInstanceTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureFieldTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserRoleTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserSettingsTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d7/ProfileFieldCheckRequirementsTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Migrate/d7/UserMigrationClassTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php6
-rw-r--r--core/modules/user/tests/src/Kernel/UserAccountFormPasswordResetTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/UserActionConfigSchemaTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/UserAnonymousActivateTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/UserDeleteTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/UserEntityLabelTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/UserEntityTest.php6
-rw-r--r--core/modules/user/tests/src/Kernel/UserFieldsTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/UserInstallTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/UserMailDefaultsTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/UserMailNotifyTest.php6
-rw-r--r--core/modules/user/tests/src/Kernel/UserRoleDeleteTest.php4
-rw-r--r--core/modules/user/tests/src/Kernel/UserRoleEntityTest.php6
-rw-r--r--core/modules/user/tests/src/Kernel/UserSaveStatusTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/UserSaveTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/UserValidationTest.php4
-rw-r--r--core/modules/user/tests/src/Kernel/Views/AccessPermissionTest.php4
-rw-r--r--core/modules/user/tests/src/Kernel/Views/ArgumentDefaultTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Views/ArgumentValidateTest.php4
-rw-r--r--core/modules/user/tests/src/Kernel/Views/HandlerArgumentUserUidTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Views/HandlerFieldPermissionTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Views/HandlerFilterCurrentUserTest.php4
-rw-r--r--core/modules/user/tests/src/Kernel/Views/HandlerFilterPermissionTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Views/HandlerFilterRolesTest.php4
-rw-r--r--core/modules/user/tests/src/Kernel/Views/RelationshipRepresentativeNodeTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Views/UserDataTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Views/UserRoleTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Views/UserViewsDataTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/Views/UserViewsFieldAccessTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/WhoIsOnlineBlockTest.php2
-rw-r--r--core/modules/user/tests/src/Unit/Form/EntityPermissionsFormTest.php2
-rw-r--r--core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php6
-rw-r--r--core/modules/user/tests/src/Unit/PermissionAccessCheckTest.php2
-rw-r--r--core/modules/user/tests/src/Unit/PermissionHandlerTest.php8
-rw-r--r--core/modules/user/tests/src/Unit/Plugin/Action/AddRoleUserTest.php4
-rw-r--r--core/modules/user/tests/src/Unit/Plugin/Action/RemoveRoleUserTest.php4
-rw-r--r--core/modules/user/tests/src/Unit/Plugin/Core/Entity/UserTest.php2
-rw-r--r--core/modules/user/tests/src/Unit/Plugin/Derivative/UserLocalTaskTest.php2
-rw-r--r--core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidatorTest.php2
-rw-r--r--core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/UserMailRequiredValidatorTest.php2
-rw-r--r--core/modules/user/tests/src/Unit/Plugin/migrate/process/ConvertTokensTest.php4
-rw-r--r--core/modules/user/tests/src/Unit/Plugin/views/field/UserBulkFormTest.php2
-rw-r--r--core/modules/user/tests/src/Unit/Theme/AdminNegotiatorTest.php2
-rw-r--r--core/modules/user/tests/src/Unit/ToolbarLinkBuilderTest.php2
-rw-r--r--core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php12
-rw-r--r--core/modules/user/tests/src/Unit/UserAuthTest.php12
-rw-r--r--core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php8
-rw-r--r--core/modules/user/tests/src/Unit/Views/Argument/RolesRidTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/BulkFormTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/DefaultViewsTest.php4
-rw-r--r--core/modules/views/tests/src/Functional/Entity/BaseFieldAccessTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Entity/EntityQueryAccessTest.php4
-rw-r--r--core/modules/views/tests/src/Functional/Entity/FieldEntityTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Entity/FieldEntityTranslationTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Entity/FieldRenderedEntityTranslationTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Entity/ViewNonTranslatableEntityTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/GlossaryTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Handler/AreaHTTPStatusCodeTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Handler/AreaTest.php6
-rw-r--r--core/modules/views/tests/src/Functional/Handler/AreaTitleWebTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Handler/FieldDropButtonTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Handler/FieldEntityLinkBaseTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Handler/FieldEntityOperationsTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Handler/FieldGroupRowsWebTest.php4
-rw-r--r--core/modules/views/tests/src/Functional/Handler/FieldWebTest.php10
-rw-r--r--core/modules/views/tests/src/Functional/Handler/FilterDateTest.php4
-rw-r--r--core/modules/views/tests/src/Functional/Handler/FilterPlaceholderTextTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Handler/HandlerTest.php12
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/AccessTest.php4
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php12
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/CacheTagTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/CacheWebTest.php4
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/ContextualFiltersBlockContextTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/ContextualFiltersStringTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/DisabledDisplayTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/DisplayAttachmentTest.php4
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/DisplayEntityReferenceTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/DisplayFeedTest.php8
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/DisplayFeedTranslationTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php8
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/DisplayTest.php18
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php4
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php20
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/FilterTest.php6
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/MenuLinkTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/MiniPagerTest.php4
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/MonthDatePluginTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/NumericFormatPluralTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/PagerTest.php20
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/QueryOptionsTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/StyleSummaryTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php14
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/ViewsBulkTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/ViewsFormTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/RenderCacheWebTest.php4
-rw-r--r--core/modules/views/tests/src/Functional/SearchIntegrationTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/SearchMultilingualTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/TaxonomyGlossaryTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/UserBatchActionTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/UserPathTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/ViewAjaxTest.php4
-rw-r--r--core/modules/views/tests/src/Functional/ViewElementTest.php4
-rw-r--r--core/modules/views/tests/src/Functional/ViewTranslationTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/ViewsEscapingTest.php4
-rw-r--r--core/modules/views/tests/src/Functional/ViewsFormAlterTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/ViewsFormMultipleTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/ViewsNoResultsBehaviorTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/ViewsThemeIntegrationTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Wizard/BasicTest.php4
-rw-r--r--core/modules/views/tests/src/Functional/Wizard/EntityTestRevisionTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Wizard/MenuTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Wizard/NodeWizardTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Wizard/PagerTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Wizard/SortingTest.php2
-rw-r--r--core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php6
-rw-r--r--core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php2
-rw-r--r--core/modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php2
-rw-r--r--core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php6
-rw-r--r--core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php4
-rw-r--r--core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php4
-rw-r--r--core/modules/views/tests/src/FunctionalJavascript/Plugin/BulkOperationsTest.php2
-rw-r--r--core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/ContextualFilterTest.php2
-rw-r--r--core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php2
-rw-r--r--core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php2
-rw-r--r--core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/GroupedExposedFilterTest.php2
-rw-r--r--core/modules/views/tests/src/FunctionalJavascript/RedirectAjaxTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/BasicTest.php6
-rw-r--r--core/modules/views/tests/src/Kernel/CacheableMetadataCalculationTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php16
-rw-r--r--core/modules/views/tests/src/Kernel/Entity/EntityViewsWithMultivalueBasefieldTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Entity/FilterEntityBundleTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Entity/LatestRevisionFilterTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Entity/LatestTranslationAffectedRevisionTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Entity/RowEntityRenderersTest.php10
-rw-r--r--core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php24
-rw-r--r--core/modules/views/tests/src/Kernel/FieldApiDataTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/AreaEmptyTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/AreaEntityTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/AreaMessagesTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/AreaOrderTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/AreaResultTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/AreaTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/AreaTextTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/AreaTitleTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/AreaViewTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php12
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/ArgumentNullTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/ArgumentStringTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/ComputedBundleFieldTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/ComputedFieldTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/EntityTestViewsFieldAccessTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FieldBooleanTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FieldCounterTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FieldCustomTest.php6
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FieldDropbuttonTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FieldEntityLinkTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php30
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FieldFileSizeTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FieldGroupRowsTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FieldKernelTest.php24
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FieldNumericTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FieldRenderedEntityTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FieldSelfTokensTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FieldUrlTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorDefaultTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorStringTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php26
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FilterEqualityTest.php8
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php10
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php26
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php52
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/HandlerAliasTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/SortDateTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/SortRandomTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/SortTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Handler/SortTranslationTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/ModuleTest.php14
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/ArgumentValidatorTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/BlockDependenciesTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/CacheTest.php18
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/CastedIntFieldJoinTestBase.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/Display/ViewsMenuLinkTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/DisplayExtenderTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/DisplayKernelTest.php6
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php12
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/ExposedFormRenderTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/JoinTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/PagerKernelTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/PluginBaseTest.php6
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/QueryTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/RelationshipJoinInTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/RelationshipTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/RowEntityTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/RssFieldsTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/SqlEntityLoadingTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/SqlQueryTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/StyleFieldsTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/StyleHtmlListTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/StyleMappingTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/StyleTableUnitTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/StyleTest.php6
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/StyleUnformattedTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/ViewsBlockTest.php8
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/ViewsSqlExceptionTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/PluginInstanceTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/QueryGroupByTest.php24
-rw-r--r--core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php16
-rw-r--r--core/modules/views/tests/src/Kernel/TestViewsTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/TokenReplaceTest.php8
-rw-r--r--core/modules/views/tests/src/Kernel/ViewElementTest.php6
-rw-r--r--core/modules/views/tests/src/Kernel/ViewExecutableTest.php28
-rw-r--r--core/modules/views/tests/src/Kernel/ViewRenderTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/ViewStorageTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/ViewsConfigDependenciesIntegrationTest.php6
-rw-r--r--core/modules/views/tests/src/Kernel/ViewsDataTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/ViewsHooksTest.php6
-rw-r--r--core/modules/views/tests/src/Kernel/ViewsPreprocessTest.php8
-rw-r--r--core/modules/views/tests/src/Kernel/ViewsTemplateTest.php4
-rw-r--r--core/modules/views/tests/src/Kernel/Wizard/WizardPluginBaseKernelTest.php2
-rw-r--r--core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php20
-rw-r--r--core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php4
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php6
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php12
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/HandlerBaseTest.php4
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php12
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/area/MessagesTest.php2
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php4
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php2
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/argument_default/QueryParameterTest.php2
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/argument_default/RawTest.php2
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php10
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/display/PageTest.php4
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php28
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php8
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php22
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php26
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/filter/FilterPluginBaseTest.php2
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/filter/InOperatorTest.php2
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php30
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/pager/SqlBaseTest.php2
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php18
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/views/display/BlockTest.php4
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php10
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/views/query/MysqlDateSqlTest.php8
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php8
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/views/query/SqliteDateSqlTest.php8
-rw-r--r--core/modules/views/tests/src/Unit/PluginBaseTest.php6
-rw-r--r--core/modules/views/tests/src/Unit/PluginTypeListTest.php2
-rw-r--r--core/modules/views/tests/src/Unit/Routing/ViewPageControllerTest.php8
-rw-r--r--core/modules/views/tests/src/Unit/ViewExecutableFactoryTest.php2
-rw-r--r--core/modules/views/tests/src/Unit/ViewExecutableTest.php38
-rw-r--r--core/modules/views/tests/src/Unit/ViewsDataHelperTest.php2
-rw-r--r--core/modules/views/tests/src/Unit/ViewsDataTest.php30
-rw-r--r--core/modules/views/tests/src/Unit/ViewsHandlerManagerTest.php8
-rw-r--r--core/modules/views/tests/src/Unit/ViewsTest.php6
-rw-r--r--core/modules/views/tests/src/Unit/WizardPluginBaseTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/AnalyzeTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/AreaEntityUITest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/ArgumentValidatorTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/CachedDataUITest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/CustomBooleanTest.php4
-rw-r--r--core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php6
-rw-r--r--core/modules/views_ui/tests/src/Functional/DisplayAttachmentTest.php4
-rw-r--r--core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php8
-rw-r--r--core/modules/views_ui/tests/src/Functional/DisplayExtenderUITest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/DisplayFeedTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/DisplayPathTest.php8
-rw-r--r--core/modules/views_ui/tests/src/Functional/DisplayTest.php20
-rw-r--r--core/modules/views_ui/tests/src/Functional/DuplicateTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php8
-rw-r--r--core/modules/views_ui/tests/src/Functional/FieldUITest.php4
-rw-r--r--core/modules/views_ui/tests/src/Functional/FilterBooleanWebTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/FilterNumericWebTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/FilterUITest.php6
-rw-r--r--core/modules/views_ui/tests/src/Functional/GroupByTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/HandlerTest.php10
-rw-r--r--core/modules/views_ui/tests/src/Functional/NewViewConfigSchemaTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/OverrideDisplaysTest.php6
-rw-r--r--core/modules/views_ui/tests/src/Functional/PreviewTest.php10
-rw-r--r--core/modules/views_ui/tests/src/Functional/QueryTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/RedirectTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/ReportFieldsTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/ReportTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/RowUITest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/SettingsTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/StorageTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/StyleTableTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/StyleUITest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/TokenizeAreaUITest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/TranslatedViewTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/UnsavedPreviewTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/ViewEditTest.php8
-rw-r--r--core/modules/views_ui/tests/src/Functional/ViewsListTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/WizardTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Functional/XssTest.php4
-rw-r--r--core/modules/views_ui/tests/src/FunctionalJavascript/AdminAjaxTest.php4
-rw-r--r--core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php8
-rw-r--r--core/modules/views_ui/tests/src/FunctionalJavascript/FieldDialogsTest.php2
-rw-r--r--core/modules/views_ui/tests/src/FunctionalJavascript/FilterCriteriaTest.php4
-rw-r--r--core/modules/views_ui/tests/src/FunctionalJavascript/FilterOptionsTest.php2
-rw-r--r--core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php6
-rw-r--r--core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php2
-rw-r--r--core/modules/views_ui/tests/src/FunctionalJavascript/ViewsWizardTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Kernel/TagTest.php4
-rw-r--r--core/modules/views_ui/tests/src/Unit/Form/Ajax/RearrangeFilterTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php2
-rw-r--r--core/modules/views_ui/tests/src/Unit/ViewUIObjectTest.php6
-rw-r--r--core/modules/workflows/tests/src/Functional/WorkflowCustomStateTransitionAccessTest.php2
-rw-r--r--core/modules/workflows/tests/src/Functional/WorkflowUiNoTypeTest.php2
-rw-r--r--core/modules/workflows/tests/src/Functional/WorkflowUiTest.php12
-rw-r--r--core/modules/workflows/tests/src/Kernel/ComplexWorkflowTypeTest.php2
-rw-r--r--core/modules/workflows/tests/src/Kernel/PredefinedWorkflowTypeTest.php2
-rw-r--r--core/modules/workflows/tests/src/Kernel/RequiredStatesTest.php8
-rw-r--r--core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php4
-rw-r--r--core/modules/workflows/tests/src/Kernel/WorkflowDependenciesTest.php2
-rw-r--r--core/modules/workflows/tests/src/Unit/StateTest.php12
-rw-r--r--core/modules/workflows/tests/src/Unit/TransitionTest.php4
-rw-r--r--core/modules/workflows/tests/src/Unit/WorkflowStateTransitionOperationsAccessCheckTest.php6
-rw-r--r--core/modules/workflows/tests/src/Unit/WorkflowTest.php82
-rw-r--r--core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php6
-rw-r--r--core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlAnonTest.php2
-rw-r--r--core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlBasicAuthTest.php2
-rw-r--r--core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlCookieTest.php2
-rw-r--r--core/modules/workspaces/tests/src/Functional/UpdateSystem/ActiveWorkspaceUpdateTest.php2
-rw-r--r--core/modules/workspaces/tests/src/Functional/WorkspaceBypassTest.php2
-rw-r--r--core/modules/workspaces/tests/src/Functional/WorkspaceCacheContextTest.php2
-rw-r--r--core/modules/workspaces/tests/src/Functional/WorkspaceConcurrentEditingTest.php2
-rw-r--r--core/modules/workspaces/tests/src/Functional/WorkspaceMenuLinkContentIntegrationTest.php2
-rw-r--r--core/modules/workspaces/tests/src/Functional/WorkspacePermissionsTest.php10
-rw-r--r--core/modules/workspaces/tests/src/Functional/WorkspaceSwitcherTest.php6
-rw-r--r--core/modules/workspaces/tests/src/Functional/WorkspaceTest.php18
-rw-r--r--core/modules/workspaces/tests/src/Functional/WorkspaceViewTest.php4
-rw-r--r--core/modules/workspaces/tests/src/Functional/WorkspaceViewsBulkFormTest.php2
-rw-r--r--core/modules/workspaces/tests/src/Functional/WorkspacesUninstallTest.php2
-rw-r--r--core/modules/workspaces/tests/src/FunctionalJavascript/WorkspaceToolbarIntegrationTest.php4
-rw-r--r--core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php4
-rw-r--r--core/modules/workspaces/tests/src/Kernel/WorkspaceAccessTest.php6
-rw-r--r--core/modules/workspaces/tests/src/Kernel/WorkspaceAssociationTest.php2
-rw-r--r--core/modules/workspaces/tests/src/Kernel/WorkspaceCRUDTest.php8
-rw-r--r--core/modules/workspaces/tests/src/Kernel/WorkspaceInformationTest.php8
-rw-r--r--core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php28
-rw-r--r--core/modules/workspaces/tests/src/Kernel/WorkspaceMergerTest.php2
-rw-r--r--core/modules/workspaces/tests/src/Kernel/WorkspacePublishFormTest.php2
-rw-r--r--core/modules/workspaces/tests/src/Unit/ActiveWorkspaceCheckTest.php2
-rw-r--r--core/modules/workspaces/tests/src/Unit/WorkspaceRequestSubscriberTest.php4
-rw-r--r--core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php6
-rw-r--r--core/profiles/demo_umami/tests/src/Functional/UmamiMultilingualInstallTest.php2
-rw-r--r--core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php4
-rw-r--r--core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php6
-rw-r--r--core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php8
-rw-r--r--core/profiles/minimal/tests/src/Functional/MinimalTest.php2
-rw-r--r--core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php2
-rw-r--r--core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php2
-rw-r--r--core/profiles/standard/tests/src/Traits/StandardTestTrait.php2
-rw-r--r--core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php6
-rw-r--r--core/tests/Drupal/BuildTests/Composer/ComposerValidateTest.php2
-rw-r--r--core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php6
-rw-r--r--core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php12
-rw-r--r--core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php2
-rw-r--r--core/tests/Drupal/BuildTests/TestSiteApplication/InstallTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxCallbacksTest.php4
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormCacheTest.php6
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php4
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php4
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxInGroupTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTest.php12
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Ajax/DialogTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Ajax/ElementValidationTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Ajax/FocusFirstCommandTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Ajax/FormValuesTest.php4
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Ajax/ThrobberTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/BrowserWithJavascriptTest.php8
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Components/ComponentRenderTest.php4
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Core/CsrfTokenRaceTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Core/Form/FormGroupingElementsTest.php6
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Core/Form/JavascriptStatesTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Core/JsMessageTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Core/MachineNameTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Dialog/DialogPositionTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php4
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/JavascriptDeprecationTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/JavascriptGetDrupalSettingsTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/MachineName/MachineNameTransliterationTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php12
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Tests/DrupalSelenium2DriverTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Tests/JSInteractionTest.php6
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Tests/JSWebAssertTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php6
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroMenuUiJavascriptTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroModalDisplayTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroPasswordConfirmWidgetTest.php4
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroTableDragTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroViewsBulkOperationsTest.php2
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroViewsUiTest.php4
-rw-r--r--core/tests/Drupal/FunctionalJavascriptTests/Theme/OliveroMessagesTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php16
-rw-r--r--core/tests/Drupal/FunctionalTests/Breadcrumb/Breadcrumb404Test.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php38
-rw-r--r--core/tests/Drupal/FunctionalTests/BrowserTestBaseUserAgentTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Core/Container/ServiceDeprecationTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Core/Test/ModuleInstallBatchTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Core/Test/PhpUnitBridgeTest.php4
-rw-r--r--core/tests/Drupal/FunctionalTests/Datetime/TimestampAgoFormatterTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Datetime/TimestampTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormCorrectUserInputMappingOnFieldDeltaElementsTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Entity/DeleteMultipleFormTest.php4
-rw-r--r--core/tests/Drupal/FunctionalTests/Entity/EntityBundleListCacheTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/ExistingDrupal8StyleDatabaseConnectionInSettingsPhpTest.php4
-rw-r--r--core/tests/Drupal/FunctionalTests/FolderTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/GetTestMethodCallerExtendsTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/GetTestMethodCallerTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/HttpKernel/CorsIntegrationTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Image/ToolkitSetupFormTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/DrupalFlushAllCachesInInstallerTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallProfileDependenciesTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerBrokenDatabaseCredentialsTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerBrokenDatabasePortSettingsTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerConfigDirectorySetNoDirectoryErrorTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerConfigDirectorySetNoDirectoryTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerDatabaseErrorMessagesTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerEmptySettingsTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerExistingBrokenDatabaseSettingsTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigDirectoryTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigMultilingualTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoConfigTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoSystemSiteTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigProfileHookInstall.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryMultilingualTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryProfileHookInstall.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryProfileMismatchTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerExistingDatabaseSettingsTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerExistingInstallationTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerExistingSettingsNoProfileTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerExistingSettingsTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerLanguageDirectionTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerLanguagePageTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerNonDefaultDatabaseDriverTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerNonEnglishProfileWithoutLocaleModuleTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerPerformanceTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerPostInstallTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerProfileRequirementsTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerRouterTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerSiteConfigProfileTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerSkipPermissionHardeningTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php4
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerThemesBlocksProfileTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationExistingFileTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageNonInteractiveTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/MinimalInstallerTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/SingleVisibleProfileTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/SiteNameTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/SiteSettingsFormTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php4
-rw-r--r--core/tests/Drupal/FunctionalTests/Installer/TestingProfileInstallTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Libraries/JqueryUiLibraryAssetsTest.php8
-rw-r--r--core/tests/Drupal/FunctionalTests/Libraries/ManyAssetsLoadOrderTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/MailCaptureTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Menu/MenuActiveTrail403Test.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Routing/CaseInsensitivePathTest.php4
-rw-r--r--core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php4
-rw-r--r--core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Routing/PathEncodedTest.php4
-rw-r--r--core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Routing/RouteCachingNonPathLanguageNegotiationTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Routing/RouteCachingQueryAlteredTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Theme/ClaroLayoutBuilderTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/Theme/ClaroTest.php6
-rw-r--r--core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php8
-rw-r--r--core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php12
-rw-r--r--core/tests/Drupal/FunctionalTests/UserHelpersTest.php2
-rw-r--r--core/tests/Drupal/FunctionalTests/WebAssertTest.php26
-rw-r--r--core/tests/Drupal/KernelTests/Component/Render/FormattableMarkupKernelTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Config/TypedConfigTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/ConfigFormTestBase.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Action/EmailActionTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Action/PublishActionTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Action/SaveActionTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Ajax/CommandsTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Archiver/TarTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Archiver/ZipTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php38
-rw-r--r--core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php18
-rw-r--r--core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Batch/BatchKernelTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Batch/BatchNegotiatorTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Block/MultipleBlockFormTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Bootstrap/ExtensionPathResolverTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Bootstrap/ResettableStaticTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Bootstrap/ShutdownFunctionTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Cache/ApcuBackendTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Cache/CacheCollectorTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Cache/CacheContextOptimizationTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php22
-rw-r--r--core/tests/Drupal/KernelTests/Core/Common/DrupalFlushAllCachesTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Common/XssUnitTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/CacheabilityMetadataConfigOverrideTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php14
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigDiffTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigEntityNormalizeTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStaticCacheTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStorageTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigEntityUnitTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigEventsTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigExportStorageTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigImporterMissingContentTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php42
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigInstallTest.php14
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigLanguageOverrideTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigModuleOverridesTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigOverrideTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigOverridesPriorityTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaDeprecationTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php22
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigSnapshotTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/Entity/ConfigEntityUpdaterTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ExcludedModulesEventSubscriberTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ExportStorageManagerTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/FileStorageFactoryTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ImportStorageTransformerTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/SchemaCheckTraitTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/Storage/CachedStorageTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/Storage/ConfigStorageTestBase.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/Storage/FileStorageTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/Storage/ManagedStorageTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/Storage/MemoryStorageTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/Storage/StorageReplaceDataWrapperTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Controller/ControllerBaseTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/AlterTest.php14
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/BasicSyntaxTest.php14
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/CaseSensitivityTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php20
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/DatabaseExceptionWrapperTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/DeleteTruncateTest.php12
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/DriverSpecificConnectionUnitTestBase.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSyntaxTestBase.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/FetchTest.php18
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/InsertDefaultsTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/InsertLobTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/InsertTest.php18
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/InvalidDataTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/LoggingTest.php12
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/MergeTest.php18
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/QueryTest.php12
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/RangeQueryTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/ReplicaKillSwitchTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/ReservedWordTest.php14
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/SelectCloneTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php36
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/SelectLeastTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/SelectOrderedTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php18
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/SelectTest.php48
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/SerializeQueryTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/StatementTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php14
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/TemporaryQueryTestBase.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/UpdateComplexTest.php16
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/UpdateLobTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/UpdateTest.php18
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/UpsertTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Datetime/DateFormatterTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Datetime/DatelistElementFormTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Datetime/DatetimeElementFormTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/Datetime/TimestampSchemaTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/DependencyInjection/ServicesDefaultsTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php10
-rw-r--r--core/tests/Drupal/KernelTests/Core/DrupalKernel/ServiceDestructionTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Element/PathElementFormTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/BundleClassTest.php12
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/BundlePermissionHandlerTraitTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityAdapterTest.php16
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php16
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/ContentEntityChangedTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php16
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/ContentEntityFieldMethodInvocationOrderTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/ContentEntityHasChangesTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNonRevisionableFieldTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNullStorageTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/ContentEntityStorageBaseTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/CreateSampleEntityTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/Element/EntityAutocompleteElementFormTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityAccessControlHandlerTest.php18
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php10
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityAutocompleteTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityBaseTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityBundleConditionTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityBundleFieldTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityBundleListenerTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php16
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityDecoupledTranslationRevisionsTest.php12
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php64
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityDeriverTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayRepositoryTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityDuplicateTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityFieldDefaultValueTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php28
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityHasFieldConstraintValidatorTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBaseTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityKeysTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityLoadByUuidTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityNonRevisionableTranslatableFieldTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityQueryAggregateTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php32
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php14
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php12
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionsTest.php14
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php12
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php22
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintValidatorTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintsTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityTypeTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityTypedDataDefinitionTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php14
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityViewHookTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php16
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/FieldTranslationSqlStorageTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/FieldWidgetConstraintValidatorTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/RevisionableContentEntityBaseTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/RouteProviderTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/EventSubscriber/ExceptionLoggingSubscriberTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Extension/ModuleExtensionListTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerDeprecatedHookTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerDeprecatedHookUnimplementedTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Extension/ModuleImplementsAlterTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php20
-rw-r--r--core/tests/Drupal/KernelTests/Core/Extension/ThemeEngineExtensionListTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Extension/ThemeExtensionListTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Extension/UpdateDescriptionTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Extension/UpdateSchemaTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Field/Entity/BaseFieldOverrideTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Field/FieldMissingTypeTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Field/FieldSettingsTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/Field/FieldType/PasswordItemTest.php18
-rw-r--r--core/tests/Drupal/KernelTests/Core/Field/MapBaseFieldTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php14
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/FileCopyTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/FileDeleteRecursiveTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/FileDeleteTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/FileSaveDataTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/FileSystemRequirementsTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/FileSystemTempDirectoryTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/FileSystemTest.php12
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/FileUrlGeneratorTest.php16
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/HtaccessTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/MimeTypeTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php14
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php10
-rw-r--r--core/tests/Drupal/KernelTests/Core/File/UrlTransformRelativeTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Form/ExternalFormUrlTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Form/FormActionXssTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Form/FormDefaultHandlersTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Form/FormValidationMessageOrderTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Form/TriggeringElementProgrammedTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Http/LinkRelationsTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/HttpKernel/StackKernelIntegrationTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Image/ToolkitTest.php12
-rw-r--r--core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php10
-rw-r--r--core/tests/Drupal/KernelTests/Core/Layout/IconBuilderTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Lock/LockTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Menu/LocalActionManagerTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Menu/MenuLinkDefaultIntegrationTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php16
-rw-r--r--core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/Pager/PagerManagerTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Pager/RequestPagerTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/ParamConverter/EntityConverterLatestRevisionTest.php12
-rw-r--r--core/tests/Drupal/KernelTests/Core/Path/PathValidatorTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Path/UrlAlterTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/Annotation/ContextDefinitionTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/Condition/ConditionTestDualUserTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/Condition/CurrentThemeConditionTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/Condition/OptionalContextConditionTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/Condition/RequestPathTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/Condition/ResponseStatusTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/ContextDefinitionTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/ContextHandlerTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/ContextTypedDataTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/DefaultPluginManagerTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/DerivativeTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/EntityContextTypedDataTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/FactoryTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Plugin/InspectionTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Queue/QueueTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Render/Element/ActionsTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Render/Element/DeprecatedElementTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Render/Element/MachineNameTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Render/Element/PluginAlterTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/Render/Element/TableSortExtenderTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php26
-rw-r--r--core/tests/Drupal/KernelTests/Core/Render/Element/WeightTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Render/ElementInfoIntegrationTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Render/RenderTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteNoneTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteProcessorCurrentIntegrationTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Routing/ContentNegotiationRoutingTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php18
-rw-r--r--core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php10
-rw-r--r--core/tests/Drupal/KernelTests/Core/Routing/PathChangedHelperTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php34
-rw-r--r--core/tests/Drupal/KernelTests/Core/Routing/UrlIntegrationTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/ServiceProvider/ServiceProviderTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Session/SessionManagerDestroyNoCliCheckTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Site/SettingsRewriteTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/StreamWrapper/StreamWrapperManagerTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/StringTranslation/TranslationStringTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/TempStore/AnonymousPrivateTempStoreTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/TempStore/TempStoreDatabaseTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Test/AssertMailTraitTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Test/EnvironmentCleanerTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Test/PhpUnitBridgeTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/BaseThemeMissingTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/BaseThemeRequiredTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/ClaroVerticalTabsTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/ConfigImportThemeInstallTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/FrontMatterTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/ImageTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/MaintenanceThemeTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/MessageTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php14
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/Stable9LibraryOverrideTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/Stable9TemplateOverrideTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php34
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/ThemeSettingsTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php12
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/TwigMarkupInterfaceTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/TypedData/ComplexDataConstraintValidatorTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/TypedData/RecursiveContextualValidatorTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/Core/TypedData/TypedDataDefinitionTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php10
-rw-r--r--core/tests/Drupal/KernelTests/Core/Updater/UpdaterTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Url/LinkGenerationTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Validation/ConstraintFactoryTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Validation/ConstraintsTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Validation/UniqueFieldConstraintTest.php6
-rw-r--r--core/tests/Drupal/KernelTests/Core/Validation/UniqueValuesConstraintValidatorTest.php8
-rw-r--r--core/tests/Drupal/KernelTests/KernelTestBaseShutdownTest.php4
-rw-r--r--core/tests/Drupal/KernelTests/KernelTestBaseTest.php32
-rw-r--r--core/tests/Drupal/KernelTests/RequestProcessing/RedirectOnExceptionTest.php2
-rw-r--r--core/tests/Drupal/Tests/CSpell/SortTest.php4
-rw-r--r--core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryCachedTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryTest.php4
-rw-r--r--core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.php6
-rw-r--r--core/tests/Drupal/Tests/Component/Annotation/DocParserIgnoredClassesTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Annotation/MockFileFinderTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Annotation/Plugin/Discovery/AnnotationBridgeDecoratorTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Annotation/PluginIdTest.php4
-rw-r--r--core/tests/Drupal/Tests/Component/Annotation/PluginTest.php12
-rw-r--r--core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php28
-rw-r--r--core/tests/Drupal/Tests/Component/ClassFinder/ClassFinderTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php38
-rw-r--r--core/tests/Drupal/Tests/Component/Datetime/TimeTest.php12
-rw-r--r--core/tests/Drupal/Tests/Component/Datetime/TimeWithNoRequestTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php98
-rw-r--r--core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php20
-rw-r--r--core/tests/Drupal/Tests/Component/Diff/DiffFormatterTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Diff/Engine/HWLDFWordAccumulatorTest.php4
-rw-r--r--core/tests/Drupal/Tests/Component/Discovery/YamlDirectoryDiscoveryTest.php8
-rw-r--r--core/tests/Drupal/Tests/Component/Discovery/YamlDiscoveryTest.php4
-rw-r--r--core/tests/Drupal/Tests/Component/DrupalComponentTest.php6
-rw-r--r--core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php12
-rw-r--r--core/tests/Drupal/Tests/Component/FileCache/FileCacheTest.php8
-rw-r--r--core/tests/Drupal/Tests/Component/FileSecurity/FileSecurityTest.php8
-rw-r--r--core/tests/Drupal/Tests/Component/FileSystem/RegexDirectoryIteratorTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/FrontMatter/FrontMatterTest.php6
-rw-r--r--core/tests/Drupal/Tests/Component/Gettext/PoHeaderTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Gettext/PoStreamWriterTest.php6
-rw-r--r--core/tests/Drupal/Tests/Component/Graph/GraphTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/HttpFoundation/SecuredRedirectResponseTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/PhpStorage/FileStorageReadOnlyTest.php4
-rw-r--r--core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php6
-rw-r--r--core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageBase.php4
-rw-r--r--core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeBaseTest.php6
-rw-r--r--core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeClassDiscoveryCachedTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeClassDiscoveryTest.php4
-rw-r--r--core/tests/Drupal/Tests/Component/Plugin/Attribute/PluginIdTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Plugin/Attribute/PluginTest.php8
-rw-r--r--core/tests/Drupal/Tests/Component/Plugin/Context/ContextTest.php4
-rw-r--r--core/tests/Drupal/Tests/Component/Plugin/DefaultFactoryTest.php20
-rw-r--r--core/tests/Drupal/Tests/Component/Plugin/Discovery/AnnotatedClassDiscoveryTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Plugin/Discovery/AttributeBridgeDecoratorTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php10
-rw-r--r--core/tests/Drupal/Tests/Component/Plugin/Discovery/StaticDiscoveryDecoratorTest.php6
-rw-r--r--core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php4
-rw-r--r--core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php8
-rw-r--r--core/tests/Drupal/Tests/Component/Plugin/PluginManagerBaseTest.php8
-rw-r--r--core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyBuilderTest.php28
-rw-r--r--core/tests/Drupal/Tests/Component/Render/FormattableMarkupTest.php6
-rw-r--r--core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php4
-rw-r--r--core/tests/Drupal/Tests/Component/Render/PlainTextOutputTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Serialization/JsonTest.php10
-rw-r--r--core/tests/Drupal/Tests/Component/Serialization/YamlPeclTest.php12
-rw-r--r--core/tests/Drupal/Tests/Component/Serialization/YamlTest.php12
-rw-r--r--core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php4
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php16
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/ColorTest.php8
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/CryptTest.php6
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/DeprecationHelperTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/EmailValidatorTest.php4
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/HtmlTest.php22
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/ImageTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/NestedArrayTest.php20
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/NumberTest.php6
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/RandomTest.php18
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/RectangleTest.php6
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/ReflectionTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/SortArrayTest.php8
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/TimerTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php14
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php22
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/VariableTest.php2
-rw-r--r--core/tests/Drupal/Tests/Component/Utility/XssTest.php16
-rw-r--r--core/tests/Drupal/Tests/Component/Uuid/UuidTest.php6
-rw-r--r--core/tests/Drupal/Tests/Composer/ComposerTest.php4
-rw-r--r--core/tests/Drupal/Tests/Composer/Generator/BuilderTest.php2
-rw-r--r--core/tests/Drupal/Tests/Composer/Generator/MetapackageUpdateTest.php2
-rw-r--r--core/tests/Drupal/Tests/Composer/Generator/OverlapWithTopLevelDependenciesTest.php2
-rw-r--r--core/tests/Drupal/Tests/Composer/Plugin/ProjectMessage/ConfigTest.php4
-rw-r--r--core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php4
-rw-r--r--core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php8
-rw-r--r--core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php10
-rw-r--r--core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldUpgradeTest.php2
-rw-r--r--core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/AppendOpTest.php2
-rw-r--r--core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/ReplaceOpTest.php4
-rw-r--r--core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/ScaffoldFileCollectionTest.php2
-rw-r--r--core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/SkipOpTest.php2
-rw-r--r--core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php8
-rw-r--r--core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/VendorHardeningPluginTest.php10
-rw-r--r--core/tests/Drupal/Tests/ComposerIntegrationTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php20
-rw-r--r--core/tests/Drupal/Tests/Core/Access/AccessResultForbiddenTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Access/AccessResultNeutralTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Access/AccessResultTest.php30
-rw-r--r--core/tests/Drupal/Tests/Core/Access/CsrfAccessCheckTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Access/CustomAccessCheckTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Access/DefaultAccessCheckTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Access/RouteProcessorCsrfTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php50
-rw-r--r--core/tests/Drupal/Tests/Core/Ajax/AjaxResponseTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Ajax/OpenOffCanvasDialogCommandTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Annotation/PluralTranslationTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Asset/CssCollectionGrouperUnitTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Asset/LibrariesDirectoryFileFinderTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Asset/LibraryDependencyResolverTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php44
-rw-r--r--core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Authentication/AuthenticationCollectorTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php28
-rw-r--r--core/tests/Drupal/Tests/Core/Batch/PercentagesTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Block/BlockBaseTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php18
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/CacheCollectorTest.php30
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/CacheFactoryTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/CacheTagsInvalidatorTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/CacheTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendFactoryTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php14
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/Context/CookieCacheContextTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/Context/HeadersCacheContextTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/Context/IsFrontPathCacheContextTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/Context/ProtocolVersionCacheContextTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/Context/QueryArgsCacheContextTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/Context/SessionCacheContextTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Command/QuickStartTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Common/AttributesTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Common/DiffArrayTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Common/TagsTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Condition/ConditionAccessResolverTraitTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Config/ConfigDependencyManagerTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Config/ConfigFactoryOverrideBaseTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Config/ConfigTest.php34
-rw-r--r--core/tests/Drupal/Tests/Core/Config/Entity/ConfigDependencyManagerTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php36
-rw-r--r--core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityDependencyTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php28
-rw-r--r--core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php16
-rw-r--r--core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayModeBaseUnitTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Config/Entity/Query/QueryFactoryTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Config/ExtensionInstallStorageTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Config/ImmutableConfigTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Config/NullStorageTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Config/ReadOnlyStorageTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Config/StorageComparerTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Controller/AjaxRendererTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Controller/ControllerBaseTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Controller/TitleResolverTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/CronTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Database/ConditionTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Database/ConnectionTest.php30
-rw-r--r--core/tests/Drupal/Tests/Core/Database/OrderByTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Database/RowCountExceptionTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Datetime/DateHelperTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/Datetime/DateTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Datetime/DrupalDateTimeTest.php16
-rw-r--r--core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/AuthenticationProviderPassTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/ProxyServicesPassTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/StackedKernelPassTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php30
-rw-r--r--core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php14
-rw-r--r--core/tests/Drupal/Tests/Core/DependencyInjection/ContainerTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/DependencyInjection/DependencySerializationTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/DependencyInjection/YamlFileLoaderTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Discovery/YamlDiscoveryTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php14
-rw-r--r--core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/DrupalKernel/ValidateHostnameTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/DrupalTest.php68
-rw-r--r--core/tests/Drupal/Tests/Core/Enhancer/EntityRevisionRouteEnhancerTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Enhancer/ParamConversionEnhancerTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/Access/EntityFormDisplayAccessControlHandlerTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php36
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php28
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/Enhancer/EntityRouteEnhancerTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php32
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityRepositoryTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php28
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityTypeBundleInfoTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php22
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityTypeRepositoryTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php64
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php54
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/FieldDefinitionTest.php28
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php24
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/Query/Sql/QueryTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php20
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php16
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php44
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php46
-rw-r--r--core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/EventSubscriber/ExceptionJsonSubscriberTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/EventSubscriber/FinalExceptionSubscriberTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/EventSubscriber/FinishResponseSubscriberTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/EventSubscriber/OptionsRequestSubscriberTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/EventSubscriber/PathRootsSubscriberTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Extension/DefaultConfigTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Extension/DependencyTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Extension/ExtensionDiscoveryTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php28
-rw-r--r--core/tests/Drupal/Tests/Core/Extension/ExtensionSerializationTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php22
-rw-r--r--core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php46
-rw-r--r--core/tests/Drupal/Tests/Core/Extension/ModuleInfoTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Extension/ThemeExtensionListTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Field/FieldDefinitionListenerTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/Field/FieldFilteredMarkupTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Field/FieldInputValueNormalizerTraitTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Field/FieldTypePluginManagerTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Field/PluginSettingsBaseTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/File/FileSystemTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/File/FileUploadSanitizeNameEventTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Flood/MemoryBackendTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Form/ConfigTargetTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Form/ConfirmFormHelperTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php14
-rw-r--r--core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php54
-rw-r--r--core/tests/Drupal/Tests/Core/Form/FormCacheTest.php26
-rw-r--r--core/tests/Drupal/Tests/Core/Form/FormElementHelperTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Form/FormHelperTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php182
-rw-r--r--core/tests/Drupal/Tests/Core/Form/FormStateTest.php42
-rw-r--r--core/tests/Drupal/Tests/Core/Form/FormStateValuesTraitTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php16
-rw-r--r--core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php20
-rw-r--r--core/tests/Drupal/Tests/Core/Form/OptGroupTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Form/SubformStateTest.php24
-rw-r--r--core/tests/Drupal/Tests/Core/Http/CacheableExceptionTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Http/ClientFactoryTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Http/TrustedHostsRequestFactoryTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Image/ImageTest.php50
-rw-r--r--core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Layout/LayoutDefaultTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php14
-rw-r--r--core/tests/Drupal/Tests/Core/Listeners/DrupalStandardsListenerDeprecationTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Logger/LogMessageParserTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Logger/LoggerChannelFactoryTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Mail/MailFormatHelperTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Mail/Plugin/Mail/PhpMailTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Mail/Plugin/Mail/SymfonyMailerTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Menu/ContextualLinkDefaultTest.php14
-rw-r--r--core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php14
-rw-r--r--core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Menu/LocalActionDefaultTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php24
-rw-r--r--core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Menu/MenuActiveTrailTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Menu/MenuLinkDefaultFormTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Menu/MenuLinkDefaultTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Menu/MenuLinkTreeElementTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Menu/MenuTreeParametersTest.php14
-rw-r--r--core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/PageCache/CommandLineOrUnsafeMethodTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/PageCache/NoSessionOpenTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/ParamConverter/EntityRevisionParamConverterTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/ParamConverter/ParamConverterManagerTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Password/DefaultPasswordGeneratorTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Password/PhpPasswordTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Path/PathMatcherTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php36
-rw-r--r--core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionIsSatisfiedTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/Context/LazyContextRepositoryTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php20
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/DefaultLazyPluginCollectionTest.php30
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php36
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecoratorTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php16
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/Discovery/HookDiscoveryTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDirectoryDiscoveryTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/PluginFormFactoryTest.php14
-rw-r--r--core/tests/Drupal/Tests/Core/Plugin/PluginWithFormsTraitTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/PrivateKeyTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/ProxyBuilder/ProxyBuilderTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php18
-rw-r--r--core/tests/Drupal/Tests/Core/Render/Element/HtmlTagTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Render/Element/MachineNameTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Render/Element/PasswordConfirmTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Render/Element/PasswordTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Render/Element/RenderElementTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Render/Element/TableSelectTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Render/Element/TextareaTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Render/Element/TextfieldTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Render/Element/TokenTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Render/ElementTest.php20
-rw-r--r--core/tests/Drupal/Tests/Core/Render/MetadataBubblingUrlGeneratorTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Render/Placeholder/ChainedPlaceholderStrategyTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Render/PlaceholderGeneratorTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Render/RendererDebugTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php20
-rw-r--r--core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Render/RendererTest.php32
-rw-r--r--core/tests/Drupal/Tests/Core/Route/RoleAccessCheckTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/RouteProcessor/RouteProcessorManagerTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/AcceptHeaderMatcherTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/ContentTypeHeaderMatcherTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/LazyRouteCollectionTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/MethodFilterTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/PathChangedHelperTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/RequestFormatRouteFilterTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/RouteMatchTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/RoutePreloaderTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/RouterTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/RouterUnsupportedTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php30
-rw-r--r--core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php26
-rw-r--r--core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Session/AnonymousUserSessionTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Session/CalculatedPermissionsItemTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Session/CalculatedPermissionsTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Session/MetadataBagTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Session/PermissionsHashGeneratorTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Session/RefinableCalculatedPermissionsTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php16
-rw-r--r--core/tests/Drupal/Tests/Core/Session/UserSessionTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Session/WriteSafeSessionHandlerTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Site/SettingsTest.php16
-rw-r--r--core/tests/Drupal/Tests/Core/StackMiddleware/ContentLengthTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/StackMiddleware/NegotiationMiddlewareTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/StringTranslation/ByteSizeMarkupTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/StringTranslation/PluralTranslatableMarkupTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/StringTranslation/TranslatableMarkupTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/StringTranslation/TranslationWrapperTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/TempStore/PrivateTempStoreTest.php14
-rw-r--r--core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php26
-rw-r--r--core/tests/Drupal/Tests/Core/Template/AttributeHelperTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Template/AttributeTest.php36
-rw-r--r--core/tests/Drupal/Tests/Core/Template/Loader/ThemeRegistryLoaderTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php32
-rw-r--r--core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php10
-rw-r--r--core/tests/Drupal/Tests/Core/Test/AssertContentTraitTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Test/JUnitConverterTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Test/PhpUnitAutoloaderTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeIsolatedTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Test/PhpUnitTestRunnerTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Test/RunTests/TestFileParserTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Test/TestDatabaseTest.php6
-rw-r--r--core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php18
-rw-r--r--core/tests/Drupal/Tests/Core/Test/TestSetupTraitTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Test/TestSuiteBaseTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Theme/AjaxBasePageNegotiatorTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Theme/Component/ComponentMetadataTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Theme/Component/ComponentPluginManagerTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Theme/CoreThemesAutoloadedForTests.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Theme/RegistryTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Theme/ThemeNegotiatorTest.php8
-rw-r--r--core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php22
-rw-r--r--core/tests/Drupal/Tests/Core/UnroutedUrlTest.php20
-rw-r--r--core/tests/Drupal/Tests/Core/Update/UpdateHookRegistryTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php24
-rw-r--r--core/tests/Drupal/Tests/Core/UrlTest.php64
-rw-r--r--core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php4
-rw-r--r--core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php34
-rw-r--r--core/tests/Drupal/Tests/Core/Utility/TokenTest.php16
-rw-r--r--core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php14
-rw-r--r--core/tests/Drupal/Tests/ExpectDeprecationTest.php4
-rw-r--r--core/tests/Drupal/Tests/PhpCs/SortTest.php4
-rw-r--r--core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php14
-rw-r--r--core/tests/Drupal/Tests/Traits/Core/Config/SchemaConfigListenerTestTrait.php2
-rw-r--r--core/tests/Drupal/Tests/UnitTestCaseTest.php4
3054 files changed, 8414 insertions, 8414 deletions
diff --git a/core/modules/announcements_feed/tests/src/FunctionalJavascript/AccessAnnouncementTest.php b/core/modules/announcements_feed/tests/src/FunctionalJavascript/AccessAnnouncementTest.php
index 189f42f845a..02718fe8e40 100644
--- a/core/modules/announcements_feed/tests/src/FunctionalJavascript/AccessAnnouncementTest.php
+++ b/core/modules/announcements_feed/tests/src/FunctionalJavascript/AccessAnnouncementTest.php
@@ -40,7 +40,7 @@ class AccessAnnouncementTest extends OffCanvasTestBase {
/**
* Test of viewing announcements by a user with appropriate permission.
*/
- public function testAnnounceFirstLogin() {
+ public function testAnnounceFirstLogin(): void {
$this->drupalLogin(
$this->drupalCreateUser(
[
@@ -62,7 +62,7 @@ class AccessAnnouncementTest extends OffCanvasTestBase {
/**
* Testing announce icon without announce permission.
*/
- public function testAnnounceWithoutPermission() {
+ public function testAnnounceWithoutPermission(): void {
// User without "access announcements" permission.
$account = $this->drupalCreateUser(
[
diff --git a/core/modules/announcements_feed/tests/src/FunctionalJavascript/AlertsJsonFeedTest.php b/core/modules/announcements_feed/tests/src/FunctionalJavascript/AlertsJsonFeedTest.php
index 96f3b81b3e1..a4b09d7feae 100644
--- a/core/modules/announcements_feed/tests/src/FunctionalJavascript/AlertsJsonFeedTest.php
+++ b/core/modules/announcements_feed/tests/src/FunctionalJavascript/AlertsJsonFeedTest.php
@@ -56,7 +56,7 @@ class AlertsJsonFeedTest extends OffCanvasTestBase {
/**
* Check the status of the announcements when the feed is updated and removed.
*/
- public function testAnnounceFeedUpdatedAndRemoved() {
+ public function testAnnounceFeedUpdatedAndRemoved(): void {
$this->markTestSkipped('Skipped due to major version-specific logic. See https://www.drupal.org/project/drupal/issues/3359322');
$this->drupalLogin($this->user);
$this->drupalGet('<front>');
@@ -88,7 +88,7 @@ class AlertsJsonFeedTest extends OffCanvasTestBase {
/**
* Check with an empty JSON feed.
*/
- public function testAnnounceFeedEmpty() {
+ public function testAnnounceFeedEmpty(): void {
// Change the feed url and reset temp storage.
AnnounceTestHttpClientMiddleware::setAnnounceTestEndpoint('/announce-feed-json/empty');
diff --git a/core/modules/announcements_feed/tests/src/Kernel/AnnounceRendererTest.php b/core/modules/announcements_feed/tests/src/Kernel/AnnounceRendererTest.php
index d91eebca43d..0c02a77fbe4 100644
--- a/core/modules/announcements_feed/tests/src/Kernel/AnnounceRendererTest.php
+++ b/core/modules/announcements_feed/tests/src/Kernel/AnnounceRendererTest.php
@@ -16,7 +16,7 @@ class AnnounceRendererTest extends AnnounceTestBase {
/**
* Tests rendered valid when something goes wrong.
*/
- public function testRendererException() {
+ public function testRendererException(): void {
$this->setTestFeedResponses([
new Response(403),
]);
@@ -28,7 +28,7 @@ class AnnounceRendererTest extends AnnounceTestBase {
/**
* Tests rendered valid content.
*/
- public function testRendererContent() {
+ public function testRendererContent(): void {
$feed_item_1 = [
'id' => '1001',
'content_html' => 'Test teaser 1',
diff --git a/core/modules/announcements_feed/tests/src/Unit/AnnounceFetcherUnitTest.php b/core/modules/announcements_feed/tests/src/Unit/AnnounceFetcherUnitTest.php
index f919d86c1cf..a5f98b7cc39 100644
--- a/core/modules/announcements_feed/tests/src/Unit/AnnounceFetcherUnitTest.php
+++ b/core/modules/announcements_feed/tests/src/Unit/AnnounceFetcherUnitTest.php
@@ -50,7 +50,7 @@ class AnnounceFetcherUnitTest extends UnitTestCase {
*
* @dataProvider urlProvider
*/
- public function testValidateUrl($url, $isValid) {
+ public function testValidateUrl($url, $isValid): void {
$this->assertEquals($isValid, $this->fetcher->validateUrl($url));
}
diff --git a/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php b/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php
index ee1aeb29f0a..94bd146e716 100644
--- a/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php
+++ b/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php
@@ -30,7 +30,7 @@ class IpAddressBlockingTest extends BrowserTestBase {
/**
* Tests various user input to confirm correct validation and saving of data.
*/
- public function testIPAddressValidation() {
+ public function testIPAddressValidation(): void {
// Create user.
$admin_user = $this->drupalCreateUser(['ban IP addresses']);
$this->drupalLogin($admin_user);
diff --git a/core/modules/ban/tests/src/Kernel/Migrate/d7/MigrateBlockedIpsTest.php b/core/modules/ban/tests/src/Kernel/Migrate/d7/MigrateBlockedIpsTest.php
index 4e9f0e0e496..a8177d312f4 100644
--- a/core/modules/ban/tests/src/Kernel/Migrate/d7/MigrateBlockedIpsTest.php
+++ b/core/modules/ban/tests/src/Kernel/Migrate/d7/MigrateBlockedIpsTest.php
@@ -34,7 +34,7 @@ class MigrateBlockedIpsTest extends MigrateDrupal7TestBase {
/**
* Tests migration of blocked IPs.
*/
- public function testBlockedIps() {
+ public function testBlockedIps(): void {
$this->startCollectingMessages();
$this->executeMigration('d7_blocked_ips');
$this->assertEmpty($this->migrateMessages);
diff --git a/core/modules/ban/tests/src/Unit/BanMiddlewareTest.php b/core/modules/ban/tests/src/Unit/BanMiddlewareTest.php
index 4b43d161715..77b9b87d934 100644
--- a/core/modules/ban/tests/src/Unit/BanMiddlewareTest.php
+++ b/core/modules/ban/tests/src/Unit/BanMiddlewareTest.php
@@ -51,7 +51,7 @@ class BanMiddlewareTest extends UnitTestCase {
/**
* Tests a banned IP.
*/
- public function testBannedIp() {
+ public function testBannedIp(): void {
$banned_ip = '17.0.0.2';
$this->banManager->expects($this->once())
->method('isBanned')
@@ -71,7 +71,7 @@ class BanMiddlewareTest extends UnitTestCase {
/**
* Tests an unbanned IP.
*/
- public function testUnbannedIp() {
+ public function testUnbannedIp(): void {
$unbanned_ip = '18.0.0.2';
$this->banManager->expects($this->once())
->method('isBanned')
diff --git a/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php b/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
index 1d9f3fca3fd..c91b28eabf9 100644
--- a/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
+++ b/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
@@ -39,7 +39,7 @@ class BasicAuthTest extends BrowserTestBase {
/**
* Tests http basic authentication.
*/
- public function testBasicAuth() {
+ public function testBasicAuth(): void {
// Enable page caching.
$config = $this->config('system.performance');
$config->set('cache.page.max_age', 300);
@@ -95,7 +95,7 @@ class BasicAuthTest extends BrowserTestBase {
/**
* Tests the global login flood control.
*/
- public function testGlobalLoginFloodControl() {
+ public function testGlobalLoginFloodControl(): void {
$this->config('user.flood')
->set('ip_limit', 2)
// Set a high per-user limit out so that it is not relevant in the test.
@@ -120,7 +120,7 @@ class BasicAuthTest extends BrowserTestBase {
/**
* Tests the per-user login flood control.
*/
- public function testPerUserLoginFloodControl() {
+ public function testPerUserLoginFloodControl(): void {
$this->config('user.flood')
// Set a high global limit out so that it is not relevant in the test.
->set('ip_limit', 4000)
@@ -158,7 +158,7 @@ class BasicAuthTest extends BrowserTestBase {
/**
* Tests compatibility with locale/UI translation.
*/
- public function testLocale() {
+ public function testLocale(): void {
ConfigurableLanguage::createFromLangcode('de')->save();
$this->config('system.site')->set('default_langcode', 'de')->save();
@@ -173,7 +173,7 @@ class BasicAuthTest extends BrowserTestBase {
/**
* Tests if a comprehensive message is displayed when the route is denied.
*/
- public function testUnauthorizedErrorMessage() {
+ public function testUnauthorizedErrorMessage(): void {
$account = $this->drupalCreateUser();
$url = Url::fromRoute('router_test.11');
@@ -209,7 +209,7 @@ class BasicAuthTest extends BrowserTestBase {
*
* @see \Drupal\basic_auth\Authentication\Provider\BasicAuth::challengeException()
*/
- public function testCacheabilityOf401Response() {
+ public function testCacheabilityOf401Response(): void {
$url = Url::fromRoute('router_test.11');
$assert_response_cacheability = function ($expected_page_cache_header_value, $expected_dynamic_page_cache_header_value) use ($url) {
@@ -249,7 +249,7 @@ class BasicAuthTest extends BrowserTestBase {
*
* @see https://www.drupal.org/node/2817727
*/
- public function testControllerNotCalledBeforeAuth() {
+ public function testControllerNotCalledBeforeAuth(): void {
$this->drupalGet('/basic_auth_test/state/modify');
$this->assertSession()->statusCodeEquals(401);
$this->drupalGet('/basic_auth_test/state/read');
diff --git a/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php b/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php
index 0c55b388486..08cabf57821 100644
--- a/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php
+++ b/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php
@@ -78,7 +78,7 @@ class BigPipeTest extends BrowserTestBase {
* - big_pipe_page_attachments()
* - \Drupal\big_pipe\Controller\BigPipeController
*/
- public function testNoJsDetection() {
+ public function testNoJsDetection(): void {
$no_js_to_js_markup = '<script>document.cookie = "' . BigPipeStrategy::NOJS_COOKIE . '=1; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT"</script>';
// 1. No session (anonymous).
@@ -142,7 +142,7 @@ class BigPipeTest extends BrowserTestBase {
*
* @see \Drupal\big_pipe_test\BigPipePlaceholderTestCases
*/
- public function testBigPipe() {
+ public function testBigPipe(): void {
// Simulate production.
$this->config('system.logging')->set('error_level', ERROR_REPORTING_HIDE)->save();
@@ -231,7 +231,7 @@ class BigPipeTest extends BrowserTestBase {
*
* @see \Drupal\big_pipe_test\BigPipePlaceholderTestCases
*/
- public function testBigPipeNoJs() {
+ public function testBigPipeNoJs(): void {
// Simulate production.
$this->config('system.logging')->set('error_level', ERROR_REPORTING_HIDE)->save();
@@ -294,7 +294,7 @@ class BigPipeTest extends BrowserTestBase {
/**
* Tests BigPipe with a multi-occurrence placeholder.
*/
- public function testBigPipeMultiOccurrencePlaceholders() {
+ public function testBigPipeMultiOccurrencePlaceholders(): void {
$this->drupalLogin($this->rootUser);
$this->assertSessionCookieExists('1');
$this->assertBigPipeNoJsCookieExists('0');
diff --git a/core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipePreviewTest.php b/core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipePreviewTest.php
index 72733108163..3579ca7b2f4 100644
--- a/core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipePreviewTest.php
+++ b/core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipePreviewTest.php
@@ -31,7 +31,7 @@ class BigPipePreviewTest extends WebDriverTestBase {
/**
* Test preview functionality within placeholders.
*/
- public function testLazyLoaderPreview() {
+ public function testLazyLoaderPreview(): void {
$user = $this->drupalCreateUser([]);
$display_name = $user->getDisplayName();
$this->drupalLogin($user);
diff --git a/core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipeRegressionTest.php b/core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipeRegressionTest.php
index 22188d9fc80..d811b561d8e 100644
--- a/core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipeRegressionTest.php
+++ b/core/modules/big_pipe/tests/src/FunctionalJavascript/BigPipeRegressionTest.php
@@ -45,7 +45,7 @@ class BigPipeRegressionTest extends WebDriverTestBase {
*
* @see https://www.drupal.org/node/2678662
*/
- public function testMultipleClosingBodies_2678662() {
+ public function testMultipleClosingBodies_2678662(): void {
$this->assertTrue($this->container->get('module_installer')->install(['render_placeholder_message_test'], TRUE), 'Installed modules.');
$this->drupalLogin($this->drupalCreateUser());
@@ -78,7 +78,7 @@ JS;
*
* @see https://www.drupal.org/node/2712935
*/
- public function testMessages_2712935() {
+ public function testMessages_2712935(): void {
$this->assertTrue($this->container->get('module_installer')->install(['render_placeholder_message_test'], TRUE), 'Installed modules.');
$this->drupalLogin($this->drupalCreateUser());
@@ -118,7 +118,7 @@ JS;
*
* @see https://www.drupal.org/node/2802923
*/
- public function testPlaceholderInParagraph_2802923() {
+ public function testPlaceholderInParagraph_2802923(): void {
$this->drupalLogin($this->drupalCreateUser());
$this->drupalGet(Url::fromRoute('big_pipe_regression_test.2802923'));
@@ -131,7 +131,7 @@ JS;
* Repeat loading of same page for two times, after second time the page is
* cached and the bug consistently reproducible.
*/
- public function testBigPipeLargeContent() {
+ public function testBigPipeLargeContent(): void {
$user = $this->drupalCreateUser();
$this->drupalLogin($user);
$assert_session = $this->assertSession();
diff --git a/core/modules/big_pipe/tests/src/Kernel/BigPipeInterfacePreviewThemeSuggestionsTest.php b/core/modules/big_pipe/tests/src/Kernel/BigPipeInterfacePreviewThemeSuggestionsTest.php
index 5ac95bcca3c..73ccd3144f1 100644
--- a/core/modules/big_pipe/tests/src/Kernel/BigPipeInterfacePreviewThemeSuggestionsTest.php
+++ b/core/modules/big_pipe/tests/src/Kernel/BigPipeInterfacePreviewThemeSuggestionsTest.php
@@ -60,7 +60,7 @@ class BigPipeInterfacePreviewThemeSuggestionsTest extends KernelTestBase {
/**
* Tests template suggestions from big_pipe_theme_suggestions_big_pipe_interface_preview().
*/
- public function testBigPipeThemeHookSuggestions() {
+ public function testBigPipeThemeHookSuggestions(): void {
$entity = $this->controller->create([
'id' => 'test_block1',
'theme' => 'stark',
diff --git a/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php b/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php
index 964154eb5ce..80c3d2de08c 100644
--- a/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php
+++ b/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php
@@ -34,7 +34,7 @@ class BigPipeResponseAttachmentsProcessorTest extends UnitTestCase {
*
* @dataProvider nonHtmlResponseProvider
*/
- public function testNonHtmlResponse($response_class) {
+ public function testNonHtmlResponse($response_class): void {
$big_pipe_response_attachments_processor = $this->createBigPipeResponseAttachmentsProcessor($this->prophesize(AttachmentsResponseProcessorInterface::class));
$non_html_response = new $response_class();
@@ -54,7 +54,7 @@ class BigPipeResponseAttachmentsProcessorTest extends UnitTestCase {
*
* @dataProvider attachmentsProvider
*/
- public function testHtmlResponse(array $attachments) {
+ public function testHtmlResponse(array $attachments): void {
$big_pipe_response = new BigPipeResponse(new HtmlResponse('original'));
$big_pipe_response->setAttachments($attachments);
diff --git a/core/modules/big_pipe/tests/src/Unit/Render/FiberPlaceholderTest.php b/core/modules/big_pipe/tests/src/Unit/Render/FiberPlaceholderTest.php
index 47f7be38cb4..25b9d45103a 100644
--- a/core/modules/big_pipe/tests/src/Unit/Render/FiberPlaceholderTest.php
+++ b/core/modules/big_pipe/tests/src/Unit/Render/FiberPlaceholderTest.php
@@ -33,7 +33,7 @@ class FiberPlaceholderTest extends UnitTestCase {
/**
* @covers \Drupal\big_pipe\Render\BigPipe::sendPlaceholders
*/
- public function testLongPlaceholderFiberSuspendingLoop() {
+ public function testLongPlaceholderFiberSuspendingLoop(): void {
$request_stack = $this->prophesize(RequestStack::class);
$request_stack->getMainRequest()
->willReturn(new Request());
diff --git a/core/modules/big_pipe/tests/src/Unit/Render/ManyPlaceholderTest.php b/core/modules/big_pipe/tests/src/Unit/Render/ManyPlaceholderTest.php
index e6bd1811f70..7446def8ce0 100644
--- a/core/modules/big_pipe/tests/src/Unit/Render/ManyPlaceholderTest.php
+++ b/core/modules/big_pipe/tests/src/Unit/Render/ManyPlaceholderTest.php
@@ -25,7 +25,7 @@ class ManyPlaceholderTest extends UnitTestCase {
/**
* @covers \Drupal\big_pipe\Render\BigPipe::sendNoJsPlaceholders
*/
- public function testManyNoJsPlaceHolders() {
+ public function testManyNoJsPlaceHolders(): void {
$session = $this->prophesize(SessionInterface::class);
$session->start()->willReturn(TRUE);
$session->save()->shouldBeCalled();
diff --git a/core/modules/big_pipe/tests/src/Unit/Render/Placeholder/BigPipeStrategyTest.php b/core/modules/big_pipe/tests/src/Unit/Render/Placeholder/BigPipeStrategyTest.php
index 864449845b7..f69b82d2096 100644
--- a/core/modules/big_pipe/tests/src/Unit/Render/Placeholder/BigPipeStrategyTest.php
+++ b/core/modules/big_pipe/tests/src/Unit/Render/Placeholder/BigPipeStrategyTest.php
@@ -25,7 +25,7 @@ class BigPipeStrategyTest extends UnitTestCase {
*
* @dataProvider placeholdersProvider
*/
- public function testProcessPlaceholders(array $placeholders, $method, $route_match_has_no_big_pipe_option, $request_has_session, $request_has_big_pipe_nojs_cookie, array $expected_big_pipe_placeholders) {
+ public function testProcessPlaceholders(array $placeholders, $method, $route_match_has_no_big_pipe_option, $request_has_session, $request_has_big_pipe_nojs_cookie, array $expected_big_pipe_placeholders): void {
$request = new Request();
$request->setMethod($method);
if ($request_has_big_pipe_nojs_cookie) {
diff --git a/core/modules/big_pipe/tests/src/Unit/StackMiddleware/ContentLengthTest.php b/core/modules/big_pipe/tests/src/Unit/StackMiddleware/ContentLengthTest.php
index 34388d32ead..3a6090b7aff 100644
--- a/core/modules/big_pipe/tests/src/Unit/StackMiddleware/ContentLengthTest.php
+++ b/core/modules/big_pipe/tests/src/Unit/StackMiddleware/ContentLengthTest.php
@@ -24,7 +24,7 @@ final class ContentLengthTest extends UnitTestCase {
* @covers ::handle
* @dataProvider providerTestSetContentLengthHeader
*/
- public function testHandle(false|int $expected_header, Response $response) {
+ public function testHandle(false|int $expected_header, Response $response): void {
$kernel = $this->prophesize(HttpKernelInterface::class);
$request = Request::create('/');
$kernel->handle($request, HttpKernelInterface::MAIN_REQUEST, TRUE)->willReturn($response);
diff --git a/core/modules/block/tests/src/Functional/BlockAdminThemeTest.php b/core/modules/block/tests/src/Functional/BlockAdminThemeTest.php
index 3f250d96a23..7d712fe6673 100644
--- a/core/modules/block/tests/src/Functional/BlockAdminThemeTest.php
+++ b/core/modules/block/tests/src/Functional/BlockAdminThemeTest.php
@@ -28,7 +28,7 @@ class BlockAdminThemeTest extends BrowserTestBase {
/**
* Check for the accessibility of the admin theme on the block admin page.
*/
- public function testAdminTheme() {
+ public function testAdminTheme(): void {
// Create administrative user.
$admin_user = $this->drupalCreateUser([
'administer blocks',
@@ -53,7 +53,7 @@ class BlockAdminThemeTest extends BrowserTestBase {
/**
* Ensure contextual links are disabled in Claro theme.
*/
- public function testClaroAdminTheme() {
+ public function testClaroAdminTheme(): void {
// Create administrative user.
$admin_user = $this->drupalCreateUser([
'access administration pages',
diff --git a/core/modules/block/tests/src/Functional/BlockCacheTest.php b/core/modules/block/tests/src/Functional/BlockCacheTest.php
index ec5cd4355f9..1c6886eb08f 100644
--- a/core/modules/block/tests/src/Functional/BlockCacheTest.php
+++ b/core/modules/block/tests/src/Functional/BlockCacheTest.php
@@ -82,7 +82,7 @@ class BlockCacheTest extends BrowserTestBase {
/**
* Tests "user.roles" cache context.
*/
- public function testCachePerRole() {
+ public function testCachePerRole(): void {
\Drupal::state()->set('block_test.cache_contexts', ['user.roles']);
// Enable our test block. Set some content for it to display.
@@ -134,7 +134,7 @@ class BlockCacheTest extends BrowserTestBase {
/**
* Tests a cacheable block without any additional cache context.
*/
- public function testCachePermissions() {
+ public function testCachePermissions(): void {
// user.permissions is a required context, so a user with different
// permissions will see a different version of the block.
\Drupal::state()->set('block_test.cache_contexts', []);
@@ -162,7 +162,7 @@ class BlockCacheTest extends BrowserTestBase {
/**
* Tests non-cacheable block.
*/
- public function testNoCache() {
+ public function testNoCache(): void {
\Drupal::state()->set('block_test.cache_max_age', 0);
$current_content = $this->randomMachineName();
@@ -183,7 +183,7 @@ class BlockCacheTest extends BrowserTestBase {
/**
* Tests "user" cache context.
*/
- public function testCachePerUser() {
+ public function testCachePerUser(): void {
\Drupal::state()->set('block_test.cache_contexts', ['user']);
$current_content = $this->randomMachineName();
@@ -215,7 +215,7 @@ class BlockCacheTest extends BrowserTestBase {
/**
* Tests "url" cache context.
*/
- public function testCachePerPage() {
+ public function testCachePerPage(): void {
\Drupal::state()->set('block_test.cache_contexts', ['url']);
$current_content = $this->randomMachineName();
diff --git a/core/modules/block/tests/src/Functional/BlockDemoTest.php b/core/modules/block/tests/src/Functional/BlockDemoTest.php
index 0b06daf0ebc..e88104f3bdf 100644
--- a/core/modules/block/tests/src/Functional/BlockDemoTest.php
+++ b/core/modules/block/tests/src/Functional/BlockDemoTest.php
@@ -28,7 +28,7 @@ class BlockDemoTest extends BrowserTestBase {
/**
* Check for the accessibility of the admin block demo page.
*/
- public function testBlockDemo() {
+ public function testBlockDemo(): void {
// Create administrative user.
$admin_user = $this->drupalCreateUser([
'administer blocks',
diff --git a/core/modules/block/tests/src/Functional/BlockFormInBlockTest.php b/core/modules/block/tests/src/Functional/BlockFormInBlockTest.php
index 7077279e892..079cc02cd1c 100644
--- a/core/modules/block/tests/src/Functional/BlockFormInBlockTest.php
+++ b/core/modules/block/tests/src/Functional/BlockFormInBlockTest.php
@@ -39,7 +39,7 @@ class BlockFormInBlockTest extends BrowserTestBase {
/**
* Tests to see if form in block's redirect isn't cached.
*/
- public function testCachePerPage() {
+ public function testCachePerPage(): void {
$form_values = ['email' => 'test@example.com'];
// Go to "test-page" and test if the block is enabled.
@@ -69,7 +69,7 @@ class BlockFormInBlockTest extends BrowserTestBase {
/**
* Tests the actual placeholders.
*/
- public function testPlaceholders() {
+ public function testPlaceholders(): void {
$this->drupalGet('test-multiple-forms');
$placeholder = 'form_action_' . Crypt::hashBase64('Drupal\Core\Form\FormBuilder::prepareForm');
diff --git a/core/modules/block/tests/src/Functional/BlockHiddenRegionTest.php b/core/modules/block/tests/src/Functional/BlockHiddenRegionTest.php
index 6b79694c2f4..264283a7631 100644
--- a/core/modules/block/tests/src/Functional/BlockHiddenRegionTest.php
+++ b/core/modules/block/tests/src/Functional/BlockHiddenRegionTest.php
@@ -51,7 +51,7 @@ class BlockHiddenRegionTest extends BrowserTestBase {
/**
* Tests that hidden regions do not inherit blocks when a theme is installed.
*/
- public function testBlockNotInHiddenRegion() {
+ public function testBlockNotInHiddenRegion(): void {
// Ensure that the search form block is displayed.
$this->drupalGet('');
diff --git a/core/modules/block/tests/src/Functional/BlockHookOperationTest.php b/core/modules/block/tests/src/Functional/BlockHookOperationTest.php
index 53076f65eef..37fa57284b8 100644
--- a/core/modules/block/tests/src/Functional/BlockHookOperationTest.php
+++ b/core/modules/block/tests/src/Functional/BlockHookOperationTest.php
@@ -43,7 +43,7 @@ class BlockHookOperationTest extends BrowserTestBase {
/**
* Tests the block list to see if the test_operation link is added.
*/
- public function testBlockOperationAlter() {
+ public function testBlockOperationAlter(): void {
// Add a test block, any block will do.
// Set the machine name so the test_operation link can be built later.
$block_id = $this->randomMachineName(16);
diff --git a/core/modules/block/tests/src/Functional/BlockHtmlTest.php b/core/modules/block/tests/src/Functional/BlockHtmlTest.php
index 439984bd4a5..e0f31032070 100644
--- a/core/modules/block/tests/src/Functional/BlockHtmlTest.php
+++ b/core/modules/block/tests/src/Functional/BlockHtmlTest.php
@@ -48,7 +48,7 @@ class BlockHtmlTest extends BrowserTestBase {
/**
* Tests for valid HTML for a block.
*/
- public function testHtml() {
+ public function testHtml(): void {
$this->drupalGet('');
// Ensure that a block's ID is converted to an HTML valid ID, and that
diff --git a/core/modules/block/tests/src/Functional/BlockInstallTest.php b/core/modules/block/tests/src/Functional/BlockInstallTest.php
index 6897526c86d..eebbd02c7a2 100644
--- a/core/modules/block/tests/src/Functional/BlockInstallTest.php
+++ b/core/modules/block/tests/src/Functional/BlockInstallTest.php
@@ -18,7 +18,7 @@ class BlockInstallTest extends BrowserTestBase {
*/
protected $defaultTheme = 'stark';
- public function testCacheTagInvalidationUponInstallation() {
+ public function testCacheTagInvalidationUponInstallation(): void {
// Warm the page cache.
$this->drupalGet('');
$this->assertSession()->pageTextNotContains('Powered by Drupal');
diff --git a/core/modules/block/tests/src/Functional/BlockInvalidRegionTest.php b/core/modules/block/tests/src/Functional/BlockInvalidRegionTest.php
index a111dacc75f..514ae49846d 100644
--- a/core/modules/block/tests/src/Functional/BlockInvalidRegionTest.php
+++ b/core/modules/block/tests/src/Functional/BlockInvalidRegionTest.php
@@ -43,7 +43,7 @@ class BlockInvalidRegionTest extends BrowserTestBase {
/**
* Tests that blocks assigned to invalid regions work correctly.
*/
- public function testBlockInInvalidRegion() {
+ public function testBlockInInvalidRegion(): void {
// Enable a test block and place it in an invalid region.
$block = $this->drupalPlaceBlock('test_html');
\Drupal::configFactory()->getEditable('block.block.' . $block->id())->set('region', 'invalid_region')->save();
diff --git a/core/modules/block/tests/src/Functional/BlockLanguageCacheTest.php b/core/modules/block/tests/src/Functional/BlockLanguageCacheTest.php
index b728d073235..6b2f5a2e69c 100644
--- a/core/modules/block/tests/src/Functional/BlockLanguageCacheTest.php
+++ b/core/modules/block/tests/src/Functional/BlockLanguageCacheTest.php
@@ -54,7 +54,7 @@ class BlockLanguageCacheTest extends BrowserTestBase {
/**
* Creates a block in a language, check blocks page in all languages.
*/
- public function testBlockLinks() {
+ public function testBlockLinks(): void {
// Create admin user to be able to access block admin.
$admin_user = $this->drupalCreateUser([
'administer blocks',
diff --git a/core/modules/block/tests/src/Functional/BlockLanguageTest.php b/core/modules/block/tests/src/Functional/BlockLanguageTest.php
index 173d939e767..d1b297c2d47 100644
--- a/core/modules/block/tests/src/Functional/BlockLanguageTest.php
+++ b/core/modules/block/tests/src/Functional/BlockLanguageTest.php
@@ -69,7 +69,7 @@ class BlockLanguageTest extends BrowserTestBase {
/**
* Tests the visibility settings for the blocks based on language.
*/
- public function testLanguageBlockVisibility() {
+ public function testLanguageBlockVisibility(): void {
// Check if the visibility setting is available.
$default_theme = $this->config('system.theme')->get('default');
$this->drupalGet('admin/structure/block/add/system_powered_by_block' . '/' . $default_theme);
@@ -108,7 +108,7 @@ class BlockLanguageTest extends BrowserTestBase {
/**
* Tests if the visibility settings are removed if the language is deleted.
*/
- public function testLanguageBlockVisibilityLanguageDelete() {
+ public function testLanguageBlockVisibilityLanguageDelete(): void {
// Enable a standard block and set the visibility setting for one language.
$edit = [
'visibility' => [
@@ -145,7 +145,7 @@ class BlockLanguageTest extends BrowserTestBase {
/**
* Tests block language visibility with different language types.
*/
- public function testMultipleLanguageTypes() {
+ public function testMultipleLanguageTypes(): void {
// Customize content language detection to be different from interface
// language detection.
$edit = [
diff --git a/core/modules/block/tests/src/Functional/BlockRenderOrderTest.php b/core/modules/block/tests/src/Functional/BlockRenderOrderTest.php
index 1fb9a6fbe59..fd909f6ae33 100644
--- a/core/modules/block/tests/src/Functional/BlockRenderOrderTest.php
+++ b/core/modules/block/tests/src/Functional/BlockRenderOrderTest.php
@@ -41,7 +41,7 @@ class BlockRenderOrderTest extends BrowserTestBase {
/**
* Tests the render order of the blocks.
*/
- public function testBlockRenderOrder() {
+ public function testBlockRenderOrder(): void {
// Enable test blocks and place them in the same region.
$region = 'header';
$test_blocks = [
diff --git a/core/modules/block/tests/src/Functional/BlockSystemBrandingTest.php b/core/modules/block/tests/src/Functional/BlockSystemBrandingTest.php
index a0bed0cf80d..dc20aefd6bd 100644
--- a/core/modules/block/tests/src/Functional/BlockSystemBrandingTest.php
+++ b/core/modules/block/tests/src/Functional/BlockSystemBrandingTest.php
@@ -39,7 +39,7 @@ class BlockSystemBrandingTest extends BlockTestBase {
/**
* Tests system branding block configuration.
*/
- public function testSystemBrandingSettings() {
+ public function testSystemBrandingSettings(): void {
$site_logo_xpath = '//div[@id="block-site-branding"]/a/img';
$site_name_xpath = '//div[@id="block-site-branding"]/a[text() = "Drupal"]';
$site_slogan_xpath = '//div[@id="block-site-branding"]/descendant::text()[last()]';
diff --git a/core/modules/block/tests/src/Functional/BlockTest.php b/core/modules/block/tests/src/Functional/BlockTest.php
index 1861c39d1f5..4738e97f0a9 100644
--- a/core/modules/block/tests/src/Functional/BlockTest.php
+++ b/core/modules/block/tests/src/Functional/BlockTest.php
@@ -26,7 +26,7 @@ class BlockTest extends BlockTestBase {
/**
* Tests block visibility.
*/
- public function testBlockVisibility() {
+ public function testBlockVisibility(): void {
$block_name = 'system_powered_by_block';
// Create a random title for the block.
$title = $this->randomMachineName(8);
@@ -86,7 +86,7 @@ class BlockTest extends BlockTestBase {
/**
* Tests that visibility can be properly toggled.
*/
- public function testBlockToggleVisibility() {
+ public function testBlockToggleVisibility(): void {
$block_name = 'system_powered_by_block';
// Create a random title for the block.
$title = $this->randomMachineName(8);
@@ -123,7 +123,7 @@ class BlockTest extends BlockTestBase {
/**
* Tests block visibility when leaving "pages" textarea empty.
*/
- public function testBlockVisibilityListedEmpty() {
+ public function testBlockVisibilityListedEmpty(): void {
$block_name = 'system_powered_by_block';
// Create a random title for the block.
$title = $this->randomMachineName(8);
@@ -160,7 +160,7 @@ class BlockTest extends BlockTestBase {
/**
* Tests adding a block from the library page with a weight query string.
*/
- public function testAddBlockFromLibraryWithWeight() {
+ public function testAddBlockFromLibraryWithWeight(): void {
$default_theme = $this->config('system.theme')->get('default');
// Test one positive, zero, and one negative weight.
foreach (['7', '0', '-9'] as $weight) {
@@ -209,7 +209,7 @@ class BlockTest extends BlockTestBase {
/**
* Tests configuring and moving a module-define block to specific regions.
*/
- public function testBlock() {
+ public function testBlock(): void {
// Place page title block to test error messages.
$this->drupalPlaceBlock('page_title_block');
@@ -293,7 +293,7 @@ class BlockTest extends BlockTestBase {
/**
* Tests that the block form has a theme selector when not passed via the URL.
*/
- public function testBlockThemeSelector() {
+ public function testBlockThemeSelector(): void {
// Install all themes.
$themes = [
'olivero',
@@ -326,7 +326,7 @@ class BlockTest extends BlockTestBase {
/**
* Tests block display of theme titles.
*/
- public function testThemeName() {
+ public function testThemeName(): void {
// Enable the help block.
$this->drupalPlaceBlock('help_block', ['region' => 'help']);
$this->drupalPlaceBlock('local_tasks_block');
@@ -342,7 +342,7 @@ class BlockTest extends BlockTestBase {
/**
* Tests block title display settings.
*/
- public function testHideBlockTitle() {
+ public function testHideBlockTitle(): void {
$block_name = 'system_powered_by_block';
// Create a random title for the block.
$title = $this->randomMachineName(8);
@@ -426,7 +426,7 @@ class BlockTest extends BlockTestBase {
* - "block:<block ID>"
* - "block_plugin:<block plugin ID>"
*/
- public function testBlockCacheTags() {
+ public function testBlockCacheTags(): void {
// The page cache only works for anonymous users.
$this->drupalLogout();
@@ -535,7 +535,7 @@ class BlockTest extends BlockTestBase {
/**
* Tests that a link exists to block layout from the appearance form.
*/
- public function testThemeAdminLink() {
+ public function testThemeAdminLink(): void {
$this->drupalPlaceBlock('help_block', ['region' => 'help']);
$theme_admin = $this->drupalCreateUser([
'administer blocks',
@@ -551,7 +551,7 @@ class BlockTest extends BlockTestBase {
/**
* Tests that uninstalling a theme removes its block configuration.
*/
- public function testUninstallTheme() {
+ public function testUninstallTheme(): void {
/** @var \Drupal\Core\Extension\ThemeInstallerInterface $theme_installer */
$theme_installer = \Drupal::service('theme_installer');
@@ -571,7 +571,7 @@ class BlockTest extends BlockTestBase {
/**
* Tests the block access.
*/
- public function testBlockAccess() {
+ public function testBlockAccess(): void {
$this->drupalPlaceBlock('test_access', ['region' => 'help']);
$this->drupalGet('<front>');
@@ -585,7 +585,7 @@ class BlockTest extends BlockTestBase {
/**
* Tests block_user_role_delete.
*/
- public function testBlockUserRoleDelete() {
+ public function testBlockUserRoleDelete(): void {
$role1 = Role::create(['id' => 'test_role1', 'label' => 'Test role 1']);
$role1->save();
@@ -618,7 +618,7 @@ class BlockTest extends BlockTestBase {
/**
* Tests block title.
*/
- public function testBlockTitle() {
+ public function testBlockTitle(): void {
// Create a custom title for the block.
$title = "This block's <b>great!</b>";
// Enable a standard block.
diff --git a/core/modules/block/tests/src/Functional/BlockUiTest.php b/core/modules/block/tests/src/Functional/BlockUiTest.php
index aa3adda8e84..d555b20cdd3 100644
--- a/core/modules/block/tests/src/Functional/BlockUiTest.php
+++ b/core/modules/block/tests/src/Functional/BlockUiTest.php
@@ -95,7 +95,7 @@ class BlockUiTest extends BrowserTestBase {
/**
* Tests block demo page exists and functions correctly.
*/
- public function testBlockDemoUiPage() {
+ public function testBlockDemoUiPage(): void {
$this->drupalPlaceBlock('help_block', ['region' => 'help']);
$this->drupalGet('admin/structure/block');
$this->clickLink('Demonstrate block regions (Stark)');
@@ -129,7 +129,7 @@ class BlockUiTest extends BrowserTestBase {
/**
* Tests block admin page exists and functions correctly.
*/
- public function testBlockAdminUiPage() {
+ public function testBlockAdminUiPage(): void {
// Visit the blocks admin ui.
$this->drupalGet('admin/structure/block');
// Look for the blocks table.
@@ -192,7 +192,7 @@ class BlockUiTest extends BrowserTestBase {
/**
* Tests the block categories on the listing page.
*/
- public function testCandidateBlockList() {
+ public function testCandidateBlockList(): void {
$this->drupalGet('admin/structure/block');
$this->clickLink('Place block');
$this->assertSession()->elementExists('xpath', '//tr[.//td/div[text()="Display message"] and .//td[text()="Block test"] and .//td//a[contains(@href, "admin/structure/block/add/test_block_instantiation/stark")]]');
@@ -209,7 +209,7 @@ class BlockUiTest extends BrowserTestBase {
/**
* Tests the behavior of unsatisfied context-aware blocks.
*/
- public function testContextAwareUnsatisfiedBlocks() {
+ public function testContextAwareUnsatisfiedBlocks(): void {
$this->drupalGet('admin/structure/block');
$this->clickLink('Place block');
// Verify that the context-aware test block does not appear.
@@ -222,7 +222,7 @@ class BlockUiTest extends BrowserTestBase {
/**
* Tests the behavior of context-aware blocks.
*/
- public function testContextAwareBlocks() {
+ public function testContextAwareBlocks(): void {
$expected_text = '<div id="test_context_aware--username">' . \Drupal::currentUser()->getAccountName() . '</div>';
$this->drupalGet('');
$this->assertSession()->pageTextNotContains('Test context-aware block');
@@ -273,7 +273,7 @@ class BlockUiTest extends BrowserTestBase {
/**
* Tests that the BlockForm populates machine name correctly.
*/
- public function testMachineNameSuggestion() {
+ public function testMachineNameSuggestion(): void {
// Check the form uses the raw machine name suggestion when no instance
// already exists.
$url = 'admin/structure/block/add/test_block_instantiation/stark';
@@ -299,7 +299,7 @@ class BlockUiTest extends BrowserTestBase {
/**
* Tests the block placement indicator.
*/
- public function testBlockPlacementIndicator() {
+ public function testBlockPlacementIndicator(): void {
// Test the block placement indicator with using the domain as URL language
// indicator. This causes destination query parameters to be absolute URLs.
\Drupal::service('module_installer')->install(['language', 'locale']);
@@ -355,7 +355,7 @@ class BlockUiTest extends BrowserTestBase {
/**
* Tests if validation errors are passed plugin form to the parent form.
*/
- public function testBlockValidateErrors() {
+ public function testBlockValidateErrors(): void {
$this->drupalGet('admin/structure/block/add/test_settings_validation/stark');
$this->submitForm([
'region' => 'content',
@@ -369,7 +369,7 @@ class BlockUiTest extends BrowserTestBase {
/**
* Tests that the enable/disable routes are protected from CSRF.
*/
- public function testRouteProtection() {
+ public function testRouteProtection(): void {
// Get the first block generated in our setUp method.
/** @var \Drupal\block\BlockInterface $block */
$block = reset($this->blocks);
@@ -383,7 +383,7 @@ class BlockUiTest extends BrowserTestBase {
/**
* Tests that users without permission are not able to view broken blocks.
*/
- public function testBrokenBlockVisibility() {
+ public function testBrokenBlockVisibility(): void {
$assert_session = $this->assertSession();
$block = $this->drupalPlaceBlock('broken');
diff --git a/core/modules/block/tests/src/Functional/BlockXssTest.php b/core/modules/block/tests/src/Functional/BlockXssTest.php
index 28b68b465f6..cd9000af989 100644
--- a/core/modules/block/tests/src/Functional/BlockXssTest.php
+++ b/core/modules/block/tests/src/Functional/BlockXssTest.php
@@ -33,7 +33,7 @@ class BlockXssTest extends BrowserTestBase {
/**
* Tests that nothing is escaped other than the blocks explicitly tested.
*/
- public function testNoUnexpectedEscaping() {
+ public function testNoUnexpectedEscaping(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer blocks',
'access administration pages',
@@ -46,7 +46,7 @@ class BlockXssTest extends BrowserTestBase {
/**
* Tests XSS in title.
*/
- public function testXssInTitle() {
+ public function testXssInTitle(): void {
$this->container->get('module_installer')->install(['block_test']);
$this->drupalPlaceBlock('test_xss_title', ['label' => '<script>alert("XSS label");</script>']);
@@ -69,7 +69,7 @@ class BlockXssTest extends BrowserTestBase {
/**
* Tests XSS in category.
*/
- public function testXssInCategory() {
+ public function testXssInCategory(): void {
$this->container->get('module_installer')->install(['block_test']);
$this->drupalPlaceBlock('test_xss_title');
$this->drupalLogin($this->drupalCreateUser([
@@ -84,7 +84,7 @@ class BlockXssTest extends BrowserTestBase {
/**
* Tests various modules that provide blocks for XSS.
*/
- public function testBlockXss() {
+ public function testBlockXss(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer blocks',
'access administration pages',
diff --git a/core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php b/core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php
index 59f30144002..1c09346e247 100644
--- a/core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php
+++ b/core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php
@@ -37,7 +37,7 @@ class NonDefaultBlockAdminTest extends BrowserTestBase {
/**
* Tests non-default theme admin.
*/
- public function testNonDefaultBlockAdmin() {
+ public function testNonDefaultBlockAdmin(): void {
$admin_user = $this->drupalCreateUser([
'administer blocks',
'administer themes',
diff --git a/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php b/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php
index 4d74e8e494e..fc999957e00 100644
--- a/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php
+++ b/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php
@@ -63,7 +63,7 @@ class DisplayBlockTest extends ViewTestBase {
/**
* Tests default and content block categories.
*/
- public function testBlockCategory() {
+ public function testBlockCategory(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer views',
'administer blocks',
@@ -145,7 +145,7 @@ class DisplayBlockTest extends ViewTestBase {
/**
* Tests removing a block display.
*/
- public function testDeleteBlockDisplay() {
+ public function testDeleteBlockDisplay(): void {
// To test all combinations possible we first place create two instances
// of the block display of the first view.
$block_1 = $this->drupalPlaceBlock('views_block:test_view_block-block_1', ['label' => 'test_view_block-block_1:1']);
@@ -198,7 +198,7 @@ class DisplayBlockTest extends ViewTestBase {
/**
* Tests the block form for a Views block.
*/
- public function testViewsBlockForm() {
+ public function testViewsBlockForm(): void {
$this->drupalLogin($this->drupalCreateUser(['administer blocks']));
$default_theme = $this->config('system.theme')->get('default');
$this->drupalGet('admin/structure/block/add/views_block:test_view_block-block_1/' . $default_theme);
@@ -262,7 +262,7 @@ class DisplayBlockTest extends ViewTestBase {
/**
* Tests the actual rendering of the views block.
*/
- public function testBlockRendering() {
+ public function testBlockRendering(): void {
// Create a block and set a custom title.
$block = $this->drupalPlaceBlock('views_block:test_view_block-block_1', [
'label' => 'test_view_block-block_1:1',
@@ -296,7 +296,7 @@ class DisplayBlockTest extends ViewTestBase {
/**
* Tests the various test cases of empty block rendering.
*/
- public function testBlockEmptyRendering() {
+ public function testBlockEmptyRendering(): void {
$url = new Url('test_page_test.test_page');
// Remove all views_test_data entries.
\Drupal::database()->truncate('views_test_data')->execute();
@@ -379,7 +379,7 @@ class DisplayBlockTest extends ViewTestBase {
/**
* Tests the contextual links on a Views block.
*/
- public function testBlockContextualLinks() {
+ public function testBlockContextualLinks(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer views',
'access contextual links',
diff --git a/core/modules/block/tests/src/FunctionalJavascript/BlockAddTest.php b/core/modules/block/tests/src/FunctionalJavascript/BlockAddTest.php
index 66570a8ff9b..595b5ed6877 100644
--- a/core/modules/block/tests/src/FunctionalJavascript/BlockAddTest.php
+++ b/core/modules/block/tests/src/FunctionalJavascript/BlockAddTest.php
@@ -29,7 +29,7 @@ class BlockAddTest extends WebDriverTestBase {
/**
* Tests the AJAX for the theme selector.
*/
- public function testBlockAddThemeSelector() {
+ public function testBlockAddThemeSelector(): void {
\Drupal::service('theme_installer')->install(['claro']);
$this->drupalLogin($this->drupalCreateUser([
diff --git a/core/modules/block/tests/src/FunctionalJavascript/BlockContextualLinksTest.php b/core/modules/block/tests/src/FunctionalJavascript/BlockContextualLinksTest.php
index d5490c91d23..c425731e844 100644
--- a/core/modules/block/tests/src/FunctionalJavascript/BlockContextualLinksTest.php
+++ b/core/modules/block/tests/src/FunctionalJavascript/BlockContextualLinksTest.php
@@ -50,7 +50,7 @@ class BlockContextualLinksTest extends WebDriverTestBase {
/**
* Test that remove/configure contextual links are present in the block.
*/
- public function testBlockContextualRemoveLinks() {
+ public function testBlockContextualRemoveLinks(): void {
$this->drupalGet('<front>');
$contextual_id = "[data-contextual-id^='block:block=$this->blockId:langcode=en']";
$this->assertSession()->waitForElement('css', "$contextual_id .contextual-links");
diff --git a/core/modules/block/tests/src/FunctionalJavascript/BlockDragTest.php b/core/modules/block/tests/src/FunctionalJavascript/BlockDragTest.php
index 2bb94851ad3..7c098a4082f 100644
--- a/core/modules/block/tests/src/FunctionalJavascript/BlockDragTest.php
+++ b/core/modules/block/tests/src/FunctionalJavascript/BlockDragTest.php
@@ -37,7 +37,7 @@ class BlockDragTest extends WebDriverTestBase {
/**
* Tests drag and drop blocks.
*/
- public function testDragAndDropBlocks() {
+ public function testDragAndDropBlocks(): void {
// Resize window to work around https://github.com/bitovi/syn/issues/164.
$this->getSession()->resizeWindow(1024, 2048);
$this->drupalGet('admin/structure/block');
diff --git a/core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php b/core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php
index fd7baaffa05..bf511af086e 100644
--- a/core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php
+++ b/core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php
@@ -40,7 +40,7 @@ class BlockFilterTest extends WebDriverTestBase {
/**
* Tests block filter.
*/
- public function testBlockFilter() {
+ public function testBlockFilter(): void {
$this->drupalGet('admin/structure/block');
$assertSession = $this->assertSession();
$session = $this->getSession();
diff --git a/core/modules/block/tests/src/Kernel/BlockConfigSchemaTest.php b/core/modules/block/tests/src/Kernel/BlockConfigSchemaTest.php
index 1f4e74b6915..8b2ead48eda 100644
--- a/core/modules/block/tests/src/Kernel/BlockConfigSchemaTest.php
+++ b/core/modules/block/tests/src/Kernel/BlockConfigSchemaTest.php
@@ -63,7 +63,7 @@ class BlockConfigSchemaTest extends KernelTestBase {
/**
* Tests the block config schema for block plugins.
*/
- public function testBlockConfigSchema() {
+ public function testBlockConfigSchema(): void {
foreach ($this->blockManager->getDefinitions() as $block_id => $definition) {
$id = $this->randomMachineName();
$block = Block::create([
diff --git a/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php b/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php
index f08150a50b1..f74a05864f5 100644
--- a/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php
+++ b/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php
@@ -33,7 +33,7 @@ class BlockInterfaceTest extends KernelTestBase {
* subsequent method calls are just attempting to cause a failure if a
* dependency outside of the plugin configuration is required.
*/
- public function testBlockInterface() {
+ public function testBlockInterface(): void {
$manager = $this->container->get('plugin.manager.block');
$configuration = [
'label' => 'Custom Display Message',
diff --git a/core/modules/block/tests/src/Kernel/BlockRebuildTest.php b/core/modules/block/tests/src/Kernel/BlockRebuildTest.php
index 86ba21fd851..cd5b0427e67 100644
--- a/core/modules/block/tests/src/Kernel/BlockRebuildTest.php
+++ b/core/modules/block/tests/src/Kernel/BlockRebuildTest.php
@@ -47,7 +47,7 @@ class BlockRebuildTest extends KernelTestBase {
/**
* @covers ::block_rebuild
*/
- public function testRebuildNoBlocks() {
+ public function testRebuildNoBlocks(): void {
block_rebuild();
$messages = \Drupal::messenger()->all();
\Drupal::messenger()->deleteAll();
@@ -57,7 +57,7 @@ class BlockRebuildTest extends KernelTestBase {
/**
* @covers ::block_rebuild
*/
- public function testRebuildNoInvalidBlocks() {
+ public function testRebuildNoInvalidBlocks(): void {
$this->placeBlock('system_powered_by_block', ['region' => 'content']);
block_rebuild();
@@ -69,7 +69,7 @@ class BlockRebuildTest extends KernelTestBase {
/**
* @covers ::block_rebuild
*/
- public function testRebuildInvalidBlocks() {
+ public function testRebuildInvalidBlocks(): void {
$this->placeBlock('system_powered_by_block', ['region' => 'content']);
$block1 = $this->placeBlock('system_powered_by_block');
$block2 = $this->placeBlock('system_powered_by_block');
diff --git a/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php b/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php
index 56514131665..a77450f5470 100644
--- a/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php
+++ b/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php
@@ -46,7 +46,7 @@ class BlockStorageUnitTest extends KernelTestBase {
/**
* Tests CRUD operations.
*/
- public function testBlockCRUD() {
+ public function testBlockCRUD(): void {
$this->assertInstanceOf(ConfigEntityStorage::class, $this->controller);
// Run each test method in the same installation.
@@ -147,7 +147,7 @@ class BlockStorageUnitTest extends KernelTestBase {
/**
* Tests the installation of default blocks.
*/
- public function testDefaultBlocks() {
+ public function testDefaultBlocks(): void {
\Drupal::service('theme_installer')->install(['stark']);
$entities = $this->controller->loadMultiple();
$this->assertEmpty($entities, 'There are no blocks initially.');
diff --git a/core/modules/block/tests/src/Kernel/BlockTemplateSuggestionsTest.php b/core/modules/block/tests/src/Kernel/BlockTemplateSuggestionsTest.php
index c3f21790ed4..049b9f74ccc 100644
--- a/core/modules/block/tests/src/Kernel/BlockTemplateSuggestionsTest.php
+++ b/core/modules/block/tests/src/Kernel/BlockTemplateSuggestionsTest.php
@@ -25,7 +25,7 @@ class BlockTemplateSuggestionsTest extends KernelTestBase {
/**
* Tests template suggestions from block_theme_suggestions_block().
*/
- public function testBlockThemeHookSuggestions() {
+ public function testBlockThemeHookSuggestions(): void {
$this->installConfig(['system']);
// Create a block using a plugin with derivative to be preprocessed.
diff --git a/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php b/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
index 2f09a31d0a9..ef87c818578 100644
--- a/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
+++ b/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
@@ -74,7 +74,7 @@ class BlockViewBuilderTest extends KernelTestBase {
/**
* Tests the rendering of blocks.
*/
- public function testBasicRendering() {
+ public function testBasicRendering(): void {
\Drupal::state()->set('block_test.content', '');
$entity = $this->controller->create([
@@ -127,7 +127,7 @@ class BlockViewBuilderTest extends KernelTestBase {
/**
* Tests block render cache handling.
*/
- public function testBlockViewBuilderCache() {
+ public function testBlockViewBuilderCache(): void {
// Verify cache handling for a non-empty block.
$this->verifyRenderCacheHandling();
@@ -191,7 +191,7 @@ class BlockViewBuilderTest extends KernelTestBase {
* @see hook_block_view_alter()
* @see hook_block_view_BASE_BLOCK_ID_alter()
*/
- public function testBlockViewBuilderViewAlter() {
+ public function testBlockViewBuilderViewAlter(): void {
// Establish baseline.
$build = $this->getBlockRenderArray();
$this->setRawContent((string) $this->renderer->renderRoot($build));
@@ -225,7 +225,7 @@ class BlockViewBuilderTest extends KernelTestBase {
* @see hook_block_build_alter()
* @see hook_block_build_BASE_BLOCK_ID_alter()
*/
- public function testBlockViewBuilderBuildAlter() {
+ public function testBlockViewBuilderBuildAlter(): void {
// Force a request via GET so we can test the render cache.
$request = \Drupal::request();
$request_method = $request->server->get('REQUEST_METHOD');
diff --git a/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockContentTranslationTest.php b/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockContentTranslationTest.php
index bf628ebabeb..8fd9422428d 100644
--- a/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockContentTranslationTest.php
+++ b/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockContentTranslationTest.php
@@ -55,7 +55,7 @@ class MigrateBlockContentTranslationTest extends MigrateDrupal6TestBase {
/**
* Tests the migration of block title translation.
*/
- public function testBlockContentTranslation() {
+ public function testBlockContentTranslation(): void {
/** @var \Drupal\language\ConfigurableLanguageManagerInterface $language_manager */
$language_manager = $this->container->get('language_manager');
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 c0edc533de2..310b7aca41c 100644
--- a/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php
+++ b/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php
@@ -95,7 +95,7 @@ class MigrateBlockTest extends MigrateDrupal6TestBase {
/**
* Tests the block migration.
*/
- public function testBlockMigration() {
+ public function testBlockMigration(): void {
$blocks = Block::loadMultiple();
$this->assertCount(25, $blocks);
diff --git a/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php
index bd7dd6c2c09..62b43807603 100644
--- a/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php
+++ b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php
@@ -59,7 +59,7 @@ class MigrateBlockContentTranslationTest extends MigrateDrupal7TestBase {
/**
* Tests the migration of block title translation.
*/
- public function testBlockContentTranslation() {
+ public function testBlockContentTranslation(): void {
// @todo Skipped due to frequent random test failures.
// See https://www.drupal.org/project/drupal/issues/3389365
$this->markTestSkipped();
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 0578aad80c3..2ef460b60f5 100644
--- a/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php
+++ b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php
@@ -115,7 +115,7 @@ class MigrateBlockTest extends MigrateDrupal7TestBase {
/**
* Tests the block migration.
*/
- public function testBlockMigration() {
+ public function testBlockMigration(): void {
$this->assertEntity('bartik_system_main', 'system_main_block', [], '', 'content', 'olivero', 0, '', '0');
$this->assertEntity('bartik_search_form', 'search_form_block', [], '', 'content', 'olivero', -1, '', '0');
$this->assertEntity('bartik_user_login', 'user_login_block', [], '', 'content', 'olivero', 0, 'User login title', 'visible');
diff --git a/core/modules/block/tests/src/Kernel/NewDefaultThemeBlocksTest.php b/core/modules/block/tests/src/Kernel/NewDefaultThemeBlocksTest.php
index 3e3637e7008..51be75bc945 100644
--- a/core/modules/block/tests/src/Kernel/NewDefaultThemeBlocksTest.php
+++ b/core/modules/block/tests/src/Kernel/NewDefaultThemeBlocksTest.php
@@ -52,7 +52,7 @@ class NewDefaultThemeBlocksTest extends KernelTestBase {
/**
* Check the blocks are correctly copied by block_themes_installed().
*/
- public function testNewDefaultThemeBlocks() {
+ public function testNewDefaultThemeBlocks(): void {
$default_theme = $this->defaultTheme;
$theme_installer = $this->themeInstaller;
$theme_installer->install([$default_theme]);
@@ -115,7 +115,7 @@ class NewDefaultThemeBlocksTest extends KernelTestBase {
/**
* Checks that a theme block is still created when same ID exists.
*/
- public function testBlockCollision() {
+ public function testBlockCollision(): void {
$default_theme = $this->defaultTheme;
$theme_installer = $this->themeInstaller;
$theme_installer->install([$default_theme]);
diff --git a/core/modules/block/tests/src/Unit/BlockConfigEntityUnitTest.php b/core/modules/block/tests/src/Unit/BlockConfigEntityUnitTest.php
index b12f180a703..ddea9a72d0b 100644
--- a/core/modules/block/tests/src/Unit/BlockConfigEntityUnitTest.php
+++ b/core/modules/block/tests/src/Unit/BlockConfigEntityUnitTest.php
@@ -94,7 +94,7 @@ class BlockConfigEntityUnitTest extends UnitTestCase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependencies() {
+ public function testCalculateDependencies(): void {
$this->themeHandler->themeExists('stark')->willReturn(TRUE);
$values = ['theme' => 'stark'];
// Mock the entity under test so that we can mock getPluginCollections().
diff --git a/core/modules/block/tests/src/Unit/BlockFormTest.php b/core/modules/block/tests/src/Unit/BlockFormTest.php
index 73edd5b4cf2..093652dffe8 100644
--- a/core/modules/block/tests/src/Unit/BlockFormTest.php
+++ b/core/modules/block/tests/src/Unit/BlockFormTest.php
@@ -142,7 +142,7 @@ class BlockFormTest extends UnitTestCase {
*
* @see \Drupal\block\BlockForm::getUniqueMachineName()
*/
- public function testGetUniqueMachineName() {
+ public function testGetUniqueMachineName(): void {
$blocks = [];
$blocks['test'] = $this->getBlockMockWithMachineName('test');
diff --git a/core/modules/block/tests/src/Unit/BlockRepositoryTest.php b/core/modules/block/tests/src/Unit/BlockRepositoryTest.php
index 15ac1c718fb..4d36f8aa36c 100644
--- a/core/modules/block/tests/src/Unit/BlockRepositoryTest.php
+++ b/core/modules/block/tests/src/Unit/BlockRepositoryTest.php
@@ -78,7 +78,7 @@ class BlockRepositoryTest extends UnitTestCase {
*
* @dataProvider providerBlocksConfig
*/
- public function testGetVisibleBlocksPerRegion(array $blocks_config, array $expected_blocks) {
+ public function testGetVisibleBlocksPerRegion(array $blocks_config, array $expected_blocks): void {
$blocks = [];
foreach ($blocks_config as $block_id => $block_config) {
$block = $this->createMock('Drupal\block\BlockInterface');
@@ -149,7 +149,7 @@ class BlockRepositoryTest extends UnitTestCase {
*
* @covers ::getVisibleBlocksPerRegion
*/
- public function testGetVisibleBlocksPerRegionWithContext() {
+ public function testGetVisibleBlocksPerRegionWithContext(): void {
$block = $this->createMock('Drupal\block\BlockInterface');
$block->expects($this->once())
->method('access')
diff --git a/core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php b/core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php
index f54c2a90775..79802e1e376 100644
--- a/core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php
+++ b/core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php
@@ -48,7 +48,7 @@ class CategoryAutocompleteTest extends UnitTestCase {
*
* @dataProvider providerTestAutocompleteSuggestions
*/
- public function testAutocompleteSuggestions($string, $suggestions) {
+ public function testAutocompleteSuggestions($string, $suggestions): void {
$suggestions = array_map(function ($suggestion) {
return ['value' => $suggestion, 'label' => Html::escape($suggestion)];
}, $suggestions);
diff --git a/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php b/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php
index 52e28bc45b9..50f34b4f653 100644
--- a/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php
+++ b/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php
@@ -67,7 +67,7 @@ class BlockLocalTasksTest extends LocalTaskIntegrationTestBase {
/**
* Tests the admin edit local task.
*/
- public function testBlockAdminLocalTasks() {
+ public function testBlockAdminLocalTasks(): void {
$this->assertLocalTasks('entity.block.edit_form', [['entity.block.edit_form']]);
}
@@ -76,7 +76,7 @@ class BlockLocalTasksTest extends LocalTaskIntegrationTestBase {
*
* @dataProvider providerTestBlockAdminDisplay
*/
- public function testBlockAdminDisplay($route, $expected) {
+ public function testBlockAdminDisplay($route, $expected): void {
$this->assertLocalTasks($route, $expected);
}
diff --git a/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/BlockPageVariantTest.php b/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/BlockPageVariantTest.php
index 4604f8b69d1..d9648265184 100644
--- a/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/BlockPageVariantTest.php
+++ b/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/BlockPageVariantTest.php
@@ -201,7 +201,7 @@ class BlockPageVariantTest extends UnitTestCase {
*
* @dataProvider providerBuild
*/
- public function testBuild(array $blocks_config, $visible_block_count, array $expected_render_array) {
+ public function testBuild(array $blocks_config, $visible_block_count, array $expected_render_array): void {
$display_variant = $this->setUpDisplayVariant();
$display_variant->setMainContent(['#markup' => 'Hello kittens!']);
@@ -236,7 +236,7 @@ class BlockPageVariantTest extends UnitTestCase {
*
* @covers ::build
*/
- public function testBuildWithoutMainContent() {
+ public function testBuildWithoutMainContent(): void {
$display_variant = $this->setUpDisplayVariant();
$this->blockRepository->expects($this->once())
->method('getVisibleBlocksPerRegion')
diff --git a/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockRegionTest.php b/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockRegionTest.php
index bde7c734d4e..e63737b5049 100644
--- a/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockRegionTest.php
+++ b/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockRegionTest.php
@@ -57,7 +57,7 @@ class BlockRegionTest extends UnitTestCase {
*
* @covers ::transform
*/
- public function testTransformSameThemeRegionExists() {
+ public function testTransformSameThemeRegionExists(): void {
$this->assertSame('triptych_second', $this->transform(['bartik', 'bartik', 'triptych_middle']));
}
@@ -69,7 +69,7 @@ class BlockRegionTest extends UnitTestCase {
*
* @covers ::transform
*/
- public function testTransformSameThemeRegionNotExists() {
+ public function testTransformSameThemeRegionNotExists(): void {
$this->assertSame('content', $this->transform(['bartik', 'bartik', 'footer']));
}
diff --git a/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockSettingsTest.php b/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockSettingsTest.php
index 38a14531fdb..c8d209d1ca7 100644
--- a/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockSettingsTest.php
+++ b/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockSettingsTest.php
@@ -27,7 +27,7 @@ class BlockSettingsTest extends UnitTestCase {
*
* @dataProvider providerTestTransform
*/
- public function testTransform($value, $expected) {
+ public function testTransform($value, $expected): void {
$executable = $this->prophesize(MigrateExecutableInterface::class)
->reveal();
$row = $this->prophesize(Row::class)->reveal();
diff --git a/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockVisibilityTest.php b/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockVisibilityTest.php
index f8f939aeae0..e88ca8cdf59 100644
--- a/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockVisibilityTest.php
+++ b/core/modules/block/tests/src/Unit/Plugin/migrate/process/BlockVisibilityTest.php
@@ -40,7 +40,7 @@ class BlockVisibilityTest extends MigrateProcessTestCase {
/**
* @covers ::transform
*/
- public function testTransformNoData() {
+ public function testTransformNoData(): void {
$transformed_value = $this->plugin->transform([0, '', []], $this->migrateExecutable, $this->row, 'destination_property');
$this->assertEmpty($transformed_value);
}
@@ -48,7 +48,7 @@ class BlockVisibilityTest extends MigrateProcessTestCase {
/**
* @covers ::transform
*/
- public function testTransformSinglePageWithFront() {
+ public function testTransformSinglePageWithFront(): void {
$visibility = $this->plugin->transform([0, '<front>', []], $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame('request_path', $visibility['request_path']['id']);
$this->assertTrue($visibility['request_path']['negate']);
@@ -58,7 +58,7 @@ class BlockVisibilityTest extends MigrateProcessTestCase {
/**
* @covers ::transform
*/
- public function testTransformMultiplePagesWithFront() {
+ public function testTransformMultiplePagesWithFront(): void {
$visibility = $this->plugin->transform([1, "foo\n/bar\rbaz\r\n<front>", []], $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame('request_path', $visibility['request_path']['id']);
$this->assertFalse($visibility['request_path']['negate']);
@@ -68,7 +68,7 @@ class BlockVisibilityTest extends MigrateProcessTestCase {
/**
* @covers ::transform
*/
- public function testTransformPhpEnabled() {
+ public function testTransformPhpEnabled(): void {
$this->moduleHandler->moduleExists('php')->willReturn(TRUE);
$visibility = $this->plugin->transform([2, '<?php', []], $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame('php', $visibility['php']['id']);
@@ -79,7 +79,7 @@ class BlockVisibilityTest extends MigrateProcessTestCase {
/**
* @covers ::transform
*/
- public function testTransformPhpDisabled() {
+ public function testTransformPhpDisabled(): void {
$this->moduleHandler->moduleExists('php')->willReturn(FALSE);
$transformed_value = $this->plugin->transform([2, '<?php', []], $this->migrateExecutable, $this->row, 'destination_property');
$this->assertEmpty($transformed_value);
@@ -88,7 +88,7 @@ class BlockVisibilityTest extends MigrateProcessTestCase {
/**
* @covers ::transform
*/
- public function testTransformException() {
+ public function testTransformException(): void {
$this->moduleHandler->moduleExists('php')->willReturn(FALSE);
$migrate_lookup = $this->prophesize(MigrateLookupInterface::class);
$this->row = $this->getMockBuilder('Drupal\migrate\Row')
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php b/core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php
index 5079d2abe40..b8a01bca98f 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php
@@ -75,7 +75,7 @@ class BlockContentCacheTagsTest extends EntityCacheTagsTestBase {
/**
* Tests that the block is cached with the correct contexts and tags.
*/
- public function testBlock() {
+ public function testBlock(): void {
$block = $this->drupalPlaceBlock('block_content:' . $this->entity->uuid());
$build = $this->container->get('entity_type.manager')->getViewBuilder('block')->view($block, 'block');
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentContextualLinksTest.php b/core/modules/block_content/tests/src/Functional/BlockContentContextualLinksTest.php
index 75759b2c171..c01a2ff0770 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentContextualLinksTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentContextualLinksTest.php
@@ -26,7 +26,7 @@ class BlockContentContextualLinksTest extends BlockContentTestBase {
/**
* Tests contextual links.
*/
- public function testBlockContentContextualLinks() {
+ public function testBlockContentContextualLinks(): void {
$block_content = $this->createBlockContent();
$block = $this->placeBlock('block_content:' . $block_content->uuid());
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
index 34a830fbb49..36cf12e2a9b 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
@@ -53,7 +53,7 @@ class BlockContentCreationTest extends BlockContentTestBase {
/**
* Creates a "Basic block" block and verifies its consistency in the database.
*/
- public function testBlockContentCreation() {
+ public function testBlockContentCreation(): void {
$this->drupalLogin($this->adminUser);
// Create a block.
@@ -77,7 +77,7 @@ class BlockContentCreationTest extends BlockContentTestBase {
/**
* Creates a "Basic page" block with multiple view modes.
*/
- public function testBlockContentCreationMultipleViewModes() {
+ public function testBlockContentCreationMultipleViewModes(): void {
// Add a new view mode and verify if it is selected as expected.
$this->drupalLogin($this->drupalCreateUser(['administer display modes']));
$this->drupalGet('admin/structure/display-modes/view/add/block_content');
@@ -140,7 +140,7 @@ class BlockContentCreationTest extends BlockContentTestBase {
/**
* Tests the redirect workflow of creating a block_content and block.
*/
- public function testBlockContentFormSubmitHandlers() {
+ public function testBlockContentFormSubmitHandlers(): void {
$this->drupalLogin($this->adminUser);
// Create a block and place in block layout.
@@ -193,7 +193,7 @@ class BlockContentCreationTest extends BlockContentTestBase {
* Creates a content block from defaults and ensures that the 'basic block'
* type is being used.
*/
- public function testDefaultBlockContentCreation() {
+ public function testDefaultBlockContentCreation(): void {
$edit = [];
$edit['info[0][value]'] = $this->randomMachineName(8);
$edit['body[0][value]'] = $this->randomMachineName(16);
@@ -212,7 +212,7 @@ class BlockContentCreationTest extends BlockContentTestBase {
/**
* Verifies that a transaction rolls back the failed creation.
*/
- public function testFailedBlockCreation() {
+ public function testFailedBlockCreation(): void {
// Create a block.
try {
$this->createBlockContent('fail_creation');
@@ -236,7 +236,7 @@ class BlockContentCreationTest extends BlockContentTestBase {
/**
* Tests deleting a block.
*/
- public function testBlockDelete() {
+ public function testBlockDelete(): void {
// Create a block.
$edit = [];
$edit['info[0][value]'] = $this->randomMachineName(8);
@@ -299,7 +299,7 @@ class BlockContentCreationTest extends BlockContentTestBase {
/**
* Tests placed content blocks create a dependency in the block placement.
*/
- public function testConfigDependencies() {
+ public function testConfigDependencies(): void {
$block = $this->createBlockContent();
// Place the block.
$block_placement_id = mb_strtolower($block->label());
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentListTest.php b/core/modules/block_content/tests/src/Functional/BlockContentListTest.php
index 9e7930a380a..58ddfe6686e 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentListTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentListTest.php
@@ -90,7 +90,7 @@ class BlockContentListTest extends BlockContentTestBase {
/**
* Tests the content block listing page with different permissions.
*/
- public function testListing() {
+ public function testListing(): void {
// Test with the admin user.
$this->drupalLogin($this->drupalCreateUser(['access block library', 'administer block content']));
$this->drupalGet('admin/content/block');
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php b/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php
index 666a8e5fcdd..09a6912e3b8 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php
@@ -77,7 +77,7 @@ class BlockContentListViewsTest extends BlockContentTestBase {
/**
* Tests the content block listing page.
*/
- public function testListing() {
+ public function testListing(): void {
// Test with an admin user.
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/content/block');
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentPageViewTest.php b/core/modules/block_content/tests/src/Functional/BlockContentPageViewTest.php
index 87c59d6e0ae..1c55c23bef9 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentPageViewTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentPageViewTest.php
@@ -26,7 +26,7 @@ class BlockContentPageViewTest extends BlockContentTestBase {
/**
* Checks block edit and fallback functionality.
*/
- public function testPageEdit() {
+ public function testPageEdit(): void {
$this->drupalLogin($this->adminUser);
$block = $this->createBlockContent();
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php b/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php
index 756ebbb8c2d..a58d770221b 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php
@@ -66,7 +66,7 @@ class BlockContentRevisionsTest extends BlockContentTestBase {
/**
* Checks block revision related operations.
*/
- public function testRevisions() {
+ public function testRevisions(): void {
$blocks = $this->blocks;
$logs = $this->revisionLogs;
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentSaveTest.php b/core/modules/block_content/tests/src/Functional/BlockContentSaveTest.php
index cedd793d81a..e70aa7514f2 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentSaveTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentSaveTest.php
@@ -37,7 +37,7 @@ class BlockContentSaveTest extends BlockContentTestBase {
/**
* Checks whether content block IDs are saved properly during an import.
*/
- public function testImport() {
+ public function testImport(): void {
// Content block ID must be a number that is not in the database.
$max_id = (int) \Drupal::entityQueryAggregate('block_content')
->accessCheck(FALSE)
@@ -69,7 +69,7 @@ class BlockContentSaveTest extends BlockContentTestBase {
*
* Verifies the static block load cache is cleared upon save.
*/
- public function testDeterminingChanges() {
+ public function testDeterminingChanges(): void {
// Initial creation.
$block = $this->createBlockContent('test_changes');
// Creating a block should set the changed date to the current time
@@ -104,7 +104,7 @@ class BlockContentSaveTest extends BlockContentTestBase {
*
* @see block_test_block_insert()
*/
- public function testBlockContentSaveOnInsert() {
+ public function testBlockContentSaveOnInsert(): void {
// block_content_test_block_content_insert() triggers a save on insert if the
// title equals 'new'.
$block = $this->createBlockContent('new');
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php b/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php
index 1881608ea79..0f355b91218 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php
@@ -62,7 +62,7 @@ class BlockContentTypeTest extends BlockContentTestBase {
/**
* Tests the order of the block content types on the add page.
*/
- public function testBlockContentAddPageOrder() {
+ public function testBlockContentAddPageOrder(): void {
$this->createBlockContentType(['id' => 'bundle_1', 'label' => 'Bundle 1']);
$this->createBlockContentType(['id' => 'bundle_2', 'label' => 'Aaa Bundle 2']);
$this->drupalLogin($this->adminUser);
@@ -73,7 +73,7 @@ class BlockContentTypeTest extends BlockContentTestBase {
/**
* Tests creating a block type programmatically and via a form.
*/
- public function testBlockContentTypeCreation() {
+ public function testBlockContentTypeCreation(): void {
// Log in a test user.
$this->drupalLogin($this->adminUser);
@@ -122,7 +122,7 @@ class BlockContentTypeTest extends BlockContentTestBase {
/**
* Tests editing a block type using the UI.
*/
- public function testBlockContentTypeEditing() {
+ public function testBlockContentTypeEditing(): void {
$this->drupalPlaceBlock('system_breadcrumb_block');
// Now create an initial block-type.
$this->createBlockContentType('basic', TRUE);
@@ -174,7 +174,7 @@ class BlockContentTypeTest extends BlockContentTestBase {
/**
* Tests deleting a block type that still has content.
*/
- public function testBlockContentTypeDeletion() {
+ public function testBlockContentTypeDeletion(): void {
// Now create an initial block-type.
$this->createBlockContentType('basic', TRUE);
@@ -201,7 +201,7 @@ class BlockContentTypeTest extends BlockContentTestBase {
/**
* Tests that redirects work as expected when multiple block types exist.
*/
- public function testsBlockContentAddTypes() {
+ public function testsBlockContentAddTypes(): void {
// Now create an initial block-type.
$this->createBlockContentType('basic', TRUE);
diff --git a/core/modules/block_content/tests/src/Functional/PageEditTest.php b/core/modules/block_content/tests/src/Functional/PageEditTest.php
index 6301ce26ca4..0c61afd8751 100644
--- a/core/modules/block_content/tests/src/Functional/PageEditTest.php
+++ b/core/modules/block_content/tests/src/Functional/PageEditTest.php
@@ -34,7 +34,7 @@ class PageEditTest extends BlockContentTestBase {
/**
* Checks block edit functionality.
*/
- public function testPageEdit() {
+ public function testPageEdit(): void {
$this->drupalLogin($this->adminUser);
$title_key = 'info[0][value]';
diff --git a/core/modules/block_content/tests/src/Functional/UnpublishedBlockTest.php b/core/modules/block_content/tests/src/Functional/UnpublishedBlockTest.php
index 9d7b50dea14..202ff2f9811 100644
--- a/core/modules/block_content/tests/src/Functional/UnpublishedBlockTest.php
+++ b/core/modules/block_content/tests/src/Functional/UnpublishedBlockTest.php
@@ -30,7 +30,7 @@ class UnpublishedBlockTest extends BrowserTestBase {
/**
* Tests unpublishing of block_content entities.
*/
- public function testViewShowsCorrectStates() {
+ public function testViewShowsCorrectStates(): void {
$block_content = BlockContent::create([
'info' => 'Test block',
'type' => 'basic',
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 de54116e1fc..674e9992386 100644
--- a/core/modules/block_content/tests/src/Functional/Views/BlockContentFieldFilterTest.php
+++ b/core/modules/block_content/tests/src/Functional/Views/BlockContentFieldFilterTest.php
@@ -73,7 +73,7 @@ class BlockContentFieldFilterTest extends BlockContentTestBase {
/**
* Tests body and info filters.
*/
- public function testFilters() {
+ public function testFilters(): void {
// Test the info filter page, which filters for info contains 'Comida'.
// Should show just the Spanish translation, once.
$this->assertPageCounts('test-info-filter', ['es' => 1, 'fr' => 0, 'en' => 0], 'Comida info filter');
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 832e3ab65e6..ec22ec4bfe9 100644
--- a/core/modules/block_content/tests/src/Functional/Views/BlockContentIntegrationTest.php
+++ b/core/modules/block_content/tests/src/Functional/Views/BlockContentIntegrationTest.php
@@ -26,7 +26,7 @@ class BlockContentIntegrationTest extends BlockContentTestBase {
/**
* Tests basic block_content view with a block_content_type argument.
*/
- public function testBlockContentViewTypeArgument() {
+ public function testBlockContentViewTypeArgument(): void {
// Create two content types with three block_contents each.
$types = [];
$all_ids = [];
diff --git a/core/modules/block_content/tests/src/Functional/Views/BlockContentRedirectTest.php b/core/modules/block_content/tests/src/Functional/Views/BlockContentRedirectTest.php
index 3708785da94..78da976346b 100644
--- a/core/modules/block_content/tests/src/Functional/Views/BlockContentRedirectTest.php
+++ b/core/modules/block_content/tests/src/Functional/Views/BlockContentRedirectTest.php
@@ -33,7 +33,7 @@ class BlockContentRedirectTest extends BlockContentTestBase {
/**
* Tests the redirect destination when editing block content.
*/
- public function testRedirectDestination() {
+ public function testRedirectDestination(): void {
$this->drupalLogin($this->drupalCreateUser(['access block library', 'administer block content']));
$this->drupalGet('admin/content/block');
diff --git a/core/modules/block_content/tests/src/Functional/Views/BlockContentWizardTest.php b/core/modules/block_content/tests/src/Functional/Views/BlockContentWizardTest.php
index d3088b02f8a..662f99dd0c0 100644
--- a/core/modules/block_content/tests/src/Functional/Views/BlockContentWizardTest.php
+++ b/core/modules/block_content/tests/src/Functional/Views/BlockContentWizardTest.php
@@ -34,7 +34,7 @@ class BlockContentWizardTest extends BlockContentTestBase {
/**
* Tests creating a 'block_content' entity view.
*/
- public function testViewAddBlockContent() {
+ public function testViewAddBlockContent(): void {
$view = [];
$view['label'] = $this->randomMachineName(16);
$view['id'] = $this->randomMachineName(16);
diff --git a/core/modules/block_content/tests/src/Kernel/BlockContentAccessHandlerTest.php b/core/modules/block_content/tests/src/Kernel/BlockContentAccessHandlerTest.php
index f6a50be88cc..6252aa73615 100644
--- a/core/modules/block_content/tests/src/Kernel/BlockContentAccessHandlerTest.php
+++ b/core/modules/block_content/tests/src/Kernel/BlockContentAccessHandlerTest.php
@@ -136,7 +136,7 @@ class BlockContentAccessHandlerTest extends KernelTestBase {
* @phpstan-param class-string<\Drupal\Core\Access\AccessResultInterface>|null $parent_access
* @phpstan-param class-string<\Drupal\Core\Access\AccessResultInterface> $expected_access
*/
- public function testAccess(string $operation, bool $published, bool $reusable, array $permissions, bool $isLatest, ?string $parent_access, string $expected_access, ?string $expected_access_message = NULL) {
+ public function testAccess(string $operation, bool $published, bool $reusable, array $permissions, bool $isLatest, ?string $parent_access, string $expected_access, ?string $expected_access_message = NULL): void {
/** @var \Drupal\Core\Entity\RevisionableStorageInterface $entityStorage */
$entityStorage = \Drupal::entityTypeManager()->getStorage('block_content');
diff --git a/core/modules/block_content/tests/src/Kernel/BlockContentDeletionTest.php b/core/modules/block_content/tests/src/Kernel/BlockContentDeletionTest.php
index a825d1423fc..07d932f36cd 100644
--- a/core/modules/block_content/tests/src/Kernel/BlockContentDeletionTest.php
+++ b/core/modules/block_content/tests/src/Kernel/BlockContentDeletionTest.php
@@ -37,7 +37,7 @@ class BlockContentDeletionTest extends KernelTestBase {
/**
* Tests deleting a block_content updates the discovered block plugin.
*/
- public function testDeletingBlockContentShouldClearPluginCache() {
+ public function testDeletingBlockContentShouldClearPluginCache(): void {
// Create a block content type.
$block_content_type = BlockContentType::create([
'id' => 'spiffy',
diff --git a/core/modules/block_content/tests/src/Kernel/BlockContentDeriverTest.php b/core/modules/block_content/tests/src/Kernel/BlockContentDeriverTest.php
index ab2c7e80385..edd3e0e096c 100644
--- a/core/modules/block_content/tests/src/Kernel/BlockContentDeriverTest.php
+++ b/core/modules/block_content/tests/src/Kernel/BlockContentDeriverTest.php
@@ -63,7 +63,7 @@ class BlockContentDeriverTest extends KernelTestBase {
/**
* Tests that only reusable blocks are derived.
*/
- public function testReusableBlocksOnlyAreDerived() {
+ public function testReusableBlocksOnlyAreDerived(): void {
// Create a block content type.
$block_content_type = BlockContentType::create([
'id' => 'spiffy',
diff --git a/core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php b/core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php
index fbccd8a1592..87592d981b6 100644
--- a/core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php
+++ b/core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php
@@ -120,7 +120,7 @@ class BlockContentEntityReferenceSelectionTest extends KernelTestBase {
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/
- public function testQueriesNotAltered() {
+ public function testQueriesNotAltered(): void {
// Ensure that queries without all the tags are not altered.
$query = $this->entityTypeManager->getStorage('block_content')
->getQuery()
@@ -145,7 +145,7 @@ class BlockContentEntityReferenceSelectionTest extends KernelTestBase {
*
* @throws \Drupal\Core\Entity\EntityStorageException
*/
- public function testNoConditions() {
+ public function testNoConditions(): void {
$this->assertEquals(
$this->expectations['block_reusable'],
$this->selectionHandler->getReferenceableEntities()
@@ -168,7 +168,7 @@ class BlockContentEntityReferenceSelectionTest extends KernelTestBase {
*
* @throws \Exception
*/
- public function testFieldConditions($condition_type, $is_reusable) {
+ public function testFieldConditions($condition_type, $is_reusable): void {
$this->selectionHandler->setTestMode($condition_type, $is_reusable);
$this->assertEquals(
$is_reusable ? $this->expectations['block_reusable'] : $this->expectations['block_non_reusable'],
diff --git a/core/modules/block_content/tests/src/Kernel/BlockContentPermissionsTest.php b/core/modules/block_content/tests/src/Kernel/BlockContentPermissionsTest.php
index 857afbf013e..e10b4c95ccf 100644
--- a/core/modules/block_content/tests/src/Kernel/BlockContentPermissionsTest.php
+++ b/core/modules/block_content/tests/src/Kernel/BlockContentPermissionsTest.php
@@ -48,7 +48,7 @@ class BlockContentPermissionsTest extends KernelTestBase {
/**
* @covers ::blockTypePermissions
*/
- public function testDynamicPermissions() {
+ public function testDynamicPermissions(): void {
$permissions = $this->permissionHandler->getPermissions();
$this->assertArrayNotHasKey('edit any basic block content', $permissions, 'The per-block-type permission does not exist.');
$this->assertArrayNotHasKey('edit any square block content', $permissions, 'The per-block-type permission does not exist.');
diff --git a/core/modules/block_content/tests/src/Kernel/BlockTemplateSuggestionsTest.php b/core/modules/block_content/tests/src/Kernel/BlockTemplateSuggestionsTest.php
index 671df462815..426f9c3ec5c 100644
--- a/core/modules/block_content/tests/src/Kernel/BlockTemplateSuggestionsTest.php
+++ b/core/modules/block_content/tests/src/Kernel/BlockTemplateSuggestionsTest.php
@@ -59,7 +59,7 @@ class BlockTemplateSuggestionsTest extends KernelTestBase {
/**
* Tests template suggestions from block_content_theme_suggestions_block().
*/
- public function testBlockThemeHookSuggestions() {
+ public function testBlockThemeHookSuggestions(): void {
// Create a block using a block_content plugin.
$block = Block::create([
'plugin' => 'block_content:' . $this->blockContent->uuid(),
diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentBodyFieldTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentBodyFieldTest.php
index 7f379e55dc3..bc48e30eea8 100644
--- a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentBodyFieldTest.php
+++ b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentBodyFieldTest.php
@@ -35,7 +35,7 @@ class MigrateBlockContentBodyFieldTest extends MigrateDrupal7TestBase {
/**
* Tests the block content body field migration.
*/
- public function testBlockContentBodyFieldMigration() {
+ public function testBlockContentBodyFieldMigration(): void {
/** @var \Drupal\field\FieldStorageConfigInterface $storage */
$storage = FieldStorageConfig::load('block_content.body');
$this->assertInstanceOf(FieldStorageConfigInterface::class, $storage);
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 b1e47a8022f..8aabd896050 100644
--- a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityDisplayTest.php
+++ b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityDisplayTest.php
@@ -52,7 +52,7 @@ class MigrateBlockContentEntityDisplayTest extends MigrateDrupal7TestBase {
/**
* Tests the migrated display configuration.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertDisplay('block_content.basic.default', 'body');
}
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 7781d0a8f77..edbe0ca83f8 100644
--- a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityFormDisplayTest.php
+++ b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityFormDisplayTest.php
@@ -52,7 +52,7 @@ class MigrateBlockContentEntityFormDisplayTest extends MigrateDrupal7TestBase {
/**
* Tests the migrated display configuration.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertDisplay('block_content.basic.default', 'body');
}
diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentStubTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentStubTest.php
index 5180987a383..c90393586d3 100644
--- a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentStubTest.php
+++ b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentStubTest.php
@@ -34,7 +34,7 @@ class MigrateBlockContentStubTest extends MigrateDrupalTestBase {
/**
* Tests creation of block content stubs with no block_content_type available.
*/
- public function testStubFailure() {
+ public function testStubFailure(): void {
// Expected MigrateException thrown when no bundles exist.
$this->expectException(MigrateException::class);
$this->expectExceptionMessage('Stubbing failed, no bundles available for entity type: block_content');
@@ -44,7 +44,7 @@ class MigrateBlockContentStubTest extends MigrateDrupalTestBase {
/**
* Tests creation of block content stubs when there is a block_content_type.
*/
- public function testStubSuccess() {
+ public function testStubSuccess(): void {
BlockContentType::create([
'id' => 'test_block_content_type',
'label' => 'Test block content type',
diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentTypeTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentTypeTest.php
index 4e3871dc4d8..1b20314ec83 100644
--- a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentTypeTest.php
+++ b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentTypeTest.php
@@ -30,7 +30,7 @@ class MigrateBlockContentTypeTest extends MigrateDrupal7TestBase {
/**
* Tests the block content type migration.
*/
- public function testBlockContentTypeMigration() {
+ public function testBlockContentTypeMigration(): void {
/** @var \Drupal\block_content\BlockContentTypeInterface $entity */
$entity = BlockContentType::load('basic');
$this->assertInstanceOf(BlockContentTypeInterface::class, $entity);
diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateBlockContentTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateBlockContentTest.php
index 50f3e8014ca..cd902047473 100644
--- a/core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateBlockContentTest.php
+++ b/core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateBlockContentTest.php
@@ -38,7 +38,7 @@ class MigrateBlockContentTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 content block to Drupal 8 migration.
*/
- public function testBlockMigration() {
+ public function testBlockMigration(): void {
/** @var \Drupal\block_content\Entity\BlockContent $block */
$block = BlockContent::load(1);
$this->assertSame('My block 1', $block->label());
diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateCustomBlockContentTranslationTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateCustomBlockContentTranslationTest.php
index fd65c07f35d..bc042de3438 100644
--- a/core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateCustomBlockContentTranslationTest.php
+++ b/core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateCustomBlockContentTranslationTest.php
@@ -43,7 +43,7 @@ class MigrateCustomBlockContentTranslationTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 i18n content block strings to Drupal 8 migration.
*/
- public function testCustomBlockContentTranslation() {
+ public function testCustomBlockContentTranslation(): void {
/** @var \Drupal\block_content\Entity\BlockContent $block */
$block = BlockContent::load(1)->getTranslation('fr');
$this->assertSame('fr - Static Block', $block->label());
diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockContentTranslationTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockContentTranslationTest.php
index 86bd211450a..da086a43513 100644
--- a/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockContentTranslationTest.php
+++ b/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockContentTranslationTest.php
@@ -45,7 +45,7 @@ class MigrateCustomBlockContentTranslationTest extends MigrateDrupal7TestBase {
/**
* Tests the Drupal 7 i18n content block strings to Drupal 8 migration.
*/
- public function testCustomBlockContentTranslation() {
+ public function testCustomBlockContentTranslation(): void {
/** @var \Drupal\block_content\Entity\BlockContent $block */
$block = BlockContent::load(1)->getTranslation('fr');
$this->assertSame('fr - Mildly amusing limerick of the day', $block->label());
diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockTest.php
index a990975d450..7ba7ae83549 100644
--- a/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockTest.php
+++ b/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockTest.php
@@ -40,7 +40,7 @@ class MigrateCustomBlockTest extends MigrateDrupal7TestBase {
/**
* Tests migration of content blocks from Drupal 7 to Drupal 8.
*/
- public function testCustomBlockMigration() {
+ public function testCustomBlockMigration(): void {
$block = BlockContent::load(1);
$this->assertInstanceOf(BlockContentInterface::class, $block);
/** @var \Drupal\block_content\BlockContentInterface $block */
diff --git a/core/modules/block_content/tests/src/Kernel/Views/RevisionRelationshipsTest.php b/core/modules/block_content/tests/src/Kernel/Views/RevisionRelationshipsTest.php
index d2b19bbc882..05d56f17ce6 100644
--- a/core/modules/block_content/tests/src/Kernel/Views/RevisionRelationshipsTest.php
+++ b/core/modules/block_content/tests/src/Kernel/Views/RevisionRelationshipsTest.php
@@ -44,7 +44,7 @@ class RevisionRelationshipsTest extends KernelTestBase {
/**
* Create a block_content with revision and rest result count for both views.
*/
- public function testBlockContentRevisionRelationship() {
+ public function testBlockContentRevisionRelationship(): void {
$this->installEntitySchema('block_content');
ViewTestData::createTestViews(static::class, ['block_content_test_views']);
diff --git a/core/modules/block_content/tests/src/Kernel/Views/RevisionUserTest.php b/core/modules/block_content/tests/src/Kernel/Views/RevisionUserTest.php
index 68f0d17cf84..a72e079033f 100644
--- a/core/modules/block_content/tests/src/Kernel/Views/RevisionUserTest.php
+++ b/core/modules/block_content/tests/src/Kernel/Views/RevisionUserTest.php
@@ -68,7 +68,7 @@ class RevisionUserTest extends ViewsKernelTestBase {
/**
* Tests the block_content_revision_user relationship.
*/
- public function testRevisionUser() {
+ public function testRevisionUser(): void {
$primary_author = $this->createUser();
$secondary_author = $this->createUser();
diff --git a/core/modules/block_content/tests/src/Unit/Access/AccessGroupAndTest.php b/core/modules/block_content/tests/src/Unit/Access/AccessGroupAndTest.php
index 080ba55c245..b9fd73b49fa 100644
--- a/core/modules/block_content/tests/src/Unit/Access/AccessGroupAndTest.php
+++ b/core/modules/block_content/tests/src/Unit/Access/AccessGroupAndTest.php
@@ -29,7 +29,7 @@ class AccessGroupAndTest extends UnitTestCase {
/**
* @covers \Drupal\block_content\Access\AccessGroupAnd
*/
- public function testGroups() {
+ public function testGroups(): void {
$allowedAccessible = $this->createAccessibleDouble(AccessResult::allowed());
$forbiddenAccessible = $this->createAccessibleDouble(AccessResult::forbidden());
$neutralAccessible = $this->createAccessibleDouble(AccessResult::neutral());
diff --git a/core/modules/block_content/tests/src/Unit/Access/DependentAccessTest.php b/core/modules/block_content/tests/src/Unit/Access/DependentAccessTest.php
index 5abd871079a..55c9a89a10c 100644
--- a/core/modules/block_content/tests/src/Unit/Access/DependentAccessTest.php
+++ b/core/modules/block_content/tests/src/Unit/Access/DependentAccessTest.php
@@ -50,7 +50,7 @@ class DependentAccessTest extends UnitTestCase {
*
* @dataProvider providerTestSetFirst
*/
- public function testSetAccessDependency($use_set_first) {
+ public function testSetAccessDependency($use_set_first): void {
$testRefinable = new RefinableDependentAccessTraitTestClass();
if ($use_set_first) {
@@ -77,7 +77,7 @@ class DependentAccessTest extends UnitTestCase {
*
* @dataProvider providerTestSetFirst
*/
- public function testMergeNonGroup($use_set_first) {
+ public function testMergeNonGroup($use_set_first): void {
$testRefinable = new RefinableDependentAccessTraitTestClass();
if ($use_set_first) {
$testRefinable->setAccessDependency($this->forbidden);
@@ -109,7 +109,7 @@ class DependentAccessTest extends UnitTestCase {
*
* @dataProvider providerTestSetFirst
*/
- public function testMergeGroup($use_set_first) {
+ public function testMergeGroup($use_set_first): void {
$andGroup = new AccessGroupAnd();
$andGroup->addDependency($this->forbidden);
$testRefinable = new RefinableDependentAccessTraitTestClass();
diff --git a/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php b/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php
index b81ad890520..f38e6d6504b 100644
--- a/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php
+++ b/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php
@@ -68,7 +68,7 @@ class BlockContentLocalTasksTest extends LocalTaskIntegrationTestBase {
*
* @dataProvider getBlockContentListingRoutes
*/
- public function testBlockContentListLocalTasks($route) {
+ public function testBlockContentListLocalTasks($route): void {
$this->assertLocalTasks($route, [
0 => [
'system.admin_content',
diff --git a/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php b/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php
index 421fe65e6ee..3bbe7941e81 100644
--- a/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php
+++ b/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php
@@ -35,7 +35,7 @@ class BreakpointDiscoveryTest extends KernelTestBase {
/**
* Tests the breakpoint group created for a theme.
*/
- public function testThemeBreakpoints() {
+ public function testThemeBreakpoints(): void {
// Verify the breakpoint group for breakpoint_theme_test was created.
$expected_breakpoints = [
'breakpoint_theme_test.mobile' => [
@@ -100,7 +100,7 @@ class BreakpointDiscoveryTest extends KernelTestBase {
/**
* Tests the custom breakpoint group provided by a theme and a module.
*/
- public function testCustomBreakpointGroups() {
+ public function testCustomBreakpointGroups(): void {
// Verify the breakpoint group for breakpoint_theme_test.group2 was created.
$expected_breakpoints = [
'breakpoint_theme_test.group2.narrow' => [
@@ -152,7 +152,7 @@ class BreakpointDiscoveryTest extends KernelTestBase {
/**
* Tests the breakpoint group created for a module.
*/
- public function testModuleBreakpoints() {
+ public function testModuleBreakpoints(): void {
$expected_breakpoints = [
'breakpoint_module_test.mobile' => [
'label' => 'mobile',
@@ -188,7 +188,7 @@ class BreakpointDiscoveryTest extends KernelTestBase {
/**
* Tests the collection of breakpoint groups.
*/
- public function testBreakpointGroups() {
+ public function testBreakpointGroups(): void {
$expected = [
'olivero' => 'Olivero',
'breakpoint_module_test' => 'Breakpoint test module',
diff --git a/core/modules/breakpoint/tests/src/Unit/BreakpointTest.php b/core/modules/breakpoint/tests/src/Unit/BreakpointTest.php
index 20a45dceb0e..b91e65c5fed 100644
--- a/core/modules/breakpoint/tests/src/Unit/BreakpointTest.php
+++ b/core/modules/breakpoint/tests/src/Unit/BreakpointTest.php
@@ -64,7 +64,7 @@ class BreakpointTest extends UnitTestCase {
/**
* @covers ::getLabel
*/
- public function testGetLabel() {
+ public function testGetLabel(): void {
$this->pluginDefinition['label'] = 'Test label';
$this->setupBreakpoint();
$this->assertEquals(new TranslatableMarkup('Test label', [], ['context' => 'breakpoint'], $this->stringTranslation), $this->breakpoint->getLabel());
@@ -73,7 +73,7 @@ class BreakpointTest extends UnitTestCase {
/**
* @covers ::getWeight
*/
- public function testGetWeight() {
+ public function testGetWeight(): void {
$this->pluginDefinition['weight'] = '4';
$this->setupBreakpoint();
// Assert that the type returned in an integer.
@@ -83,7 +83,7 @@ class BreakpointTest extends UnitTestCase {
/**
* @covers ::getMediaQuery
*/
- public function testGetMediaQuery() {
+ public function testGetMediaQuery(): void {
$this->pluginDefinition['mediaQuery'] = 'only screen and (min-width: 1220px)';
$this->setupBreakpoint();
$this->assertEquals('only screen and (min-width: 1220px)', $this->breakpoint->getMediaQuery());
@@ -92,7 +92,7 @@ class BreakpointTest extends UnitTestCase {
/**
* @covers ::getMultipliers
*/
- public function testGetMultipliers() {
+ public function testGetMultipliers(): void {
$this->pluginDefinition['multipliers'] = ['1x', '2x'];
$this->setupBreakpoint();
$this->assertSame(['1x', '2x'], $this->breakpoint->getMultipliers());
@@ -101,7 +101,7 @@ class BreakpointTest extends UnitTestCase {
/**
* @covers ::getProvider
*/
- public function testGetProvider() {
+ public function testGetProvider(): void {
$this->pluginDefinition['provider'] = 'Breakpoint';
$this->setupBreakpoint();
$this->assertEquals('Breakpoint', $this->breakpoint->getProvider());
@@ -110,7 +110,7 @@ class BreakpointTest extends UnitTestCase {
/**
* @covers ::getGroup
*/
- public function testGetGroup() {
+ public function testGetGroup(): void {
$this->pluginDefinition['group'] = 'Breakpoint';
$this->setupBreakpoint();
$this->assertEquals('Breakpoint', $this->breakpoint->getGroup());
diff --git a/core/modules/ckeditor5/tests/src/Functional/AddedStylesheetsTest.php b/core/modules/ckeditor5/tests/src/Functional/AddedStylesheetsTest.php
index 970aaf86175..d54a315a6d4 100644
--- a/core/modules/ckeditor5/tests/src/Functional/AddedStylesheetsTest.php
+++ b/core/modules/ckeditor5/tests/src/Functional/AddedStylesheetsTest.php
@@ -97,7 +97,7 @@ class AddedStylesheetsTest extends BrowserTestBase {
/**
* Test the ckeditor5-stylesheets theme config.
*/
- public function testCkeditorStylesheets() {
+ public function testCkeditorStylesheets(): void {
$assert_session = $this->assertSession();
/** @var \Drupal\Core\Extension\ThemeInstallerInterface $theme_installer */
diff --git a/core/modules/ckeditor5/tests/src/Functional/ImageUploadAccessTest.php b/core/modules/ckeditor5/tests/src/Functional/ImageUploadAccessTest.php
index 17854a89cb2..2caaf7a5b11 100644
--- a/core/modules/ckeditor5/tests/src/Functional/ImageUploadAccessTest.php
+++ b/core/modules/ckeditor5/tests/src/Functional/ImageUploadAccessTest.php
@@ -18,7 +18,7 @@ class ImageUploadAccessTest extends ImageUploadTest {
/**
* Test access to the CKEditor 5 image upload controller.
*/
- public function testCkeditor5ImageUploadRoute() {
+ public function testCkeditor5ImageUploadRoute(): void {
$this->createBasicFormat();
$url = $this->getUploadUrl();
$test_image = file_get_contents(current($this->getTestFiles('image'))->uri);
diff --git a/core/modules/ckeditor5/tests/src/Functional/ImageUploadTest.php b/core/modules/ckeditor5/tests/src/Functional/ImageUploadTest.php
index a4303e8fc4e..29e50adaabf 100644
--- a/core/modules/ckeditor5/tests/src/Functional/ImageUploadTest.php
+++ b/core/modules/ckeditor5/tests/src/Functional/ImageUploadTest.php
@@ -60,7 +60,7 @@ class ImageUploadTest extends BrowserTestBase {
/**
* Tests using the file upload route with a disallowed extension.
*/
- public function testUploadFileExtension() {
+ public function testUploadFileExtension(): void {
$this->createBasicFormat();
$this->createEditorWithUpload([
'status' => TRUE,
@@ -86,7 +86,7 @@ class ImageUploadTest extends BrowserTestBase {
/**
* Tests using the file upload route with a file size larger than allowed.
*/
- public function testFileUploadLargerFileSize() {
+ public function testFileUploadLargerFileSize(): void {
$this->createBasicFormat();
$this->createEditorWithUpload([
'status' => TRUE,
@@ -120,7 +120,7 @@ class ImageUploadTest extends BrowserTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/3184974
*/
- public function testLockAfterFailedValidation() {
+ public function testLockAfterFailedValidation(): void {
$this->createBasicFormat();
$this->createEditorWithUpload([
'status' => TRUE,
diff --git a/core/modules/ckeditor5/tests/src/Functional/MediaEntityMetadataApiTest.php b/core/modules/ckeditor5/tests/src/Functional/MediaEntityMetadataApiTest.php
index 8ab999fe22b..d4af20d6bf9 100644
--- a/core/modules/ckeditor5/tests/src/Functional/MediaEntityMetadataApiTest.php
+++ b/core/modules/ckeditor5/tests/src/Functional/MediaEntityMetadataApiTest.php
@@ -215,7 +215,7 @@ class MediaEntityMetadataApiTest extends BrowserTestBase {
/**
* Tests the media entity metadata API.
*/
- public function testApi() {
+ public function testApi(): void {
$path = '/ckeditor5/filtered_html/media-entity-metadata';
$token = $this->container->get('csrf_token')->get(ltrim($path, '/'));
$uuid = $this->mediaImage->uuid();
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/AdminUiTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/AdminUiTest.php
index 3bbf63a8309..dcc358b739f 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/AdminUiTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/AdminUiTest.php
@@ -26,7 +26,7 @@ class AdminUiTest extends CKEditor5TestBase {
/**
* Confirm settings only trigger AJAX when select value is CKEditor 5.
*/
- public function testSettingsOnlyFireAjaxWithCkeditor5() {
+ public function testSettingsOnlyFireAjaxWithCkeditor5(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
$this->addNewTextFormat($page, $assert_session);
@@ -139,7 +139,7 @@ JS;
/**
* CKEditor 5's filter UI modifications should not break it for other editors.
*/
- public function testUnavailableFiltersHiddenWhenSwitching() {
+ public function testUnavailableFiltersHiddenWhenSwitching(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
$this->createNewTextFormat($page, $assert_session, 'unicorn');
@@ -154,7 +154,7 @@ JS;
/**
* Test that filter settings are only visible when the filter is enabled.
*/
- public function testFilterCheckboxesToggleSettings() {
+ public function testFilterCheckboxesToggleSettings(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -272,7 +272,7 @@ JS;
/**
* Tests the plugin settings form section.
*/
- public function testPluginSettingsFormSection() {
+ public function testPluginSettingsFormSection(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -316,7 +316,7 @@ JS;
/**
* Tests the language config form.
*/
- public function testLanguageConfigForm() {
+ public function testLanguageConfigForm(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5AllowedTagsTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5AllowedTagsTest.php
index efa8ffa0825..22a369eca03 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5AllowedTagsTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5AllowedTagsTest.php
@@ -57,7 +57,7 @@ class CKEditor5AllowedTagsTest extends CKEditor5TestBase {
/**
* Test enabling CKEditor 5 in a way that triggers validation.
*/
- public function testEnablingToVersion5Validation() {
+ public function testEnablingToVersion5Validation(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -128,7 +128,7 @@ class CKEditor5AllowedTagsTest extends CKEditor5TestBase {
/**
* Confirm that switching to CKEditor 5 from another editor updates tags.
*/
- public function testSwitchToVersion5() {
+ public function testSwitchToVersion5(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -162,7 +162,7 @@ class CKEditor5AllowedTagsTest extends CKEditor5TestBase {
/**
* Tests that the img tag is added after enabling image uploads.
*/
- public function testImgAddedViaUploadPlugin() {
+ public function testImgAddedViaUploadPlugin(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -234,7 +234,7 @@ class CKEditor5AllowedTagsTest extends CKEditor5TestBase {
/**
* Test filter_html allowed tags.
*/
- public function testAllowedTags() {
+ public function testAllowedTags(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -338,7 +338,7 @@ class CKEditor5AllowedTagsTest extends CKEditor5TestBase {
/**
* Test that <drupal-media> is added to allowed tags when media embed enabled.
*/
- public function testMediaElementAllowedTags() {
+ public function testMediaElementAllowedTags(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -417,7 +417,7 @@ class CKEditor5AllowedTagsTest extends CKEditor5TestBase {
/**
* Tests full HTML text format.
*/
- public function testFullHtml() {
+ public function testFullHtml(): void {
FilterFormat::create(
Yaml::parseFile('core/profiles/standard/config/install/filter.format.full_html.yml')
)->save();
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5DialogTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5DialogTest.php
index 51447052f37..924faeaa616 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5DialogTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5DialogTest.php
@@ -33,7 +33,7 @@ class CKEditor5DialogTest extends CKEditor5TestBase {
/**
* Tests if CKEditor 5 tooltips can be interacted with in dialogs.
*/
- public function testCKEditor5FocusInTooltipsInDialog() {
+ public function testCKEditor5FocusInTooltipsInDialog(): void {
FilterFormat::create([
'format' => 'test_format',
'name' => 'CKEditor 5 with link',
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5FragmentLinkTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5FragmentLinkTest.php
index 0e446e4e426..fc36e1799bd 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5FragmentLinkTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5FragmentLinkTest.php
@@ -95,7 +95,7 @@ class CKEditor5FragmentLinkTest extends WebDriverTestBase {
/**
* Tests if the fragment link to a textarea works with CKEditor 5 enabled.
*/
- public function testFragmentLink() {
+ public function testFragmentLink(): void {
$session = $this->getSession();
$web_assert = $this->assertSession();
$ckeditor_class = '.ck-editor';
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5OffCanvasTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5OffCanvasTest.php
index eea39462ba1..212584749ec 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5OffCanvasTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5OffCanvasTest.php
@@ -24,7 +24,7 @@ class CKEditor5OffCanvasTest extends CKEditor5TestBase {
/**
* Tests if CKEditor is properly styled inside an off-canvas dialog.
*/
- public function testOffCanvasStyles() {
+ public function testOffCanvasStyles(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5ReadOnlyModeTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5ReadOnlyModeTest.php
index 4a287960b7e..bec3961ec46 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5ReadOnlyModeTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5ReadOnlyModeTest.php
@@ -52,7 +52,7 @@ class CKEditor5ReadOnlyModeTest extends CKEditor5TestBase {
/**
* Test that disabling a CKEditor 5 field results in an uneditable editor.
*/
- public function testReadOnlyMode() {
+ public function testReadOnlyMode(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
$this->addNewTextFormat($page, $assert_session);
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5Test.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5Test.php
index 2d0f8068734..901714da565 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5Test.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5Test.php
@@ -40,7 +40,7 @@ class CKEditor5Test extends CKEditor5TestBase {
/**
* Tests configuring CKEditor 5 for existing content.
*/
- public function testExistingContent() {
+ public function testExistingContent(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -72,7 +72,7 @@ class CKEditor5Test extends CKEditor5TestBase {
/**
* Ensures that attribute values are encoded.
*/
- public function testAttributeEncoding() {
+ public function testAttributeEncoding(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -147,7 +147,7 @@ class CKEditor5Test extends CKEditor5TestBase {
/**
* Test headings configuration.
*/
- public function testHeadingsPlugin() {
+ public function testHeadingsPlugin(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -222,7 +222,7 @@ class CKEditor5Test extends CKEditor5TestBase {
/**
* Test for Language of Parts plugin.
*/
- public function testLanguageOfPartsPlugin() {
+ public function testLanguageOfPartsPlugin(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -404,7 +404,7 @@ JS;
/**
* Confirms active tab status is intact after AJAX refresh.
*/
- public function testActiveTabsMaintained() {
+ public function testActiveTabsMaintained(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -543,7 +543,7 @@ JS;
/**
* Ensures that CKEditor 5 integrates with file reference filter.
*/
- public function testEditorFileReferenceIntegration() {
+ public function testEditorFileReferenceIntegration(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -601,7 +601,7 @@ JS;
/**
* Ensures that CKEditor italic model is converted to em.
*/
- public function testEmphasis() {
+ public function testEmphasis(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -628,7 +628,7 @@ JS;
/**
* Tests list plugin.
*/
- public function testListPlugin() {
+ public function testListPlugin(): void {
FilterFormat::create([
'format' => 'test_format',
'name' => 'CKEditor 5 with list',
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/EmphasisTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/EmphasisTest.php
index f811d2fb6e1..2e21e558805 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/EmphasisTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/EmphasisTest.php
@@ -120,7 +120,7 @@ class EmphasisTest extends WebDriverTestBase {
/**
* Ensures that CKEditor italic model is converted to em.
*/
- public function testEmphasis() {
+ public function testEmphasis(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -142,7 +142,7 @@ class EmphasisTest extends WebDriverTestBase {
/**
* Tests that arbitrary attributes are allowed via GHS.
*/
- public function testEmphasisArbitraryHtml() {
+ public function testEmphasisArbitraryHtml(): void {
$assert_session = $this->assertSession();
$editor = Editor::load('test_format');
$settings = $editor->getSettings();
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTest.php
index 55526f7380f..5dd5caf183c 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTest.php
@@ -136,7 +136,7 @@ class ImageTest extends ImageTestBase {
/**
* Tests the ckeditor5_imageResize and ckeditor5_imageUpload settings forms.
*/
- public function testImageSettingsForm() {
+ public function testImageSettingsForm(): void {
$assert_session = $this->assertSession();
$this->drupalGet('admin/config/content/formats/manage/test_format');
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php
index 7eb2894cc95..3ef2ca9e66f 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php
@@ -101,7 +101,7 @@ abstract class ImageTestBase extends CKEditor5TestBase {
/**
* Ensures that attributes are retained on conversion.
*/
- public function testAttributeRetentionDuringUpcasting() {
+ public function testAttributeRetentionDuringUpcasting(): void {
// Run test cases in a single test to make the test run faster.
$attributes_to_retain = [
'-none-' => 'inline',
@@ -163,7 +163,7 @@ abstract class ImageTestBase extends CKEditor5TestBase {
*
* @dataProvider providerLinkability
*/
- public function testImageArbitraryHtml(string $image_type, bool $unrestricted) {
+ public function testImageArbitraryHtml(string $image_type, bool $unrestricted): void {
$editor = Editor::load('test_format');
$settings = $editor->getSettings();
@@ -210,7 +210,7 @@ abstract class ImageTestBase extends CKEditor5TestBase {
*
* @dataProvider providerLinkability
*/
- public function testLinkability(string $image_type, bool $unrestricted) {
+ public function testLinkability(string $image_type, bool $unrestricted): void {
assert($image_type === 'inline' || $image_type === 'block');
// Disable filter_html.
@@ -361,7 +361,7 @@ abstract class ImageTestBase extends CKEditor5TestBase {
*
* @dataProvider providerAltTextRequired
*/
- public function testAltTextRequired(bool $unrestricted) {
+ public function testAltTextRequired(bool $unrestricted): void {
// Disable filter_html.
if ($unrestricted) {
FilterFormat::load('test_format')
@@ -584,7 +584,7 @@ abstract class ImageTestBase extends CKEditor5TestBase {
/**
* Ensures that images can have caption set.
*/
- public function testImageCaption() {
+ public function testImageCaption(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaLibraryTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaLibraryTest.php
index ea91158c9af..9344a247784 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaLibraryTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaLibraryTest.php
@@ -155,7 +155,7 @@ class MediaLibraryTest extends WebDriverTestBase {
/**
* Tests using drupalMedia button to embed media into CKEditor 5.
*/
- public function testButton() {
+ public function testButton(): void {
// Skipped due to frequent random test failures.
// @todo Fix this and stop skipping it at https://www.drupal.org/i/3351597.
$this->markTestSkipped();
@@ -226,7 +226,7 @@ class MediaLibraryTest extends WebDriverTestBase {
/**
* Tests the allowed media types setting on the MediaEmbed filter.
*/
- public function testAllowedMediaTypes() {
+ public function testAllowedMediaTypes(): void {
$test_cases = [
'all_media_types' => [],
'only_image' => ['image' => 'image'],
@@ -278,7 +278,7 @@ class MediaLibraryTest extends WebDriverTestBase {
/**
* Ensures that alt text can be changed on Media Library inserted Media.
*/
- public function testAlt() {
+ public function testAlt(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaLinkabilityTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaLinkabilityTest.php
index 209b1de962c..f8a41742db1 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaLinkabilityTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaLinkabilityTest.php
@@ -88,7 +88,7 @@ class MediaLinkabilityTest extends MediaTestBase {
*
* @dataProvider providerLinkability
*/
- public function testLinkability(bool $unrestricted) {
+ public function testLinkability(bool $unrestricted): void {
// Disable filter_html.
if ($unrestricted) {
FilterFormat::load('test_format')
@@ -233,7 +233,7 @@ class MediaLinkabilityTest extends MediaTestBase {
*
* @dataProvider providerLinkability
*/
- public function testLinkManualDecorator(bool $unrestricted) {
+ public function testLinkManualDecorator(bool $unrestricted): void {
\Drupal::service('module_installer')->install(['ckeditor5_manual_decorator_test']);
$this->resetAll();
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaPreviewTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaPreviewTest.php
index 6eb25795812..3eb2986d547 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaPreviewTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaPreviewTest.php
@@ -19,7 +19,7 @@ class MediaPreviewTest extends MediaTestBase {
/**
* Tests that failed media embed preview requests inform the end user.
*/
- public function testErrorMessages() {
+ public function testErrorMessages(): void {
// This test currently frequently causes the SQLite database to lock, so
// skip the test on SQLite until the issue can be resolved.
// @todo https://www.drupal.org/project/drupal/issues/3273626
@@ -87,7 +87,7 @@ class MediaPreviewTest extends MediaTestBase {
/**
* The CKEditor Widget must load a preview generated using the default theme.
*/
- public function testPreviewUsesDefaultThemeAndIsClientCacheable() {
+ public function testPreviewUsesDefaultThemeAndIsClientCacheable(): void {
// Make the node edit form use the admin theme, like on most Drupal sites.
$this->config('node.settings')
->set('use_admin_theme', TRUE)
@@ -144,7 +144,7 @@ class MediaPreviewTest extends MediaTestBase {
*
* @dataProvider previewAccessProvider
*/
- public function testEmbedPreviewAccess($media_embed_enabled, $can_use_format) {
+ public function testEmbedPreviewAccess($media_embed_enabled, $can_use_format): void {
// Reconfigure the host entity's text format to suit our needs.
/** @var \Drupal\filter\FilterFormatInterface $format */
$format = FilterFormat::load($this->host->body->format);
@@ -207,7 +207,7 @@ class MediaPreviewTest extends MediaTestBase {
/**
* Ensure media preview isn't clickable.
*/
- public function testMediaPointerEvent() {
+ public function testMediaPointerEvent(): void {
$entityViewDisplay = EntityViewDisplay::load('media.image.view_mode_1');
$thumbnail = $entityViewDisplay->getComponent('thumbnail');
$thumbnail['settings']['image_link'] = 'file';
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php
index 94298af359a..32f0ef191bb 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php
@@ -30,7 +30,7 @@ class MediaTest extends MediaTestBase {
/**
* Tests that `<drupal-media>` is converted into a block element.
*/
- public function testConversion() {
+ public function testConversion(): void {
// Wrap the `<drupal-media>` markup in a `<p>`.
$original_value = $this->host->body->value;
$this->host->body->value = '<p>foo' . $original_value . '</p>';
@@ -50,7 +50,7 @@ class MediaTest extends MediaTestBase {
*
* @see \Drupal\Tests\media\Kernel\MediaEmbedFilterTest::testOnlyDrupalMediaTagProcessed()
*/
- public function testOnlyDrupalMediaTagProcessed() {
+ public function testOnlyDrupalMediaTagProcessed(): void {
$original_value = $this->host->body->value;
$this->host->body->value = str_replace('drupal-media', 'p', $original_value);
$this->host->save();
@@ -75,7 +75,7 @@ class MediaTest extends MediaTestBase {
/**
* Tests adding media to a list does not split the list.
*/
- public function testMediaSplitList() {
+ public function testMediaSplitList(): void {
$assert_session = $this->assertSession();
$editor = Editor::load('test_format');
@@ -136,7 +136,7 @@ class MediaTest extends MediaTestBase {
/**
* Tests that arbitrary attributes are allowed via GHS.
*/
- public function testMediaArbitraryHtml() {
+ public function testMediaArbitraryHtml(): void {
$assert_session = $this->assertSession();
$editor = Editor::load('test_format');
@@ -193,7 +193,7 @@ class MediaTest extends MediaTestBase {
/**
* Tests caption editing in the CKEditor widget.
*/
- public function testEditableCaption() {
+ public function testEditableCaption(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
// Test that setting caption to blank string doesn't break 'Edit media'
@@ -362,7 +362,7 @@ class MediaTest extends MediaTestBase {
/**
* Tests the CKEditor 5 media plugin can override image media's alt attribute.
*/
- public function testAlt() {
+ public function testAlt(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
$this->drupalGet($this->host->toUrl('edit-form'));
@@ -472,7 +472,7 @@ class MediaTest extends MediaTestBase {
/**
* Tests the CKEditor 5 media plugin loads the translated alt attribute.
*/
- public function testTranslationAlt() {
+ public function testTranslationAlt(): void {
\Drupal::service('module_installer')->install(['language', 'content_translation']);
$this->resetAll();
ConfigurableLanguage::createFromLangcode('fr')->save();
@@ -572,7 +572,7 @@ class MediaTest extends MediaTestBase {
* the media style toolbar allows altering the alignment and that the changes
* are reflected on the widget and downcast drupal-media tag.
*/
- public function testAlignment() {
+ public function testAlignment(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
$this->drupalGet($this->host->toUrl('edit-form'));
@@ -623,7 +623,7 @@ class MediaTest extends MediaTestBase {
/**
* Ensures that Drupal Media Styles can be displayed in a dropdown.
*/
- public function testDrupalMediaStyleInDropdown() {
+ public function testDrupalMediaStyleInDropdown(): void {
\Drupal::service('module_installer')->install(['ckeditor5_drupalelementstyle_test']);
$this->resetAll();
@@ -660,7 +660,7 @@ class MediaTest extends MediaTestBase {
/**
* Tests Drupal Media Style with a CSS class.
*/
- public function testDrupalMediaStyleWithClass() {
+ public function testDrupalMediaStyleWithClass(): void {
$editor = Editor::load('test_format');
$editor->setSettings([
'toolbar' => [
@@ -747,7 +747,7 @@ class MediaTest extends MediaTestBase {
*
* @dataProvider providerTestViewMode
*/
- public function testViewMode(bool $with_alignment) {
+ public function testViewMode(bool $with_alignment): void {
EntityViewMode::create([
'id' => 'media.view_mode_3',
'targetEntityType' => 'media',
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/SourceEditingTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/SourceEditingTest.php
index b7c1af2d051..ea925522dda 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/SourceEditingTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/SourceEditingTest.php
@@ -24,7 +24,7 @@ class SourceEditingTest extends SourceEditingTestBase {
/**
* @covers \Drupal\ckeditor5\Plugin\CKEditor5Plugin\SourceEditing::buildConfigurationForm
*/
- public function testSourceEditingSettingsForm() {
+ public function testSourceEditingSettingsForm(): void {
$this->drupalLogin($this->drupalCreateUser(['administer filters']));
$page = $this->getSession()->getPage();
@@ -71,7 +71,7 @@ JS;
*
* @dataProvider providerAllowingExtraAttributes
*/
- public function testAllowingExtraAttributes(string $original_markup, string $expected_markup, ?string $allowed_elements_string = NULL) {
+ public function testAllowingExtraAttributes(string $original_markup, string $expected_markup, ?string $allowed_elements_string = NULL): void {
$this->host->body->value = $original_markup;
$this->host->save();
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/StyleTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/StyleTest.php
index 1e09a5b91bc..67d33b3726b 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/StyleTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/StyleTest.php
@@ -24,7 +24,7 @@ class StyleTest extends CKEditor5TestBase {
/**
* @covers \Drupal\ckeditor5\Plugin\CKEditor5Plugin\Style::buildConfigurationForm
*/
- public function testStyleSettingsForm() {
+ public function testStyleSettingsForm(): void {
$this->drupalLogin($this->drupalCreateUser(['administer filters']));
$page = $this->getSession()->getPage();
@@ -151,7 +151,7 @@ JS;
/**
* Tests Style functionality: setting a class, expected style choices.
*/
- public function testStyleFunctionality() {
+ public function testStyleFunctionality(): void {
FilterFormat::create([
'format' => 'test_format',
'name' => 'Test format',
diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/TableTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/TableTest.php
index 975e5810c76..188f36974b9 100644
--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/TableTest.php
+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/TableTest.php
@@ -126,7 +126,7 @@ class TableTest extends WebDriverTestBase {
/**
* Confirms tables convert to the expected markup.
*/
- public function testTableConversion() {
+ public function testTableConversion(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -153,7 +153,7 @@ class TableTest extends WebDriverTestBase {
/**
* Tests creating a table with caption in the UI.
*/
- public function testTableCaptionUi() {
+ public function testTableCaptionUi(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php b/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php
index 6d635a7f781..2de924c0ed3 100644
--- a/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php
+++ b/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php
@@ -1119,7 +1119,7 @@ PHP,
/**
* Tests the enabling of plugins.
*/
- public function testEnabledPlugins() {
+ public function testEnabledPlugins(): void {
$editor = Editor::load('basic_html');
// Case 1: no extra CKEditor 5 plugins.
@@ -1290,7 +1290,7 @@ PHP,
* @covers \Drupal\ckeditor5\Plugin\CKEditor5PluginManager::getProvidedElements
* @dataProvider providerTestProvidedElements
*/
- public function testProvidedElements(array $plugins, array $text_editor_settings, array $expected_elements, string $expected_readable_string) {
+ public function testProvidedElements(array $plugins, array $text_editor_settings, array $expected_elements, string $expected_readable_string): void {
$this->enableModules(['ckeditor5_plugin_elements_test']);
$text_editor = Editor::create([
@@ -1540,7 +1540,7 @@ PHP,
*
* @dataProvider providerTestPluginSupportingElement
*/
- public function testPluginSupportingElement(string $tag, ?string $expected_plugin_id) {
+ public function testPluginSupportingElement(string $tag, ?string $expected_plugin_id): void {
$this->enableModules(['ckeditor5_definition_supporting_element']);
$plugin_id = $this->manager->findPluginSupportingElement($tag);
$this->assertSame($expected_plugin_id, $plugin_id);
diff --git a/core/modules/ckeditor5/tests/src/Kernel/CKEditor5StylesheetsTest.php b/core/modules/ckeditor5/tests/src/Kernel/CKEditor5StylesheetsTest.php
index 4b20ac6d1b3..a034d16de70 100644
--- a/core/modules/ckeditor5/tests/src/Kernel/CKEditor5StylesheetsTest.php
+++ b/core/modules/ckeditor5/tests/src/Kernel/CKEditor5StylesheetsTest.php
@@ -34,7 +34,7 @@ class CKEditor5StylesheetsTest extends KernelTestBase {
*
* @dataProvider externalStylesheetsProvider
*/
- public function testExternalStylesheets($theme, $expected) {
+ public function testExternalStylesheets($theme, $expected): void {
\Drupal::service('theme_installer')->install([$theme]);
$this->config('system.theme')->set('default', $theme)->save();
$this->assertSame($expected, _ckeditor5_theme_css($theme));
diff --git a/core/modules/ckeditor5/tests/src/Kernel/ConfigurablePluginTest.php b/core/modules/ckeditor5/tests/src/Kernel/ConfigurablePluginTest.php
index 3edfa27720e..16d571cf980 100644
--- a/core/modules/ckeditor5/tests/src/Kernel/ConfigurablePluginTest.php
+++ b/core/modules/ckeditor5/tests/src/Kernel/ConfigurablePluginTest.php
@@ -46,7 +46,7 @@ class ConfigurablePluginTest extends KernelTestBase {
/**
* Tests default settings for configurable CKEditor 5 plugins.
*/
- public function testDefaults() {
+ public function testDefaults(): void {
$all_definitions = $this->manager->getDefinitions();
$configurable_definitions = array_filter($all_definitions, function (CKEditor5PluginDefinition $definition): bool {
return $definition->isConfigurable();
diff --git a/core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php b/core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php
index 6550a5f0167..78272fff453 100644
--- a/core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php
+++ b/core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php
@@ -72,7 +72,7 @@ class ValidatorsTest extends KernelTestBase {
* All expected violations for the given CKEditor 5 settings, with property
* path as keys and message as values.
*/
- public function test(array $ckeditor5_settings, array $expected_violations) {
+ public function test(array $ckeditor5_settings, array $expected_violations): void {
// The data provider is unable to access services, so the test scenario of
// testing with CKEditor 5's default settings is partially provided here.
if ($ckeditor5_settings === ['__DEFAULT__']) {
@@ -655,7 +655,7 @@ class ValidatorsTest extends KernelTestBase {
* @param array $expected_violations
* All expected violations for the pair.
*/
- public function testPair(array $ckeditor5_settings, array $editor_image_upload_settings, array $filters, array $expected_violations) {
+ public function testPair(array $ckeditor5_settings, array $editor_image_upload_settings, array $filters, array $expected_violations): void {
$text_editor = Editor::create([
'format' => 'dummy',
'editor' => 'ckeditor5',
diff --git a/core/modules/comment/tests/src/Functional/CommentAccessTest.php b/core/modules/comment/tests/src/Functional/CommentAccessTest.php
index df6f41d9091..209f17f6c16 100644
--- a/core/modules/comment/tests/src/Functional/CommentAccessTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentAccessTest.php
@@ -75,7 +75,7 @@ class CommentAccessTest extends BrowserTestBase {
/**
* Tests commenting disabled for access-blocked entities.
*/
- public function testCannotCommentOnEntitiesYouCannotView() {
+ public function testCannotCommentOnEntitiesYouCannotView(): void {
$assert = $this->assertSession();
$comment_url = 'comment/reply/node/' . $this->unpublishedNode->id() . '/comment';
@@ -93,7 +93,7 @@ class CommentAccessTest extends BrowserTestBase {
/**
* Tests cannot view comment reply form on entities you cannot view.
*/
- public function testCannotViewCommentReplyFormOnEntitiesYouCannotView() {
+ public function testCannotViewCommentReplyFormOnEntitiesYouCannotView(): void {
$assert = $this->assertSession();
// Create a comment on an unpublished node.
diff --git a/core/modules/comment/tests/src/Functional/CommentAdminTest.php b/core/modules/comment/tests/src/Functional/CommentAdminTest.php
index ce220b6d120..f8dfc8a9b38 100644
--- a/core/modules/comment/tests/src/Functional/CommentAdminTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentAdminTest.php
@@ -35,7 +35,7 @@ class CommentAdminTest extends CommentTestBase {
/**
* Tests comment approval functionality through admin/content/comment.
*/
- public function testApprovalAdminInterface() {
+ public function testApprovalAdminInterface(): void {
// Set anonymous comments to require approval.
user_role_change_permissions(RoleInterface::ANONYMOUS_ID, [
'access comments' => TRUE,
@@ -128,7 +128,7 @@ class CommentAdminTest extends CommentTestBase {
/**
* Tests comment approval functionality through the node interface.
*/
- public function testApprovalNodeInterface() {
+ public function testApprovalNodeInterface(): void {
// Set anonymous comments to require approval.
user_role_change_permissions(RoleInterface::ANONYMOUS_ID, [
'access comments' => TRUE,
@@ -181,7 +181,7 @@ class CommentAdminTest extends CommentTestBase {
/**
* Tests comment bundle admin.
*/
- public function testCommentAdmin() {
+ public function testCommentAdmin(): void {
// Login.
$this->drupalLogin($this->adminUser);
// Browse to comment bundle overview.
@@ -203,7 +203,7 @@ class CommentAdminTest extends CommentTestBase {
/**
* Tests editing a comment as an admin.
*/
- public function testEditComment() {
+ public function testEditComment(): void {
// Enable anonymous user comments.
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, [
'access comments',
@@ -244,7 +244,7 @@ class CommentAdminTest extends CommentTestBase {
/**
* Tests commented translation deletion admin view.
*/
- public function testCommentedTranslationDeletion() {
+ public function testCommentedTranslationDeletion(): void {
\Drupal::service('module_installer')->install([
'language',
'locale',
diff --git a/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php b/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php
index 529018cb4ff..dd21d393d2f 100644
--- a/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php
@@ -41,7 +41,7 @@ class CommentAnonymousTest extends CommentTestBase {
/**
* Tests anonymous comment functionality.
*/
- public function testAnonymous() {
+ public function testAnonymous(): void {
$this->setCommentAnonymous(CommentInterface::ANONYMOUS_MAYNOT_CONTACT);
// Preview comments (with `skip comment approval` permission).
diff --git a/core/modules/comment/tests/src/Functional/CommentBlockTest.php b/core/modules/comment/tests/src/Functional/CommentBlockTest.php
index c1565fdfe01..1c368a78d78 100644
--- a/core/modules/comment/tests/src/Functional/CommentBlockTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentBlockTest.php
@@ -45,7 +45,7 @@ class CommentBlockTest extends CommentTestBase {
/**
* Tests the recent comments block.
*/
- public function testRecentCommentBlock() {
+ public function testRecentCommentBlock(): void {
$this->drupalLogin($this->adminUser);
$this->drupalPlaceBlock('views_block:comments_recent-block_1');
diff --git a/core/modules/comment/tests/src/Functional/CommentCSSTest.php b/core/modules/comment/tests/src/Functional/CommentCSSTest.php
index 645e075b9c8..6894ffef589 100644
--- a/core/modules/comment/tests/src/Functional/CommentCSSTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentCSSTest.php
@@ -42,7 +42,7 @@ class CommentCSSTest extends CommentTestBase {
/**
* Tests CSS classes on comments.
*/
- public function testCommentClasses() {
+ public function testCommentClasses(): void {
// Create all permutations for comments, users, and nodes.
$parameters = [
'node_uid' => [0, $this->webUser->id()],
diff --git a/core/modules/comment/tests/src/Functional/CommentCacheTagsTest.php b/core/modules/comment/tests/src/Functional/CommentCacheTagsTest.php
index 8f11f20a29c..71f75312f72 100644
--- a/core/modules/comment/tests/src/Functional/CommentCacheTagsTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentCacheTagsTest.php
@@ -103,7 +103,7 @@ class CommentCacheTagsTest extends EntityWithUriCacheTagsTestBase {
/**
* Tests that comments invalidate the cache tag of their host entity.
*/
- public function testCommentEntity() {
+ public function testCommentEntity(): void {
$this->verifyPageCache($this->entityTestCamelid->toUrl(), 'MISS');
$this->verifyPageCache($this->entityTestCamelid->toUrl(), 'HIT');
diff --git a/core/modules/comment/tests/src/Functional/CommentDisplayConfigurableTest.php b/core/modules/comment/tests/src/Functional/CommentDisplayConfigurableTest.php
index c84c4d20533..0ffbb1bcf95 100644
--- a/core/modules/comment/tests/src/Functional/CommentDisplayConfigurableTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentDisplayConfigurableTest.php
@@ -38,7 +38,7 @@ class CommentDisplayConfigurableTest extends CommentTestBase {
/**
* Sets base fields to configurable display and check settings are respected.
*/
- public function testDisplayConfigurable() {
+ public function testDisplayConfigurable(): void {
// Add a comment.
$nid = $this->node->id();
/** @var \Drupal\comment\CommentInterface $comment */
diff --git a/core/modules/comment/tests/src/Functional/CommentEntityReferenceTest.php b/core/modules/comment/tests/src/Functional/CommentEntityReferenceTest.php
index 1b328e924aa..9130bf29086 100644
--- a/core/modules/comment/tests/src/Functional/CommentEntityReferenceTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentEntityReferenceTest.php
@@ -83,7 +83,7 @@ class CommentEntityReferenceTest extends CommentTestBase {
/**
* Tests that comments are correctly saved as entity references.
*/
- public function testCommentAsEntityReference() {
+ public function testCommentAsEntityReference(): void {
// Load the node and save it.
$edit = [
'entity_reference_comment' => $this->comment->id(),
@@ -100,7 +100,7 @@ class CommentEntityReferenceTest extends CommentTestBase {
/**
* Tests that comments of unpublished are not shown.
*/
- public function testCommentOfUnpublishedNodeBypassAccess() {
+ public function testCommentOfUnpublishedNodeBypassAccess(): void {
// Unpublish the node that has the comment.
$this->node->setUnpublished()->save();
diff --git a/core/modules/comment/tests/src/Functional/CommentEntityTest.php b/core/modules/comment/tests/src/Functional/CommentEntityTest.php
index a783eee9a55..b822bb9afa6 100644
--- a/core/modules/comment/tests/src/Functional/CommentEntityTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentEntityTest.php
@@ -69,7 +69,7 @@ class CommentEntityTest extends CommentTestBase {
/**
* Tests CSS classes on comments.
*/
- public function testEntityChanges() {
+ public function testEntityChanges(): void {
$this->drupalLogin($this->webUser);
// Create a new node.
$term = $this->createTerm($this->vocab, ['uid' => $this->webUser->id()]);
diff --git a/core/modules/comment/tests/src/Functional/CommentFieldsTest.php b/core/modules/comment/tests/src/Functional/CommentFieldsTest.php
index 3e41b977774..bce7eb07200 100644
--- a/core/modules/comment/tests/src/Functional/CommentFieldsTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentFieldsTest.php
@@ -31,7 +31,7 @@ class CommentFieldsTest extends CommentTestBase {
/**
* Tests that the default 'comment_body' field is correctly added.
*/
- public function testCommentDefaultFields() {
+ public function testCommentDefaultFields(): void {
// Do not make assumptions on default node types created by the test
// installation profile, and create our own.
$this->drupalCreateContentType(['type' => 'test_node_type']);
@@ -69,7 +69,7 @@ class CommentFieldsTest extends CommentTestBase {
/**
* Tests that you can remove a comment field.
*/
- public function testCommentFieldDelete() {
+ public function testCommentFieldDelete(): void {
$this->drupalCreateContentType(['type' => 'test_node_type']);
$this->addDefaultCommentField('node', 'test_node_type');
// We want to test the handling of removing the primary comment field, so we
@@ -99,7 +99,7 @@ class CommentFieldsTest extends CommentTestBase {
/**
* Tests link building with non-default comment field names.
*/
- public function testCommentFieldLinksNonDefaultName() {
+ public function testCommentFieldLinksNonDefaultName(): void {
$this->drupalCreateContentType(['type' => 'test_node_type']);
$this->addDefaultCommentField('node', 'test_node_type', 'comment2');
@@ -145,7 +145,7 @@ class CommentFieldsTest extends CommentTestBase {
/**
* Tests creating a comment field through the interface.
*/
- public function testCommentFieldCreate() {
+ public function testCommentFieldCreate(): void {
// Create user who can administer user fields.
$user = $this->drupalCreateUser([
'administer user fields',
diff --git a/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php
index 48477dffccf..beb71661cd4 100644
--- a/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php
@@ -46,7 +46,7 @@ class CommentInterfaceTest extends CommentTestBase {
/**
* Tests the comment interface.
*/
- public function testCommentInterface() {
+ public function testCommentInterface(): void {
// Post comment #1 without subject or preview.
$this->drupalLogin($this->webUser);
@@ -227,7 +227,7 @@ class CommentInterfaceTest extends CommentTestBase {
* comment body are used for the subject. If this would break within a word,
* then the break is put at the previous word boundary instead.
*/
- public function testAutoFilledSubject() {
+ public function testAutoFilledSubject(): void {
$this->drupalLogin($this->webUser);
$this->drupalGet('node/' . $this->node->id());
@@ -260,7 +260,7 @@ class CommentInterfaceTest extends CommentTestBase {
* with the additional check that HTML is stripped appropriately prior to
* character-counting.
*/
- public function testAutoFilledHtmlSubject() {
+ public function testAutoFilledHtmlSubject(): void {
// Set up two default (i.e. filtered HTML) input formats, because then we
// can select one of them. Then create a user that can use these formats,
// log the user in, and then GET the node page on which to test the
@@ -309,7 +309,7 @@ class CommentInterfaceTest extends CommentTestBase {
/**
* Tests the comment formatter configured with a custom comment view mode.
*/
- public function testViewMode() {
+ public function testViewMode(): void {
$this->drupalLogin($this->webUser);
$this->drupalGet($this->node->toUrl());
$comment_text = $this->randomMachineName();
diff --git a/core/modules/comment/tests/src/Functional/CommentLanguageTest.php b/core/modules/comment/tests/src/Functional/CommentLanguageTest.php
index e098ea3f340..213e4e04211 100644
--- a/core/modules/comment/tests/src/Functional/CommentLanguageTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentLanguageTest.php
@@ -106,7 +106,7 @@ class CommentLanguageTest extends BrowserTestBase {
/**
* Tests that comment language is properly set.
*/
- public function testCommentLanguage() {
+ public function testCommentLanguage(): void {
// Create two nodes, one for english and one for french, and comment each
// node using both english and french as content language by changing URL
diff --git a/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php b/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php
index aeb6c015863..20d1c06e9fb 100644
--- a/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php
@@ -31,7 +31,7 @@ class CommentLinksAlterTest extends CommentTestBase {
/**
* Tests comment links altering.
*/
- public function testCommentLinksAlter() {
+ public function testCommentLinksAlter(): void {
$this->drupalLogin($this->webUser);
$comment_text = $this->randomMachineName();
$subject = $this->randomMachineName();
diff --git a/core/modules/comment/tests/src/Functional/CommentLinksTest.php b/core/modules/comment/tests/src/Functional/CommentLinksTest.php
index bb2b0c36b24..dd625e67575 100644
--- a/core/modules/comment/tests/src/Functional/CommentLinksTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentLinksTest.php
@@ -49,7 +49,7 @@ class CommentLinksTest extends CommentTestBase {
/**
* Tests that comment links are output and can be hidden.
*/
- public function testCommentLinks() {
+ public function testCommentLinks(): void {
// Remove additional user permissions from $this->webUser added by setUp(),
// since this test is limited to anonymous and authenticated roles only.
$roles = $this->webUser->getRoles();
diff --git a/core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php b/core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php
index 88a91176ad9..aab53335042 100644
--- a/core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php
@@ -57,7 +57,7 @@ class CommentNewIndicatorTest extends CommentTestBase {
/**
* Tests new comment marker.
*/
- public function testCommentNewCommentsIndicator() {
+ public function testCommentNewCommentsIndicator(): void {
// Test if the right links are displayed when no comment is present for the
// node.
$this->drupalLogin($this->adminUser);
diff --git a/core/modules/comment/tests/src/Functional/CommentNodeAccessTest.php b/core/modules/comment/tests/src/Functional/CommentNodeAccessTest.php
index fa89d9bb869..6e75e64fe26 100644
--- a/core/modules/comment/tests/src/Functional/CommentNodeAccessTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentNodeAccessTest.php
@@ -53,7 +53,7 @@ class CommentNodeAccessTest extends CommentTestBase {
/**
* Tests that threaded comments can be viewed.
*/
- public function testThreadedCommentView() {
+ public function testThreadedCommentView(): void {
// Set comments to have subject required and preview disabled.
$this->setCommentPreview(DRUPAL_DISABLED);
$this->setCommentForm(TRUE);
diff --git a/core/modules/comment/tests/src/Functional/CommentNodeChangesTest.php b/core/modules/comment/tests/src/Functional/CommentNodeChangesTest.php
index bc76ae97a87..feae4736c69 100644
--- a/core/modules/comment/tests/src/Functional/CommentNodeChangesTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentNodeChangesTest.php
@@ -23,7 +23,7 @@ class CommentNodeChangesTest extends CommentTestBase {
/**
* Tests that comments are deleted with the node.
*/
- public function testNodeDeletion() {
+ public function testNodeDeletion(): void {
$this->drupalLogin($this->webUser);
$comment = $this->postComment($this->node, $this->randomMachineName(), $this->randomMachineName());
$this->assertInstanceOf(Comment::class, $comment);
diff --git a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
index 9693ac528f7..67a498278f6 100644
--- a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
@@ -265,7 +265,7 @@ class CommentNonNodeTest extends BrowserTestBase {
/**
* Tests anonymous comment functionality.
*/
- public function testCommentFunctionality() {
+ public function testCommentFunctionality(): void {
$limited_user = $this->drupalCreateUser([
'administer entity_test fields',
]);
@@ -490,7 +490,7 @@ class CommentNonNodeTest extends BrowserTestBase {
/**
* Tests comment fields cannot be added to entity types without integer IDs.
*/
- public function testsNonIntegerIdEntities() {
+ public function testsNonIntegerIdEntities(): void {
// Create a bundle for entity_test_string_id.
entity_test_create_bundle('entity_test', 'Entity Test', 'entity_test_string_id');
$limited_user = $this->drupalCreateUser([
@@ -526,7 +526,7 @@ class CommentNonNodeTest extends BrowserTestBase {
/**
* Ensures that comment settings are not required.
*/
- public function testCommentSettingsNotRequired() {
+ public function testCommentSettingsNotRequired(): void {
$limited_user = $this->drupalCreateUser([
'administer entity_test fields',
]);
diff --git a/core/modules/comment/tests/src/Functional/CommentPagerTest.php b/core/modules/comment/tests/src/Functional/CommentPagerTest.php
index 3d1b927cb45..d6b01d72173 100644
--- a/core/modules/comment/tests/src/Functional/CommentPagerTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentPagerTest.php
@@ -23,7 +23,7 @@ class CommentPagerTest extends CommentTestBase {
/**
* Confirms comment paging works correctly with flat and threaded comments.
*/
- public function testCommentPaging() {
+ public function testCommentPaging(): void {
$this->drupalLogin($this->adminUser);
// Set comment variables.
@@ -113,7 +113,7 @@ class CommentPagerTest extends CommentTestBase {
/**
* Confirms comment paging works correctly with flat and threaded comments.
*/
- public function testCommentPermalink() {
+ public function testCommentPermalink(): void {
$this->drupalLogin($this->adminUser);
// Set comment variables.
@@ -145,7 +145,7 @@ class CommentPagerTest extends CommentTestBase {
/**
* Tests comment ordering and threading.
*/
- public function testCommentOrderingThreading() {
+ public function testCommentOrderingThreading(): void {
$this->drupalLogin($this->adminUser);
// Set comment variables.
@@ -246,7 +246,7 @@ class CommentPagerTest extends CommentTestBase {
/**
* Tests calculation of first page with new comment.
*/
- public function testCommentNewPageIndicator() {
+ public function testCommentNewPageIndicator(): void {
$this->drupalLogin($this->adminUser);
// Set comment variables.
@@ -338,7 +338,7 @@ class CommentPagerTest extends CommentTestBase {
/**
* Confirms comment paging works correctly with two pagers.
*/
- public function testTwoPagers() {
+ public function testTwoPagers(): void {
// Add another field to article content-type.
$this->addDefaultCommentField('node', 'article', 'comment_2');
// Set default to display comment list with unique pager id.
diff --git a/core/modules/comment/tests/src/Functional/CommentPreviewTest.php b/core/modules/comment/tests/src/Functional/CommentPreviewTest.php
index 6175e382ebc..3d9676c8b73 100644
--- a/core/modules/comment/tests/src/Functional/CommentPreviewTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentPreviewTest.php
@@ -36,7 +36,7 @@ class CommentPreviewTest extends CommentTestBase {
/**
* Tests comment preview.
*/
- public function testCommentPreview() {
+ public function testCommentPreview(): void {
$this->setCommentPreview(DRUPAL_OPTIONAL);
$this->setCommentForm(TRUE);
$this->setCommentSubject(TRUE);
@@ -92,7 +92,7 @@ class CommentPreviewTest extends CommentTestBase {
/**
* Tests comment preview.
*/
- public function testCommentPreviewDuplicateSubmission() {
+ public function testCommentPreviewDuplicateSubmission(): void {
$this->setCommentPreview(DRUPAL_OPTIONAL);
$this->setCommentForm(TRUE);
$this->setCommentSubject(TRUE);
@@ -133,7 +133,7 @@ class CommentPreviewTest extends CommentTestBase {
/**
* Tests comment edit, preview, and save.
*/
- public function testCommentEditPreviewSave() {
+ public function testCommentEditPreviewSave(): void {
$web_user = $this->drupalCreateUser([
'access comments',
'post comments',
diff --git a/core/modules/comment/tests/src/Functional/CommentRssTest.php b/core/modules/comment/tests/src/Functional/CommentRssTest.php
index d0f84215a30..3aed649a0a1 100644
--- a/core/modules/comment/tests/src/Functional/CommentRssTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentRssTest.php
@@ -49,7 +49,7 @@ class CommentRssTest extends CommentTestBase {
/**
* Tests comments as part of an RSS feed.
*/
- public function testCommentRss() {
+ public function testCommentRss(): void {
// Find comment in RSS feed.
$this->drupalLogin($this->webUser);
$this->postComment($this->node, $this->randomMachineName(), $this->randomMachineName());
diff --git a/core/modules/comment/tests/src/Functional/CommentStatisticsTest.php b/core/modules/comment/tests/src/Functional/CommentStatisticsTest.php
index 9a309f16e0a..202db96c362 100644
--- a/core/modules/comment/tests/src/Functional/CommentStatisticsTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentStatisticsTest.php
@@ -53,7 +53,7 @@ class CommentStatisticsTest extends CommentTestBase {
/**
* Tests the node comment statistics.
*/
- public function testCommentNodeCommentStatistics() {
+ public function testCommentNodeCommentStatistics(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
// Set comments to have subject and preview disabled.
$this->setCommentPreview(DRUPAL_DISABLED);
diff --git a/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php b/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php
index 9a654e7316c..e3f336c3378 100644
--- a/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php
@@ -85,7 +85,7 @@ class CommentStatusFieldAccessTest extends BrowserTestBase {
/**
* Tests comment status field access.
*/
- public function testCommentStatusFieldAccessStatus() {
+ public function testCommentStatusFieldAccessStatus(): void {
$this->drupalLogin($this->nodeAuthor);
$this->drupalGet('node/add/article');
$assert = $this->assertSession();
diff --git a/core/modules/comment/tests/src/Functional/CommentThreadingTest.php b/core/modules/comment/tests/src/Functional/CommentThreadingTest.php
index 12eb2b14974..38620e75af5 100644
--- a/core/modules/comment/tests/src/Functional/CommentThreadingTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentThreadingTest.php
@@ -21,7 +21,7 @@ class CommentThreadingTest extends CommentTestBase {
/**
* Tests the comment threading.
*/
- public function testCommentThreading() {
+ public function testCommentThreading(): void {
// Set comments to have a subject with preview disabled.
$this->setCommentPreview(DRUPAL_DISABLED);
$this->setCommentForm(TRUE);
diff --git a/core/modules/comment/tests/src/Functional/CommentTitleTest.php b/core/modules/comment/tests/src/Functional/CommentTitleTest.php
index 644aadb9641..a215a36d440 100644
--- a/core/modules/comment/tests/src/Functional/CommentTitleTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentTitleTest.php
@@ -19,7 +19,7 @@ class CommentTitleTest extends CommentTestBase {
/**
* Tests markup for comments with empty titles.
*/
- public function testCommentEmptyTitles() {
+ public function testCommentEmptyTitles(): void {
// Create a node.
$this->drupalLogin($this->webUser);
$this->node = $this->drupalCreateNode(['type' => 'article', 'promote' => 1, 'uid' => $this->webUser->id()]);
@@ -67,7 +67,7 @@ class CommentTitleTest extends CommentTestBase {
/**
* Tests markup for comments with populated titles.
*/
- public function testCommentPopulatedTitles() {
+ public function testCommentPopulatedTitles(): void {
// Set comments to have a subject with preview disabled.
$this->setCommentPreview(DRUPAL_DISABLED);
$this->setCommentForm(TRUE);
diff --git a/core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php b/core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php
index 76a28ce954f..9bbc1e8c530 100644
--- a/core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php
@@ -34,7 +34,7 @@ class CommentTokenReplaceTest extends CommentTestBase {
/**
* Creates a comment, then tests the tokens generated from it.
*/
- public function testCommentTokenReplacement() {
+ public function testCommentTokenReplacement(): void {
$token_service = \Drupal::token();
$language_interface = \Drupal::languageManager()->getCurrentLanguage();
$url_options = [
diff --git a/core/modules/comment/tests/src/Functional/CommentTranslationUITest.php b/core/modules/comment/tests/src/Functional/CommentTranslationUITest.php
index 7cfb47da61c..b1e575d4b54 100644
--- a/core/modules/comment/tests/src/Functional/CommentTranslationUITest.php
+++ b/core/modules/comment/tests/src/Functional/CommentTranslationUITest.php
@@ -204,7 +204,7 @@ class CommentTranslationUITest extends ContentTranslationUITestBase {
/**
* Tests translate link on comment content admin page.
*/
- public function testTranslateLinkCommentAdminPage() {
+ public function testTranslateLinkCommentAdminPage(): void {
$this->adminUser = $this->drupalCreateUser(array_merge(parent::getTranslatorPermissions(), ['access administration pages', 'administer comments', 'skip comment approval']));
$this->drupalLogin($this->adminUser);
diff --git a/core/modules/comment/tests/src/Functional/CommentTypeTest.php b/core/modules/comment/tests/src/Functional/CommentTypeTest.php
index 1eb95ea4f58..9ac706b12a5 100644
--- a/core/modules/comment/tests/src/Functional/CommentTypeTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentTypeTest.php
@@ -57,7 +57,7 @@ class CommentTypeTest extends CommentTestBase {
/**
* Tests creating a comment type programmatically and via a form.
*/
- public function testCommentTypeCreation() {
+ public function testCommentTypeCreation(): void {
// Create a comment type programmatically.
$type = $this->createCommentType('other');
@@ -121,7 +121,7 @@ class CommentTypeTest extends CommentTestBase {
/**
* Tests editing a comment type using the UI.
*/
- public function testCommentTypeEditing() {
+ public function testCommentTypeEditing(): void {
$this->drupalLogin($this->adminUser);
$field = FieldConfig::loadByName('comment', 'comment', 'comment_body');
@@ -156,7 +156,7 @@ class CommentTypeTest extends CommentTestBase {
/**
* Tests deleting a comment type that still has content.
*/
- public function testCommentTypeDeletion() {
+ public function testCommentTypeDeletion(): void {
// Create a comment type programmatically.
$type = $this->createCommentType('foo');
$this->drupalCreateContentType(['type' => 'page']);
diff --git a/core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php b/core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php
index 5dd9abdd32d..60b13b23616 100644
--- a/core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php
+++ b/core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php
@@ -289,7 +289,7 @@ abstract class CommentResourceTestBase extends EntityResourceTestBase {
* - base fields that are marked as required, but yet can still result in
* validation errors other than "missing required field".
*/
- public function testPostDxWithoutCriticalBaseFields() {
+ public function testPostDxWithoutCriticalBaseFields(): void {
$this->initAuthentication();
$this->provisionEntityResource();
$this->setUpAuthorization('POST');
@@ -341,7 +341,7 @@ abstract class CommentResourceTestBase extends EntityResourceTestBase {
/**
* Tests POSTing a comment with and without 'skip comment approval'.
*/
- public function testPostSkipCommentApproval() {
+ public function testPostSkipCommentApproval(): void {
$this->initAuthentication();
$this->provisionEntityResource();
$this->setUpAuthorization('POST');
diff --git a/core/modules/comment/tests/src/Functional/Rest/CommentXmlAnonTest.php b/core/modules/comment/tests/src/Functional/Rest/CommentXmlAnonTest.php
index 95836456817..6404656dfe9 100644
--- a/core/modules/comment/tests/src/Functional/Rest/CommentXmlAnonTest.php
+++ b/core/modules/comment/tests/src/Functional/Rest/CommentXmlAnonTest.php
@@ -55,7 +55,7 @@ class CommentXmlAnonTest extends CommentResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPostDxWithoutCriticalBaseFields() {
+ public function testPostDxWithoutCriticalBaseFields(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
@@ -63,7 +63,7 @@ class CommentXmlAnonTest extends CommentResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPostSkipCommentApproval() {
+ public function testPostSkipCommentApproval(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/comment/tests/src/Functional/Rest/CommentXmlBasicAuthTest.php b/core/modules/comment/tests/src/Functional/Rest/CommentXmlBasicAuthTest.php
index cc62c590df4..05fec0c0a77 100644
--- a/core/modules/comment/tests/src/Functional/Rest/CommentXmlBasicAuthTest.php
+++ b/core/modules/comment/tests/src/Functional/Rest/CommentXmlBasicAuthTest.php
@@ -44,7 +44,7 @@ class CommentXmlBasicAuthTest extends CommentResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPostDxWithoutCriticalBaseFields() {
+ public function testPostDxWithoutCriticalBaseFields(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
@@ -52,7 +52,7 @@ class CommentXmlBasicAuthTest extends CommentResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPostSkipCommentApproval() {
+ public function testPostSkipCommentApproval(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/comment/tests/src/Functional/Rest/CommentXmlCookieTest.php b/core/modules/comment/tests/src/Functional/Rest/CommentXmlCookieTest.php
index 44b6fc95030..44028b9db89 100644
--- a/core/modules/comment/tests/src/Functional/Rest/CommentXmlCookieTest.php
+++ b/core/modules/comment/tests/src/Functional/Rest/CommentXmlCookieTest.php
@@ -39,7 +39,7 @@ class CommentXmlCookieTest extends CommentResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPostDxWithoutCriticalBaseFields() {
+ public function testPostDxWithoutCriticalBaseFields(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
@@ -47,7 +47,7 @@ class CommentXmlCookieTest extends CommentResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPostSkipCommentApproval() {
+ public function testPostSkipCommentApproval(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/comment/tests/src/Functional/Views/CommentAdminTest.php b/core/modules/comment/tests/src/Functional/Views/CommentAdminTest.php
index 2676189c120..2156aad327f 100644
--- a/core/modules/comment/tests/src/Functional/Views/CommentAdminTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentAdminTest.php
@@ -55,7 +55,7 @@ class CommentAdminTest extends CommentBrowserTestBase {
/**
* Tests comment approval functionality through admin/content/comment.
*/
- public function testApprovalAdminInterface() {
+ public function testApprovalAdminInterface(): void {
// Set anonymous comments to require approval.
user_role_change_permissions(RoleInterface::ANONYMOUS_ID, [
'access comments' => TRUE,
@@ -205,7 +205,7 @@ class CommentAdminTest extends CommentBrowserTestBase {
/**
* Tests commented entity label of admin view.
*/
- public function testCommentedEntityLabel() {
+ public function testCommentedEntityLabel(): void {
\Drupal::service('module_installer')->install(['block_content']);
\Drupal::service('router.builder')->rebuildIfNeeded();
$bundle = BlockContentType::create([
diff --git a/core/modules/comment/tests/src/Functional/Views/CommentApproveLinkTest.php b/core/modules/comment/tests/src/Functional/Views/CommentApproveLinkTest.php
index a5e7e65886a..97edfbcc442 100644
--- a/core/modules/comment/tests/src/Functional/Views/CommentApproveLinkTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentApproveLinkTest.php
@@ -43,7 +43,7 @@ class CommentApproveLinkTest extends CommentTestBase {
/**
* Tests that "approve comment" link exists and works as expected.
*/
- public function testCommentApproveLink() {
+ public function testCommentApproveLink(): void {
$this->drupalLogin($this->drupalCreateUser(['administer comments']));
// Set the comment status to unpublished.
$this->comment->setUnpublished();
diff --git a/core/modules/comment/tests/src/Functional/Views/CommentEditTest.php b/core/modules/comment/tests/src/Functional/Views/CommentEditTest.php
index b75da43e194..c932d19b34e 100644
--- a/core/modules/comment/tests/src/Functional/Views/CommentEditTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentEditTest.php
@@ -21,7 +21,7 @@ class CommentEditTest extends CommentBrowserTestBase {
/**
* Tests comment label in admin view.
*/
- public function testCommentEdit() {
+ public function testCommentEdit(): void {
$this->drupalLogin($this->adminUser);
// Post a comment to node.
$node_comment = $this->postComment($this->node, $this->randomMachineName(), $this->randomMachineName(), TRUE);
diff --git a/core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php b/core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php
index 63b84c45c57..0c58b3320d6 100644
--- a/core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php
@@ -85,7 +85,7 @@ class CommentFieldFilterTest extends CommentTestBase {
/**
* Tests body and title filters.
*/
- public function testFilters() {
+ public function testFilters(): void {
// Test the title filter page, which filters for title contains 'Comida'.
// Should show just the Spanish translation, once.
$this->assertPageCounts('test-title-filter', ['es' => 1, 'fr' => 0, 'en' => 0], 'Comida title filter');
diff --git a/core/modules/comment/tests/src/Functional/Views/CommentOperationsTest.php b/core/modules/comment/tests/src/Functional/Views/CommentOperationsTest.php
index 04a67d304a6..9f657ca01f4 100644
--- a/core/modules/comment/tests/src/Functional/Views/CommentOperationsTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentOperationsTest.php
@@ -26,7 +26,7 @@ class CommentOperationsTest extends CommentTestBase {
/**
* Tests the operations field plugin.
*/
- public function testCommentOperations() {
+ public function testCommentOperations(): void {
$admin_account = $this->drupalCreateUser(['administer comments']);
$this->drupalLogin($admin_account);
$this->drupalGet('test-comment-operations');
diff --git a/core/modules/comment/tests/src/Functional/Views/CommentRowTest.php b/core/modules/comment/tests/src/Functional/Views/CommentRowTest.php
index 2011a8becb4..f8502f890d8 100644
--- a/core/modules/comment/tests/src/Functional/Views/CommentRowTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentRowTest.php
@@ -26,7 +26,7 @@ class CommentRowTest extends CommentTestBase {
/**
* Tests comment row.
*/
- public function testCommentRow() {
+ public function testCommentRow(): void {
$this->drupalGet('test-comment-row');
$this->assertSession()->elementsCount('xpath', '//article[contains(@class, "comment")]', 1);
}
diff --git a/core/modules/comment/tests/src/Functional/Views/DefaultViewRecentCommentsTest.php b/core/modules/comment/tests/src/Functional/Views/DefaultViewRecentCommentsTest.php
index fbf13cf3e69..65bd437ce27 100644
--- a/core/modules/comment/tests/src/Functional/Views/DefaultViewRecentCommentsTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/DefaultViewRecentCommentsTest.php
@@ -118,7 +118,7 @@ class DefaultViewRecentCommentsTest extends ViewTestBase {
/**
* Tests the block defined by the comments_recent view.
*/
- public function testBlockDisplay() {
+ public function testBlockDisplay(): void {
$user = $this->drupalCreateUser(['access comments']);
$this->drupalLogin($user);
diff --git a/core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php b/core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php
index 56c80d658e8..da0c274f1c8 100644
--- a/core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php
@@ -33,7 +33,7 @@ class NodeCommentsTest extends CommentTestBase {
/**
* Tests the new comments field plugin.
*/
- public function testNewComments() {
+ public function testNewComments(): void {
$this->drupalGet('test-new-comments');
$this->assertSession()->statusCodeEquals(200);
$new_comments = $this->cssSelect(".views-field-new-comments a:contains('1')");
@@ -43,7 +43,7 @@ class NodeCommentsTest extends CommentTestBase {
/**
* Test the comment count field.
*/
- public function testCommentCount() {
+ public function testCommentCount(): void {
$this->drupalGet('test-comment-count');
$this->assertSession()->statusCodeEquals(200);
$this->assertCount(2, $this->cssSelect('.views-row'));
diff --git a/core/modules/comment/tests/src/Functional/Views/RowRssTest.php b/core/modules/comment/tests/src/Functional/Views/RowRssTest.php
index a58f1cae5bf..d4e90589701 100644
--- a/core/modules/comment/tests/src/Functional/Views/RowRssTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/RowRssTest.php
@@ -27,7 +27,7 @@ class RowRssTest extends CommentTestBase {
/**
* Tests comment rss output.
*/
- public function testRssRow() {
+ public function testRssRow(): void {
$this->drupalGet('test-comment-rss');
// Because the response is XML we can't use the page which depends on an
diff --git a/core/modules/comment/tests/src/Functional/Views/WizardTest.php b/core/modules/comment/tests/src/Functional/Views/WizardTest.php
index 12286a0a85b..1b94591e5b5 100644
--- a/core/modules/comment/tests/src/Functional/Views/WizardTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/WizardTest.php
@@ -43,7 +43,7 @@ class WizardTest extends WizardTestBase {
/**
* Tests adding a view of comments.
*/
- public function testCommentWizard() {
+ public function testCommentWizard(): void {
$view = [];
$view['label'] = $this->randomMachineName(16);
$view['id'] = $this->randomMachineName(16);
diff --git a/core/modules/comment/tests/src/Kernel/CommentBaseFieldTest.php b/core/modules/comment/tests/src/Kernel/CommentBaseFieldTest.php
index 6b6da07b346..24c43a8eac6 100644
--- a/core/modules/comment/tests/src/Kernel/CommentBaseFieldTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentBaseFieldTest.php
@@ -41,7 +41,7 @@ class CommentBaseFieldTest extends KernelTestBase {
/**
* Tests comment as a base field.
*/
- public function testCommentBaseField() {
+ public function testCommentBaseField(): void {
// Verify entity creation.
$entity = CommentTestBaseField::create([
'name' => $this->randomMachineName(),
diff --git a/core/modules/comment/tests/src/Kernel/CommentBundlesTest.php b/core/modules/comment/tests/src/Kernel/CommentBundlesTest.php
index cc2f5a80948..ee5ea547ee4 100644
--- a/core/modules/comment/tests/src/Kernel/CommentBundlesTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentBundlesTest.php
@@ -60,7 +60,7 @@ class CommentBundlesTest extends KernelTestBase {
/**
* Tests that the entity_id field is set correctly for each comment bundle.
*/
- public function testEntityIdField() {
+ public function testEntityIdField(): void {
$field_definitions = [];
foreach (array_keys($this->targetEntityTypes) as $id) {
diff --git a/core/modules/comment/tests/src/Kernel/CommentDefaultFormatterCacheTagsTest.php b/core/modules/comment/tests/src/Kernel/CommentDefaultFormatterCacheTagsTest.php
index ecbc1d64c09..4eca26e0610 100644
--- a/core/modules/comment/tests/src/Kernel/CommentDefaultFormatterCacheTagsTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentDefaultFormatterCacheTagsTest.php
@@ -71,7 +71,7 @@ class CommentDefaultFormatterCacheTagsTest extends EntityKernelTestBase {
/**
* Tests the bubbling of cache tags.
*/
- public function testCacheTags() {
+ public function testCacheTags(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
diff --git a/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php b/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php
index c1f492035ad..82e1e1c759d 100644
--- a/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php
@@ -95,7 +95,7 @@ class CommentFieldAccessTest extends EntityKernelTestBase {
/**
* Tests permissions on comment fields.
*/
- public function testAccessToAdministrativeFields() {
+ public function testAccessToAdministrativeFields(): void {
// Create a comment type.
$comment_type = CommentType::create([
'id' => 'comment',
diff --git a/core/modules/comment/tests/src/Kernel/CommentHostnameTest.php b/core/modules/comment/tests/src/Kernel/CommentHostnameTest.php
index a0e0c7e68a7..305ae0cfbc5 100644
--- a/core/modules/comment/tests/src/Kernel/CommentHostnameTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentHostnameTest.php
@@ -30,7 +30,7 @@ class CommentHostnameTest extends KernelTestBase {
*
* @covers ::getDefaultHostname
*/
- public function testGetDefaultHostname() {
+ public function testGetDefaultHostname(): void {
// Create a fake request to be used for testing.
$request = Request::create('/', 'GET', [], [], [], ['REMOTE_ADDR' => '203.0.113.1']);
$request->setSession(new Session(new MockArraySessionStorage()));
diff --git a/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php b/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php
index 58ab6a9102e..ff1fc72da68 100644
--- a/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php
@@ -59,7 +59,7 @@ class CommentIntegrationTest extends KernelTestBase {
* @see comment_entity_view_display_presave()
* @see CommentDefaultFormatter::calculateDependencies()
*/
- public function testViewMode() {
+ public function testViewMode(): void {
$mode = $this->randomMachineName();
// Create a new comment view mode and a view display entity.
EntityViewMode::create([
@@ -151,7 +151,7 @@ class CommentIntegrationTest extends KernelTestBase {
/**
* Tests the default owner of comment entities.
*/
- public function testCommentDefaultOwner() {
+ public function testCommentDefaultOwner(): void {
$comment = Comment::create([
'comment_type' => 'comment',
]);
diff --git a/core/modules/comment/tests/src/Kernel/CommentItemTest.php b/core/modules/comment/tests/src/Kernel/CommentItemTest.php
index c0cf918bcdb..12ac7a09734 100644
--- a/core/modules/comment/tests/src/Kernel/CommentItemTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentItemTest.php
@@ -40,7 +40,7 @@ class CommentItemTest extends FieldKernelTestBase {
/**
* Tests using entity fields of the comment field type.
*/
- public function testCommentItem() {
+ public function testCommentItem(): void {
$this->addDefaultCommentField('entity_test', 'entity_test', 'comment');
// Verify entity creation.
@@ -74,7 +74,7 @@ class CommentItemTest extends FieldKernelTestBase {
/**
* Tests comment author name.
*/
- public function testCommentAuthorName() {
+ public function testCommentAuthorName(): void {
$this->installEntitySchema('comment');
$this->addDefaultCommentField('entity_test', 'entity_test', 'comment');
diff --git a/core/modules/comment/tests/src/Kernel/CommentOrphanTest.php b/core/modules/comment/tests/src/Kernel/CommentOrphanTest.php
index 5c660f57b51..8c31076f475 100644
--- a/core/modules/comment/tests/src/Kernel/CommentOrphanTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentOrphanTest.php
@@ -39,7 +39,7 @@ class CommentOrphanTest extends EntityKernelTestBase {
*
* @dataProvider providerTestOrphan
*/
- public function testOrphan($property) {
+ public function testOrphan($property): void {
DateFormat::create([
'id' => 'fallback',
diff --git a/core/modules/comment/tests/src/Kernel/CommentStringIdEntitiesTest.php b/core/modules/comment/tests/src/Kernel/CommentStringIdEntitiesTest.php
index a2b3f46dedc..ff57326f69a 100644
--- a/core/modules/comment/tests/src/Kernel/CommentStringIdEntitiesTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentStringIdEntitiesTest.php
@@ -44,7 +44,7 @@ class CommentStringIdEntitiesTest extends KernelTestBase {
/**
* Tests that comment fields cannot be added entities with non-integer IDs.
*/
- public function testCommentFieldNonStringId() {
+ public function testCommentFieldNonStringId(): void {
$this->expectException(\UnexpectedValueException::class);
$bundle = CommentType::create([
'id' => 'foo',
diff --git a/core/modules/comment/tests/src/Kernel/CommentUninstallTest.php b/core/modules/comment/tests/src/Kernel/CommentUninstallTest.php
index ddeb62260a2..8c40b5a44cf 100644
--- a/core/modules/comment/tests/src/Kernel/CommentUninstallTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentUninstallTest.php
@@ -58,7 +58,7 @@ class CommentUninstallTest extends KernelTestBase {
/**
* Tests if comment module uninstall fails if the field exists.
*/
- public function testCommentUninstallWithField() {
+ public function testCommentUninstallWithField(): void {
// Ensure that the field exists before uninstalling.
$field_storage = FieldStorageConfig::loadByName('comment', 'comment_body');
$this->assertNotNull($field_storage);
@@ -72,7 +72,7 @@ class CommentUninstallTest extends KernelTestBase {
/**
* Tests if uninstallation succeeds if the field has been deleted beforehand.
*/
- public function testCommentUninstallWithoutField() {
+ public function testCommentUninstallWithoutField(): void {
// Tests if uninstall succeeds if the field has been deleted beforehand.
// Manually delete the comment_body field before module uninstall.
FieldStorageConfig::loadByName('comment', 'comment_body')->delete();
diff --git a/core/modules/comment/tests/src/Kernel/CommentValidationTest.php b/core/modules/comment/tests/src/Kernel/CommentValidationTest.php
index b0a7ae38c28..fc1d295908e 100644
--- a/core/modules/comment/tests/src/Kernel/CommentValidationTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentValidationTest.php
@@ -41,7 +41,7 @@ class CommentValidationTest extends EntityKernelTestBase {
/**
* Tests the comment validation constraints.
*/
- public function testValidation() {
+ public function testValidation(): void {
// Add a user.
$user = User::create(['name' => 'test', 'status' => TRUE]);
$user->save();
@@ -192,7 +192,7 @@ class CommentValidationTest extends EntityKernelTestBase {
/**
* Tests that comments of unpublished nodes are not valid.
*/
- public function testValidationOfCommentOfUnpublishedNode() {
+ public function testValidationOfCommentOfUnpublishedNode(): void {
// Create a page node type.
$this->entityTypeManager->getStorage('node_type')->create([
'type' => 'page',
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php b/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php
index 21a134fe89f..d2a74fd7a46 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php
@@ -56,7 +56,7 @@ class MigrateCommentStubTest extends MigrateDrupalTestBase {
/**
* Tests creation of comment stubs.
*/
- public function testStub() {
+ public function testStub(): void {
$this->performStubTest('comment');
}
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 4fb6cbe2e67..0e28da2a865 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityDisplayTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityDisplayTest.php
@@ -57,7 +57,7 @@ class MigrateCommentEntityDisplayTest extends MigrateDrupal6TestBase {
/**
* Tests the migrated display configuration.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertDisplay('node.article.default', 'comment_node_article');
$this->assertDisplay('node.company.default', 'comment_node_company');
$this->assertDisplay('node.employee.default', 'comment_node_employee');
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 4b79d333a98..6186dee9cf7 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplaySubjectTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplaySubjectTest.php
@@ -63,7 +63,7 @@ class MigrateCommentEntityFormDisplaySubjectTest extends MigrateDrupal6TestBase
/**
* Tests the migrated display configuration.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertSubjectVisible('comment.comment_node_article.default');
$this->assertSubjectVisible('comment.comment_node_company.default');
$this->assertSubjectVisible('comment.comment_node_employee.default');
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 021c9a48a36..3c7590701d3 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplayTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplayTest.php
@@ -55,7 +55,7 @@ class MigrateCommentEntityFormDisplayTest extends MigrateDrupal6TestBase {
/**
* Tests the migrated display configuration.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertDisplay('node.article.default', 'comment_node_article');
$this->assertDisplay('node.company.default', 'comment_node_company');
$this->assertDisplay('node.employee.default', 'comment_node_employee');
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 f6696baba67..97163fcb21c 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldInstanceTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldInstanceTest.php
@@ -75,7 +75,7 @@ class MigrateCommentFieldInstanceTest extends MigrateDrupal6TestBase {
/**
* Tests the migrated field instance values.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertEntity('article', 'comment_node_article', 2, 1, 50, 0, FALSE, 1);
$this->assertEntity('company', 'comment_node_company', 2, 1, 50, 0, FALSE, 1);
$this->assertEntity('employee', 'comment_node_employee', 2, 1, 50, 0, FALSE, 1);
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 cbe2ba86be0..f1336881bfd 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldTest.php
@@ -51,7 +51,7 @@ class MigrateCommentFieldTest extends MigrateDrupal6TestBase {
/**
* Tests the migrated comment fields.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertEntity('comment_node_article');
$this->assertEntity('comment_node_company');
$this->assertEntity('comment_node_employee');
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTest.php
index e747be91711..8cc17c7fda3 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTest.php
@@ -59,7 +59,7 @@ class MigrateCommentTest extends MigrateDrupal6TestBase {
/**
* Tests the migrated comments.
*/
- public function testMigration() {
+ public function testMigration(): void {
$comment = Comment::load(1);
$this->assertSame('The first comment.', $comment->getSubject());
$this->assertSame('The first comment body.', $comment->comment_body->value);
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 8ee00767398..f3480914b43 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php
@@ -40,7 +40,7 @@ class MigrateCommentTypeTest extends MigrateDrupal6TestBase {
/**
* Tests the migrated comment types.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->installConfig(['comment']);
$this->executeMigration('d6_comment_type');
@@ -74,7 +74,7 @@ class MigrateCommentTypeTest extends MigrateDrupal6TestBase {
*
* @dataProvider providerTestNoCommentTypeMigration
*/
- public function testNoCommentTypeMigration(array $disabled_source_modules, array $expected_messages) {
+ public function testNoCommentTypeMigration(array $disabled_source_modules, array $expected_messages): void {
if (!empty($disabled_source_modules)) {
$this->sourceDatabase->update('system')
->condition('name', $disabled_source_modules, 'IN')
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/CommentEntityTranslationCheckRequirementsTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/CommentEntityTranslationCheckRequirementsTest.php
index 3166215c59d..47dc5969acd 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/CommentEntityTranslationCheckRequirementsTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/CommentEntityTranslationCheckRequirementsTest.php
@@ -28,7 +28,7 @@ class CommentEntityTranslationCheckRequirementsTest extends MigrateDrupal7TestBa
*
* @dataProvider providerTestCheckRequirements
*/
- public function testCheckRequirements($module) {
+ public function testCheckRequirements($module): void {
// Disable the module in the source site.
$this->sourceDatabase->update('system')
->condition('name', $module)
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 09bf1c59a90..d4c501fd869 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php
@@ -55,7 +55,7 @@ class MigrateCommentEntityDisplayTest extends MigrateDrupal7TestBase {
/**
* Tests the migrated display configuration.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertDisplay('node.page.default', 'comment_node_page');
$this->assertDisplay('node.article.default', 'comment_node_article');
$this->assertDisplay('node.book.default', 'comment_node_book');
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 c3346be203e..8331ddda88b 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php
@@ -60,7 +60,7 @@ class MigrateCommentEntityFormDisplaySubjectTest extends MigrateDrupal7TestBase
/**
* Tests the migrated display configuration.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertSubjectVisible('comment.comment_node_page.default');
$this->assertSubjectVisible('comment.comment_node_article.default');
$this->assertSubjectVisible('comment.comment_node_book.default');
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 9020d7bfa03..e4384f9165c 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplayTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplayTest.php
@@ -54,7 +54,7 @@ class MigrateCommentEntityFormDisplayTest extends MigrateDrupal7TestBase {
/**
* Tests the migrated display configuration.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertDisplay('node.page.default', 'comment_node_page');
$this->assertDisplay('node.article.default', 'comment_node_article');
$this->assertDisplay('node.book.default', 'comment_node_book');
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 b6e12b2f98d..08035c02625 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php
@@ -74,7 +74,7 @@ class MigrateCommentFieldInstanceTest extends MigrateDrupal7TestBase {
/**
* Tests the migrated fields.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertEntity('page', 'comment_node_page', 0, 1, 50, 0, TRUE, 1);
$this->assertEntity('article', 'comment_node_article', 2, 1, 50, 0, TRUE, 1);
$this->assertEntity('blog', 'comment_node_blog', 2, 1, 50, 0, TRUE, 1);
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 840149a5db1..24a5d6d4391 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php
@@ -48,7 +48,7 @@ class MigrateCommentFieldTest extends MigrateDrupal7TestBase {
/**
* Tests the migrated comment fields.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertEntity('comment_node_page');
$this->assertEntity('comment_node_article');
$this->assertEntity('comment_node_blog');
diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php
index 2a5f6c54dac..e60a4562e37 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php
@@ -66,7 +66,7 @@ class MigrateCommentTest extends MigrateDrupal7TestBase {
/**
* Tests the migrated comments.
*/
- public function testMigration() {
+ public function testMigration(): void {
$comment = Comment::load(1);
$this->assertInstanceOf(Comment::class, $comment);
$this->assertSame('Subject field in English', $comment->getSubject());
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 0bf90afa248..f5b014e9fdd 100644
--- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php
+++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php
@@ -40,7 +40,7 @@ class MigrateCommentTypeTest extends MigrateDrupal7TestBase {
/**
* Tests the migrated comment types.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->migrateCommentTypes();
$comment_fields = [
@@ -80,7 +80,7 @@ class MigrateCommentTypeTest extends MigrateDrupal7TestBase {
*
* @dataProvider providerTestNoCommentTypeMigration
*/
- public function testNoCommentTypeMigration(array $disabled_source_modules, array $expected_messages) {
+ public function testNoCommentTypeMigration(array $disabled_source_modules, array $expected_messages): void {
if (!empty($disabled_source_modules)) {
$this->sourceDatabase->update('system')
->condition('name', $disabled_source_modules, 'IN')
diff --git a/core/modules/comment/tests/src/Kernel/Plugin/migrate/source/CommentTypeRequirementsTest.php b/core/modules/comment/tests/src/Kernel/Plugin/migrate/source/CommentTypeRequirementsTest.php
index 29404430f43..379e51803b0 100644
--- a/core/modules/comment/tests/src/Kernel/Plugin/migrate/source/CommentTypeRequirementsTest.php
+++ b/core/modules/comment/tests/src/Kernel/Plugin/migrate/source/CommentTypeRequirementsTest.php
@@ -31,7 +31,7 @@ class CommentTypeRequirementsTest extends MigrateDrupal7TestBase {
*
* @dataProvider providerTestCheckCommentTypeRequirements
*/
- public function testCheckCommentTypeRequirements(array $disabled_source_modules, string $exception_message, string $migration_plugin_id) {
+ public function testCheckCommentTypeRequirements(array $disabled_source_modules, string $exception_message, string $migration_plugin_id): void {
if (!empty($disabled_source_modules)) {
$this->sourceDatabase->update('system')
->condition('name', $disabled_source_modules, 'IN')
diff --git a/core/modules/comment/tests/src/Kernel/Views/CommentAdminViewTest.php b/core/modules/comment/tests/src/Kernel/Views/CommentAdminViewTest.php
index 7713a558e84..a0e4ae3e38a 100644
--- a/core/modules/comment/tests/src/Kernel/Views/CommentAdminViewTest.php
+++ b/core/modules/comment/tests/src/Kernel/Views/CommentAdminViewTest.php
@@ -135,7 +135,7 @@ class CommentAdminViewTest extends ViewsKernelTestBase {
/**
* Tests comment admin view filters.
*/
- public function testFilters() {
+ public function testFilters(): void {
$this->doTestFilters('page_published');
// Unpublish the comments to test the Unapproved comments tab.
foreach ($this->comments as $comment) {
diff --git a/core/modules/comment/tests/src/Kernel/Views/CommentDepthTest.php b/core/modules/comment/tests/src/Kernel/Views/CommentDepthTest.php
index 58020cca1b5..48b6c2dd945 100644
--- a/core/modules/comment/tests/src/Kernel/Views/CommentDepthTest.php
+++ b/core/modules/comment/tests/src/Kernel/Views/CommentDepthTest.php
@@ -43,7 +43,7 @@ class CommentDepthTest extends CommentViewsKernelTestBase {
/**
* Test the comment depth.
*/
- public function testCommentDepth() {
+ public function testCommentDepth(): void {
$this->enableModules(['field']);
$this->installConfig(['field']);
diff --git a/core/modules/comment/tests/src/Kernel/Views/CommentFieldNameTest.php b/core/modules/comment/tests/src/Kernel/Views/CommentFieldNameTest.php
index 0cc0611a815..713ca4186b5 100644
--- a/core/modules/comment/tests/src/Kernel/Views/CommentFieldNameTest.php
+++ b/core/modules/comment/tests/src/Kernel/Views/CommentFieldNameTest.php
@@ -53,7 +53,7 @@ class CommentFieldNameTest extends KernelTestBase {
/**
* Tests comment field name.
*/
- public function testCommentFieldName() {
+ public function testCommentFieldName(): void {
$renderer = $this->container->get('renderer');
$this->installEntitySchema('user');
diff --git a/core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php b/core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php
index 954e24efb09..ecd8d4e4886 100644
--- a/core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php
+++ b/core/modules/comment/tests/src/Kernel/Views/CommentLinksTest.php
@@ -46,7 +46,7 @@ class CommentLinksTest extends CommentViewsKernelTestBase {
/**
* Tests the comment approve link.
*/
- public function testLinkApprove() {
+ public function testLinkApprove(): void {
$host = EntityTest::create(['name' => $this->randomString()]);
$host->save();
@@ -112,7 +112,7 @@ class CommentLinksTest extends CommentViewsKernelTestBase {
/**
* Tests the comment reply link.
*/
- public function testLinkReply() {
+ public function testLinkReply(): void {
$this->enableModules(['field']);
$this->installSchema('comment', ['comment_entity_statistics']);
$this->installConfig(['field']);
diff --git a/core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php b/core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php
index 6259dff4603..02b2eb0b23c 100644
--- a/core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php
+++ b/core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php
@@ -107,7 +107,7 @@ class CommentUserNameTest extends ViewsKernelTestBase {
/**
* Tests the username formatter.
*/
- public function testUsername() {
+ public function testUsername(): void {
$view_id = $this->randomMachineName();
$view = View::create([
'id' => $view_id,
diff --git a/core/modules/comment/tests/src/Kernel/Views/CommentViewsFieldAccessTest.php b/core/modules/comment/tests/src/Kernel/Views/CommentViewsFieldAccessTest.php
index 01679b517fc..3b682c4d8ea 100644
--- a/core/modules/comment/tests/src/Kernel/Views/CommentViewsFieldAccessTest.php
+++ b/core/modules/comment/tests/src/Kernel/Views/CommentViewsFieldAccessTest.php
@@ -34,7 +34,7 @@ class CommentViewsFieldAccessTest extends FieldFieldAccessTestBase {
/**
* Check access for comment fields.
*/
- public function testCommentFields() {
+ public function testCommentFields(): void {
$user = User::create([
'name' => 'test user',
]);
diff --git a/core/modules/comment/tests/src/Kernel/Views/FilterAndArgumentUserUidTest.php b/core/modules/comment/tests/src/Kernel/Views/FilterAndArgumentUserUidTest.php
index a2abce8b107..40eaeeaa3cb 100644
--- a/core/modules/comment/tests/src/Kernel/Views/FilterAndArgumentUserUidTest.php
+++ b/core/modules/comment/tests/src/Kernel/Views/FilterAndArgumentUserUidTest.php
@@ -52,7 +52,7 @@ class FilterAndArgumentUserUidTest extends KernelTestBase {
/**
* Tests the user posted or commented filter and argument handlers.
*/
- public function testHandlers() {
+ public function testHandlers(): void {
$this->installEntitySchema('user');
$this->installEntitySchema('node');
$this->installEntitySchema('comment');
diff --git a/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php b/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php
index 11507f3d72f..1d26daaf4a9 100644
--- a/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php
+++ b/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php
@@ -115,7 +115,7 @@ class CommentLinkBuilderTest extends UnitTestCase {
*
* @covers ::buildCommentedEntityLinks
*/
- public function testCommentLinkBuilder(array $node_args, $context, $has_access_comments, $history_exists, $has_post_comments, $is_anonymous, $expected) {
+ public function testCommentLinkBuilder(array $node_args, $context, $has_access_comments, $history_exists, $has_post_comments, $is_anonymous, $expected): void {
$node = $this->getMockNode(...$node_args);
$this->moduleHandler->expects($this->any())
->method('moduleExists')
diff --git a/core/modules/comment/tests/src/Unit/CommentManagerTest.php b/core/modules/comment/tests/src/Unit/CommentManagerTest.php
index 1409a886d4e..89230901bef 100644
--- a/core/modules/comment/tests/src/Unit/CommentManagerTest.php
+++ b/core/modules/comment/tests/src/Unit/CommentManagerTest.php
@@ -23,7 +23,7 @@ class CommentManagerTest extends UnitTestCase {
*
* @covers ::getFields
*/
- public function testGetFields() {
+ public function testGetFields(): void {
// Set up a content entity type.
$entity_type = $this->createMock('Drupal\Core\Entity\ContentEntityTypeInterface');
$entity_type->expects($this->any())
diff --git a/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php b/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php
index 0e1d7809d85..146d68277d7 100644
--- a/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php
+++ b/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php
@@ -99,7 +99,7 @@ class CommentStatisticsUnitTest extends UnitTestCase {
* @group Drupal
* @group Comment
*/
- public function testRead() {
+ public function testRead(): void {
$this->callsToFetch = 0;
$results = $this->commentStatistics->read(['1' => 'boo', '2' => 'foo'], 'snafus');
$this->assertEquals(['something', 'something-else'], $results);
diff --git a/core/modules/comment/tests/src/Unit/Entity/CommentLockTest.php b/core/modules/comment/tests/src/Unit/Entity/CommentLockTest.php
index 27441f6d426..81ee1d77e06 100644
--- a/core/modules/comment/tests/src/Unit/Entity/CommentLockTest.php
+++ b/core/modules/comment/tests/src/Unit/Entity/CommentLockTest.php
@@ -19,7 +19,7 @@ class CommentLockTest extends UnitTestCase {
/**
* Tests the lock behavior.
*/
- public function testLocks() {
+ public function testLocks(): void {
$container = new ContainerBuilder();
$container->set('module_handler', $this->createMock('Drupal\Core\Extension\ModuleHandlerInterface'));
$container->set('current_user', $this->createMock('Drupal\Core\Session\AccountInterface'));
diff --git a/core/modules/comment/tests/src/Unit/Plugin/views/field/CommentBulkFormTest.php b/core/modules/comment/tests/src/Unit/Plugin/views/field/CommentBulkFormTest.php
index c25bb748973..377dd1e2894 100644
--- a/core/modules/comment/tests/src/Unit/Plugin/views/field/CommentBulkFormTest.php
+++ b/core/modules/comment/tests/src/Unit/Plugin/views/field/CommentBulkFormTest.php
@@ -29,7 +29,7 @@ class CommentBulkFormTest extends UnitTestCase {
/**
* Tests the constructor assignment of actions.
*/
- public function testConstructor() {
+ public function testConstructor(): void {
$actions = [];
for ($i = 1; $i <= 2; $i++) {
diff --git a/core/modules/config/tests/src/Functional/CacheabilityMetadataConfigOverrideIntegrationTest.php b/core/modules/config/tests/src/Functional/CacheabilityMetadataConfigOverrideIntegrationTest.php
index 3e1f74fe6b5..bd619cec837 100644
--- a/core/modules/config/tests/src/Functional/CacheabilityMetadataConfigOverrideIntegrationTest.php
+++ b/core/modules/config/tests/src/Functional/CacheabilityMetadataConfigOverrideIntegrationTest.php
@@ -46,7 +46,7 @@ class CacheabilityMetadataConfigOverrideIntegrationTest extends BrowserTestBase
/**
* Tests if config overrides correctly set cacheability metadata.
*/
- public function testConfigOverride() {
+ public function testConfigOverride(): void {
// Check the default (disabled) state of the cache context. The block label
// should not be overridden.
$this->drupalGet('<front>');
diff --git a/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php b/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php
index 0be204b22b5..97a16d7671c 100644
--- a/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php
@@ -36,7 +36,7 @@ class ConfigDependencyWebTest extends BrowserTestBase {
*
* @see \Drupal\Core\Config\Entity\ConfigDependencyDeleteFormTrait
*/
- public function testConfigDependencyDeleteFormTrait() {
+ public function testConfigDependencyDeleteFormTrait(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer site configuration',
]));
diff --git a/core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php b/core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php
index 8688fc517ec..a04b9b9b37a 100644
--- a/core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php
@@ -28,7 +28,7 @@ class ConfigDraggableListBuilderTest extends BrowserTestBase {
/**
* Tests draggable lists.
*/
- public function testDraggableList() {
+ public function testDraggableList(): void {
$this->drupalLogin($this->drupalCreateUser(['administer permissions']));
// Create more than 50 roles.
diff --git a/core/modules/config/tests/src/Functional/ConfigEntityFormOverrideTest.php b/core/modules/config/tests/src/Functional/ConfigEntityFormOverrideTest.php
index 1cad82aaee0..b4789958f28 100644
--- a/core/modules/config/tests/src/Functional/ConfigEntityFormOverrideTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigEntityFormOverrideTest.php
@@ -26,7 +26,7 @@ class ConfigEntityFormOverrideTest extends BrowserTestBase {
/**
* Tests that overrides do not affect forms or listing screens.
*/
- public function testFormsWithOverrides() {
+ public function testFormsWithOverrides(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer site configuration',
]));
diff --git a/core/modules/config/tests/src/Functional/ConfigEntityListMultilingualTest.php b/core/modules/config/tests/src/Functional/ConfigEntityListMultilingualTest.php
index 8c3cb03f229..1b006248fc2 100644
--- a/core/modules/config/tests/src/Functional/ConfigEntityListMultilingualTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigEntityListMultilingualTest.php
@@ -43,7 +43,7 @@ class ConfigEntityListMultilingualTest extends BrowserTestBase {
/**
* Tests the listing UI with different language scenarios.
*/
- public function testListUI() {
+ public function testListUI(): void {
// Log in as an administrative user to access the full menu trail.
$this->drupalLogin($this->drupalCreateUser([
'access administration pages',
diff --git a/core/modules/config/tests/src/Functional/ConfigEntityListTest.php b/core/modules/config/tests/src/Functional/ConfigEntityListTest.php
index 8f618ba041a..d8cea1dd10a 100644
--- a/core/modules/config/tests/src/Functional/ConfigEntityListTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigEntityListTest.php
@@ -45,7 +45,7 @@ class ConfigEntityListTest extends BrowserTestBase {
/**
* Tests entity list builder methods.
*/
- public function testList() {
+ public function testList(): void {
$controller = \Drupal::entityTypeManager()->getListBuilder('config_test');
// Test getStorage() method.
@@ -216,7 +216,7 @@ class ConfigEntityListTest extends BrowserTestBase {
/**
* Tests the listing UI.
*/
- public function testListUI() {
+ public function testListUI(): void {
// Log in as an administrative user to access the full menu trail.
$this->drupalLogin($this->drupalCreateUser([
'access administration pages',
@@ -314,7 +314,7 @@ class ConfigEntityListTest extends BrowserTestBase {
/**
* Tests paging.
*/
- public function testPager() {
+ public function testPager(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer site configuration',
]));
diff --git a/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php b/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php
index 90f882199cd..8cf60997ee2 100644
--- a/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php
+++ b/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php
@@ -28,7 +28,7 @@ class ConfigEntityStatusUITest extends BrowserTestBase {
/**
* Tests status operations.
*/
- public function testCRUD() {
+ public function testCRUD(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer site configuration',
]));
diff --git a/core/modules/config/tests/src/Functional/ConfigEntityTest.php b/core/modules/config/tests/src/Functional/ConfigEntityTest.php
index 6a6057ac0d5..686e379cbaf 100644
--- a/core/modules/config/tests/src/Functional/ConfigEntityTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigEntityTest.php
@@ -40,7 +40,7 @@ class ConfigEntityTest extends BrowserTestBase {
/**
* Tests CRUD operations.
*/
- public function testCRUD() {
+ public function testCRUD(): void {
$default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId();
// Verify default properties on a newly created empty entity.
$storage = \Drupal::entityTypeManager()->getStorage('config_test');
@@ -227,7 +227,7 @@ class ConfigEntityTest extends BrowserTestBase {
/**
* Tests CRUD operations through the UI.
*/
- public function testCrudUi() {
+ public function testCrudUi(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer site configuration',
]));
diff --git a/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php b/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php
index b4935da7a07..013b2e7a264 100644
--- a/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php
+++ b/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php
@@ -96,7 +96,7 @@ class ConfigExportImportUITest extends BrowserTestBase {
/**
* Tests a simple site export import case.
*/
- public function testExportImport() {
+ public function testExportImport(): void {
// After installation there is no snapshot and nothing to import.
$this->drupalGet('admin/config/development/configuration');
$this->assertSession()->pageTextNotContains('Warning message');
@@ -224,7 +224,7 @@ class ConfigExportImportUITest extends BrowserTestBase {
/**
* Tests an export and import of collections.
*/
- public function testExportImportCollections() {
+ public function testExportImportCollections(): void {
/** @var \Drupal\Core\Config\StorageInterface $active_storage */
$active_storage = \Drupal::service('config.storage');
diff --git a/core/modules/config/tests/src/Functional/ConfigExportUITest.php b/core/modules/config/tests/src/Functional/ConfigExportUITest.php
index 6a2cdc55bd7..9a25e111713 100644
--- a/core/modules/config/tests/src/Functional/ConfigExportUITest.php
+++ b/core/modules/config/tests/src/Functional/ConfigExportUITest.php
@@ -47,7 +47,7 @@ class ConfigExportUITest extends BrowserTestBase {
/**
* Tests export of configuration.
*/
- public function testExport() {
+ public function testExport(): void {
// Verify the export page with export submit button is available.
$this->drupalGet('admin/config/development/configuration/full/export');
$this->assertSession()->buttonExists('Export');
diff --git a/core/modules/config/tests/src/Functional/ConfigFormOverrideTest.php b/core/modules/config/tests/src/Functional/ConfigFormOverrideTest.php
index 273874c2c70..5459f18d8b8 100644
--- a/core/modules/config/tests/src/Functional/ConfigFormOverrideTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigFormOverrideTest.php
@@ -22,7 +22,7 @@ class ConfigFormOverrideTest extends BrowserTestBase {
/**
* Tests that overrides do not affect forms.
*/
- public function testFormsWithOverrides() {
+ public function testFormsWithOverrides(): void {
$this->drupalLogin($this->drupalCreateUser([
'access administration pages',
'administer site configuration',
diff --git a/core/modules/config/tests/src/Functional/ConfigImportAllTest.php b/core/modules/config/tests/src/Functional/ConfigImportAllTest.php
index 8b574c83807..9fa9c5ab236 100644
--- a/core/modules/config/tests/src/Functional/ConfigImportAllTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigImportAllTest.php
@@ -60,7 +60,7 @@ class ConfigImportAllTest extends ModuleTestBase {
/**
* Tests that a fixed set of modules can be installed and uninstalled.
*/
- public function testInstallUninstall() {
+ public function testInstallUninstall(): void {
// Get a list of modules to enable.
$all_modules = $this->container->get('extension.list.module')->getList();
diff --git a/core/modules/config/tests/src/Functional/ConfigImportInstallProfileTest.php b/core/modules/config/tests/src/Functional/ConfigImportInstallProfileTest.php
index 67b3f93e520..0ec7fa40525 100644
--- a/core/modules/config/tests/src/Functional/ConfigImportInstallProfileTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigImportInstallProfileTest.php
@@ -58,7 +58,7 @@ class ConfigImportInstallProfileTest extends BrowserTestBase {
*
* @see \Drupal\Core\EventSubscriber\ConfigImportSubscriber
*/
- public function testInstallProfileValidation() {
+ public function testInstallProfileValidation(): void {
$sync = $this->container->get('config.storage.sync');
$this->copyConfig($this->container->get('config.storage'), $sync);
$core = $sync->read('core.extension');
diff --git a/core/modules/config/tests/src/Functional/ConfigImportUITest.php b/core/modules/config/tests/src/Functional/ConfigImportUITest.php
index 9e54269460c..68a911e0ff1 100644
--- a/core/modules/config/tests/src/Functional/ConfigImportUITest.php
+++ b/core/modules/config/tests/src/Functional/ConfigImportUITest.php
@@ -55,7 +55,7 @@ class ConfigImportUITest extends BrowserTestBase {
/**
* Tests importing configuration.
*/
- public function testImport() {
+ public function testImport(): void {
$name = 'system.site';
$dynamic_name = 'config_test.dynamic.new';
/** @var \Drupal\Core\Config\StorageInterface $sync */
@@ -240,7 +240,7 @@ class ConfigImportUITest extends BrowserTestBase {
/**
* Tests concurrent importing of configuration.
*/
- public function testImportLock() {
+ public function testImportLock(): void {
// Create updated configuration object.
$new_site_name = 'Config import test ' . $this->randomString();
$this->prepareSiteNameUpdate($new_site_name);
@@ -267,7 +267,7 @@ class ConfigImportUITest extends BrowserTestBase {
/**
* Tests verification of site UUID before importing configuration.
*/
- public function testImportSiteUuidValidation() {
+ public function testImportSiteUuidValidation(): void {
$sync = \Drupal::service('config.storage.sync');
// Create updated configuration object.
$config_data = $this->config('system.site')->get();
@@ -284,7 +284,7 @@ class ConfigImportUITest extends BrowserTestBase {
/**
* Tests the screen that shows differences between active and sync.
*/
- public function testImportDiff() {
+ public function testImportDiff(): void {
$sync = $this->container->get('config.storage.sync');
$config_name = 'config_test.system';
$change_key = 'foo';
@@ -360,7 +360,7 @@ class ConfigImportUITest extends BrowserTestBase {
/**
* Tests that multiple validation errors are listed on the page.
*/
- public function testImportValidation() {
+ public function testImportValidation(): void {
// Set state value so that
// \Drupal\config_import_test\EventSubscriber::onConfigImportValidate() logs
// validation errors.
@@ -382,7 +382,7 @@ class ConfigImportUITest extends BrowserTestBase {
$this->assertNotEquals($this->config('system.site')->get('name'), $new_site_name);
}
- public function testConfigUninstallConfigException() {
+ public function testConfigUninstallConfigException(): void {
$sync = $this->container->get('config.storage.sync');
$core_extension = $this->config('core.extension')->get();
@@ -408,7 +408,7 @@ class ConfigImportUITest extends BrowserTestBase {
/**
* Tests an import that results in an error.
*/
- public function testImportErrorLog() {
+ public function testImportErrorLog(): void {
$name_primary = 'config_test.dynamic.primary';
$name_secondary = 'config_test.dynamic.secondary';
$sync = $this->container->get('config.storage.sync');
@@ -462,7 +462,7 @@ class ConfigImportUITest extends BrowserTestBase {
*
* @see \Drupal\Core\Entity\Event\BundleConfigImportValidate
*/
- public function testEntityBundleDelete() {
+ public function testEntityBundleDelete(): void {
\Drupal::service('module_installer')->install(['node']);
$this->copyConfig($this->container->get('config.storage'), $this->container->get('config.storage.sync'));
@@ -506,7 +506,7 @@ class ConfigImportUITest extends BrowserTestBase {
*
* @see \Drupal\Core\EventSubscriber\ConfigImportSubscriber
*/
- public function testExtensionValidation() {
+ public function testExtensionValidation(): void {
\Drupal::service('module_installer')->install(['node']);
\Drupal::service('theme_installer')->install(['test_subtheme']);
$this->rebuildContainer();
@@ -539,7 +539,7 @@ class ConfigImportUITest extends BrowserTestBase {
/**
* Tests that errors set in the batch and on the ConfigImporter are merged.
*/
- public function testBatchErrors() {
+ public function testBatchErrors(): void {
$new_site_name = 'Config import test ' . $this->randomString();
$this->prepareSiteNameUpdate($new_site_name);
\Drupal::state()->set('config_import_steps_alter.error', TRUE);
diff --git a/core/modules/config/tests/src/Functional/ConfigImportUploadTest.php b/core/modules/config/tests/src/Functional/ConfigImportUploadTest.php
index 81840bcdc9e..064a9c0b2f1 100644
--- a/core/modules/config/tests/src/Functional/ConfigImportUploadTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigImportUploadTest.php
@@ -49,7 +49,7 @@ class ConfigImportUploadTest extends BrowserTestBase {
/**
* Tests importing configuration.
*/
- public function testImport() {
+ public function testImport(): void {
// Verify access to the config upload form.
$this->drupalGet('admin/config/development/configuration/full/import');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/config/tests/src/Functional/ConfigInstallProfileOverrideTest.php b/core/modules/config/tests/src/Functional/ConfigInstallProfileOverrideTest.php
index 6419facb290..1bf53507e12 100644
--- a/core/modules/config/tests/src/Functional/ConfigInstallProfileOverrideTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigInstallProfileOverrideTest.php
@@ -38,7 +38,7 @@ class ConfigInstallProfileOverrideTest extends BrowserTestBase {
/**
* Tests install profile config changes.
*/
- public function testInstallProfileConfigOverwrite() {
+ public function testInstallProfileConfigOverwrite(): void {
$config_name = 'system.cron';
// The expected configuration from the system module.
$expected_original_data = [
diff --git a/core/modules/config/tests/src/Functional/ConfigInstallProfileUnmetDependenciesTest.php b/core/modules/config/tests/src/Functional/ConfigInstallProfileUnmetDependenciesTest.php
index 001cc527b21..df839d0ff1d 100644
--- a/core/modules/config/tests/src/Functional/ConfigInstallProfileUnmetDependenciesTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigInstallProfileUnmetDependenciesTest.php
@@ -96,7 +96,7 @@ class ConfigInstallProfileUnmetDependenciesTest extends InstallerTestBase {
/**
* Confirms that the installation succeeded.
*/
- public function testInstalled() {
+ public function testInstalled(): void {
if ($this->expectedException) {
$this->assertStringContainsString('Configuration objects provided by <em class="placeholder">testing_config_overrides</em> have unmet dependencies: <em class="placeholder">system.action.user_block_user_action (does_not_exist)</em>', $this->expectedException->getMessage());
$this->assertStringContainsString('Drupal\Core\Config\UnmetDependenciesException', $this->expectedException->getMessage());
diff --git a/core/modules/config/tests/src/Functional/ConfigInstallWebTest.php b/core/modules/config/tests/src/Functional/ConfigInstallWebTest.php
index ec2b92ea0ff..00b6f4b56c2 100644
--- a/core/modules/config/tests/src/Functional/ConfigInstallWebTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigInstallWebTest.php
@@ -55,7 +55,7 @@ class ConfigInstallWebTest extends BrowserTestBase {
/**
* Tests module re-installation.
*/
- public function testIntegrationModuleReinstallation() {
+ public function testIntegrationModuleReinstallation(): void {
$default_config = 'config_integration_test.settings';
$default_configuration_entity = 'config_test.dynamic.config_integration_test';
@@ -135,7 +135,7 @@ class ConfigInstallWebTest extends BrowserTestBase {
/**
* Tests pre-existing configuration detection.
*/
- public function testPreExistingConfigInstall() {
+ public function testPreExistingConfigInstall(): void {
$this->drupalLogin($this->adminUser);
// Try to install config_install_fail_test and config_test. Doing this
@@ -201,7 +201,7 @@ class ConfigInstallWebTest extends BrowserTestBase {
/**
* Tests unmet dependencies detection.
*/
- public function testUnmetDependenciesInstall() {
+ public function testUnmetDependenciesInstall(): void {
$this->drupalLogin($this->adminUser);
// We need to install separately since config_install_dependency_test does
// not depend on config_test and order is important.
@@ -228,7 +228,7 @@ class ConfigInstallWebTest extends BrowserTestBase {
/**
* Tests config_requirements().
*/
- public function testConfigModuleRequirements() {
+ public function testConfigModuleRequirements(): void {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/modules');
$this->submitForm(['modules[config][enable]' => TRUE], 'Install');
diff --git a/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php b/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php
index eeff36568c7..1b6594abd9b 100644
--- a/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php
@@ -41,7 +41,7 @@ class ConfigLanguageOverrideWebTest extends BrowserTestBase {
/**
* Tests translating the site name.
*/
- public function testSiteNameTranslation() {
+ public function testSiteNameTranslation(): void {
$adminUser = $this->drupalCreateUser([
'administer site configuration',
'administer languages',
diff --git a/core/modules/config/tests/src/Functional/ConfigSingleImportExportTest.php b/core/modules/config/tests/src/Functional/ConfigSingleImportExportTest.php
index ea00319cfb5..8423fc5fb36 100644
--- a/core/modules/config/tests/src/Functional/ConfigSingleImportExportTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigSingleImportExportTest.php
@@ -45,7 +45,7 @@ class ConfigSingleImportExportTest extends BrowserTestBase {
/**
* Tests importing a single configuration file.
*/
- public function testImport() {
+ public function testImport(): void {
$storage = \Drupal::entityTypeManager()->getStorage('config_test');
$uuid = \Drupal::service('uuid');
@@ -200,7 +200,7 @@ EOD;
/**
* Tests importing a simple configuration file.
*/
- public function testImportSimpleConfiguration() {
+ public function testImportSimpleConfiguration(): void {
$this->drupalLogin($this->drupalCreateUser(['import configuration']));
$config = $this->config('system.site')->set('name', 'Test simple import');
@@ -243,7 +243,7 @@ EOD;
/**
* Tests exporting a single configuration file.
*/
- public function testExport() {
+ public function testExport(): void {
$this->drupalLogin($this->drupalCreateUser(['export configuration']));
// Verify that the simple configuration option is selected when specified
diff --git a/core/modules/config/tests/src/Functional/LanguageNegotiationFormOverrideTest.php b/core/modules/config/tests/src/Functional/LanguageNegotiationFormOverrideTest.php
index 188dda24597..931902a4db8 100644
--- a/core/modules/config/tests/src/Functional/LanguageNegotiationFormOverrideTest.php
+++ b/core/modules/config/tests/src/Functional/LanguageNegotiationFormOverrideTest.php
@@ -27,7 +27,7 @@ class LanguageNegotiationFormOverrideTest extends BrowserTestBase {
/**
* Tests that overrides do not affect language-negotiation form values.
*/
- public function testFormWithOverride() {
+ public function testFormWithOverride(): void {
$this->drupalLogin($this->drupalCreateUser([
'access administration pages',
'administer site configuration',
diff --git a/core/modules/config/tests/src/Functional/SchemaConfigListenerWebTest.php b/core/modules/config/tests/src/Functional/SchemaConfigListenerWebTest.php
index a8d8840d608..1ed96822155 100644
--- a/core/modules/config/tests/src/Functional/SchemaConfigListenerWebTest.php
+++ b/core/modules/config/tests/src/Functional/SchemaConfigListenerWebTest.php
@@ -27,7 +27,7 @@ class SchemaConfigListenerWebTest extends BrowserTestBase {
/**
* Tests \Drupal\Core\Config\Development\ConfigSchemaChecker.
*/
- public function testConfigSchemaChecker() {
+ public function testConfigSchemaChecker(): void {
$this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
// Test a non-existing schema.
diff --git a/core/modules/config/tests/src/Functional/TransformedConfigExportImportUITest.php b/core/modules/config/tests/src/Functional/TransformedConfigExportImportUITest.php
index cba8b6b429e..3456df0f153 100644
--- a/core/modules/config/tests/src/Functional/TransformedConfigExportImportUITest.php
+++ b/core/modules/config/tests/src/Functional/TransformedConfigExportImportUITest.php
@@ -48,7 +48,7 @@ class TransformedConfigExportImportUITest extends BrowserTestBase {
/**
* Tests a simple site export import case.
*/
- public function testTransformedExportImport() {
+ public function testTransformedExportImport(): void {
// After installation there is no snapshot but a new site name.
$this->drupalGet('admin/config/development/configuration');
$this->assertSession()->pageTextNotContains('Warning message');
diff --git a/core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php b/core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php
index 9de2bbe8b67..612a654bcf5 100644
--- a/core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php
+++ b/core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php
@@ -26,7 +26,7 @@ class ConfigEntityTest extends WebDriverTestBase {
/**
* Tests ajax operations through the UI on 'Add' page.
*/
- public function testAjaxOnAddPage() {
+ public function testAjaxOnAddPage(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer site configuration',
]));
diff --git a/core/modules/config/tests/src/FunctionalJavascript/ConfigExportTest.php b/core/modules/config/tests/src/FunctionalJavascript/ConfigExportTest.php
index ae1c582348f..aacee5065b0 100644
--- a/core/modules/config/tests/src/FunctionalJavascript/ConfigExportTest.php
+++ b/core/modules/config/tests/src/FunctionalJavascript/ConfigExportTest.php
@@ -78,7 +78,7 @@ class ConfigExportTest extends WebDriverTestBase {
/**
* Tests Ajax form functionality on the config export page.
*/
- public function testAjaxOnExportPage() {
+ public function testAjaxOnExportPage(): void {
$this->drupalLogin($this->drupalCreateUser([
'export configuration',
'administer blocks',
diff --git a/core/modules/config/tests/src/Kernel/ConfigUninstallViaCliImportTest.php b/core/modules/config/tests/src/Kernel/ConfigUninstallViaCliImportTest.php
index 96b79b22f64..51be5dbc64b 100644
--- a/core/modules/config/tests/src/Kernel/ConfigUninstallViaCliImportTest.php
+++ b/core/modules/config/tests/src/Kernel/ConfigUninstallViaCliImportTest.php
@@ -65,7 +65,7 @@ class ConfigUninstallViaCliImportTest extends KernelTestBase {
*
* @see \Drupal\config\ConfigSubscriber
*/
- public function testConfigUninstallViaCli() {
+ public function testConfigUninstallViaCli(): void {
$this->assertTrue($this->container->get('module_handler')->moduleExists('config'));
$sync = $this->container->get('config.storage.sync');
$extensions = $sync->read('core.extension');
diff --git a/core/modules/config/tests/src/Unit/Menu/ConfigLocalTasksTest.php b/core/modules/config/tests/src/Unit/Menu/ConfigLocalTasksTest.php
index 753f949776d..99248e5f72b 100644
--- a/core/modules/config/tests/src/Unit/Menu/ConfigLocalTasksTest.php
+++ b/core/modules/config/tests/src/Unit/Menu/ConfigLocalTasksTest.php
@@ -26,7 +26,7 @@ class ConfigLocalTasksTest extends LocalTaskIntegrationTestBase {
*
* @dataProvider getConfigAdminRoutes
*/
- public function testConfigAdminLocalTasks($route, $expected) {
+ public function testConfigAdminLocalTasks($route, $expected): void {
$this->assertLocalTasks($route, $expected);
}
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationCacheTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationCacheTest.php
index 4c16afa7657..f1818b5cae9 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationCacheTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationCacheTest.php
@@ -121,7 +121,7 @@ class ConfigTranslationCacheTest extends BrowserTestBase {
/**
* Tests the translation of field and field storage configuration.
*/
- public function testFieldConfigTranslation() {
+ public function testFieldConfigTranslation(): void {
// Add a test field which has a translatable field setting and a
// translatable field storage setting.
$field_name = $this->randomMachineName();
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationDateFormatUiTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationDateFormatUiTest.php
index 64ab57fe5d3..021fe1f1736 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationDateFormatUiTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationDateFormatUiTest.php
@@ -47,7 +47,7 @@ class ConfigTranslationDateFormatUiTest extends BrowserTestBase {
/**
* Tests date format translation behavior.
*/
- public function testDateFormatUI() {
+ public function testDateFormatUI(): void {
$this->drupalGet('admin/config/regional/date-time');
// Assert translation link unlocked date format.
@@ -68,7 +68,7 @@ class ConfigTranslationDateFormatUiTest extends BrowserTestBase {
/**
* Tests date format translation.
*/
- public function testDateFormatTranslation() {
+ public function testDateFormatTranslation(): void {
$this->drupalGet('admin/config/regional/date-time');
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationInstallTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationInstallTest.php
index 23e9d1e6872..5f454f6dacb 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationInstallTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationInstallTest.php
@@ -64,7 +64,7 @@ msgstr "Language $langcode"
PO;
}
- public function testConfigTranslation() {
+ public function testConfigTranslation(): void {
\Drupal::service('module_installer')->install(['node', 'field_ui']);
$this->createContentType(['type' => 'article']);
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php
index 0cb1ede702e..f9cbbf370af 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php
@@ -495,7 +495,7 @@ class ConfigTranslationListUiTest extends BrowserTestBase {
/**
* Tests if translate link is added to operations in all configuration lists.
*/
- public function testTranslateOperationInListUi() {
+ public function testTranslateOperationInListUi(): void {
// All lists based on paths provided by the module.
$this->doBlockListTest();
$this->doMenuListTest();
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php
index 1854e19d562..ed082d4a6a9 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php
@@ -85,7 +85,7 @@ class ConfigTranslationOverviewTest extends BrowserTestBase {
/**
* Tests the config translation mapper page.
*/
- public function testMapperListPage() {
+ public function testMapperListPage(): void {
$this->drupalGet('admin/config/regional/config-translation');
$this->assertSession()->linkByHrefExists('admin/config/regional/config-translation/config_test');
$this->assertSession()->linkByHrefExists('admin/config/people/accounts/translate');
@@ -138,7 +138,7 @@ class ConfigTranslationOverviewTest extends BrowserTestBase {
/**
* Tests availability of hidden entities in the translation overview.
*/
- public function testHiddenEntities() {
+ public function testHiddenEntities(): void {
// Hidden languages are only available to translate through the
// configuration translation listings.
$this->drupalGet('admin/config/regional/config-translation/configurable_language');
@@ -159,7 +159,7 @@ class ConfigTranslationOverviewTest extends BrowserTestBase {
/**
* Tests that overrides do not affect listing screens.
*/
- public function testListingPageWithOverrides() {
+ public function testListingPageWithOverrides(): void {
$original_label = 'Default';
$overridden_label = 'Overridden label';
@@ -184,7 +184,7 @@ class ConfigTranslationOverviewTest extends BrowserTestBase {
/**
* Tests the field listing for the translate operation.
*/
- public function testListingFieldsPage() {
+ public function testListingFieldsPage(): void {
// Create a content type.
$node_type = NodeType::create([
'type' => 'basic',
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiModulesTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiModulesTest.php
index e821698c3b5..b27453b8fb3 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiModulesTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiModulesTest.php
@@ -23,7 +23,7 @@ class ConfigTranslationUiModulesTest extends ConfigTranslationUiTestBase {
/**
* Tests the contact form translation.
*/
- public function testContactConfigEntityTranslation() {
+ public function testContactConfigEntityTranslation(): void {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/structure/contact');
@@ -161,7 +161,7 @@ class ConfigTranslationUiModulesTest extends ConfigTranslationUiTestBase {
/**
* Tests the views translation interface.
*/
- public function testViewsTranslationUI() {
+ public function testViewsTranslationUI(): void {
$this->drupalLogin($this->adminUser);
$description = 'All content promoted to the front page.';
@@ -207,7 +207,7 @@ class ConfigTranslationUiModulesTest extends ConfigTranslationUiTestBase {
/**
* Tests the translation of field and field storage configuration.
*/
- public function testFieldConfigTranslation() {
+ public function testFieldConfigTranslation(): void {
// Add a test field which has a translatable field setting and a
// translatable field storage setting.
$field_name = $this->randomMachineName();
@@ -247,7 +247,7 @@ class ConfigTranslationUiModulesTest extends ConfigTranslationUiTestBase {
/**
* Tests the translation of a boolean field settings.
*/
- public function testBooleanFieldConfigTranslation() {
+ public function testBooleanFieldConfigTranslation(): void {
// Add a test boolean field.
$field_name = $this->randomMachineName();
FieldStorageConfig::create([
@@ -287,7 +287,7 @@ class ConfigTranslationUiModulesTest extends ConfigTranslationUiTestBase {
/**
* Tests text_format translation.
*/
- public function testTextFormatTranslation() {
+ public function testTextFormatTranslation(): void {
$this->drupalLogin($this->adminUser);
/** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */
$config_factory = $this->container->get('config.factory');
@@ -383,7 +383,7 @@ class ConfigTranslationUiModulesTest extends ConfigTranslationUiTestBase {
/**
* Tests field translation for node fields.
*/
- public function testNodeFieldTranslation() {
+ public function testNodeFieldTranslation(): void {
NodeType::create(['type' => 'article', 'name' => 'Article'])->save();
$field_name = 'translatable_field';
@@ -422,7 +422,7 @@ class ConfigTranslationUiModulesTest extends ConfigTranslationUiTestBase {
/**
* Test translation save confirmation message.
*/
- public function testMenuTranslationWithoutChange() {
+ public function testMenuTranslationWithoutChange(): void {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/structure/menu/manage/main/translate/tyv/add');
$this->submitForm([], 'Save translation');
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiSiteInformationTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiSiteInformationTest.php
index 469bf3aab98..bc24521bb0a 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiSiteInformationTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiSiteInformationTest.php
@@ -16,7 +16,7 @@ class ConfigTranslationUiSiteInformationTest extends ConfigTranslationUiTestBase
/**
* Tests the site information translation interface.
*/
- public function testSiteInformationTranslationUi() {
+ public function testSiteInformationTranslationUi(): void {
$this->drupalLogin($this->adminUser);
$site_name = 'Name of the site for testing configuration translation';
@@ -121,7 +121,7 @@ class ConfigTranslationUiSiteInformationTest extends ConfigTranslationUiTestBase
/**
* Tests the site information translation interface.
*/
- public function testSourceValueDuplicateSave() {
+ public function testSourceValueDuplicateSave(): void {
$this->drupalLogin($this->adminUser);
$site_name = 'Site name for testing configuration translation';
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php
index 936ecda1f1d..ed2bf54955b 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php
@@ -24,7 +24,7 @@ class ConfigTranslationUiTest extends ConfigTranslationUiTestBase {
* names involved building up one configuration translation form. Test that
* the translations are saved for all configuration names properly.
*/
- public function testAccountSettingsConfigurationTranslation() {
+ public function testAccountSettingsConfigurationTranslation(): void {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/config/people/accounts');
@@ -58,7 +58,7 @@ class ConfigTranslationUiTest extends ConfigTranslationUiTestBase {
/**
* Tests source and target language edge cases.
*/
- public function testSourceAndTargetLanguage() {
+ public function testSourceAndTargetLanguage(): void {
$this->drupalLogin($this->adminUser);
// Loading translation page for not-specified language (und)
@@ -104,7 +104,7 @@ class ConfigTranslationUiTest extends ConfigTranslationUiTestBase {
/**
* Tests plural source elements in configuration translation forms.
*/
- public function testPluralConfigStringsSourceElements() {
+ public function testPluralConfigStringsSourceElements(): void {
$this->drupalLogin($this->adminUser);
// Languages to test, with various number of plural forms.
@@ -148,7 +148,7 @@ class ConfigTranslationUiTest extends ConfigTranslationUiTestBase {
/**
* Tests translation of plural strings with multiple plural forms in config.
*/
- public function testPluralConfigStrings() {
+ public function testPluralConfigStrings(): void {
$this->drupalLogin($this->adminUser);
// First import a .po file with multiple plural forms.
@@ -197,7 +197,7 @@ class ConfigTranslationUiTest extends ConfigTranslationUiTestBase {
/**
* Tests translation storage in locale storage.
*/
- public function testLocaleDBStorage() {
+ public function testLocaleDBStorage(): void {
// Enable import of translations. By default this is disabled for automated
// tests.
$this->config('locale.settings')
@@ -249,7 +249,7 @@ class ConfigTranslationUiTest extends ConfigTranslationUiTestBase {
/**
* Tests the single language existing.
*/
- public function testSingleLanguageUI() {
+ public function testSingleLanguageUI(): void {
$this->drupalLogin($this->adminUser);
// Delete French language
@@ -279,7 +279,7 @@ class ConfigTranslationUiTest extends ConfigTranslationUiTestBase {
/**
* Tests the config_translation_info_alter() hook.
*/
- public function testAlterInfo() {
+ public function testAlterInfo(): void {
$this->drupalLogin($this->adminUser);
$this->container->get('state')->set('config_translation_test_config_translation_info_alter', TRUE);
@@ -295,7 +295,7 @@ class ConfigTranslationUiTest extends ConfigTranslationUiTestBase {
/**
* Tests the sequence data type translation.
*/
- public function testSequenceTranslation() {
+ public function testSequenceTranslation(): void {
$this->drupalLogin($this->adminUser);
/** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */
$config_factory = $this->container->get('config.factory');
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiThemeTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiThemeTest.php
index 041954fb11b..611e4f7e419 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiThemeTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiThemeTest.php
@@ -67,7 +67,7 @@ class ConfigTranslationUiThemeTest extends BrowserTestBase {
/**
* Tests that theme provided *.config_translation.yml files are found.
*/
- public function testThemeDiscovery() {
+ public function testThemeDiscovery(): void {
// Install the test theme and rebuild routes.
$theme = 'config_translation_test_theme';
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationViewListUiTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationViewListUiTest.php
index 35783204a07..a79c5ed92c9 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationViewListUiTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationViewListUiTest.php
@@ -56,7 +56,7 @@ class ConfigTranslationViewListUiTest extends UITestBase {
/**
* Tests views_ui list to see if translate link is added to operations.
*/
- public function testTranslateOperationInViewListUi() {
+ public function testTranslateOperationInViewListUi(): void {
// Views UI List 'admin/structure/views'.
$this->drupalGet('admin/structure/views');
$translate_link = 'admin/structure/views/view/test_view/translate';
@@ -74,7 +74,7 @@ class ConfigTranslationViewListUiTest extends UITestBase {
/**
* Test to ensure that TimestampFormatter translation works.
*/
- public function testTimestampFormatterTranslation() {
+ public function testTimestampFormatterTranslation(): void {
ConfigurableLanguage::createFromLangcode('de')->save();
$this->drupalCreateContentType(['type' => 'article']);
diff --git a/core/modules/config_translation/tests/src/FunctionalJavascript/ConfigTranslationUiTest.php b/core/modules/config_translation/tests/src/FunctionalJavascript/ConfigTranslationUiTest.php
index f80528a0770..5d8b08bc54d 100644
--- a/core/modules/config_translation/tests/src/FunctionalJavascript/ConfigTranslationUiTest.php
+++ b/core/modules/config_translation/tests/src/FunctionalJavascript/ConfigTranslationUiTest.php
@@ -33,7 +33,7 @@ class ConfigTranslationUiTest extends WebDriverTestBase {
/**
* Tests that contextual link related to views.
*/
- public function testViewContextualLink() {
+ public function testViewContextualLink(): void {
$user = $this->drupalCreateUser([
'translate configuration',
'access contextual links',
@@ -49,7 +49,7 @@ class ConfigTranslationUiTest extends WebDriverTestBase {
/**
* Tests that the add, edit and delete operations open in a modal.
*/
- public function testConfigTranslationDialog() {
+ public function testConfigTranslationDialog(): void {
$page = $this->getSession()->getPage();
ConfigurableLanguage::createFromLangcode('fi')->save();
diff --git a/core/modules/config_translation/tests/src/Kernel/ConfigMapperTest.php b/core/modules/config_translation/tests/src/Kernel/ConfigMapperTest.php
index d720074e4e2..20dd11311f5 100644
--- a/core/modules/config_translation/tests/src/Kernel/ConfigMapperTest.php
+++ b/core/modules/config_translation/tests/src/Kernel/ConfigMapperTest.php
@@ -29,7 +29,7 @@ class ConfigMapperTest extends KernelTestBase {
/**
* Tests adding config names to mapper.
*/
- public function testAddingConfigNames() {
+ public function testAddingConfigNames(): void {
// Get a config names mapper.
$mappers = \Drupal::service('plugin.manager.config_translation.mapper')->getMappers();
$mapper = $mappers['system.site_information_settings'];
diff --git a/core/modules/config_translation/tests/src/Kernel/ConfigTranslationFormTest.php b/core/modules/config_translation/tests/src/Kernel/ConfigTranslationFormTest.php
index 09d3585c913..17d8b2d0948 100644
--- a/core/modules/config_translation/tests/src/Kernel/ConfigTranslationFormTest.php
+++ b/core/modules/config_translation/tests/src/Kernel/ConfigTranslationFormTest.php
@@ -29,7 +29,7 @@ class ConfigTranslationFormTest extends KernelTestBase {
/**
* Tests altering of the configuration translation forms.
*/
- public function testConfigTranslationFormAlter() {
+ public function testConfigTranslationFormAlter(): void {
$this->installConfig(['config_translation_test']);
$definitions = $this->container->get('plugin.manager.config_translation.mapper')->getDefinitions();
diff --git a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateSystemMaintenanceTranslationTest.php b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateSystemMaintenanceTranslationTest.php
index 698361fdf7a..1c6c8a852b4 100644
--- a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateSystemMaintenanceTranslationTest.php
+++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateSystemMaintenanceTranslationTest.php
@@ -33,7 +33,7 @@ class MigrateSystemMaintenanceTranslationTest extends MigrateDrupal6TestBase {
/**
* Tests migration of system variables to system.maintenance.yml.
*/
- public function testSystemMaintenance() {
+ public function testSystemMaintenance(): void {
$config = \Drupal::service('language_manager')->getLanguageConfigOverride('fr', 'system.maintenance');
$this->assertSame('fr - Drupal is currently under maintenance. We should be back shortly. Thank you for your patience.', $config->get('message'));
}
diff --git a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateSystemSiteTranslationTest.php b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateSystemSiteTranslationTest.php
index a820aaf2c43..64e67ad63fc 100644
--- a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateSystemSiteTranslationTest.php
+++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateSystemSiteTranslationTest.php
@@ -33,7 +33,7 @@ class MigrateSystemSiteTranslationTest extends MigrateDrupal6TestBase {
/**
* Tests migration of system (site) variables to system.site.yml.
*/
- public function testSystemSite() {
+ public function testSystemSite(): void {
$config_translation = \Drupal::service('language_manager')->getLanguageConfigOverride('fr', 'system.site');
$this->assertSame('fr site name', $config_translation->get('name'));
$this->assertSame('fr_site_mail@example.com', $config_translation->get('mail'));
diff --git a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTranslationTest.php b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTranslationTest.php
index 4077f42abf4..c18edc10f1d 100644
--- a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTranslationTest.php
+++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTranslationTest.php
@@ -41,7 +41,7 @@ class MigrateUserConfigsTranslationTest extends MigrateDrupal6TestBase {
/**
* Tests migration of i18n user variables to user.mail.yml.
*/
- public function testUserMail() {
+ public function testUserMail(): void {
$config = \Drupal::service('language_manager')->getLanguageConfigOverride('fr', 'user.mail');
$this->assertSame('fr - Account details for [user:name] at [site:name] (approved)', $config->get('status_activated.subject'));
$this->assertSame("fr - [user:name],\r\n\r\nYour account at [site:name] has been activated.\r\n\r\nYou may now log in by clicking on this link or copying and pasting it in your browser:\r\n\r\n[user:one-time-login-url]\r\n\r\nThis is a one-time login, so it can be used only once.\r\n\r\nAfter logging in, you will be redirected to [user:edit-url] so you can change your password.\r\n\r\nOnce you have set your own password, you will be able to log in to [site:login-url] in the future using:\r\n\r\nusername: [user:name]\r\n", $config->get('status_activated.body'));
diff --git a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldInstanceTranslationTest.php b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldInstanceTranslationTest.php
index 95ad8077e5f..2132a129c79 100644
--- a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldInstanceTranslationTest.php
+++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldInstanceTranslationTest.php
@@ -26,7 +26,7 @@ class MigrateUserProfileFieldInstanceTranslationTest extends MigrateDrupal6TestB
/**
* Tests migration of translated user profile fields.
*/
- public function testUserProfileFields() {
+ public function testUserProfileFields(): void {
$this->executeMigrations([
'language',
'user_profile_field',
diff --git a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserProfileTranslationRollbackTest.php b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserProfileTranslationRollbackTest.php
index 2eed9d6ea6d..e9783463fe9 100644
--- a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserProfileTranslationRollbackTest.php
+++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateUserProfileTranslationRollbackTest.php
@@ -27,7 +27,7 @@ class MigrateUserProfileTranslationRollbackTest extends MigrateDrupal6TestBase {
/**
* Tests rollback of the complete node migration.
*/
- public function testRollback() {
+ public function testRollback(): void {
$migration_ids = [
'user_profile_field',
'd6_profile_field_option_translation',
diff --git a/core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateSystemMaintenanceTranslationTest.php b/core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateSystemMaintenanceTranslationTest.php
index 6d12e1dab52..d0fc20ddbaf 100644
--- a/core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateSystemMaintenanceTranslationTest.php
+++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateSystemMaintenanceTranslationTest.php
@@ -33,7 +33,7 @@ class MigrateSystemMaintenanceTranslationTest extends MigrateDrupal7TestBase {
/**
* Tests migrations of i18n maintenance variable.
*/
- public function testSystemMaintenance() {
+ public function testSystemMaintenance(): void {
$config = \Drupal::service('language_manager')->getLanguageConfigOverride('is', 'system.maintenance');
$this->assertSame('is - This is a custom maintenance mode message.', $config->get('message'));
}
diff --git a/core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateSystemSiteTranslationTest.php b/core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateSystemSiteTranslationTest.php
index 520941afc22..0b4d427094d 100644
--- a/core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateSystemSiteTranslationTest.php
+++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateSystemSiteTranslationTest.php
@@ -36,7 +36,7 @@ class MigrateSystemSiteTranslationTest extends MigrateDrupal7TestBase {
/**
* Tests migration of system (site) variables to system.site.yml.
*/
- public function testSystemSite() {
+ public function testSystemSite(): void {
$language_manager = \Drupal::service('language_manager');
$config_translation = $language_manager->getLanguageConfigOverride('fr', 'system.site');
$this->assertSame('The Site Name', $config_translation->get('name'));
diff --git a/core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateUserConfigsTranslationTest.php b/core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateUserConfigsTranslationTest.php
index c487f96879e..3d68f0d0657 100644
--- a/core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateUserConfigsTranslationTest.php
+++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateUserConfigsTranslationTest.php
@@ -47,7 +47,7 @@ class MigrateUserConfigsTranslationTest extends MigrateDrupal7TestBase {
/**
* Tests migration of i18n user variables to user.mail and user.settings.
*/
- public function testUserConfig() {
+ public function testUserConfig(): void {
// Tests migration of i18n user variables to user.mail.yml.
$language_manager = \Drupal::service('language_manager');
$config = $language_manager->getLanguageConfigOverride('is', 'user.mail');
diff --git a/core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php b/core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php
index 39b4f2a90be..3889274b885 100644
--- a/core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php
+++ b/core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php
@@ -113,7 +113,7 @@ class ConfigEntityMapperTest extends UnitTestCase {
/**
* Tests ConfigEntityMapper::setEntity() and ConfigEntityMapper::getEntity().
*/
- public function testEntityGetterAndSetter() {
+ public function testEntityGetterAndSetter(): void {
$this->entity
->expects($this->once())
->method('id')
@@ -152,7 +152,7 @@ class ConfigEntityMapperTest extends UnitTestCase {
/**
* Tests ConfigEntityMapper::getOverviewRouteParameters().
*/
- public function testGetOverviewRouteParameters() {
+ public function testGetOverviewRouteParameters(): void {
$entity_type = $this->createMock('Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
$this->entityTypeManager
->expects($this->once())
@@ -175,7 +175,7 @@ class ConfigEntityMapperTest extends UnitTestCase {
/**
* Tests ConfigEntityMapper::getType().
*/
- public function testGetType() {
+ public function testGetType(): void {
$result = $this->configEntityMapper->getType();
$this->assertSame('configurable_language', $result);
}
@@ -183,7 +183,7 @@ class ConfigEntityMapperTest extends UnitTestCase {
/**
* Tests ConfigEntityMapper::getTypeName().
*/
- public function testGetTypeName() {
+ public function testGetTypeName(): void {
$entity_type = $this->createMock('Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
$entity_type->expects($this->once())
->method('getLabel')
@@ -201,7 +201,7 @@ class ConfigEntityMapperTest extends UnitTestCase {
/**
* Tests ConfigEntityMapper::getTypeLabel().
*/
- public function testGetTypeLabel() {
+ public function testGetTypeLabel(): void {
$entity_type = $this->createMock('Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
$entity_type->expects($this->once())
->method('getLabel')
@@ -219,7 +219,7 @@ class ConfigEntityMapperTest extends UnitTestCase {
/**
* Tests ConfigEntityMapper::getOperations().
*/
- public function testGetOperations() {
+ public function testGetOperations(): void {
$result = $this->configEntityMapper->getOperations();
$expected = [
diff --git a/core/modules/config_translation/tests/src/Unit/ConfigFieldMapperTest.php b/core/modules/config_translation/tests/src/Unit/ConfigFieldMapperTest.php
index 35fc7a10f20..481bc708ce3 100644
--- a/core/modules/config_translation/tests/src/Unit/ConfigFieldMapperTest.php
+++ b/core/modules/config_translation/tests/src/Unit/ConfigFieldMapperTest.php
@@ -87,7 +87,7 @@ class ConfigFieldMapperTest extends UnitTestCase {
*
* @covers ::setEntity
*/
- public function testSetEntity() {
+ public function testSetEntity(): void {
$entity_type = $this->createMock('Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
$entity_type
->expects($this->any())
diff --git a/core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php b/core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php
index 81d55a2d579..149fecb7fa8 100644
--- a/core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php
+++ b/core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php
@@ -72,7 +72,7 @@ class ConfigMapperManagerTest extends UnitTestCase {
*
* @dataProvider providerTestHasTranslatable
*/
- public function testHasTranslatable(TypedDataInterface $element, $expected) {
+ public function testHasTranslatable(TypedDataInterface $element, $expected): void {
$this->typedConfigManager
->expects($this->once())
->method('get')
diff --git a/core/modules/config_translation/tests/src/Unit/ConfigNamesMapperTest.php b/core/modules/config_translation/tests/src/Unit/ConfigNamesMapperTest.php
index 2eaa4a14d72..d20ac0d4927 100644
--- a/core/modules/config_translation/tests/src/Unit/ConfigNamesMapperTest.php
+++ b/core/modules/config_translation/tests/src/Unit/ConfigNamesMapperTest.php
@@ -150,7 +150,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getTitle().
*/
- public function testGetTitle() {
+ public function testGetTitle(): void {
$result = $this->configNamesMapper->getTitle();
$this->assertSame($this->pluginDefinition['title'], (string) $result);
}
@@ -158,7 +158,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getBaseRouteName().
*/
- public function testGetBaseRouteName() {
+ public function testGetBaseRouteName(): void {
$result = $this->configNamesMapper->getBaseRouteName();
$this->assertSame($this->pluginDefinition['base_route_name'], $result);
}
@@ -166,7 +166,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getBaseRouteParameters().
*/
- public function testGetBaseRouteParameters() {
+ public function testGetBaseRouteParameters(): void {
$result = $this->configNamesMapper->getBaseRouteParameters();
$this->assertSame([], $result);
}
@@ -174,7 +174,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getBaseRoute().
*/
- public function testGetBaseRoute() {
+ public function testGetBaseRoute(): void {
$result = $this->configNamesMapper->getBaseRoute();
$this->assertSame($this->baseRoute, $result);
}
@@ -182,7 +182,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getBasePath().
*/
- public function testGetBasePath() {
+ public function testGetBasePath(): void {
$this->urlGenerator->expects($this->once())
->method('getPathFromRoute')
->with('system.site_information_settings', [])
@@ -194,7 +194,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getOverviewRouteName().
*/
- public function testGetOverviewRouteName() {
+ public function testGetOverviewRouteName(): void {
$result = $this->configNamesMapper->getOverviewRouteName();
$expected = 'config_translation.item.overview.' . $this->pluginDefinition['base_route_name'];
$this->assertSame($expected, $result);
@@ -203,7 +203,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getOverviewRouteParameters().
*/
- public function testGetOverviewRouteParameters() {
+ public function testGetOverviewRouteParameters(): void {
$result = $this->configNamesMapper->getOverviewRouteParameters();
$this->assertSame([], $result);
}
@@ -211,7 +211,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getOverviewRoute().
*/
- public function testGetOverviewRoute() {
+ public function testGetOverviewRoute(): void {
$expected = new Route('/admin/config/system/site-information/translate',
[
'_controller' => '\Drupal\config_translation\Controller\ConfigTranslationController::itemPage',
@@ -228,7 +228,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getOverviewPath().
*/
- public function testGetOverviewPath() {
+ public function testGetOverviewPath(): void {
$this->urlGenerator->expects($this->once())
->method('getPathFromRoute')
->with('config_translation.item.overview.system.site_information_settings', [])
@@ -241,7 +241,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getAddRouteName().
*/
- public function testGetAddRouteName() {
+ public function testGetAddRouteName(): void {
$result = $this->configNamesMapper->getAddRouteName();
$expected = 'config_translation.item.add.' . $this->pluginDefinition['base_route_name'];
$this->assertSame($expected, $result);
@@ -250,7 +250,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getAddRouteParameters().
*/
- public function testGetAddRouteParameters() {
+ public function testGetAddRouteParameters(): void {
$route_match = new RouteMatch('example', new Route('/test/{langcode}'), ['langcode' => 'xx']);
$this->configNamesMapper->populateFromRouteMatch($route_match);
@@ -262,7 +262,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getAddRoute().
*/
- public function testGetAddRoute() {
+ public function testGetAddRoute(): void {
$expected = new Route('/admin/config/system/site-information/translate/{langcode}/add',
[
'_form' => '\Drupal\config_translation\Form\ConfigTranslationAddForm',
@@ -279,7 +279,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getEditRouteName().
*/
- public function testGetEditRouteName() {
+ public function testGetEditRouteName(): void {
$result = $this->configNamesMapper->getEditRouteName();
$expected = 'config_translation.item.edit.' . $this->pluginDefinition['base_route_name'];
$this->assertSame($expected, $result);
@@ -288,7 +288,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getEditRouteParameters().
*/
- public function testGetEditRouteParameters() {
+ public function testGetEditRouteParameters(): void {
$route_match = new RouteMatch('example', new Route('/test/{langcode}'), ['langcode' => 'xx']);
$this->configNamesMapper->populateFromRouteMatch($route_match);
@@ -300,7 +300,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getEditRoute().
*/
- public function testGetEditRoute() {
+ public function testGetEditRoute(): void {
$expected = new Route('/admin/config/system/site-information/translate/{langcode}/edit',
[
'_form' => '\Drupal\config_translation\Form\ConfigTranslationEditForm',
@@ -317,7 +317,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getDeleteRouteName().
*/
- public function testGetDeleteRouteName() {
+ public function testGetDeleteRouteName(): void {
$result = $this->configNamesMapper->getDeleteRouteName();
$expected = 'config_translation.item.delete.' . $this->pluginDefinition['base_route_name'];
$this->assertSame($expected, $result);
@@ -326,7 +326,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getDeleteRouteParameters().
*/
- public function testGetDeleteRouteParameters() {
+ public function testGetDeleteRouteParameters(): void {
$route_match = new RouteMatch('example', new Route('/test/{langcode}'), ['langcode' => 'xx']);
$this->configNamesMapper->populateFromRouteMatch($route_match);
@@ -338,7 +338,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getRoute().
*/
- public function testGetDeleteRoute() {
+ public function testGetDeleteRoute(): void {
$expected = new Route('/admin/config/system/site-information/translate/{langcode}/delete',
[
'_form' => '\Drupal\config_translation\Form\ConfigTranslationDeleteForm',
@@ -355,7 +355,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getConfigNames().
*/
- public function testGetConfigNames() {
+ public function testGetConfigNames(): void {
$result = $this->configNamesMapper->getConfigNames();
$this->assertSame($this->pluginDefinition['names'], $result);
}
@@ -363,7 +363,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::addConfigName().
*/
- public function testAddConfigName() {
+ public function testAddConfigName(): void {
$names = $this->configNamesMapper->getConfigNames();
$this->configNamesMapper->addConfigName('test');
$names[] = 'test';
@@ -374,7 +374,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getWeight().
*/
- public function testGetWeight() {
+ public function testGetWeight(): void {
$result = $this->configNamesMapper->getWeight();
$this->assertSame($this->pluginDefinition['weight'], $result);
}
@@ -382,7 +382,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::populateFromRouteMatch().
*/
- public function testPopulateFromRouteMatch() {
+ public function testPopulateFromRouteMatch(): void {
// Make sure the language code is not set initially.
$this->assertNull($this->configNamesMapper->getInternalLangcode());
@@ -405,7 +405,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getTypeLabel().
*/
- public function testGetTypeLabel() {
+ public function testGetTypeLabel(): void {
$result = $this->configNamesMapper->getTypeLabel();
$this->assertSame($this->pluginDefinition['title'], (string) $result);
}
@@ -413,7 +413,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getLangcode().
*/
- public function testGetLangcode() {
+ public function testGetLangcode(): void {
// Test that the getLangcode() falls back to 'en', if no explicit language
// code is provided.
$config_factory = $this->getConfigFactoryStub([
@@ -460,7 +460,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getConfigData().
*/
- public function testGetConfigData() {
+ public function testGetConfigData(): void {
$configs = [
'system.site' => [
'name' => 'Drupal',
@@ -496,7 +496,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
*
* @dataProvider providerTestHasSchema
*/
- public function testHasSchema(array $mock_return_values, $expected) {
+ public function testHasSchema(array $mock_return_values, $expected): void {
// As the configuration names are arbitrary, simply use integers.
$config_names = range(1, count($mock_return_values));
$this->configNamesMapper->setConfigNames($config_names);
@@ -543,7 +543,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
*
* @dataProvider providerTestHasTranslatable
*/
- public function testHasTranslatable(array $mock_return_values, $expected) {
+ public function testHasTranslatable(array $mock_return_values, $expected): void {
// As the configuration names are arbitrary, simply use integers.
$config_names = range(1, count($mock_return_values));
$this->configNamesMapper->setConfigNames($config_names);
@@ -592,7 +592,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
*
* @dataProvider providerTestHasTranslation
*/
- public function testHasTranslation(array $mock_return_values, $expected) {
+ public function testHasTranslation(array $mock_return_values, $expected): void {
$language = new Language();
// As the configuration names are arbitrary, simply use integers.
@@ -634,7 +634,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::getTypeName().
*/
- public function testGetTypeName() {
+ public function testGetTypeName(): void {
$result = $this->configNamesMapper->getTypeName();
$this->assertSame('Settings', (string) $result);
}
@@ -642,7 +642,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
/**
* Tests ConfigNamesMapper::hasTranslation().
*/
- public function testGetOperations() {
+ public function testGetOperations(): void {
$expected = [
'translate' => [
'title' => 'Translate',
diff --git a/core/modules/contact/tests/src/Functional/ContactLanguageTest.php b/core/modules/contact/tests/src/Functional/ContactLanguageTest.php
index 54acd4eafcf..a4a7d7c79f8 100644
--- a/core/modules/contact/tests/src/Functional/ContactLanguageTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactLanguageTest.php
@@ -53,7 +53,7 @@ class ContactLanguageTest extends BrowserTestBase {
/**
* Tests configuration options with language enabled.
*/
- public function testContactLanguage() {
+ public function testContactLanguage(): void {
// Ensure that contact form by default does not show the language select.
$this->drupalGet('contact');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
index 0c2a91fe2dd..2a4616b728b 100644
--- a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
@@ -81,7 +81,7 @@ class ContactPersonalTest extends BrowserTestBase {
/**
* Tests that mails for contact messages are correctly sent.
*/
- public function testSendPersonalContactMessage() {
+ public function testSendPersonalContactMessage(): void {
// Ensure that the web user's email needs escaping.
$mail = $this->webUser->getAccountName() . '&escaped@example.com';
$this->webUser->setEmail($mail)->save();
@@ -135,7 +135,7 @@ class ContactPersonalTest extends BrowserTestBase {
/**
* Tests access to the personal contact form.
*/
- public function testPersonalContactAccess() {
+ public function testPersonalContactAccess(): void {
// Test allowed access to admin user's contact form.
$this->drupalLogin($this->webUser);
$this->drupalGet('user/' . $this->adminUser->id() . '/contact');
@@ -256,7 +256,7 @@ class ContactPersonalTest extends BrowserTestBase {
/**
* Tests the personal contact form flood protection.
*/
- public function testPersonalContactFlood() {
+ public function testPersonalContactFlood(): void {
$flood_limit = 3;
$this->config('contact.settings')->set('flood.limit', $flood_limit)->save();
@@ -283,7 +283,7 @@ class ContactPersonalTest extends BrowserTestBase {
/**
* Tests the personal contact form based access when an admin adds users.
*/
- public function testAdminContact() {
+ public function testAdminContact(): void {
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['access user contact forms']);
$this->checkContactAccess(200);
$this->checkContactAccess(403, FALSE);
diff --git a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
index 378ee9284c6..09b56fae036 100644
--- a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
@@ -59,7 +59,7 @@ class ContactSitewideTest extends BrowserTestBase {
/**
* Tests configuration options and the site-wide contact form.
*/
- public function testSiteWideContact() {
+ public function testSiteWideContact(): void {
// Tests name and email fields for authenticated and anonymous users.
$this->drupalLogin($this->drupalCreateUser([
'access site-wide contact form',
@@ -440,7 +440,7 @@ class ContactSitewideTest extends BrowserTestBase {
/**
* Tests auto-reply on the site-wide contact form.
*/
- public function testAutoReply() {
+ public function testAutoReply(): void {
// Create and log in administrative user.
$admin_user = $this->drupalCreateUser([
'access site-wide contact form',
diff --git a/core/modules/contact/tests/src/Functional/ContactStorageTest.php b/core/modules/contact/tests/src/Functional/ContactStorageTest.php
index bef5bfb9697..65bc730f20b 100644
--- a/core/modules/contact/tests/src/Functional/ContactStorageTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactStorageTest.php
@@ -41,7 +41,7 @@ class ContactStorageTest extends ContactSitewideTest {
/**
* Tests configuration options and the site-wide contact form.
*/
- public function testContactStorage() {
+ public function testContactStorage(): void {
// Create and log in administrative user.
$admin_user = $this->drupalCreateUser([
'access site-wide contact form',
diff --git a/core/modules/contact/tests/src/Functional/Rest/MessageResourceTestBase.php b/core/modules/contact/tests/src/Functional/Rest/MessageResourceTestBase.php
index 096f993db8f..d9fb6a5ad94 100644
--- a/core/modules/contact/tests/src/Functional/Rest/MessageResourceTestBase.php
+++ b/core/modules/contact/tests/src/Functional/Rest/MessageResourceTestBase.php
@@ -112,7 +112,7 @@ abstract class MessageResourceTestBase extends EntityResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testGet() {
+ public function testGet(): void {
// Contact Message entities are not stored, so they cannot be retrieved.
$this->expectException(RouteNotFoundException::class);
$this->expectExceptionMessage('Route "rest.entity.contact_message.GET" does not exist.');
@@ -124,7 +124,7 @@ abstract class MessageResourceTestBase extends EntityResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatch() {
+ public function testPatch(): void {
// Contact Message entities are not stored, so they cannot be modified.
$this->expectException(RouteNotFoundException::class);
$this->expectExceptionMessage('Route "rest.entity.contact_message.PATCH" does not exist.');
@@ -136,7 +136,7 @@ abstract class MessageResourceTestBase extends EntityResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testDelete() {
+ public function testDelete(): void {
// Contact Message entities are not stored, so they cannot be deleted.
$this->expectException(RouteNotFoundException::class);
$this->expectExceptionMessage('Route "rest.entity.contact_message.DELETE" does not exist.');
diff --git a/core/modules/contact/tests/src/Functional/Views/ContactLinkTest.php b/core/modules/contact/tests/src/Functional/Views/ContactLinkTest.php
index a08ff26bd1f..294dd649556 100644
--- a/core/modules/contact/tests/src/Functional/Views/ContactLinkTest.php
+++ b/core/modules/contact/tests/src/Functional/Views/ContactLinkTest.php
@@ -54,7 +54,7 @@ class ContactLinkTest extends ViewTestBase {
/**
* Tests contact link.
*/
- public function testContactLink() {
+ public function testContactLink(): void {
$accounts = [];
$accounts['root'] = User::load(1);
// Create an account with access to all contact pages.
diff --git a/core/modules/contact/tests/src/Kernel/MessageEntityTest.php b/core/modules/contact/tests/src/Kernel/MessageEntityTest.php
index babf2b8f1e1..164c4790e54 100644
--- a/core/modules/contact/tests/src/Kernel/MessageEntityTest.php
+++ b/core/modules/contact/tests/src/Kernel/MessageEntityTest.php
@@ -38,7 +38,7 @@ class MessageEntityTest extends EntityKernelTestBase {
/**
* Tests some of the methods.
*/
- public function testMessageMethods() {
+ public function testMessageMethods(): void {
$message_storage = $this->container->get('entity_type.manager')->getStorage('contact_message');
$message = $message_storage->create(['contact_form' => 'feedback']);
diff --git a/core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php b/core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php
index 4cd886fb0d1..4ce64609d11 100644
--- a/core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php
+++ b/core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php
@@ -59,7 +59,7 @@ class MigrateContactCategoryTest extends MigrateDrupal6TestBase {
/**
* The Drupal 6 and 7 contact categories to Drupal 8 migration.
*/
- public function testContactCategory() {
+ public function testContactCategory(): void {
$this->assertEntity('website_feedback', 'Website feedback', ['admin@example.com'], '', 0);
$this->assertEntity('some_other_category', 'Some other category', ['test@example.com'], 'Thanks for contacting us, we will reply ASAP!', 1);
$this->assertEntity('a_category_much_longer_than_th', 'A category much longer than thirty two characters', ['fortyninechars@example.com'], '', 2);
diff --git a/core/modules/contact/tests/src/Kernel/Migrate/d6/MigrateContactSettingsTest.php b/core/modules/contact/tests/src/Kernel/Migrate/d6/MigrateContactSettingsTest.php
index 2653a999251..4c8c1dcf0c4 100644
--- a/core/modules/contact/tests/src/Kernel/Migrate/d6/MigrateContactSettingsTest.php
+++ b/core/modules/contact/tests/src/Kernel/Migrate/d6/MigrateContactSettingsTest.php
@@ -32,7 +32,7 @@ class MigrateContactSettingsTest extends MigrateDrupal6TestBase {
/**
* Tests migration of contact variables to contact.settings.yml.
*/
- public function testContactSettings() {
+ public function testContactSettings(): void {
$config = $this->config('contact.settings');
$this->assertTrue($config->get('user_default_enabled'));
$this->assertSame(3, $config->get('flood.limit'));
diff --git a/core/modules/contact/tests/src/Kernel/Migrate/d7/MigrateContactSettingsTest.php b/core/modules/contact/tests/src/Kernel/Migrate/d7/MigrateContactSettingsTest.php
index 60a0286c686..d7f515839f8 100644
--- a/core/modules/contact/tests/src/Kernel/Migrate/d7/MigrateContactSettingsTest.php
+++ b/core/modules/contact/tests/src/Kernel/Migrate/d7/MigrateContactSettingsTest.php
@@ -30,7 +30,7 @@ class MigrateContactSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests migration of Contact's variables to configuration.
*/
- public function testContactSettings() {
+ public function testContactSettings(): void {
$config = $this->config('contact.settings');
$this->assertTrue($config->get('user_default_enabled'));
$this->assertSame(33, $config->get('flood.limit'));
diff --git a/core/modules/contact/tests/src/Kernel/Views/ContactFieldsTest.php b/core/modules/contact/tests/src/Kernel/Views/ContactFieldsTest.php
index 4bdc00de498..b444c7105d9 100644
--- a/core/modules/contact/tests/src/Kernel/Views/ContactFieldsTest.php
+++ b/core/modules/contact/tests/src/Kernel/Views/ContactFieldsTest.php
@@ -31,7 +31,7 @@ class ContactFieldsTest extends KernelTestBase {
/**
* Tests the views data generation.
*/
- public function testViewsData() {
+ public function testViewsData(): void {
$this->installConfig(['contact']);
FieldStorageConfig::create([
'type' => 'text',
diff --git a/core/modules/contact/tests/src/Unit/MailHandlerTest.php b/core/modules/contact/tests/src/Unit/MailHandlerTest.php
index 6fbdff1d4df..139e0cd480a 100644
--- a/core/modules/contact/tests/src/Unit/MailHandlerTest.php
+++ b/core/modules/contact/tests/src/Unit/MailHandlerTest.php
@@ -99,7 +99,7 @@ class MailHandlerTest extends UnitTestCase {
*
* @covers ::sendMailMessages
*/
- public function testInvalidRecipient() {
+ public function testInvalidRecipient(): void {
$message = $this->createMock('\Drupal\contact\MessageInterface');
$message->expects($this->once())
->method('isPersonal')
@@ -133,7 +133,7 @@ class MailHandlerTest extends UnitTestCase {
*
* @covers ::sendMailMessages
*/
- public function testSendMailMessages(bool $anonymous, ?bool $auto_reply, bool $copy_sender, array $results) {
+ public function testSendMailMessages(bool $anonymous, ?bool $auto_reply, bool $copy_sender, array $results): void {
if ($anonymous) {
$message = $this->getAnonymousMockMessage(explode(', ', $results[0]['to']), $auto_reply, $copy_sender);
$sender = $this->getMockSender();
diff --git a/core/modules/content_moderation/tests/src/Functional/ContentModerationWorkflowTypeTest.php b/core/modules/content_moderation/tests/src/Functional/ContentModerationWorkflowTypeTest.php
index 198fbab8278..57e68521257 100644
--- a/core/modules/content_moderation/tests/src/Functional/ContentModerationWorkflowTypeTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ContentModerationWorkflowTypeTest.php
@@ -43,7 +43,7 @@ class ContentModerationWorkflowTypeTest extends BrowserTestBase {
/**
* Tests creating a new workflow using the content moderation plugin.
*/
- public function testNewWorkflow() {
+ public function testNewWorkflow(): void {
$types[] = $this->createContentType();
$types[] = $this->createContentType();
$types[] = $this->createContentType();
diff --git a/core/modules/content_moderation/tests/src/Functional/DefaultModerationStateTest.php b/core/modules/content_moderation/tests/src/Functional/DefaultModerationStateTest.php
index 309526e7ec1..ab825c87c6b 100644
--- a/core/modules/content_moderation/tests/src/Functional/DefaultModerationStateTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/DefaultModerationStateTest.php
@@ -29,7 +29,7 @@ class DefaultModerationStateTest extends ModerationStateTestBase {
/**
* Tests a workflow with a default moderation state set.
*/
- public function testPublishedDefaultState() {
+ public function testPublishedDefaultState(): void {
// Set the default moderation state to be "published".
$this->drupalGet('admin/config/workflow/workflows/manage/' . $this->workflow->id());
$this->submitForm(['type_settings[workflow_settings][default_moderation_state]' => 'published'], 'Save');
@@ -47,7 +47,7 @@ class DefaultModerationStateTest extends ModerationStateTestBase {
/**
* Tests access to deleting the default state.
*/
- public function testDeleteDefaultStateAccess() {
+ public function testDeleteDefaultStateAccess(): void {
$this->drupalGet('admin/config/workflow/workflows/manage/editorial/state/archived/delete');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/content_moderation/tests/src/Functional/LayoutBuilderContentModerationIntegrationTest.php b/core/modules/content_moderation/tests/src/Functional/LayoutBuilderContentModerationIntegrationTest.php
index 075c9ac697e..8d523fa4063 100644
--- a/core/modules/content_moderation/tests/src/Functional/LayoutBuilderContentModerationIntegrationTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/LayoutBuilderContentModerationIntegrationTest.php
@@ -96,7 +96,7 @@ class LayoutBuilderContentModerationIntegrationTest extends BrowserTestBase {
/**
* Tests that Layout changes are respected by Content Moderation.
*/
- public function testLayoutModeration() {
+ public function testLayoutModeration(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -169,7 +169,7 @@ class LayoutBuilderContentModerationIntegrationTest extends BrowserTestBase {
/**
* Test placing inline blocks that belong to a moderated content block bundle.
*/
- public function testModeratedInlineBlockBundles() {
+ public function testModeratedInlineBlockBundles(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/content_moderation/tests/src/Functional/ModeratedContentLocalTaskTest.php b/core/modules/content_moderation/tests/src/Functional/ModeratedContentLocalTaskTest.php
index dfdb166f1b4..48f097a3061 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModeratedContentLocalTaskTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModeratedContentLocalTaskTest.php
@@ -52,7 +52,7 @@ class ModeratedContentLocalTaskTest extends BrowserTestBase {
/**
* Tests the moderated content local task appears.
*/
- public function testModeratedContentLocalTask() {
+ public function testModeratedContentLocalTask(): void {
$this->drupalLogin($this->adminUser);
// Verify the moderated content tab exists.
diff --git a/core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php b/core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php
index e829f0bb510..25cbff3e948 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php
@@ -67,7 +67,7 @@ class ModeratedContentViewTest extends BrowserTestBase {
/**
* Tests the moderated content page.
*/
- public function testModeratedContentPage() {
+ public function testModeratedContentPage(): void {
$assert_session = $this->assertSession();
$this->drupalLogin($this->adminUser);
@@ -151,7 +151,7 @@ class ModeratedContentViewTest extends BrowserTestBase {
/**
* Tests the moderated content page with multilingual content.
*/
- public function testModeratedContentPageMultilingual() {
+ public function testModeratedContentPageMultilingual(): void {
ConfigurableLanguage::createFromLangcode('fr')->save();
$node = $this->drupalCreateNode([
diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationActionsTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationActionsTest.php
index 7cd22de0b51..340c08e7a95 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModerationActionsTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModerationActionsTest.php
@@ -63,7 +63,7 @@ class ModerationActionsTest extends BrowserTestBase {
*
* @dataProvider nodeStatusActionsTestCases
*/
- public function testNodeStatusActions($action, $bundle, $warning_appears, $starting_status, $final_status) {
+ public function testNodeStatusActions($action, $bundle, $warning_appears, $starting_status, $final_status): void {
// Create and run an action on a node.
$node = Node::create([
'type' => $bundle,
diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationContentTranslationTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationContentTranslationTest.php
index fe0fd22454f..aa62fd7a79e 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModerationContentTranslationTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModerationContentTranslationTest.php
@@ -68,7 +68,7 @@ class ModerationContentTranslationTest extends BrowserTestBase {
/**
* Tests existing translations being edited after enabling content moderation.
*/
- public function testModerationWithExistingContent() {
+ public function testModerationWithExistingContent(): void {
// Create a published article in English.
$edit = [
'title[0][value]' => 'Published English node',
diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php
index d84d3f97c44..a265feb7f1b 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php
@@ -61,7 +61,7 @@ class ModerationFormTest extends ModerationStateTestBase {
* @see \Drupal\content_moderation\EntityOperations
* @see \Drupal\Tests\content_moderation\Functional\ModerationStateBlockTest::testCustomBlockModeration
*/
- public function testModerationForm() {
+ public function testModerationForm(): void {
// Test the states that appear by default when creating a new item of
// content.
$this->drupalGet('node/add/moderated_content');
@@ -198,7 +198,7 @@ class ModerationFormTest extends ModerationStateTestBase {
/**
* Tests moderation non-bundle entity type.
*/
- public function testNonBundleModerationForm() {
+ public function testNonBundleModerationForm(): void {
$this->drupalLogin($this->rootUser);
$this->workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_mulrevpub', 'entity_test_mulrevpub');
$this->workflow->save();
@@ -266,7 +266,7 @@ class ModerationFormTest extends ModerationStateTestBase {
/**
* Tests the revision author is updated when the moderation form is used.
*/
- public function testModerationFormSetsRevisionAuthor() {
+ public function testModerationFormSetsRevisionAuthor(): void {
// Create new moderated content in published.
$node = $this->createNode(['type' => 'moderated_content', 'moderation_state' => 'published']);
// Make a pending revision.
@@ -292,7 +292,7 @@ class ModerationFormTest extends ModerationStateTestBase {
/**
* Tests translated and moderated nodes.
*/
- public function testContentTranslationNodeForm() {
+ public function testContentTranslationNodeForm(): void {
$this->drupalLogin($this->rootUser);
// Add French language.
@@ -493,7 +493,7 @@ class ModerationFormTest extends ModerationStateTestBase {
/**
* Tests the moderation_state field when an alternative widget is set.
*/
- public function testAlternativeModerationStateWidget() {
+ public function testAlternativeModerationStateWidget(): void {
$entity_form_display = EntityFormDisplay::load('node.moderated_content.default');
$entity_form_display->setComponent('moderation_state', [
'type' => 'string_textfield',
@@ -514,7 +514,7 @@ class ModerationFormTest extends ModerationStateTestBase {
* @covers \Drupal\content_moderation\Plugin\WorkflowType\ContentModeration::workflowHasData
* @covers \Drupal\content_moderation\Plugin\WorkflowType\ContentModeration::workflowStateHasData
*/
- public function testWorkflowInUse() {
+ public function testWorkflowInUse(): void {
$user = $this->createUser([
'administer workflows',
'create moderated_content content',
diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php
index d4bce624602..206433a9952 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php
@@ -68,7 +68,7 @@ class ModerationLocaleTest extends ModerationStateTestBase {
/**
* Tests article translations can be moderated separately.
*/
- public function testTranslateModeratedContent() {
+ public function testTranslateModeratedContent(): void {
// Create a published article in English.
$edit = [
'title[0][value]' => 'Published English node',
@@ -218,7 +218,7 @@ class ModerationLocaleTest extends ModerationStateTestBase {
/**
* Tests that individual translations can be moderated independently.
*/
- public function testLanguageIndependentContentModeration() {
+ public function testLanguageIndependentContentModeration(): void {
// Create a published article in English (revision 1).
$this->drupalGet('node/add/article');
$node = $this->submitNodeForm('Test 1.1 EN', 'published');
@@ -415,7 +415,7 @@ class ModerationLocaleTest extends ModerationStateTestBase {
/**
* Checks that new translation values are populated properly.
*/
- public function testNewTranslationSourceValues() {
+ public function testNewTranslationSourceValues(): void {
// Create a published article in Italian (revision 1).
$this->drupalGet('node/add/article');
$node = $this->submitNodeForm('Test 1.1 IT', 'published', TRUE, 'it');
@@ -452,7 +452,7 @@ class ModerationLocaleTest extends ModerationStateTestBase {
/**
* Tests article revision history shows revisions for the correct translation.
*/
- public function testTranslationRevisionsHistory() {
+ public function testTranslationRevisionsHistory(): void {
// Create a published article in English.
$edit = [
'title[0][value]' => 'English node',
diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationRevisionRevertTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationRevisionRevertTest.php
index b5d9026ef1d..b7823c02357 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModerationRevisionRevertTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModerationRevisionRevertTest.php
@@ -64,7 +64,7 @@ class ModerationRevisionRevertTest extends BrowserTestBase {
/**
* Tests that reverting a revision works.
*/
- public function testEditingAfterRevertRevision() {
+ public function testEditingAfterRevertRevision(): void {
// Create a draft.
$this->drupalGet('node/add/moderated_bundle');
$this->submitForm([
diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationStateAccessTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationStateAccessTest.php
index 0fe50084a50..d8f435116e0 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModerationStateAccessTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModerationStateAccessTest.php
@@ -53,7 +53,7 @@ class ModerationStateAccessTest extends BrowserTestBase {
/**
* Tests the view operation access handler with the view permission.
*/
- public function testViewShowsCorrectStates() {
+ public function testViewShowsCorrectStates(): void {
$permissions = [
'access content',
'view all revisions',
diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationStateBlockTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationStateBlockTest.php
index 34b03ed22ff..5880df23bd6 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModerationStateBlockTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModerationStateBlockTest.php
@@ -63,7 +63,7 @@ class ModerationStateBlockTest extends ModerationStateTestBase {
* @see \Drupal\content_moderation\EntityOperations::entityPresave
* @see \Drupal\content_moderation\Tests\ModerationFormTest::testModerationForm
*/
- public function testCustomBlockModeration() {
+ public function testCustomBlockModeration(): void {
$this->drupalLogin($this->rootUser);
// Enable moderation for content blocks.
diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTest.php
index f5296310aad..f403f8b244e 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTest.php
@@ -33,7 +33,7 @@ class ModerationStateNodeTest extends ModerationStateTestBase {
/**
* Tests creating and deleting content.
*/
- public function testCreatingContent() {
+ public function testCreatingContent(): void {
$this->drupalGet('node/add/moderated_content');
$this->submitForm([
'title[0][value]' => 'moderated content',
@@ -86,7 +86,7 @@ class ModerationStateNodeTest extends ModerationStateTestBase {
/**
* Tests edit form destinations.
*/
- public function testFormSaveDestination() {
+ public function testFormSaveDestination(): void {
// Create new moderated content in draft.
$this->drupalGet('node/add/moderated_content');
$this->submitForm([
@@ -137,7 +137,7 @@ class ModerationStateNodeTest extends ModerationStateTestBase {
/**
* Tests pagers aren't broken by content_moderation.
*/
- public function testPagers() {
+ public function testPagers(): void {
// Create 51 nodes to force the pager.
foreach (range(1, 51) as $delta) {
Node::create([
@@ -160,7 +160,7 @@ class ModerationStateNodeTest extends ModerationStateTestBase {
/**
* Tests the workflow when a user has no Content Moderation permissions.
*/
- public function testNoContentModerationPermissions() {
+ public function testNoContentModerationPermissions(): void {
$session_assert = $this->assertSession();
// Create a user with quite advanced node permissions but no content
diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php
index 4c12134eebf..de2a87168e4 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php
@@ -23,7 +23,7 @@ class ModerationStateNodeTypeTest extends ModerationStateTestBase {
* @covers \Drupal\content_moderation\EntityTypeInfo::formAlter
* @covers \Drupal\content_moderation\Entity\Handler\NodeModerationHandler::enforceRevisionsBundleFormAlter
*/
- public function testNotModerated() {
+ public function testNotModerated(): void {
$this->drupalLogin($this->adminUser);
$this->createContentTypeFromUi('Not moderated', 'not_moderated');
$this->assertSession()->pageTextContains('The content type Not moderated has been added.');
@@ -42,7 +42,7 @@ class ModerationStateNodeTypeTest extends ModerationStateTestBase {
* @covers \Drupal\content_moderation\EntityTypeInfo::formAlter
* @covers \Drupal\content_moderation\Entity\Handler\NodeModerationHandler::enforceRevisionsBundleFormAlter
*/
- public function testEnablingOnExistingContent() {
+ public function testEnablingOnExistingContent(): void {
$editor_permissions = [
'administer workflows',
'access administration pages',
@@ -108,7 +108,7 @@ class ModerationStateNodeTypeTest extends ModerationStateTestBase {
/**
* @covers \Drupal\content_moderation\Entity\Handler\NodeModerationHandler::enforceRevisionsBundleFormAlter
*/
- public function testEnforceRevisionsEntityFormAlter() {
+ public function testEnforceRevisionsEntityFormAlter(): void {
$this->drupalLogin($this->adminUser);
$this->createContentTypeFromUi('Moderated', 'moderated');
diff --git a/core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php b/core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php
index 2cdb1144f3e..ddbca36e3e3 100644
--- a/core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php
@@ -72,7 +72,7 @@ class NodeAccessTest extends ModerationStateTestBase {
/**
* Verifies that a non-admin user can still access the appropriate pages.
*/
- public function testPageAccess() {
+ public function testPageAccess(): void {
// Initially disable access grant records in
// node_access_test_node_access_records().
\Drupal::state()->set('node_access_test.private', TRUE);
diff --git a/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php b/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php
index ab3948c61c2..fd86154bf8f 100644
--- a/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php
@@ -85,7 +85,7 @@ class ViewsModerationStateFilterTest extends ViewTestBase {
* @covers ::calculateDependencies
* @covers ::onDependencyRemoval
*/
- public function testModerationStateFilterDependencyHandling() {
+ public function testModerationStateFilterDependencyHandling(): void {
// First, check that the view doesn't have any config dependency when there
// are no states configured in the filter.
$view_id = 'test_content_moderation_state_filter_base_table';
@@ -170,7 +170,7 @@ class ViewsModerationStateFilterTest extends ViewTestBase {
*
* @dataProvider providerTestWorkflowChanges
*/
- public function testWorkflowChanges($view_id) {
+ public function testWorkflowChanges($view_id): void {
// First, apply the Editorial workflow to both of our content types.
$this->drupalGet('admin/config/workflow/workflows/manage/editorial/type/node');
$this->submitForm([
@@ -277,7 +277,7 @@ class ViewsModerationStateFilterTest extends ViewTestBase {
/**
* Tests the content moderation state filter caching is correct.
*/
- public function testFilterRenderCache() {
+ public function testFilterRenderCache(): void {
// Initially all states of the workflow are displayed.
$this->drupalGet('admin/config/workflow/workflows/manage/editorial/type/node');
$this->submitForm(['bundles[example_a]' => TRUE], 'Save');
diff --git a/core/modules/content_moderation/tests/src/Functional/WorkspaceContentModerationIntegrationTest.php b/core/modules/content_moderation/tests/src/Functional/WorkspaceContentModerationIntegrationTest.php
index bb47a4e89e1..5829390ecc6 100644
--- a/core/modules/content_moderation/tests/src/Functional/WorkspaceContentModerationIntegrationTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/WorkspaceContentModerationIntegrationTest.php
@@ -52,7 +52,7 @@ class WorkspaceContentModerationIntegrationTest extends ModerationStateTestBase
/**
* Tests moderating nodes in a workspace.
*/
- public function testModerationInWorkspace() {
+ public function testModerationInWorkspace(): void {
$stage = Workspace::load('stage');
$this->switchToWorkspace($stage);
diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationAccessTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationAccessTest.php
index a59b3958022..aeffeb19f28 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationAccessTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationAccessTest.php
@@ -62,7 +62,7 @@ class ContentModerationAccessTest extends KernelTestBase {
/**
* Tests access cacheability.
*/
- public function testAccessCacheability() {
+ public function testAccessCacheability(): void {
$node = $this->createNode(['type' => 'page']);
/** @var \Drupal\user\RoleInterface $authenticated */
diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationPermissionsTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationPermissionsTest.php
index c0172b89ae5..b9a4a81d108 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationPermissionsTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationPermissionsTest.php
@@ -39,7 +39,7 @@ class ContentModerationPermissionsTest extends KernelTestBase {
*
* @dataProvider permissionsTestCases
*/
- public function testPermissions($workflow, $permissions) {
+ public function testPermissions($workflow, $permissions): void {
Workflow::create($workflow)->save();
$this->assertEquals($permissions, (new Permissions())->transitionPermissions());
}
diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationResaveTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationResaveTest.php
index 7551d998a77..f1e37debc43 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationResaveTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationResaveTest.php
@@ -76,7 +76,7 @@ class ContentModerationResaveTest extends KernelTestBase {
/**
* Tests that Content Moderation works with entities being resaved.
*/
- public function testContentModerationResave() {
+ public function testContentModerationResave(): void {
$entity = $this->entityStorage->create();
$this->assertSame('draft', $entity->get('moderation_state')->value);
$this->assertNull(\Drupal::state()->get('content_moderation_test_resave'));
diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateAccessControlHandlerTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateAccessControlHandlerTest.php
index cdb70c079bc..7d3448850f6 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateAccessControlHandlerTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateAccessControlHandlerTest.php
@@ -45,7 +45,7 @@ class ContentModerationStateAccessControlHandlerTest extends KernelTestBase {
* @covers ::checkAccess
* @covers ::checkCreateAccess
*/
- public function testHandler() {
+ public function testHandler(): void {
$entity = ContentModerationState::create([]);
$this->assertFalse($this->accessControlHandler->access($entity, 'view'));
$this->assertFalse($this->accessControlHandler->access($entity, 'update'));
diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateResourceTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateResourceTest.php
index d2f5356be35..6de00d4df98 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateResourceTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateResourceTest.php
@@ -22,7 +22,7 @@ class ContentModerationStateResourceTest extends KernelTestBase {
/**
* @see \Drupal\content_moderation\Entity\ContentModerationState
*/
- public function testCreateContentModerationStateResource() {
+ public function testCreateContentModerationStateResource(): void {
$this->expectException(PluginNotFoundException::class);
$this->expectExceptionMessage('The "entity:content_moderation_state" plugin does not exist.');
RestResourceConfig::create([
diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateStorageSchemaTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateStorageSchemaTest.php
index bf0cfdf9ed3..2f01fb2e56e 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateStorageSchemaTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateStorageSchemaTest.php
@@ -60,7 +60,7 @@ class ContentModerationStateStorageSchemaTest extends KernelTestBase {
*
* @covers ::getEntitySchema
*/
- public function testUniqueKeys() {
+ public function testUniqueKeys(): void {
// Create a node which will create a new ContentModerationState entity.
$node = Node::create([
'title' => 'Test title',
diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
index 9cfc05086b6..934ce06d1bc 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
@@ -114,7 +114,7 @@ class ContentModerationStateTest extends KernelTestBase {
*
* @dataProvider basicModerationTestCases
*/
- public function testBasicModeration($entity_type_id) {
+ public function testBasicModeration($entity_type_id): void {
$entity = $this->createEntity($entity_type_id, 'draft');
$entity = $this->reloadEntity($entity);
$this->assertEquals('draft', $entity->moderation_state->value);
@@ -204,7 +204,7 @@ class ContentModerationStateTest extends KernelTestBase {
*
* @dataProvider basicModerationTestCases
*/
- public function testContentModerationStateDataRemoval($entity_type_id) {
+ public function testContentModerationStateDataRemoval($entity_type_id): void {
/** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
$entity = $this->createEntity($entity_type_id);
$entity = $this->reloadEntity($entity);
@@ -218,7 +218,7 @@ class ContentModerationStateTest extends KernelTestBase {
*
* @dataProvider basicModerationTestCases
*/
- public function testContentModerationStateRevisionDataRemoval($entity_type_id) {
+ public function testContentModerationStateRevisionDataRemoval($entity_type_id): void {
/** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
$entity = $this->createEntity($entity_type_id);
$revision_1 = clone $entity;
@@ -253,7 +253,7 @@ class ContentModerationStateTest extends KernelTestBase {
*
* @dataProvider basicModerationTestCases
*/
- public function testContentModerationStatePendingRevisionDataRemoval($entity_type_id) {
+ public function testContentModerationStatePendingRevisionDataRemoval($entity_type_id): void {
$entity = $this->createEntity($entity_type_id, 'published');
$entity->setNewRevision(TRUE);
$entity->moderation_state = 'draft';
@@ -273,7 +273,7 @@ class ContentModerationStateTest extends KernelTestBase {
/**
* Tests removal of content moderation state entities for preexisting content.
*/
- public function testExistingContentModerationStateDataRemoval() {
+ public function testExistingContentModerationStateDataRemoval(): void {
/** @var \Drupal\Core\Entity\RevisionableStorageInterface $storage */
$storage = $this->entityTypeManager->getStorage('entity_test_mulrevpub');
@@ -299,7 +299,7 @@ class ContentModerationStateTest extends KernelTestBase {
*
* @dataProvider basicModerationTestCases
*/
- public function testContentModerationStateTranslationDataRemoval($entity_type_id) {
+ public function testContentModerationStateTranslationDataRemoval($entity_type_id): void {
// Test content moderation state translation deletion.
if ($this->entityTypeManager->getDefinition($entity_type_id)->isTranslatable()) {
/** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
@@ -323,7 +323,7 @@ class ContentModerationStateTest extends KernelTestBase {
/**
* Tests basic multilingual content moderation through the API.
*/
- public function testMultilingualModeration() {
+ public function testMultilingualModeration(): void {
$this->createContentType([
'type' => 'example',
]);
@@ -433,7 +433,7 @@ class ContentModerationStateTest extends KernelTestBase {
/**
* Tests moderation when the moderation_state field has a config override.
*/
- public function testModerationWithFieldConfigOverride() {
+ public function testModerationWithFieldConfigOverride(): void {
$this->createContentType([
'type' => 'test_type',
]);
@@ -465,7 +465,7 @@ class ContentModerationStateTest extends KernelTestBase {
*
* @dataProvider moderationWithSpecialLanguagesTestCases
*/
- public function testModerationWithSpecialLanguages($original_language, $updated_language) {
+ public function testModerationWithSpecialLanguages($original_language, $updated_language): void {
$workflow = $this->createEditorialWorkflow();
$this->addEntityTypeAndBundleToWorkflow($workflow, $this->revEntityTypeId, $this->revEntityTypeId);
@@ -507,7 +507,7 @@ class ContentModerationStateTest extends KernelTestBase {
/**
* Tests changing the language of content without adding a translation.
*/
- public function testChangingContentLangcode() {
+ public function testChangingContentLangcode(): void {
$this->createContentType([
'type' => 'test_type',
]);
@@ -540,7 +540,7 @@ class ContentModerationStateTest extends KernelTestBase {
/**
* Tests that a non-translatable entity type with a langcode can be moderated.
*/
- public function testNonTranslatableEntityTypeModeration() {
+ public function testNonTranslatableEntityTypeModeration(): void {
$workflow = $this->createEditorialWorkflow();
$this->addEntityTypeAndBundleToWorkflow($workflow, $this->revEntityTypeId, $this->revEntityTypeId);
@@ -563,7 +563,7 @@ class ContentModerationStateTest extends KernelTestBase {
/**
* Tests moderation of a non-translatable entity type with no langcode.
*/
- public function testNonLangcodeEntityTypeModeration() {
+ public function testNonLangcodeEntityTypeModeration(): void {
// Unset the langcode entity key for 'entity_test_rev'.
$entity_type = clone $this->entityTypeManager->getDefinition($this->revEntityTypeId);
$keys = $entity_type->getKeys();
@@ -598,7 +598,7 @@ class ContentModerationStateTest extends KernelTestBase {
/**
* Tests the dependencies of the workflow when using content moderation.
*/
- public function testWorkflowDependencies() {
+ public function testWorkflowDependencies(): void {
$node_type = $this->createContentType([
'type' => 'example',
]);
@@ -641,7 +641,7 @@ class ContentModerationStateTest extends KernelTestBase {
/**
* Tests the content moderation workflow dependencies for non-config bundles.
*/
- public function testWorkflowNonConfigBundleDependencies() {
+ public function testWorkflowNonConfigBundleDependencies(): void {
// Create a bundle not based on any particular configuration.
entity_test_create_bundle('test_bundle');
@@ -681,7 +681,7 @@ class ContentModerationStateTest extends KernelTestBase {
*
* @dataProvider basicModerationTestCases
*/
- public function testRevisionDefaultState($entity_type_id) {
+ public function testRevisionDefaultState($entity_type_id): void {
// Check that the revision default state of the moderated entity and the
// content moderation state entity always match.
$entity = $this->createEntity($entity_type_id, 'published');
diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationSyncingTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationSyncingTest.php
index 78556eefdae..8204273393a 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationSyncingTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationSyncingTest.php
@@ -44,7 +44,7 @@ class ContentModerationSyncingTest extends KernelTestBase {
/**
* Tests no new revision is forced during a sync.
*/
- public function testNoRevisionForcedDuringSync() {
+ public function testNoRevisionForcedDuringSync(): void {
$entity = EntityTestMulRevPub::create([
'moderation_state' => 'draft',
'name' => 'foo',
@@ -62,7 +62,7 @@ class ContentModerationSyncingTest extends KernelTestBase {
/**
* Tests changing the moderation state during a sync.
*/
- public function testSingleRevisionStateChangedDuringSync() {
+ public function testSingleRevisionStateChangedDuringSync(): void {
$entity = EntityTestMulRevPub::create([
'moderation_state' => 'published',
'name' => 'foo',
@@ -88,7 +88,7 @@ class ContentModerationSyncingTest extends KernelTestBase {
/**
* Tests state changes with multiple revisions during a sync.
*/
- public function testMultipleRevisionStateChangedDuringSync() {
+ public function testMultipleRevisionStateChangedDuringSync(): void {
$entity = EntityTestMulRevPub::create([
'moderation_state' => 'published',
'name' => 'foo',
@@ -116,7 +116,7 @@ class ContentModerationSyncingTest extends KernelTestBase {
/**
* Tests modifying a previous revision during a sync.
*/
- public function testUpdatingPreviousRevisionDuringSync() {
+ public function testUpdatingPreviousRevisionDuringSync(): void {
/** @var \Drupal\Core\Entity\RevisionableStorageInterface $storage */
$storage = $this->container->get('entity_type.manager')->getStorage('entity_test_mulrevpub');
@@ -144,7 +144,7 @@ class ContentModerationSyncingTest extends KernelTestBase {
/**
* Tests a moderation state changed on a previous revision during a sync.
*/
- public function testStateChangedPreviousRevisionDuringSync() {
+ public function testStateChangedPreviousRevisionDuringSync(): void {
/** @var \Drupal\Core\Entity\RevisionableStorageInterface $storage */
$storage = $this->container->get('entity_type.manager')->getStorage('entity_test_mulrevpub');
diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationWorkflowConfigTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationWorkflowConfigTest.php
index 93d88cd1dd2..20f23a54347 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationWorkflowConfigTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationWorkflowConfigTest.php
@@ -83,7 +83,7 @@ class ContentModerationWorkflowConfigTest extends KernelTestBase {
/**
* Tests deleting a state via config import.
*/
- public function testDeletingStateViaConfiguration() {
+ public function testDeletingStateViaConfiguration(): void {
$config_sync = \Drupal::service('config.storage.sync');
// Alter the workflow data.
diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationWorkflowTypeApiTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationWorkflowTypeApiTest.php
index 8bf6f0cf676..79b47665d2b 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationWorkflowTypeApiTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationWorkflowTypeApiTest.php
@@ -46,7 +46,7 @@ class ContentModerationWorkflowTypeApiTest extends KernelTestBase {
* @covers ::addEntityTypeAndBundle
* @covers ::removeEntityTypeAndBundle
*/
- public function testGetBundlesForEntityType() {
+ public function testGetBundlesForEntityType(): void {
/** @var \Drupal\content_moderation\Plugin\WorkflowType\ContentModeration $workflow_plugin */
$workflow_plugin = $this->workflow->getTypePlugin();
// The content moderation plugin does not validate the existence of the
@@ -64,7 +64,7 @@ class ContentModerationWorkflowTypeApiTest extends KernelTestBase {
* @covers ::addEntityTypeAndBundle
* @covers ::removeEntityTypeAndBundle
*/
- public function testAppliesToEntityTypeAndBundle() {
+ public function testAppliesToEntityTypeAndBundle(): void {
/** @var \Drupal\content_moderation\Plugin\WorkflowType\ContentModeration $workflow_plugin */
$workflow_plugin = $this->workflow->getTypePlugin();
// The content moderation plugin does not validate the existence of the
@@ -80,7 +80,7 @@ class ContentModerationWorkflowTypeApiTest extends KernelTestBase {
/**
* @covers ::addEntityTypeAndBundle
*/
- public function testAddEntityTypeAndBundle() {
+ public function testAddEntityTypeAndBundle(): void {
/** @var \Drupal\content_moderation\Plugin\WorkflowType\ContentModeration $workflow_plugin */
$workflow_plugin = $this->workflow->getTypePlugin();
@@ -104,7 +104,7 @@ class ContentModerationWorkflowTypeApiTest extends KernelTestBase {
* @covers ::addEntityTypeAndBundle
* @covers ::removeEntityTypeAndBundle
*/
- public function testRemoveEntityTypeAndBundle() {
+ public function testRemoveEntityTypeAndBundle(): void {
/** @var \Drupal\content_moderation\Plugin\WorkflowType\ContentModeration $workflow_plugin */
$workflow_plugin = $this->workflow->getTypePlugin();
diff --git a/core/modules/content_moderation/tests/src/Kernel/DefaultRevisionStateTest.php b/core/modules/content_moderation/tests/src/Kernel/DefaultRevisionStateTest.php
index b0d13d29bef..34a6664238b 100644
--- a/core/modules/content_moderation/tests/src/Kernel/DefaultRevisionStateTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/DefaultRevisionStateTest.php
@@ -62,7 +62,7 @@ class DefaultRevisionStateTest extends KernelTestBase {
/**
* Tests a translatable Node.
*/
- public function testMultilingual() {
+ public function testMultilingual(): void {
// Enable French.
ConfigurableLanguage::createFromLangcode('fr')->save();
$node_type = NodeType::create([
diff --git a/core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php b/core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php
index 6282ba0b6ea..69c1b93a9c7 100644
--- a/core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php
@@ -60,7 +60,7 @@ class EntityOperationsTest extends KernelTestBase {
/**
* Verifies that the process of saving pending revisions works as expected.
*/
- public function testPendingRevisions() {
+ public function testPendingRevisions(): void {
// Create a new node in draft.
$page = Node::create([
'type' => 'page',
@@ -134,7 +134,7 @@ class EntityOperationsTest extends KernelTestBase {
/**
* Verifies that a newly-created node can go straight to published.
*/
- public function testPublishedCreation() {
+ public function testPublishedCreation(): void {
// Create a new node in draft.
$page = Node::create([
'type' => 'page',
@@ -156,7 +156,7 @@ class EntityOperationsTest extends KernelTestBase {
/**
* Verifies that an unpublished state may be made the default revision.
*/
- public function testArchive() {
+ public function testArchive(): void {
$page = Node::create([
'type' => 'page',
'title' => $this->randomString(),
diff --git a/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php b/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php
index 5d8d7613494..e769818a9cb 100644
--- a/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php
@@ -68,7 +68,7 @@ class EntityStateChangeValidationTest extends KernelTestBase {
*
* @covers ::validate
*/
- public function testValidTransition() {
+ public function testValidTransition(): void {
$this->setCurrentUser($this->adminUser);
$node_type = NodeType::create([
@@ -99,7 +99,7 @@ class EntityStateChangeValidationTest extends KernelTestBase {
*
* @covers ::validate
*/
- public function testInvalidTransition() {
+ public function testInvalidTransition(): void {
$this->setCurrentUser($this->adminUser);
$node_type = NodeType::create([
@@ -128,7 +128,7 @@ class EntityStateChangeValidationTest extends KernelTestBase {
/**
* Tests validation with an invalid state.
*/
- public function testInvalidState() {
+ public function testInvalidState(): void {
$node_type = NodeType::create([
'type' => 'example',
'name' => 'Example',
@@ -152,7 +152,7 @@ class EntityStateChangeValidationTest extends KernelTestBase {
/**
* Tests validation with no initial state or an invalid state.
*/
- public function testInvalidStateWithoutExisting() {
+ public function testInvalidStateWithoutExisting(): void {
$this->setCurrentUser($this->adminUser);
// Create content without moderation enabled for the content type.
$node_type = NodeType::create([
@@ -202,7 +202,7 @@ class EntityStateChangeValidationTest extends KernelTestBase {
/**
* Tests state transition validation with multiple languages.
*/
- public function testInvalidStateMultilingual() {
+ public function testInvalidStateMultilingual(): void {
$this->setCurrentUser($this->adminUser);
ConfigurableLanguage::createFromLangcode('fr')->save();
@@ -260,7 +260,7 @@ class EntityStateChangeValidationTest extends KernelTestBase {
/**
* Tests that content without prior moderation information can be moderated.
*/
- public function testExistingContentWithNoModeration() {
+ public function testExistingContentWithNoModeration(): void {
$this->setCurrentUser($this->adminUser);
$node_type = NodeType::create([
@@ -297,7 +297,7 @@ class EntityStateChangeValidationTest extends KernelTestBase {
/**
* Tests that content without prior moderation information can be translated.
*/
- public function testExistingMultilingualContentWithNoModeration() {
+ public function testExistingMultilingualContentWithNoModeration(): void {
$this->setCurrentUser($this->adminUser);
// Enable French.
@@ -343,7 +343,7 @@ class EntityStateChangeValidationTest extends KernelTestBase {
/**
* @dataProvider transitionAccessValidationTestCases
*/
- public function testTransitionAccessValidation($permissions, $target_state, $messages) {
+ public function testTransitionAccessValidation($permissions, $target_state, $messages): void {
$node_type = NodeType::create([
'type' => 'example',
'name' => 'Example',
diff --git a/core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php b/core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php
index d1032902b6b..78f6e6e3515 100644
--- a/core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php
@@ -67,7 +67,7 @@ class EntityTypeInfoTest extends KernelTestBase {
/**
* @covers ::entityBaseFieldInfo
*/
- public function testEntityBaseFieldInfo() {
+ public function testEntityBaseFieldInfo(): void {
$definition = $this->entityTypeManager->getDefinition('entity_test');
$definition->setHandlerClass('moderation', ModerationHandler::class);
@@ -86,7 +86,7 @@ class EntityTypeInfoTest extends KernelTestBase {
*
* @dataProvider providerTestEntityTypeAlter
*/
- public function testEntityTypeAlter($entity_type_id, $moderatable) {
+ public function testEntityTypeAlter($entity_type_id, $moderatable): void {
$entity_types = $this->entityTypeManager->getDefinitions();
$this->assertSame($moderatable, $entity_types[$entity_type_id]->hasHandlerClass('moderation'));
}
@@ -112,7 +112,7 @@ class EntityTypeInfoTest extends KernelTestBase {
/**
* @covers ::entityBaseFieldInfo
*/
- public function testBaseFieldOnlyAddedToModeratedEntityTypes() {
+ public function testBaseFieldOnlyAddedToModeratedEntityTypes(): void {
$definition = $this->entityTypeManager->getDefinition('entity_test_with_bundle');
EntityTestBundle::create([
@@ -133,7 +133,7 @@ class EntityTypeInfoTest extends KernelTestBase {
/**
* Tests entity base field provider.
*/
- public function testEntityBaseFieldProvider() {
+ public function testEntityBaseFieldProvider(): void {
$this->enableModeration('entity_test_mulrev', 'entity_test_mulrev');
$this->container->get('state')->set('entity_test.field_test_item', TRUE);
diff --git a/core/modules/content_moderation/tests/src/Kernel/InitialStateTest.php b/core/modules/content_moderation/tests/src/Kernel/InitialStateTest.php
index 739c76d3606..2c856a591f5 100644
--- a/core/modules/content_moderation/tests/src/Kernel/InitialStateTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/InitialStateTest.php
@@ -44,7 +44,7 @@ class InitialStateTest extends KernelTestBase {
/**
* Tests the correct initial state.
*/
- public function testInitialState() {
+ public function testInitialState(): void {
$node_type = NodeType::create([
'type' => 'example',
'name' => 'Example',
diff --git a/core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php b/core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php
index 84e886c2099..70cde38a476 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php
@@ -63,7 +63,7 @@ class ModerationInformationTest extends KernelTestBase {
/**
* @covers ::getDefaultRevisionId
*/
- public function testGetDefaultRevisionId() {
+ public function testGetDefaultRevisionId(): void {
$entity_test_rev = EntityTestRev::create([
'name' => 'Default Revision',
'moderation_state' => 'published',
@@ -84,7 +84,7 @@ class ModerationInformationTest extends KernelTestBase {
* @covers ::isDefaultRevisionPublished
* @dataProvider isDefaultRevisionPublishedTestCases
*/
- public function testIsDefaultRevisionPublished($initial_state, $final_state, $initial_is_default_published, $final_is_default_published) {
+ public function testIsDefaultRevisionPublished($initial_state, $final_state, $initial_is_default_published, $final_is_default_published): void {
$entity = EntityTestMulRevPub::create([
'moderation_state' => $initial_state,
]);
@@ -131,7 +131,7 @@ class ModerationInformationTest extends KernelTestBase {
/**
* @covers ::isDefaultRevisionPublished
*/
- public function testIsDefaultRevisionPublishedMultilingual() {
+ public function testIsDefaultRevisionPublishedMultilingual(): void {
$entity = EntityTestMulRevPub::create([
'moderation_state' => 'draft',
]);
@@ -153,7 +153,7 @@ class ModerationInformationTest extends KernelTestBase {
/**
* @covers ::hasPendingRevision
*/
- public function testHasPendingRevision() {
+ public function testHasPendingRevision(): void {
$entity = EntityTestMulRevPub::create([
'moderation_state' => 'published',
]);
@@ -184,7 +184,7 @@ class ModerationInformationTest extends KernelTestBase {
/**
* @covers ::getOriginalState
*/
- public function testGetOriginalState() {
+ public function testGetOriginalState(): void {
$entity = EntityTestMulRevPub::create([
'moderation_state' => 'published',
]);
@@ -196,7 +196,7 @@ class ModerationInformationTest extends KernelTestBase {
/**
* @covers ::getOriginalState
*/
- public function testGetOriginalStateMultilingual() {
+ public function testGetOriginalStateMultilingual(): void {
$entity = EntityTestMulRevPub::create([
'moderation_state' => 'draft',
]);
diff --git a/core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php b/core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php
index 5b93b8574e2..1c83da34b69 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php
@@ -79,7 +79,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Tests the field item list when accessing an index.
*/
- public function testArrayIndex() {
+ public function testArrayIndex(): void {
$this->assertFalse($this->testNode->isPublished());
$this->assertEquals('draft', $this->testNode->moderation_state[0]->value);
}
@@ -87,7 +87,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Tests the field item list when iterating.
*/
- public function testArrayIteration() {
+ public function testArrayIteration(): void {
$states = [];
foreach ($this->testNode->moderation_state as $item) {
$states[] = $item->value;
@@ -98,14 +98,14 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* @covers ::getValue
*/
- public function testGetValue() {
+ public function testGetValue(): void {
$this->assertEquals([['value' => 'draft']], $this->testNode->moderation_state->getValue());
}
/**
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
$this->assertEquals('draft', $this->testNode->moderation_state->get(0)->value);
$this->expectException(\InvalidArgumentException::class);
$this->testNode->moderation_state->get(2);
@@ -114,7 +114,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Tests the item list when it is emptied and appended to.
*/
- public function testEmptyStateAndAppend() {
+ public function testEmptyStateAndAppend(): void {
// This test case mimics the lifecycle of an entity that is being patched in
// a rest resource.
$this->testNode->moderation_state->setValue([]);
@@ -130,7 +130,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Tests an empty value assigned to the field item.
*/
- public function testEmptyFieldItem() {
+ public function testEmptyFieldItem(): void {
$this->testNode->moderation_state->value = '';
$this->assertEquals('', $this->testNode->moderation_state->value);
$this->assertEmptiedModerationFieldItemList();
@@ -139,7 +139,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Tests an empty value assigned to the field item list.
*/
- public function testEmptyFieldItemList() {
+ public function testEmptyFieldItemList(): void {
$this->testNode->moderation_state = '';
$this->assertEquals('', $this->testNode->moderation_state->value);
$this->assertEmptiedModerationFieldItemList();
@@ -148,7 +148,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Tests the field item when it is unset.
*/
- public function testUnsetItemList() {
+ public function testUnsetItemList(): void {
unset($this->testNode->moderation_state);
$this->assertEquals(NULL, $this->testNode->moderation_state->value);
$this->assertEmptiedModerationFieldItemList();
@@ -157,7 +157,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Tests the field item when it is assigned NULL.
*/
- public function testAssignNullItemList() {
+ public function testAssignNullItemList(): void {
$this->testNode->moderation_state = NULL;
$this->assertEquals(NULL, $this->testNode->moderation_state->value);
$this->assertEmptiedModerationFieldItemList();
@@ -183,7 +183,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Tests the list class with a non moderated entity.
*/
- public function testNonModeratedEntity() {
+ public function testNonModeratedEntity(): void {
$unmoderated_node = Node::create([
'type' => 'unmoderated',
'title' => 'Test title',
@@ -201,7 +201,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
*
* @dataProvider moderationStateChangesTestCases
*/
- public function testModerationStateChanges($initial_state, $final_state, $first_published, $first_is_default, $second_published, $second_is_default) {
+ public function testModerationStateChanges($initial_state, $final_state, $first_published, $first_is_default, $second_published, $second_is_default): void {
$this->testNode->moderation_state->value = $initial_state;
$this->assertEquals($first_published, $this->testNode->isPublished());
$this->assertEquals($first_is_default, $this->testNode->isDefaultRevision());
@@ -255,7 +255,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Tests updating the state for an entity without a workflow.
*/
- public function testEntityWithNoWorkflow() {
+ public function testEntityWithNoWorkflow(): void {
$node_type = NodeType::create([
'type' => 'example_no_workflow',
'name' => 'No-Workflow example',
@@ -283,7 +283,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
*
* @dataProvider entityUnserializeTestCases
*/
- public function testEntityUnserialize($state, $default, $published) {
+ public function testEntityUnserialize($state, $default, $published): void {
$this->testNode->moderation_state->value = $state;
$this->assertEquals($state, $this->testNode->moderation_state->value);
@@ -320,7 +320,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
*
* @dataProvider moderatedEntityWithExistingIdTestCases
*/
- public function testModeratedEntityWithExistingId($state) {
+ public function testModeratedEntityWithExistingId($state): void {
$node = Node::create([
'title' => 'Test title',
'type' => 'example',
@@ -348,7 +348,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Test customizing the default moderation state.
*/
- public function testWorkflowCustomizedInitialState() {
+ public function testWorkflowCustomizedInitialState(): void {
$workflow = Workflow::load('editorial');
$configuration = $workflow->getTypePlugin()->getConfiguration();
@@ -380,7 +380,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Tests the field item list when used with existing unmoderated content.
*/
- public function testWithExistingUnmoderatedContent() {
+ public function testWithExistingUnmoderatedContent(): void {
$node = Node::create([
'title' => 'Test title',
'type' => 'unmoderated',
@@ -413,7 +413,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Test generating sample values for entities with a moderation state.
*/
- public function testModerationStateSampleValues() {
+ public function testModerationStateSampleValues(): void {
$this->container->get('current_user')->setAccount(
$this->createUser([
'use editorial transition create_new_draft',
@@ -430,7 +430,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Tests field item list translation support with unmoderated content.
*/
- public function testTranslationWithExistingUnmoderatedContent() {
+ public function testTranslationWithExistingUnmoderatedContent(): void {
$node = Node::create([
'title' => 'Published en',
'langcode' => 'en',
diff --git a/core/modules/content_moderation/tests/src/Kernel/ModerationStateWidgetTest.php b/core/modules/content_moderation/tests/src/Kernel/ModerationStateWidgetTest.php
index ef543db1098..8354e59fa81 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ModerationStateWidgetTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ModerationStateWidgetTest.php
@@ -60,7 +60,7 @@ class ModerationStateWidgetTest extends KernelTestBase {
/**
* Tests the widget does not impact a non-moderated entity.
*/
- public function testWidgetNonModeratedEntity() {
+ public function testWidgetNonModeratedEntity(): void {
// Create an unmoderated entity and build a form display which will include
// the ModerationStateWidget plugin, in a hidden state.
$entity = Node::create([
@@ -85,7 +85,7 @@ class ModerationStateWidgetTest extends KernelTestBase {
/**
* @covers ::isApplicable
*/
- public function testIsApplicable() {
+ public function testIsApplicable(): void {
// The moderation_state field definition should be applicable to our widget.
$fields = $this->container->get('entity_field.manager')->getFieldDefinitions('node', 'test_type');
$this->assertTrue(ModerationStateWidget::isApplicable($fields['moderation_state']));
diff --git a/core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php b/core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php
index ab1fa1f3177..5d6cfb8a154 100644
--- a/core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php
@@ -69,7 +69,7 @@ class NodeAccessTest extends KernelTestBase {
/**
* @covers \Drupal\content_moderation\ModerationInformation::getDefaultRevisionId
*/
- public function testGetDefaultRevisionId() {
+ public function testGetDefaultRevisionId(): void {
// Create an admin user.
$user = $this->createUser([], NULL, TRUE);
\Drupal::currentUser()->setAccount($user);
diff --git a/core/modules/content_moderation/tests/src/Kernel/StateFormatterTest.php b/core/modules/content_moderation/tests/src/Kernel/StateFormatterTest.php
index ab708d29b00..8c402ec968f 100644
--- a/core/modules/content_moderation/tests/src/Kernel/StateFormatterTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/StateFormatterTest.php
@@ -50,7 +50,7 @@ class StateFormatterTest extends KernelTestBase {
*
* @dataProvider formatterTestCases
*/
- public function testStateFieldFormatter($field_value, $formatter_settings, $expected_output) {
+ public function testStateFieldFormatter($field_value, $formatter_settings, $expected_output): void {
$entity = EntityTestRev::create([
'moderation_state' => $field_value,
]);
diff --git a/core/modules/content_moderation/tests/src/Kernel/ViewsDataIntegrationTest.php b/core/modules/content_moderation/tests/src/Kernel/ViewsDataIntegrationTest.php
index 53275888d07..60e65b5f5f7 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ViewsDataIntegrationTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ViewsDataIntegrationTest.php
@@ -59,7 +59,7 @@ class ViewsDataIntegrationTest extends ViewsKernelTestBase {
/**
* Tests the content moderation state views field.
*/
- public function testContentModerationStateField() {
+ public function testContentModerationStateField(): void {
$node = Node::create([
'type' => 'page',
'title' => 'Test title',
diff --git a/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php b/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php
index 3ab02092705..9b3771e98e0 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php
@@ -85,7 +85,7 @@ class ViewsModerationStateFilterTest extends ViewsKernelTestBase {
/**
* Tests the content moderation state filter.
*/
- public function testStateFilterViewsRelationship() {
+ public function testStateFilterViewsRelationship(): void {
$workflow = Workflow::load('editorial');
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->getTypePlugin()->addState('translated_draft', 'Bar');
@@ -180,7 +180,7 @@ class ViewsModerationStateFilterTest extends ViewsKernelTestBase {
/**
* Tests the moderation filter with a non-translatable entity type.
*/
- public function testNonTranslatableEntityType() {
+ public function testNonTranslatableEntityType(): void {
$workflow = Workflow::load('editorial');
$workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_no_bundle', 'entity_test_no_bundle');
$workflow->save();
@@ -201,7 +201,7 @@ class ViewsModerationStateFilterTest extends ViewsKernelTestBase {
/**
* Tests the moderation state filter on an entity added via a relationship.
*/
- public function testModerationStateFilterOnJoinedEntity() {
+ public function testModerationStateFilterOnJoinedEntity(): void {
$workflow = Workflow::load('editorial');
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->save();
@@ -275,7 +275,7 @@ class ViewsModerationStateFilterTest extends ViewsKernelTestBase {
/**
* Tests the list of states in the filter plugin.
*/
- public function testStateFilterStatesList() {
+ public function testStateFilterStatesList(): void {
// By default a view of nodes will not have states to filter.
$workflow = Workflow::load('editorial');
$workflow->getTypePlugin()->removeEntityTypeAndBundle('node', 'example');
diff --git a/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateSortTest.php b/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateSortTest.php
index da968fc7f5e..47a90f20131 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateSortTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateSortTest.php
@@ -65,7 +65,7 @@ class ViewsModerationStateSortTest extends ViewsKernelTestBase {
/**
* Tests sorting with a standard data base table.
*/
- public function testSortBaseTable() {
+ public function testSortBaseTable(): void {
$this->enableModules(['content_moderation_test_views']);
$this->installConfig(['content_moderation_test_views']);
@@ -104,7 +104,7 @@ class ViewsModerationStateSortTest extends ViewsKernelTestBase {
/**
* Tests sorting with the revision base table.
*/
- public function testSortRevisionBaseTable() {
+ public function testSortRevisionBaseTable(): void {
$this->enableModules(['content_moderation_test_views']);
$this->installConfig(['content_moderation_test_views']);
diff --git a/core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php b/core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php
index 5a03dee9cfc..5967d8d5b41 100644
--- a/core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php
@@ -55,7 +55,7 @@ class WorkspacesContentModerationStateTest extends ContentModerationStateTest {
*
* @see \Drupal\workspaces\EntityTypeInfo::entityTypeAlter()
*/
- public function testWorkspaceEntityTypeModeration() {
+ public function testWorkspaceEntityTypeModeration(): void {
/** @var \Drupal\content_moderation\ModerationInformationInterface $moderation_info */
$moderation_info = \Drupal::service('content_moderation.moderation_information');
$entity_type = \Drupal::entityTypeManager()->getDefinition('workspace');
@@ -67,7 +67,7 @@ class WorkspacesContentModerationStateTest extends ContentModerationStateTest {
*
* @see content_moderation_workspace_access()
*/
- public function testContentModerationIntegrationWithWorkspaces() {
+ public function testContentModerationIntegrationWithWorkspaces(): void {
$editorial = $this->createEditorialWorkflow();
$access_handler = \Drupal::entityTypeManager()->getAccessControlHandler('workspace');
@@ -191,7 +191,7 @@ class WorkspacesContentModerationStateTest extends ContentModerationStateTest {
/**
* {@inheritdoc}
*/
- public function testModerationWithFieldConfigOverride() {
+ public function testModerationWithFieldConfigOverride(): void {
// This test does not assert anything that can be workspace-specific.
$this->markTestSkipped();
}
@@ -199,7 +199,7 @@ class WorkspacesContentModerationStateTest extends ContentModerationStateTest {
/**
* {@inheritdoc}
*/
- public function testWorkflowDependencies() {
+ public function testWorkflowDependencies(): void {
// This test does not assert anything that can be workspace-specific.
$this->markTestSkipped();
}
@@ -207,7 +207,7 @@ class WorkspacesContentModerationStateTest extends ContentModerationStateTest {
/**
* {@inheritdoc}
*/
- public function testWorkflowNonConfigBundleDependencies() {
+ public function testWorkflowNonConfigBundleDependencies(): void {
// This test does not assert anything that can be workspace-specific.
$this->markTestSkipped();
}
@@ -215,7 +215,7 @@ class WorkspacesContentModerationStateTest extends ContentModerationStateTest {
/**
* {@inheritdoc}
*/
- public function testGetCurrentUserId() {
+ public function testGetCurrentUserId(): void {
// This test does not assert anything that can be workspace-specific.
$this->markTestSkipped();
}
diff --git a/core/modules/content_moderation/tests/src/Unit/ContentModerationRouteSubscriberTest.php b/core/modules/content_moderation/tests/src/Unit/ContentModerationRouteSubscriberTest.php
index 1c1a942d18a..9d703c71ff0 100644
--- a/core/modules/content_moderation/tests/src/Unit/ContentModerationRouteSubscriberTest.php
+++ b/core/modules/content_moderation/tests/src/Unit/ContentModerationRouteSubscriberTest.php
@@ -229,7 +229,7 @@ class ContentModerationRouteSubscriberTest extends UnitTestCase {
*
* @dataProvider setLatestRevisionFlagTestCases
*/
- public function testSetLatestRevisionFlag($defaults, $parameters, $expected_parameters = FALSE) {
+ public function testSetLatestRevisionFlag($defaults, $parameters, $expected_parameters = FALSE): void {
$route = new Route('/foo/{entity_test}', $defaults, [], [
'parameters' => $parameters,
]);
diff --git a/core/modules/content_moderation/tests/src/Unit/ContentPreprocessTest.php b/core/modules/content_moderation/tests/src/Unit/ContentPreprocessTest.php
index 7c8071b46e0..7da1cfa314e 100644
--- a/core/modules/content_moderation/tests/src/Unit/ContentPreprocessTest.php
+++ b/core/modules/content_moderation/tests/src/Unit/ContentPreprocessTest.php
@@ -20,7 +20,7 @@ class ContentPreprocessTest extends UnitTestCase {
* @covers ::isLatestVersionPage
* @dataProvider routeNodeProvider
*/
- public function testIsLatestVersionPage($route_name, $route_nid, $check_nid, $result, $message) {
+ public function testIsLatestVersionPage($route_name, $route_nid, $check_nid, $result, $message): void {
$content_preprocess = new ContentPreprocess($this->setupCurrentRouteMatch($route_name, $route_nid));
$node = $this->setupNode($check_nid);
$this->assertEquals($result, $content_preprocess->isLatestVersionPage($node), $message);
diff --git a/core/modules/content_moderation/tests/src/Unit/LatestRevisionCheckTest.php b/core/modules/content_moderation/tests/src/Unit/LatestRevisionCheckTest.php
index 3f094dc0700..41b469683ca 100644
--- a/core/modules/content_moderation/tests/src/Unit/LatestRevisionCheckTest.php
+++ b/core/modules/content_moderation/tests/src/Unit/LatestRevisionCheckTest.php
@@ -59,7 +59,7 @@ class LatestRevisionCheckTest extends UnitTestCase {
*
* @dataProvider accessSituationProvider
*/
- public function testLatestAccessPermissions($entity_class, $entity_type, $has_pending_revision, array $account_permissions, $is_owner, $result_class) {
+ public function testLatestAccessPermissions($entity_class, $entity_type, $has_pending_revision, array $account_permissions, $is_owner, $result_class): void {
/** @var \Drupal\Core\Session\AccountInterface $account */
$account = $this->prophesize(AccountInterface::class);
diff --git a/core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php b/core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php
index f35b3b7f29e..2ba7527eb1b 100644
--- a/core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php
+++ b/core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php
@@ -71,7 +71,7 @@ class ModerationInformationTest extends UnitTestCase {
/**
* @covers ::isModeratedEntityType
*/
- public function testIsModeratedEntityType() {
+ public function testIsModeratedEntityType(): void {
$moderation_information = new ModerationInformation($this->getEntityTypeManager(), $this->setupModerationBundleInfo('test_bundle', 'workflow'));
$moderated_entity_type = $this->prophesize(EntityTypeInterface::class);
@@ -88,7 +88,7 @@ class ModerationInformationTest extends UnitTestCase {
* @dataProvider providerWorkflow
* @covers ::isModeratedEntity
*/
- public function testIsModeratedEntity($workflow, $expected) {
+ public function testIsModeratedEntity($workflow, $expected): void {
$moderation_information = new ModerationInformation($this->getEntityTypeManager(), $this->setupModerationBundleInfo('test_bundle', $workflow));
$entity_type = new ContentEntityType([
@@ -108,7 +108,7 @@ class ModerationInformationTest extends UnitTestCase {
* @dataProvider providerWorkflow
* @covers ::getWorkflowForEntity
*/
- public function testGetWorkflowForEntity($workflow) {
+ public function testGetWorkflowForEntity($workflow): void {
$entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class);
if ($workflow) {
$workflow_entity = $this->prophesize(WorkflowInterface::class)->reveal();
@@ -131,7 +131,7 @@ class ModerationInformationTest extends UnitTestCase {
* @dataProvider providerWorkflow
* @covers ::shouldModerateEntitiesOfBundle
*/
- public function testShouldModerateEntities($workflow, $expected) {
+ public function testShouldModerateEntities($workflow, $expected): void {
$entity_type = new ContentEntityType([
'id' => 'test_entity_type',
'bundle_entity_type' => 'entity_test_bundle',
diff --git a/core/modules/content_moderation/tests/src/Unit/StateTransitionValidationTest.php b/core/modules/content_moderation/tests/src/Unit/StateTransitionValidationTest.php
index b2aaaeee782..70c413f5fa8 100644
--- a/core/modules/content_moderation/tests/src/Unit/StateTransitionValidationTest.php
+++ b/core/modules/content_moderation/tests/src/Unit/StateTransitionValidationTest.php
@@ -69,7 +69,7 @@ class StateTransitionValidationTest extends UnitTestCase {
*
* @dataProvider userTransitionsProvider
*/
- public function testUserSensitiveValidTransitions($from_id, $to_id, $permission, $allowed, $result) {
+ public function testUserSensitiveValidTransitions($from_id, $to_id, $permission, $allowed, $result): void {
$user = $this->prophesize(AccountInterface::class);
// The one listed permission will be returned as instructed; Any others are
// always denied.
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php
index b4c75b52743..8ccc0e6feae 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php
@@ -112,7 +112,7 @@ class ContentTranslationContextualLinksTest extends BrowserTestBase {
/**
* Tests that a contextual link is available for translating a node.
*/
- public function testContentTranslationContextualLinks() {
+ public function testContentTranslationContextualLinks(): void {
// Create a node.
$title = $this->randomString();
$this->drupalCreateNode(['type' => $this->bundle, 'title' => $title, 'langcode' => 'en']);
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationDisableSettingTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationDisableSettingTest.php
index bafefceb99b..854b750de56 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationDisableSettingTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationDisableSettingTest.php
@@ -32,7 +32,7 @@ class ContentTranslationDisableSettingTest extends BrowserTestBase {
/**
* Tests that entity schemas are up-to-date after enabling translation.
*/
- public function testDisableSetting() {
+ public function testDisableSetting(): void {
// Define selectors.
$group_checkbox = 'entity_types[menu_link_content]';
$translatable_checkbox = 'settings[menu_link_content][menu_link_content][translatable]';
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationEnableTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationEnableTest.php
index 67778bf1674..097cd05a58a 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationEnableTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationEnableTest.php
@@ -36,7 +36,7 @@ class ContentTranslationEnableTest extends BrowserTestBase {
/**
* Tests that entity schemas are up-to-date after enabling translation.
*/
- public function testEnable() {
+ public function testEnable(): void {
$this->drupalLogin($this->rootUser);
// Enable modules and make sure the related config entity type definitions
// are installed.
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php
index a41dc6fcaf9..a1454538b87 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php
@@ -43,7 +43,7 @@ class ContentTranslationEntityBundleUITest extends BrowserTestBase {
/**
* Tests content types default translation behavior.
*/
- public function testContentTypeUI() {
+ public function testContentTypeUI(): void {
// Create first content type.
$this->drupalCreateContentType(['type' => 'article']);
// Enable content translation.
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php
index d9d92e13519..57378e54664 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php
@@ -78,7 +78,7 @@ class ContentTranslationLanguageChangeTest extends NodeTestBase {
/**
* Tests that the source language is properly set when changing.
*/
- public function testLanguageChange() {
+ public function testLanguageChange(): void {
// Create a node in English.
$this->drupalGet('node/add/article');
$edit = [
@@ -113,7 +113,7 @@ class ContentTranslationLanguageChangeTest extends NodeTestBase {
/**
* Tests that title does not change on ajax call with new language value.
*/
- public function testTitleDoesNotChangesOnChangingLanguageWidgetAndTriggeringAjaxCall() {
+ public function testTitleDoesNotChangesOnChangingLanguageWidgetAndTriggeringAjaxCall(): void {
// Create a node in English.
$this->drupalGet('node/add/article', ['query' => ['test_field_only_en_fr' => 1]]);
$edit = [
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationLinkTagTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationLinkTagTest.php
index bd8f3466caa..29e91a49af2 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationLinkTagTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationLinkTagTest.php
@@ -85,7 +85,7 @@ class ContentTranslationLinkTagTest extends BrowserTestBase {
/**
* Tests alternate link tag found for entity types with canonical links.
*/
- public function testCanonicalAlternateTags() {
+ public function testCanonicalAlternateTags(): void {
/** @var \Drupal\Core\Language\LanguageManagerInterface $languageManager */
$languageManager = $this->container->get('language_manager');
/** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager */
@@ -142,7 +142,7 @@ class ContentTranslationLinkTagTest extends BrowserTestBase {
/**
* Tests alternate link tag missing for entity types without canonical links.
*/
- public function testCanonicalAlternateTagsMissing() {
+ public function testCanonicalAlternateTagsMissing(): void {
/** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager */
$entityTypeManager = $this->container->get('entity_type.manager');
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationMetadataFieldsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationMetadataFieldsTest.php
index 094f12de910..e949397b4e3 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationMetadataFieldsTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationMetadataFieldsTest.php
@@ -56,7 +56,7 @@ class ContentTranslationMetadataFieldsTest extends ContentTranslationTestBase {
/**
* Tests skipping setting non translatable metadata fields.
*/
- public function testSkipUntranslatable() {
+ public function testSkipUntranslatable(): void {
$this->drupalLogin($this->translator);
$fields = \Drupal::service('entity_field.manager')->getFieldDefinitions($this->entityTypeId, $this->bundle);
@@ -112,7 +112,7 @@ class ContentTranslationMetadataFieldsTest extends ContentTranslationTestBase {
/**
* Tests setting translatable metadata fields.
*/
- public function testSetTranslatable() {
+ public function testSetTranslatable(): void {
$this->drupalLogin($this->translator);
$fields = \Drupal::service('entity_field.manager')->getFieldDefinitions($this->entityTypeId, $this->bundle);
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationNewTranslationWithExistingRevisionsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationNewTranslationWithExistingRevisionsTest.php
index ccad2c9bad2..7a8955a262e 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationNewTranslationWithExistingRevisionsTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationNewTranslationWithExistingRevisionsTest.php
@@ -50,7 +50,7 @@ class ContentTranslationNewTranslationWithExistingRevisionsTest extends ContentT
/**
* Tests a translation with a draft is not deleted.
*/
- public function testDraftTranslationIsNotDeleted() {
+ public function testDraftTranslationIsNotDeleted(): void {
$this->drupalLogin($this->translator);
// Create a test node.
@@ -116,7 +116,7 @@ class ContentTranslationNewTranslationWithExistingRevisionsTest extends ContentT
/**
* Test translation delete hooks are not invoked.
*/
- public function testCreatingNewDraftDoesNotInvokeDeleteHook() {
+ public function testCreatingNewDraftDoesNotInvokeDeleteHook(): void {
$this->drupalLogin($this->translator);
// Create a test node.
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php
index 95368d97d99..3a521b8fe6a 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php
@@ -77,7 +77,7 @@ class ContentTranslationOperationsTest extends NodeTestBase {
/**
* Tests that the operation "Translate" is displayed in the content listing.
*/
- public function testOperationTranslateLink() {
+ public function testOperationTranslateLink(): void {
$node = $this->drupalCreateNode(['type' => 'article', 'langcode' => 'es']);
// Verify no translation operation links are displayed for users without
// permission.
@@ -143,7 +143,7 @@ class ContentTranslationOperationsTest extends NodeTestBase {
*
* @see content_translation_translate_access()
*/
- public function testContentTranslationOverviewAccess() {
+ public function testContentTranslationOverviewAccess(): void {
$access_control_handler = \Drupal::entityTypeManager()->getAccessControlHandler('node');
$user = $this->createUser(['create content translations', 'access content']);
$this->drupalLogin($user);
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationOutdatedRevisionTranslationTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationOutdatedRevisionTranslationTest.php
index 2361421e3f3..96726c68756 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationOutdatedRevisionTranslationTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationOutdatedRevisionTranslationTest.php
@@ -39,7 +39,7 @@ class ContentTranslationOutdatedRevisionTranslationTest extends ContentTranslati
/**
* Tests that outdated revision translations work correctly.
*/
- public function testFlagAsOutdatedHidden() {
+ public function testFlagAsOutdatedHidden(): void {
// Create a test node.
$values = [
'title' => 'Test 1.1 EN',
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationRevisionTranslationDeletionTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationRevisionTranslationDeletionTest.php
index 2f81f4c766e..8ecd28de8fe 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationRevisionTranslationDeletionTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationRevisionTranslationDeletionTest.php
@@ -39,7 +39,7 @@ class ContentTranslationRevisionTranslationDeletionTest extends ContentTranslati
/**
* Tests that translation overview handles pending revisions correctly.
*/
- public function testOverview() {
+ public function testOverview(): void {
$index = 1;
$accounts = [
$this->rootUser,
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
index dc00957e4b9..10e55ae6f85 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
@@ -74,7 +74,7 @@ class ContentTranslationSettingsTest extends BrowserTestBase {
/**
* Tests that the settings UI works as expected.
*/
- public function testSettingsUI() {
+ public function testSettingsUI(): void {
// Check for the content_translation_menu_links_discovered_alter() changes.
$this->drupalGet('admin/config');
$this->assertSession()->linkExists('Content language and translation');
@@ -245,7 +245,7 @@ class ContentTranslationSettingsTest extends BrowserTestBase {
/**
* Tests the language settings checkbox on account settings page.
*/
- public function testAccountLanguageSettingsUI() {
+ public function testAccountLanguageSettingsUI(): void {
// Make sure the checkbox is available and not checked by default.
$this->drupalGet('admin/config/people/accounts');
$this->assertSession()->fieldExists('language[content_translation]');
@@ -291,7 +291,7 @@ class ContentTranslationSettingsTest extends BrowserTestBase {
/**
* Tests that field setting depends on bundle translatability.
*/
- public function testFieldTranslatableSettingsUI() {
+ public function testFieldTranslatableSettingsUI(): void {
// At least one field needs to be translatable to enable article for
// translation. Create an extra field to be used for this purpose. We use
// the UI to test our form alterations.
@@ -325,7 +325,7 @@ class ContentTranslationSettingsTest extends BrowserTestBase {
/**
* Tests the translatable settings checkbox for untranslatable entities.
*/
- public function testNonTranslatableTranslationSettingsUI() {
+ public function testNonTranslatableTranslationSettingsUI(): void {
$this->drupalGet('admin/config/regional/content-language');
$this->assertSession()->fieldNotExists('settings[entity_test][entity_test][translatable]');
}
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationStandardFieldsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationStandardFieldsTest.php
index ff580980abc..96a2da72e87 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationStandardFieldsTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationStandardFieldsTest.php
@@ -60,7 +60,7 @@ class ContentTranslationStandardFieldsTest extends BrowserTestBase {
/**
* Tests that translatable fields are being rendered.
*/
- public function testFieldTranslatableArticle() {
+ public function testFieldTranslatableArticle(): void {
// Install block and field modules.
\Drupal::service('module_installer')->install(
[
@@ -167,7 +167,7 @@ class ContentTranslationStandardFieldsTest extends BrowserTestBase {
/**
* Tests that revision_log is not translatable.
*/
- public function testRevisionLogNotTranslatable() {
+ public function testRevisionLogNotTranslatable(): void {
$path = 'admin/config/regional/content-language';
$this->drupalGet($path);
$this->assertSession()->fieldNotExists('edit-settings-node-article-fields-revision-log');
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php
index 46fcba4d0fb..61d2edcdc6d 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php
@@ -105,7 +105,7 @@ class ContentTranslationSyncImageTest extends ContentTranslationTestBase {
/**
* Tests image field synchronization.
*/
- public function testImageFieldSync() {
+ public function testImageFieldSync(): void {
// Check that the alt and title fields are enabled for the image field.
$this->drupalLogin($this->editor);
$this->drupalGet('entity_test_mul/structure/' . $this->entityTypeId . '/fields/' . $this->entityTypeId . '.' . $this->entityTypeId . '.' . $this->fieldName);
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationUISkipTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationUISkipTest.php
index d9dd0100ec5..d069e9c5be0 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationUISkipTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationUISkipTest.php
@@ -30,7 +30,7 @@ class ContentTranslationUISkipTest extends BrowserTestBase {
/**
* Tests the content_translation_ui_skip key functionality.
*/
- public function testUICheckSkip() {
+ public function testUICheckSkip(): void {
$admin_user = $this->drupalCreateUser([
'translate any entity',
'administer content translation',
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php
index 335f7a05a07..75aaec084a8 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php
@@ -53,7 +53,7 @@ abstract class ContentTranslationUITestBase extends ContentTranslationTestBase {
/**
* Tests the basic translation UI.
*/
- public function testTranslationUI() {
+ public function testTranslationUI(): void {
$this->doTestBasicTranslation();
$this->doTestTranslationOverview();
$this->doTestOutdatedStatus();
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationUntranslatableFieldsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationUntranslatableFieldsTest.php
index 2a12a8ad2a0..d0b8a15e1f8 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationUntranslatableFieldsTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationUntranslatableFieldsTest.php
@@ -84,7 +84,7 @@ class ContentTranslationUntranslatableFieldsTest extends ContentTranslationPendi
/**
* Tests that hiding untranslatable field widgets works correctly.
*/
- public function testHiddenWidgets() {
+ public function testHiddenWidgets(): void {
/** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */
$entity_type_manager = $this->container->get('entity_type.manager');
$id = $this->createEntity(['title' => $this->randomString()], 'en');
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php
index 0dbb05b54a6..ae49210101b 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php
@@ -190,7 +190,7 @@ class ContentTranslationWorkflowsTest extends ContentTranslationTestBase {
/**
* Tests simple and editorial translation workflows.
*/
- public function testWorkflows() {
+ public function testWorkflows(): void {
// Test workflows for the editor.
$expected_status = [
'edit' => 200,
diff --git a/core/modules/content_translation/tests/src/Functional/Views/ContentTranslationViewsUITest.php b/core/modules/content_translation/tests/src/Functional/Views/ContentTranslationViewsUITest.php
index 3a929c0ba57..d4a6432b8f8 100644
--- a/core/modules/content_translation/tests/src/Functional/Views/ContentTranslationViewsUITest.php
+++ b/core/modules/content_translation/tests/src/Functional/Views/ContentTranslationViewsUITest.php
@@ -35,7 +35,7 @@ class ContentTranslationViewsUITest extends UITestBase {
/**
* Tests the views UI.
*/
- public function testViewsUI() {
+ public function testViewsUI(): void {
$this->drupalGet('admin/structure/views/view/test_view/edit');
$this->assertSession()->titleEquals('Test view (Views test data) | Drupal');
}
diff --git a/core/modules/content_translation/tests/src/Functional/Views/TranslationLinkTest.php b/core/modules/content_translation/tests/src/Functional/Views/TranslationLinkTest.php
index ce3c9c877f9..9111383d596 100644
--- a/core/modules/content_translation/tests/src/Functional/Views/TranslationLinkTest.php
+++ b/core/modules/content_translation/tests/src/Functional/Views/TranslationLinkTest.php
@@ -71,7 +71,7 @@ class TranslationLinkTest extends ContentTranslationTestBase {
/**
* Tests the content translation overview link field handler.
*/
- public function testTranslationLink() {
+ public function testTranslationLink(): void {
$this->drupalGet('test-entity-translations-link');
$this->assertSession()->linkByHrefExists('user/1/translations');
$this->assertSession()->linkByHrefNotExists('user/2/translations', 'The translations link is not present when content_translation_translate_access() is FALSE.');
diff --git a/core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationConfigUITest.php b/core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationConfigUITest.php
index ed54b452707..4f4b7da3709 100644
--- a/core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationConfigUITest.php
+++ b/core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationConfigUITest.php
@@ -33,7 +33,7 @@ class ContentTranslationConfigUITest extends WebDriverTestBase {
/**
* Tests that the content translation configuration javascript does't fail.
*/
- public function testContentTranslationConfigUI() {
+ public function testContentTranslationConfigUI(): void {
$content_translation_manager = $this->container->get('content_translation.manager');
$content_translation_manager->setEnabled('node', 'article', TRUE);
$this->rebuildContainer();
diff --git a/core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationContextualLinksTest.php b/core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationContextualLinksTest.php
index 4d71d0e0db8..8e11084b1f6 100644
--- a/core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationContextualLinksTest.php
+++ b/core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationContextualLinksTest.php
@@ -61,7 +61,7 @@ class ContentTranslationContextualLinksTest extends WebDriverTestBase {
/**
* Tests that a contextual link is available for translating a node.
*/
- public function testContentTranslationContextualLinks() {
+ public function testContentTranslationContextualLinks(): void {
$node = $this->drupalCreateNode(['type' => 'page', 'title' => 'Test']);
// Check that the translate link appears on the node page.
diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php
index a718864245f..c75ab238b1e 100644
--- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php
+++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php
@@ -68,7 +68,7 @@ class ContentTranslationConfigImportTest extends KernelTestBase {
/**
* Tests config import updates.
*/
- public function testConfigImportUpdates() {
+ public function testConfigImportUpdates(): void {
$entity_type_id = 'entity_test_mul';
$config_id = $entity_type_id . '.' . $entity_type_id;
$config_name = 'language.content_settings.' . $config_id;
diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationEntityBundleInfoTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationEntityBundleInfoTest.php
index 8c141b70882..86f04e80629 100644
--- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationEntityBundleInfoTest.php
+++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationEntityBundleInfoTest.php
@@ -61,7 +61,7 @@ class ContentTranslationEntityBundleInfoTest extends KernelTestBase {
/**
* Tests that modules can know whether bundles are translatable.
*/
- public function testHookInvocationOrder() {
+ public function testHookInvocationOrder(): void {
$this->contentTranslationManager->setEnabled('entity_test_mul', 'entity_test_mul', TRUE);
$this->bundleInfo->clearCachedBundles();
$this->bundleInfo->getAllBundleInfo();
@@ -88,7 +88,7 @@ class ContentTranslationEntityBundleInfoTest extends KernelTestBase {
/**
* Tests that field synchronization is skipped for disabled bundles.
*/
- public function testFieldSynchronizationWithDisabledBundle() {
+ public function testFieldSynchronizationWithDisabledBundle(): void {
$entity = EntityTestMul::create();
$entity->save();
@@ -104,7 +104,7 @@ class ContentTranslationEntityBundleInfoTest extends KernelTestBase {
*
* @throws \Drupal\Core\Entity\EntityStorageException
*/
- public function testBundleClearOnLanguageContentSettingInsert() {
+ public function testBundleClearOnLanguageContentSettingInsert(): void {
$node = $this->getBundledNode();
$this->assertFalse($node->isTranslatable());
$this->contentTranslationManager->setEnabled('node', 'bundle_test', TRUE);
@@ -117,7 +117,7 @@ class ContentTranslationEntityBundleInfoTest extends KernelTestBase {
* @throws \Drupal\Core\Entity\EntityStorageException
* @throws \Exception
*/
- public function testBundleClearOnLanguageContentSettingUpdate() {
+ public function testBundleClearOnLanguageContentSettingUpdate(): void {
$node = $this->getBundledNode();
$this->assertFalse($node->isTranslatable());
$this->container->get('entity_type.manager')->getStorage('language_content_settings')->create([
diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php
index 71260e8eca1..4d06bb0219e 100644
--- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php
+++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php
@@ -127,7 +127,7 @@ class ContentTranslationFieldSyncRevisionTest extends EntityKernelTestBase {
* @covers \Drupal\content_translation\FieldTranslationSynchronizer::synchronizeFields
* @covers \Drupal\content_translation\FieldTranslationSynchronizer::synchronizeItems
*/
- public function testFieldSynchronizationAndValidation() {
+ public function testFieldSynchronizationAndValidation(): void {
// Test that when untranslatable field widgets are displayed, synchronized
// field properties can be changed only in default revisions.
$this->setUntranslatableFieldWidgetsDisplay(TRUE);
@@ -456,7 +456,7 @@ class ContentTranslationFieldSyncRevisionTest extends EntityKernelTestBase {
/**
* Tests changing the default language of an entity.
*/
- public function testChangeDefaultLanguageNonTranslatableFieldsHidden() {
+ public function testChangeDefaultLanguageNonTranslatableFieldsHidden(): void {
$this->setUntranslatableFieldWidgetsDisplay(FALSE);
$entity = $this->saveNewEntity();
$entity->langcode = 'it';
diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationHandlerTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationHandlerTest.php
index a4c2817d95d..02674fd0ad6 100644
--- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationHandlerTest.php
+++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationHandlerTest.php
@@ -103,7 +103,7 @@ class ContentTranslationHandlerTest extends KernelTestBase {
* @covers ::entityFormSharedElements
* @covers ::addTranslatabilityClue
*/
- public function testEntityFormSharedElements(array $element, $default_translation_affected, $default_translation, $translation_form, array $expected) {
+ public function testEntityFormSharedElements(array $element, $default_translation_affected, $default_translation, $translation_form, array $expected): void {
$this->state->set('entity_test.translation', TRUE);
$this->state->set('entity_test.untranslatable_fields.default_translation_affected', $default_translation_affected);
$this->entityTypeBundleInfo->clearCachedBundles();
diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationModuleInstallTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationModuleInstallTest.php
index 5d33311b95e..5da1fb908c6 100644
--- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationModuleInstallTest.php
+++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationModuleInstallTest.php
@@ -62,7 +62,7 @@ class ContentTranslationModuleInstallTest extends KernelTestBase {
/**
* Tests that content translation fields are created upon module installation.
*/
- public function testFieldUpdates() {
+ public function testFieldUpdates(): void {
// The module ships a translatable bundle of the 'entity_test_with_bundle'
// entity type.
$this->installConfig(['content_translation_test']);
diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationPermissionsTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationPermissionsTest.php
index 146dc29bf65..cd396e634c3 100644
--- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationPermissionsTest.php
+++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationPermissionsTest.php
@@ -40,7 +40,7 @@ class ContentTranslationPermissionsTest extends KernelTestBase {
/**
* Tests that enabling translation via the API triggers schema updates.
*/
- public function testPermissions() {
+ public function testPermissions(): void {
$this->container->get('content_translation.manager')->setEnabled('entity_test_mul', 'entity_test_mul', TRUE);
$this->container->get('content_translation.manager')->setEnabled('entity_test_mul_with_bundle', 'test', TRUE);
$permissions = $this->container->get('user.permissions')->getPermissions();
diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php
index cd1f05f2a56..448ea0ee9e4 100644
--- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php
+++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php
@@ -37,7 +37,7 @@ class ContentTranslationSettingsApiTest extends KernelTestBase {
/**
* Tests that enabling translation via the API triggers schema updates.
*/
- public function testSettingsApi() {
+ public function testSettingsApi(): void {
$this->container->get('content_translation.manager')->setEnabled('entity_test_mul', 'entity_test_mul', TRUE);
$schema = Database::getConnection()->schema();
$result =
diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationSyncUnitTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationSyncUnitTest.php
index 38b0ba26189..72d369824c3 100644
--- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationSyncUnitTest.php
+++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationSyncUnitTest.php
@@ -87,7 +87,7 @@ class ContentTranslationSyncUnitTest extends KernelTestBase {
/**
* Tests the field synchronization algorithm.
*/
- public function testFieldSync() {
+ public function testFieldSync(): void {
// Add a new item to the source items and check that its added to all the
// translations.
$sync_langcode = $this->langcodes[2];
@@ -178,7 +178,7 @@ class ContentTranslationSyncUnitTest extends KernelTestBase {
/**
* Tests that items holding the same values are correctly synchronized.
*/
- public function testMultipleSyncedValues() {
+ public function testMultipleSyncedValues(): void {
$sync_langcode = $this->langcodes[1];
$unchanged_items = $this->unchangedFieldValues[$sync_langcode];
@@ -237,7 +237,7 @@ class ContentTranslationSyncUnitTest extends KernelTestBase {
/**
* Tests that one change in a synchronized column triggers a change in all columns.
*/
- public function testDifferingSyncedColumns() {
+ public function testDifferingSyncedColumns(): void {
$sync_langcode = $this->langcodes[2];
$unchanged_items = $this->unchangedFieldValues[$sync_langcode];
$field_values = $this->unchangedFieldValues;
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 ae2f5a8e494..914473cf68e 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
@@ -124,7 +124,7 @@ class MigrateTaxonomyTermTranslationTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 i18n taxonomy term to Drupal 8 migration.
*/
- public function testTranslatedTaxonomyTerms() {
+ public function testTranslatedTaxonomyTerms(): void {
$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']);
diff --git a/core/modules/content_translation/tests/src/Kernel/Migrate/d7/MigrateEntityTranslationSettingsTest.php b/core/modules/content_translation/tests/src/Kernel/Migrate/d7/MigrateEntityTranslationSettingsTest.php
index 22d8f95a43c..3487c0606ec 100644
--- a/core/modules/content_translation/tests/src/Kernel/Migrate/d7/MigrateEntityTranslationSettingsTest.php
+++ b/core/modules/content_translation/tests/src/Kernel/Migrate/d7/MigrateEntityTranslationSettingsTest.php
@@ -59,7 +59,7 @@ class MigrateEntityTranslationSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests entity translation settings migration.
*/
- public function testEntityTranslationSettingsMigration() {
+ public function testEntityTranslationSettingsMigration(): void {
// Tests 'comment_node_test_content_type' entity translation settings.
$config = $this->config('language.content_settings.comment.comment_node_test_content_type');
$this->assertSame($config->get('target_entity_type_id'), 'comment');
diff --git a/core/modules/content_translation/tests/src/Unit/Access/ContentTranslationManageAccessCheckTest.php b/core/modules/content_translation/tests/src/Unit/Access/ContentTranslationManageAccessCheckTest.php
index 11af029a694..de493c5187d 100644
--- a/core/modules/content_translation/tests/src/Unit/Access/ContentTranslationManageAccessCheckTest.php
+++ b/core/modules/content_translation/tests/src/Unit/Access/ContentTranslationManageAccessCheckTest.php
@@ -51,7 +51,7 @@ class ContentTranslationManageAccessCheckTest extends UnitTestCase {
*
* @covers ::access
*/
- public function testCreateAccess() {
+ public function testCreateAccess(): void {
// Set the mock translation handler.
$translation_handler = $this->createMock('\Drupal\content_translation\ContentTranslationHandlerInterface');
$translation_handler->expects($this->once())
diff --git a/core/modules/content_translation/tests/src/Unit/Menu/ContentTranslationLocalTasksTest.php b/core/modules/content_translation/tests/src/Unit/Menu/ContentTranslationLocalTasksTest.php
index be57e9eb445..ccb1ba534a2 100644
--- a/core/modules/content_translation/tests/src/Unit/Menu/ContentTranslationLocalTasksTest.php
+++ b/core/modules/content_translation/tests/src/Unit/Menu/ContentTranslationLocalTasksTest.php
@@ -48,7 +48,7 @@ class ContentTranslationLocalTasksTest extends LocalTaskIntegrationTestBase {
*
* @dataProvider providerTestBlockAdminDisplay
*/
- public function testBlockAdminDisplay($route, $expected) {
+ public function testBlockAdminDisplay($route, $expected): void {
$this->assertLocalTasks($route, $expected);
}
diff --git a/core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php b/core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php
index 4e80c5795d8..fca3ec805aa 100644
--- a/core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php
+++ b/core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php
@@ -88,7 +88,7 @@ class ContextualDynamicContextTest extends BrowserTestBase {
* Ensures that contextual link placeholders always exist, even if the user is
* not allowed to use contextual links.
*/
- public function testDifferentPermissions() {
+ public function testDifferentPermissions(): void {
$this->drupalLogin($this->editorUser);
// Create three nodes in the following order:
@@ -172,7 +172,7 @@ class ContextualDynamicContextTest extends BrowserTestBase {
/**
* Tests the contextual placeholder content is protected by a token.
*/
- public function testTokenProtection() {
+ public function testTokenProtection(): void {
$this->drupalLogin($this->editorUser);
// Create a node that will have a contextual link.
diff --git a/core/modules/contextual/tests/src/FunctionalJavascript/ContextualLinksTest.php b/core/modules/contextual/tests/src/FunctionalJavascript/ContextualLinksTest.php
index aa7ba560c4f..deedcd66889 100644
--- a/core/modules/contextual/tests/src/FunctionalJavascript/ContextualLinksTest.php
+++ b/core/modules/contextual/tests/src/FunctionalJavascript/ContextualLinksTest.php
@@ -42,7 +42,7 @@ class ContextualLinksTest extends WebDriverTestBase {
/**
* Tests the visibility of contextual links.
*/
- public function testContextualLinksVisibility() {
+ public function testContextualLinksVisibility(): void {
$this->drupalGet('user');
$contextualLinks = $this->assertSession()->waitForElement('css', '.contextual button');
$this->assertEmpty($contextualLinks);
@@ -74,7 +74,7 @@ class ContextualLinksTest extends WebDriverTestBase {
/**
* Tests clicking contextual links.
*/
- public function testContextualLinksClick() {
+ public function testContextualLinksClick(): void {
$this->container->get('module_installer')->install(['contextual_test']);
// Test clicking contextual link without toolbar.
$this->drupalGet('user');
@@ -124,7 +124,7 @@ class ContextualLinksTest extends WebDriverTestBase {
/**
* Tests the contextual links destination.
*/
- public function testContextualLinksDestination() {
+ public function testContextualLinksDestination(): void {
$this->grantPermissions(Role::load(Role::AUTHENTICATED_ID), [
'access contextual links',
'administer blocks',
@@ -139,7 +139,7 @@ class ContextualLinksTest extends WebDriverTestBase {
/**
* Tests the contextual links destination with query.
*/
- public function testContextualLinksDestinationWithQuery() {
+ public function testContextualLinksDestinationWithQuery(): void {
$this->grantPermissions(Role::load(Role::AUTHENTICATED_ID), [
'access contextual links',
'administer blocks',
diff --git a/core/modules/contextual/tests/src/FunctionalJavascript/DuplicateContextualLinksTest.php b/core/modules/contextual/tests/src/FunctionalJavascript/DuplicateContextualLinksTest.php
index b67bcd5c532..8549a9c06ff 100644
--- a/core/modules/contextual/tests/src/FunctionalJavascript/DuplicateContextualLinksTest.php
+++ b/core/modules/contextual/tests/src/FunctionalJavascript/DuplicateContextualLinksTest.php
@@ -33,7 +33,7 @@ class DuplicateContextualLinksTest extends WebDriverTestBase {
/**
* Tests the contextual links with same id.
*/
- public function testSameContextualLinks() {
+ public function testSameContextualLinks(): void {
$this->drupalPlaceBlock('views_block:contextual_recent-block_1', ['id' => 'first']);
$this->drupalPlaceBlock('views_block:contextual_recent-block_1', ['id' => 'second']);
$this->drupalCreateContentType(['type' => 'page']);
diff --git a/core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php b/core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php
index 50427cd7110..6d7f8c493ff 100644
--- a/core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php
+++ b/core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php
@@ -67,7 +67,7 @@ class EditModeTest extends WebDriverTestBase {
/**
* Tests enabling and disabling edit mode.
*/
- public function testEditModeEnableDisable() {
+ public function testEditModeEnableDisable(): void {
$web_assert = $this->assertSession();
$page = $this->getSession()->getPage();
// Get the page twice to ensure edit mode remains enabled after a new page
diff --git a/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php b/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php
index b09f0f9e55f..dfb2fb2f0dc 100644
--- a/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php
+++ b/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php
@@ -110,7 +110,7 @@ class ContextualUnitTest extends KernelTestBase {
*
* @dataProvider contextualLinksDataProvider
*/
- public function testContextualLinksToId(array $links, string $id) {
+ public function testContextualLinksToId(array $links, string $id): void {
$this->assertSame($id, _contextual_links_to_id($links));
}
@@ -126,7 +126,7 @@ class ContextualUnitTest extends KernelTestBase {
*
* @dataProvider contextualLinksDataProvider
*/
- public function testContextualIdToLinks(array $links, string $id) {
+ public function testContextualIdToLinks(array $links, string $id): void {
$this->assertSame($links, _contextual_id_to_links($id));
}
diff --git a/core/modules/datetime/tests/src/Functional/DateFilterTest.php b/core/modules/datetime/tests/src/Functional/DateFilterTest.php
index 3bc64daa522..fdee4433d35 100644
--- a/core/modules/datetime/tests/src/Functional/DateFilterTest.php
+++ b/core/modules/datetime/tests/src/Functional/DateFilterTest.php
@@ -82,7 +82,7 @@ class DateFilterTest extends ViewTestBase {
/**
* Tests the limit of the expose operator functionality.
*/
- public function testLimitExposedOperators() {
+ public function testLimitExposedOperators(): void {
$this->drupalGet('test_exposed_filter_datetime');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php b/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php
index 845c96560cc..5d788a4e763 100644
--- a/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php
+++ b/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php
@@ -43,7 +43,7 @@ class DateTimeFieldTest extends DateTestBase {
/**
* Tests date field functionality.
*/
- public function testDateField() {
+ public function testDateField(): void {
$field_name = $this->fieldStorage->getName();
$display_repository = \Drupal::service('entity_display.repository');
@@ -222,7 +222,7 @@ class DateTimeFieldTest extends DateTestBase {
/**
* Tests date and time field.
*/
- public function testDatetimeField() {
+ public function testDatetimeField(): void {
$field_name = $this->fieldStorage->getName();
$field_label = $this->field->label();
// Change the field to a datetime field.
@@ -383,7 +383,7 @@ class DateTimeFieldTest extends DateTestBase {
/**
* Tests Date List Widget functionality.
*/
- public function testDatelistWidget() {
+ public function testDatelistWidget(): void {
$field_name = $this->fieldStorage->getName();
$field_label = $this->field->label();
@@ -662,7 +662,7 @@ class DateTimeFieldTest extends DateTestBase {
/**
* Tests default value functionality.
*/
- public function testDefaultValue() {
+ public function testDefaultValue(): void {
// Create a test content type.
$this->drupalCreateContentType(['type' => 'date_content']);
@@ -788,7 +788,7 @@ class DateTimeFieldTest extends DateTestBase {
/**
* Tests that invalid values are caught and marked as invalid.
*/
- public function testInvalidField() {
+ public function testInvalidField(): void {
// Change the field to a datetime field.
$this->fieldStorage->setSetting('datetime_type', 'datetime');
$this->fieldStorage->save();
@@ -879,7 +879,7 @@ class DateTimeFieldTest extends DateTestBase {
/**
* Tests that 'Date' field storage setting form is disabled if field has data.
*/
- public function testDateStorageSettings() {
+ public function testDateStorageSettings(): void {
// Create a test content type.
$this->drupalCreateContentType(['type' => 'date_content']);
diff --git a/core/modules/datetime/tests/src/Functional/DateTimeTimeAgoFormatterTest.php b/core/modules/datetime/tests/src/Functional/DateTimeTimeAgoFormatterTest.php
index 94cafb4a09c..0a7e1dd2ae2 100644
--- a/core/modules/datetime/tests/src/Functional/DateTimeTimeAgoFormatterTest.php
+++ b/core/modules/datetime/tests/src/Functional/DateTimeTimeAgoFormatterTest.php
@@ -104,7 +104,7 @@ class DateTimeTimeAgoFormatterTest extends BrowserTestBase {
/**
* Tests the formatter settings.
*/
- public function testSettings() {
+ public function testSettings(): void {
$this->drupalGet('entity_test/structure/entity_test/display');
$edit = [
diff --git a/core/modules/datetime/tests/src/Functional/DateTimeWidgetTest.php b/core/modules/datetime/tests/src/Functional/DateTimeWidgetTest.php
index 05035906f71..a008e4bff92 100644
--- a/core/modules/datetime/tests/src/Functional/DateTimeWidgetTest.php
+++ b/core/modules/datetime/tests/src/Functional/DateTimeWidgetTest.php
@@ -36,7 +36,7 @@ class DateTimeWidgetTest extends DateTestBase {
/**
* Test default value functionality.
*/
- public function testDateOnlyDefaultValue() {
+ public function testDateOnlyDefaultValue(): void {
// Create a test content type.
$this->drupalCreateContentType(['type' => 'date_only_content']);
diff --git a/core/modules/datetime/tests/src/Functional/Views/FilterDateTest.php b/core/modules/datetime/tests/src/Functional/Views/FilterDateTest.php
index 5d5851fab5a..677839e9a61 100644
--- a/core/modules/datetime/tests/src/Functional/Views/FilterDateTest.php
+++ b/core/modules/datetime/tests/src/Functional/Views/FilterDateTest.php
@@ -123,7 +123,7 @@ class FilterDateTest extends ViewTestBase {
/**
* Tests exposed grouped filters.
*/
- public function testExposedGroupedFilters() {
+ public function testExposedGroupedFilters(): void {
$filter_identifier = $this->fieldName . '_value';
$this->drupalGet('admin/structure/views/nojs/handler/test_filter_datetime/default/filter/' . $filter_identifier);
$this->submitForm([], 'Expose filter');
@@ -216,7 +216,7 @@ class FilterDateTest extends ViewTestBase {
/**
* Tests exposed date filters with a pager.
*/
- public function testExposedFilterWithPager() {
+ public function testExposedFilterWithPager(): void {
// Expose the empty and not empty operators in a grouped filter.
$this->drupalGet('admin/structure/views/nojs/handler/test_filter_datetime/default/filter/' . $this->fieldName . '_value');
$this->submitForm([], t('Expose filter'));
diff --git a/core/modules/datetime/tests/src/Kernel/DateTimeFormInjectionTest.php b/core/modules/datetime/tests/src/Kernel/DateTimeFormInjectionTest.php
index d0e9afce8b9..8b790d9dbd3 100644
--- a/core/modules/datetime/tests/src/Kernel/DateTimeFormInjectionTest.php
+++ b/core/modules/datetime/tests/src/Kernel/DateTimeFormInjectionTest.php
@@ -93,7 +93,7 @@ class DateTimeFormInjectionTest extends KernelTestBase implements FormInterface
/**
* Tests custom string injection serialization.
*/
- public function testDatetimeSerialization() {
+ public function testDatetimeSerialization(): void {
$form_state = new FormState();
$form_state->setRequestMethod('POST');
$form_state->setCached();
diff --git a/core/modules/datetime/tests/src/Kernel/DateTimeItemTest.php b/core/modules/datetime/tests/src/Kernel/DateTimeItemTest.php
index a5de8267e7a..e7a9d16d5a8 100644
--- a/core/modules/datetime/tests/src/Kernel/DateTimeItemTest.php
+++ b/core/modules/datetime/tests/src/Kernel/DateTimeItemTest.php
@@ -70,7 +70,7 @@ class DateTimeItemTest extends FieldKernelTestBase {
/**
* Tests using entity fields of the datetime field type.
*/
- public function testDateTime() {
+ public function testDateTime(): void {
$this->fieldStorage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATETIME);
$this->fieldStorage->save();
@@ -114,7 +114,7 @@ class DateTimeItemTest extends FieldKernelTestBase {
/**
* Tests using entity fields of the date field type.
*/
- public function testDateOnly() {
+ public function testDateOnly(): void {
$this->fieldStorage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATE);
$this->fieldStorage->save();
@@ -167,7 +167,7 @@ class DateTimeItemTest extends FieldKernelTestBase {
/**
* Tests DateTimeItem::setValue().
*/
- public function testSetValue() {
+ public function testSetValue(): void {
// Test a date+time field.
$this->fieldStorage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATETIME);
$this->fieldStorage->save();
@@ -224,7 +224,7 @@ class DateTimeItemTest extends FieldKernelTestBase {
/**
* Tests setting the value of the DateTimeItem directly.
*/
- public function testSetValueProperty() {
+ public function testSetValueProperty(): void {
// Test Date::setValue() with a date+time field.
// Test a date+time field.
$this->fieldStorage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATETIME);
@@ -261,7 +261,7 @@ class DateTimeItemTest extends FieldKernelTestBase {
*
* @dataProvider datetimeValidationProvider
*/
- public function testDatetimeValidation($value) {
+ public function testDatetimeValidation($value): void {
$this->expectException(AssertionFailedError::class);
$this->fieldStorage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATETIME);
@@ -321,7 +321,7 @@ class DateTimeItemTest extends FieldKernelTestBase {
*
* @dataProvider dateOnlyValidationProvider
*/
- public function testDateOnlyValidation($value) {
+ public function testDateOnlyValidation($value): void {
$this->expectException(AssertionFailedError::class);
$this->fieldStorage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATE);
diff --git a/core/modules/datetime/tests/src/Kernel/Views/ArgumentDateTimeTest.php b/core/modules/datetime/tests/src/Kernel/Views/ArgumentDateTimeTest.php
index 59345983d8d..9c9244aea63 100644
--- a/core/modules/datetime/tests/src/Kernel/Views/ArgumentDateTimeTest.php
+++ b/core/modules/datetime/tests/src/Kernel/Views/ArgumentDateTimeTest.php
@@ -52,7 +52,7 @@ class ArgumentDateTimeTest extends DateTimeHandlerTestBase {
*
* @see \Drupal\datetime\Plugin\views\argument\YearDate
*/
- public function testDatetimeArgumentYear() {
+ public function testDatetimeArgumentYear(): void {
$view = Views::getView('test_argument_datetime');
// The 'default' display has the 'year' argument.
@@ -95,7 +95,7 @@ class ArgumentDateTimeTest extends DateTimeHandlerTestBase {
*
* @see \Drupal\datetime\Plugin\views\argument\MonthDate
*/
- public function testDatetimeArgumentMonth() {
+ public function testDatetimeArgumentMonth(): void {
$view = Views::getView('test_argument_datetime');
// The 'embed_1' display has the 'month' argument.
$view->setDisplay('embed_1');
@@ -121,7 +121,7 @@ class ArgumentDateTimeTest extends DateTimeHandlerTestBase {
*
* @see \Drupal\datetime\Plugin\views\argument\DayDate
*/
- public function testDatetimeArgumentDay() {
+ public function testDatetimeArgumentDay(): void {
$view = Views::getView('test_argument_datetime');
// The 'embed_2' display has the 'day' argument.
@@ -145,7 +145,7 @@ class ArgumentDateTimeTest extends DateTimeHandlerTestBase {
/**
* Tests year, month, and day arguments combined.
*/
- public function testDatetimeArgumentAll() {
+ public function testDatetimeArgumentAll(): void {
$view = Views::getView('test_argument_datetime');
// The 'embed_3' display has year, month, and day arguments.
$view->setDisplay('embed_3');
@@ -167,7 +167,7 @@ class ArgumentDateTimeTest extends DateTimeHandlerTestBase {
/**
* Tests week WW argument.
*/
- public function testDatetimeArgumentWeek() {
+ public function testDatetimeArgumentWeek(): void {
$view = Views::getView('test_argument_datetime');
// The 'embed_4' display has WW argument.
$view->setDisplay('embed_4');
@@ -191,7 +191,7 @@ class ArgumentDateTimeTest extends DateTimeHandlerTestBase {
/**
* Tests full_date CCYYMMDD argument.
*/
- public function testDatetimeArgumentFullDate() {
+ public function testDatetimeArgumentFullDate(): void {
$view = Views::getView('test_argument_datetime');
// The 'embed_5' display has CCYYMMDD argument.
$view->setDisplay('embed_5');
@@ -213,7 +213,7 @@ class ArgumentDateTimeTest extends DateTimeHandlerTestBase {
/**
* Tests year_month CCYYMM argument.
*/
- public function testDatetimeArgumentYearMonth() {
+ public function testDatetimeArgumentYearMonth(): void {
$view = Views::getView('test_argument_datetime');
// The 'embed_6' display has CCYYMM argument.
$view->setDisplay('embed_6');
diff --git a/core/modules/datetime/tests/src/Kernel/Views/DateTimeSchemaTest.php b/core/modules/datetime/tests/src/Kernel/Views/DateTimeSchemaTest.php
index 662b34d5d45..0463e084c6e 100644
--- a/core/modules/datetime/tests/src/Kernel/Views/DateTimeSchemaTest.php
+++ b/core/modules/datetime/tests/src/Kernel/Views/DateTimeSchemaTest.php
@@ -24,7 +24,7 @@ class DateTimeSchemaTest extends DateTimeHandlerTestBase {
/**
* Tests argument plugin schema.
*/
- public function testDateTimeSchema() {
+ public function testDateTimeSchema(): void {
// Test argument schema.
$view = Views::getView('test_argument_datetime');
$view->initHandlers();
diff --git a/core/modules/datetime/tests/src/Kernel/Views/FilterDateTest.php b/core/modules/datetime/tests/src/Kernel/Views/FilterDateTest.php
index e3c70d8f268..4d4997b2b37 100644
--- a/core/modules/datetime/tests/src/Kernel/Views/FilterDateTest.php
+++ b/core/modules/datetime/tests/src/Kernel/Views/FilterDateTest.php
@@ -87,7 +87,7 @@ class FilterDateTest extends DateTimeHandlerTestBase {
/**
* Tests offsets with date-only fields.
*/
- public function testDateOffsets() {
+ public function testDateOffsets(): void {
$view = Views::getView('test_filter_datetime');
$field = static::$fieldName . '_value';
@@ -171,7 +171,7 @@ class FilterDateTest extends DateTimeHandlerTestBase {
/**
* Tests date filter with date-only fields.
*/
- public function testDateIs() {
+ public function testDateIs(): void {
$view = Views::getView('test_filter_datetime');
$field = static::$fieldName . '_value';
diff --git a/core/modules/datetime/tests/src/Kernel/Views/FilterDateTimeTest.php b/core/modules/datetime/tests/src/Kernel/Views/FilterDateTimeTest.php
index 9ba6fe57e8a..5861acf8c7f 100644
--- a/core/modules/datetime/tests/src/Kernel/Views/FilterDateTimeTest.php
+++ b/core/modules/datetime/tests/src/Kernel/Views/FilterDateTimeTest.php
@@ -73,7 +73,7 @@ class FilterDateTimeTest extends DateTimeHandlerTestBase {
/**
* Tests filter operations.
*/
- public function testDatetimeFilter() {
+ public function testDatetimeFilter(): void {
$this->_testOffset();
$this->_testBetween();
$this->_testExact();
diff --git a/core/modules/datetime/tests/src/Kernel/Views/SortDateTimeTest.php b/core/modules/datetime/tests/src/Kernel/Views/SortDateTimeTest.php
index 9c276736156..96eaeb06596 100644
--- a/core/modules/datetime/tests/src/Kernel/Views/SortDateTimeTest.php
+++ b/core/modules/datetime/tests/src/Kernel/Views/SortDateTimeTest.php
@@ -51,7 +51,7 @@ class SortDateTimeTest extends DateTimeHandlerTestBase {
/**
* Tests the datetime sort handler.
*/
- public function testDateTimeSort() {
+ public function testDateTimeSort(): void {
$field = static::$fieldName . '_value';
$view = Views::getView('test_sort_datetime');
diff --git a/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php b/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php
index 54833c37548..7d1f0d52253 100644
--- a/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php
+++ b/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php
@@ -26,7 +26,7 @@ class DateFieldTest extends UnitTestCase {
*
* @dataProvider providerTestDefineValueProcessPipeline
*/
- public function testDefineValueProcessPipeline($data, $from_format, $to_format) {
+ public function testDefineValueProcessPipeline($data, $from_format, $to_format): void {
$migration = $this->createMock('Drupal\migrate\Plugin\MigrationInterface');
$pipeline = [
'plugin' => 'sub_process',
@@ -134,7 +134,7 @@ class DateFieldTest extends UnitTestCase {
*
* @covers ::defineValueProcessPipeline
*/
- public function testDefineValueProcessPipelineException() {
+ public function testDefineValueProcessPipelineException(): void {
$migration = $this->createMock('Drupal\migrate\Plugin\MigrationInterface');
$plugin = new DateField([], '', []);
diff --git a/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php b/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php
index 40751e7fddc..e2b07cdc0f0 100644
--- a/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php
+++ b/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php
@@ -56,7 +56,7 @@ class DateRangeFieldTest extends DateTestBase {
/**
* Tests date field functionality.
*/
- public function testDateRangeField() {
+ public function testDateRangeField(): void {
$field_name = $this->fieldStorage->getName();
$field_label = $this->field->label();
@@ -261,7 +261,7 @@ class DateRangeFieldTest extends DateTestBase {
/**
* Tests date and time field.
*/
- public function testDatetimeRangeField() {
+ public function testDatetimeRangeField(): void {
$field_name = $this->fieldStorage->getName();
$field_label = $this->field->label();
@@ -439,7 +439,7 @@ class DateRangeFieldTest extends DateTestBase {
/**
* Tests all-day field.
*/
- public function testAlldayRangeField() {
+ public function testAlldayRangeField(): void {
$field_name = $this->fieldStorage->getName();
$field_label = $this->field->label();
@@ -615,7 +615,7 @@ class DateRangeFieldTest extends DateTestBase {
/**
* Tests Date Range List Widget functionality.
*/
- public function testDatelistWidget() {
+ public function testDatelistWidget(): void {
$field_name = $this->fieldStorage->getName();
$field_label = $this->field->label();
@@ -972,7 +972,7 @@ class DateRangeFieldTest extends DateTestBase {
/**
* Tests default value functionality.
*/
- public function testDefaultValue() {
+ public function testDefaultValue(): void {
// Create a test content type.
$this->drupalCreateContentType(['type' => 'date_content']);
@@ -1162,7 +1162,7 @@ class DateRangeFieldTest extends DateTestBase {
/**
* Tests that invalid values are caught and marked as invalid.
*/
- public function testInvalidField() {
+ public function testInvalidField(): void {
// Change the field to a datetime field.
$this->fieldStorage->setSetting('datetime_type', DateRangeItem::DATETIME_TYPE_DATETIME);
$this->fieldStorage->save();
@@ -1375,7 +1375,7 @@ class DateRangeFieldTest extends DateTestBase {
/**
* Tests that 'Date' field storage setting form is disabled if field has data.
*/
- public function testDateStorageSettings() {
+ public function testDateStorageSettings(): void {
// Create a test content type.
$this->drupalCreateContentType(['type' => 'date_content']);
diff --git a/core/modules/datetime_range/tests/src/Kernel/DateRangeItemTest.php b/core/modules/datetime_range/tests/src/Kernel/DateRangeItemTest.php
index 3e9b45b701a..08aceceab59 100644
--- a/core/modules/datetime_range/tests/src/Kernel/DateRangeItemTest.php
+++ b/core/modules/datetime_range/tests/src/Kernel/DateRangeItemTest.php
@@ -82,7 +82,7 @@ class DateRangeItemTest extends FieldKernelTestBase {
/**
* Tests the field configured for date-only.
*/
- public function testDateOnly() {
+ public function testDateOnly(): void {
$this->fieldStorage->setSetting('datetime_type', DateRangeItem::DATETIME_TYPE_DATE);
$field_name = $this->fieldStorage->getName();
// Create an entity.
diff --git a/core/modules/datetime_range/tests/src/Kernel/SeparatorTranslationTest.php b/core/modules/datetime_range/tests/src/Kernel/SeparatorTranslationTest.php
index 06cc1cb8e72..92c0d9452a8 100644
--- a/core/modules/datetime_range/tests/src/Kernel/SeparatorTranslationTest.php
+++ b/core/modules/datetime_range/tests/src/Kernel/SeparatorTranslationTest.php
@@ -93,7 +93,7 @@ class SeparatorTranslationTest extends KernelTestBase {
/**
* Tests the translation of the range separator.
*/
- public function testSeparatorTranslation() {
+ public function testSeparatorTranslation(): void {
// Create an entity.
$entity = EntityTest::create([
'name' => $this->randomString(),
diff --git a/core/modules/datetime_range/tests/src/Kernel/Views/EntityTypeWithoutViewsDataTest.php b/core/modules/datetime_range/tests/src/Kernel/Views/EntityTypeWithoutViewsDataTest.php
index 48b40e5d106..4020059b7d1 100644
--- a/core/modules/datetime_range/tests/src/Kernel/Views/EntityTypeWithoutViewsDataTest.php
+++ b/core/modules/datetime_range/tests/src/Kernel/Views/EntityTypeWithoutViewsDataTest.php
@@ -35,7 +35,7 @@ class EntityTypeWithoutViewsDataTest extends KernelTestBase {
*
* @see datetime_test_entity_type_alter()
*/
- public function testEntityTypeWithoutViewsData() {
+ public function testEntityTypeWithoutViewsData(): void {
$view_yaml = $this->getModulePath('taxonomy') . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY . '/views.view.taxonomy_term.yml';
$values = Yaml::decode(file_get_contents($view_yaml));
$this->assertEquals(SAVED_NEW, View::create($values)->save());
diff --git a/core/modules/datetime_range/tests/src/Kernel/Views/FilterDateTest.php b/core/modules/datetime_range/tests/src/Kernel/Views/FilterDateTest.php
index fea0aa9e2ee..c5d53ac4dc9 100644
--- a/core/modules/datetime_range/tests/src/Kernel/Views/FilterDateTest.php
+++ b/core/modules/datetime_range/tests/src/Kernel/Views/FilterDateTest.php
@@ -118,7 +118,7 @@ class FilterDateTest extends DateTimeHandlerTestBase {
/**
* Tests offsets with date-only fields.
*/
- public function testDateOffsets() {
+ public function testDateOffsets(): void {
$view = Views::getView('test_filter_datetime');
$field_start = static::$fieldName . '_value';
$field_end = static::$fieldName . '_end_value';
diff --git a/core/modules/dblog/tests/src/Functional/DbLogTest.php b/core/modules/dblog/tests/src/Functional/DbLogTest.php
index 8be02b25151..2dba2c1fafd 100644
--- a/core/modules/dblog/tests/src/Functional/DbLogTest.php
+++ b/core/modules/dblog/tests/src/Functional/DbLogTest.php
@@ -83,7 +83,7 @@ class DbLogTest extends BrowserTestBase {
* Database Logging module functionality through both the admin and user
* interfaces.
*/
- public function testDbLog() {
+ public function testDbLog(): void {
// Log in the admin user.
$this->drupalLogin($this->adminUser);
@@ -110,7 +110,7 @@ class DbLogTest extends BrowserTestBase {
/**
* Tests individual log event page.
*/
- public function testLogEventPage() {
+ public function testLogEventPage(): void {
// Login the admin user.
$this->drupalLogin($this->adminUser);
@@ -178,7 +178,7 @@ class DbLogTest extends BrowserTestBase {
/**
* Tests that a 403 event is logged with the exception triggering it.
*/
- public function test403LogEventPage() {
+ public function test403LogEventPage(): void {
$assert_session = $this->assertSession();
$uri = 'admin/reports';
@@ -218,7 +218,7 @@ class DbLogTest extends BrowserTestBase {
/**
* Tests not-existing log event page.
*/
- public function testLogEventNotFoundPage() {
+ public function testLogEventNotFoundPage(): void {
// Login the admin user.
$this->drupalLogin($this->adminUser);
@@ -237,7 +237,7 @@ class DbLogTest extends BrowserTestBase {
* - Incorrect location: When location attribute is incorrect uri which can
* not be used to generate a valid link.
*/
- public function testLogEventPageWithMissingInfo() {
+ public function testLogEventPageWithMissingInfo(): void {
$this->drupalLogin($this->adminUser);
$connection = Database::getConnection();
@@ -280,7 +280,7 @@ class DbLogTest extends BrowserTestBase {
/**
* Test that twig errors are displayed correctly.
*/
- public function testMessageParsing() {
+ public function testMessageParsing(): void {
$this->drupalLogin($this->adminUser);
// Log a common twig error with {{ }} and { } variables.
\Drupal::service('logger.factory')->get("php")
@@ -617,7 +617,7 @@ class DbLogTest extends BrowserTestBase {
* Logs in the admin user, creates a database log event, and tests the
* functionality of clearing the database log through the admin interface.
*/
- public function testDBLogAddAndClear() {
+ public function testDBLogAddAndClear(): void {
global $base_root;
$connection = Database::getConnection();
// Get a count of how many watchdog entries already exist.
@@ -652,7 +652,7 @@ class DbLogTest extends BrowserTestBase {
/**
* Tests the database log filter functionality at admin/reports/dblog.
*/
- public function testFilter() {
+ public function testFilter(): void {
$this->drupalLogin($this->adminUser);
// Clear the log to ensure that only generated entries will be found.
@@ -828,7 +828,7 @@ class DbLogTest extends BrowserTestBase {
/**
* Tests that the details page displays correctly for a temporary user.
*/
- public function testTemporaryUser() {
+ public function testTemporaryUser(): void {
// Create a temporary user.
$temporary_user = $this->drupalCreateUser();
$temporary_user_uid = $temporary_user->id();
@@ -859,7 +859,7 @@ class DbLogTest extends BrowserTestBase {
/**
* Make sure HTML tags are filtered out in the log overview links.
*/
- public function testOverviewLinks() {
+ public function testOverviewLinks(): void {
$this->drupalLogin($this->adminUser);
// cSpell:disable-next-line
$this->generateLogEntries(1, ['message' => "&lt;script&gt;alert('foo');&lt;/script&gt;<strong>Lorem</strong> ipsum dolor sit amet, consectetur adipiscing & elit."]);
@@ -882,7 +882,7 @@ class DbLogTest extends BrowserTestBase {
/**
* Tests sorting for entries with the same timestamp.
*/
- public function testSameTimestampEntries() {
+ public function testSameTimestampEntries(): void {
$this->drupalLogin($this->adminUser);
$this->generateLogEntries(1, ['timestamp' => 1498062000, 'type' => 'same_time', 'message' => 'First']);
@@ -900,7 +900,7 @@ class DbLogTest extends BrowserTestBase {
/**
* Tests that the details page displays correctly backtrace.
*/
- public function testBacktrace() {
+ public function testBacktrace(): void {
$this->drupalLogin($this->adminUser);
$this->drupalGet('/error-test/generate-warnings');
diff --git a/core/modules/dblog/tests/src/Functional/DbLogViewsTest.php b/core/modules/dblog/tests/src/Functional/DbLogViewsTest.php
index a8a39b2d799..81272380289 100644
--- a/core/modules/dblog/tests/src/Functional/DbLogViewsTest.php
+++ b/core/modules/dblog/tests/src/Functional/DbLogViewsTest.php
@@ -59,7 +59,7 @@ class DbLogViewsTest extends DbLogTest {
/**
* Tests the empty text for the watchdog view is not using an input format.
*/
- public function testEmptyText() {
+ public function testEmptyText(): void {
$view = Views::getView('watchdog');
$data = $view->storage->toArray();
$area = $data['display']['default']['display_options']['empty']['area'];
diff --git a/core/modules/dblog/tests/src/Kernel/ConnectionFailureTest.php b/core/modules/dblog/tests/src/Kernel/ConnectionFailureTest.php
index e8ab1320c8c..afb79e42b2a 100644
--- a/core/modules/dblog/tests/src/Kernel/ConnectionFailureTest.php
+++ b/core/modules/dblog/tests/src/Kernel/ConnectionFailureTest.php
@@ -22,7 +22,7 @@ class ConnectionFailureTest extends KernelTestBase {
/**
* Tests logging of connection failures.
*/
- public function testConnectionFailureLogging() {
+ public function testConnectionFailureLogging(): void {
$this->installSchema('dblog', ['watchdog']);
// MySQL errors like "1153 - Got a packet bigger than 'max_allowed_packet'
diff --git a/core/modules/dblog/tests/src/Kernel/DbLogControllerTest.php b/core/modules/dblog/tests/src/Kernel/DbLogControllerTest.php
index 06ca1706bab..327751f6519 100644
--- a/core/modules/dblog/tests/src/Kernel/DbLogControllerTest.php
+++ b/core/modules/dblog/tests/src/Kernel/DbLogControllerTest.php
@@ -31,7 +31,7 @@ class DbLogControllerTest extends KernelTestBase {
/**
* Tests links with non latin characters.
*/
- public function testNonLatinCharacters() {
+ public function testNonLatinCharacters(): void {
$link = 'hello-
科州的小九寨沟绝美高山湖泊酱凉拌素鸡照烧鸡黄玫瑰
@@ -64,7 +64,7 @@ class DbLogControllerTest extends KernelTestBase {
/**
* Tests corrupted log entries can still display available data.
*/
- public function testDbLogCorrupted() {
+ public function testDbLogCorrupted(): void {
$dblog_controller = DbLogController::create($this->container);
// Check message with properly serialized data.
diff --git a/core/modules/dblog/tests/src/Kernel/DbLogFormInjectionTest.php b/core/modules/dblog/tests/src/Kernel/DbLogFormInjectionTest.php
index 9113dc6eb87..59c4b8f4e1d 100644
--- a/core/modules/dblog/tests/src/Kernel/DbLogFormInjectionTest.php
+++ b/core/modules/dblog/tests/src/Kernel/DbLogFormInjectionTest.php
@@ -93,7 +93,7 @@ class DbLogFormInjectionTest extends KernelTestBase implements FormInterface {
/**
* Tests db log injection serialization.
*/
- public function testLoggerSerialization() {
+ public function testLoggerSerialization(): void {
$form_state = new FormState();
// Forms are only serialized during POST requests.
diff --git a/core/modules/dblog/tests/src/Kernel/DbLogTest.php b/core/modules/dblog/tests/src/Kernel/DbLogTest.php
index c86f062ab15..9bdc36cb98a 100644
--- a/core/modules/dblog/tests/src/Kernel/DbLogTest.php
+++ b/core/modules/dblog/tests/src/Kernel/DbLogTest.php
@@ -35,7 +35,7 @@ class DbLogTest extends KernelTestBase {
/**
* Tests that cron correctly applies the database log row limit.
*/
- public function testDbLogCron() {
+ public function testDbLogCron(): void {
$row_limit = 100;
// Generate additional log entries.
$this->generateLogEntries($row_limit + 10);
@@ -65,7 +65,7 @@ class DbLogTest extends KernelTestBase {
/**
* Tests that only valid placeholders are stored in the variables column.
*/
- public function testInvalidPlaceholders() {
+ public function testInvalidPlaceholders(): void {
\Drupal::logger('my_module')->warning('Hello @string @array @object', ['@string' => '', '@array' => [], '@object' => new \stdClass()]);
$variables = \Drupal::database()
->select('watchdog', 'w')
diff --git a/core/modules/dblog/tests/src/Kernel/Migrate/d6/MigrateDblogConfigsTest.php b/core/modules/dblog/tests/src/Kernel/Migrate/d6/MigrateDblogConfigsTest.php
index f8cdd96beaa..0e02c879c00 100644
--- a/core/modules/dblog/tests/src/Kernel/Migrate/d6/MigrateDblogConfigsTest.php
+++ b/core/modules/dblog/tests/src/Kernel/Migrate/d6/MigrateDblogConfigsTest.php
@@ -37,7 +37,7 @@ class MigrateDblogConfigsTest extends MigrateDrupal6TestBase {
/**
* Tests migration of dblog variables to dblog.settings.yml.
*/
- public function testDblogSettings() {
+ public function testDblogSettings(): void {
$config = $this->config('dblog.settings');
$this->assertSame(10000, $config->get('row_limit'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'dblog.settings', $config->get());
diff --git a/core/modules/dblog/tests/src/Kernel/Migrate/d7/MigrateDblogConfigsTest.php b/core/modules/dblog/tests/src/Kernel/Migrate/d7/MigrateDblogConfigsTest.php
index b25c425f39c..92e338cebcd 100644
--- a/core/modules/dblog/tests/src/Kernel/Migrate/d7/MigrateDblogConfigsTest.php
+++ b/core/modules/dblog/tests/src/Kernel/Migrate/d7/MigrateDblogConfigsTest.php
@@ -30,7 +30,7 @@ class MigrateDblogConfigsTest extends MigrateDrupal7TestBase {
/**
* Tests migration of dblog variables to dblog.settings.yml.
*/
- public function testDblogSettings() {
+ public function testDblogSettings(): void {
$config = $this->config('dblog.settings');
$this->assertSame(10000, $config->get('row_limit'));
}
diff --git a/core/modules/dblog/tests/src/Kernel/Views/ViewsIntegrationTest.php b/core/modules/dblog/tests/src/Kernel/Views/ViewsIntegrationTest.php
index a743f2cda4d..ee75d0738b2 100644
--- a/core/modules/dblog/tests/src/Kernel/Views/ViewsIntegrationTest.php
+++ b/core/modules/dblog/tests/src/Kernel/Views/ViewsIntegrationTest.php
@@ -50,7 +50,7 @@ class ViewsIntegrationTest extends ViewsKernelTestBase {
/**
* Tests the messages escaping functionality.
*/
- public function testMessages() {
+ public function testMessages(): void {
// Remove the watchdog entries added by the potential batch process.
$this->container->get('database')->truncate('watchdog')->execute();
@@ -94,7 +94,7 @@ class ViewsIntegrationTest extends ViewsKernelTestBase {
/**
* Tests the relationship with the users_field_data table.
*/
- public function testRelationship() {
+ public function testRelationship(): void {
$view = Views::getView('dblog_integration_test');
$view->setDisplay('page_1');
// The uid relationship should now join to the {users_field_data} table.
@@ -107,7 +107,7 @@ class ViewsIntegrationTest extends ViewsKernelTestBase {
/**
* Tests views can be filtered by severity and log type.
*/
- public function testFiltering() {
+ public function testFiltering(): void {
// Remove the watchdog entries added by the potential batch process.
$this->container->get('database')->truncate('watchdog')->execute();
$this->createLogEntries();
diff --git a/core/modules/dynamic_page_cache/tests/src/Functional/DynamicPageCacheIntegrationTest.php b/core/modules/dynamic_page_cache/tests/src/Functional/DynamicPageCacheIntegrationTest.php
index a41b01735fe..93ac6ba1e61 100644
--- a/core/modules/dynamic_page_cache/tests/src/Functional/DynamicPageCacheIntegrationTest.php
+++ b/core/modules/dynamic_page_cache/tests/src/Functional/DynamicPageCacheIntegrationTest.php
@@ -48,7 +48,7 @@ class DynamicPageCacheIntegrationTest extends BrowserTestBase {
/**
* Tests that Dynamic Page Cache works correctly, and verifies the edge cases.
*/
- public function testDynamicPageCache() {
+ public function testDynamicPageCache(): void {
// Controllers returning plain response objects are ignored by Dynamic Page
// Cache.
$url = Url::fromUri('route:dynamic_page_cache_test.response');
diff --git a/core/modules/editor/tests/src/Functional/EditorAdminTest.php b/core/modules/editor/tests/src/Functional/EditorAdminTest.php
index 67a648876b2..8a709128187 100644
--- a/core/modules/editor/tests/src/Functional/EditorAdminTest.php
+++ b/core/modules/editor/tests/src/Functional/EditorAdminTest.php
@@ -58,7 +58,7 @@ class EditorAdminTest extends BrowserTestBase {
/**
* Tests an existing format without any editors available.
*/
- public function testNoEditorAvailable() {
+ public function testNoEditorAvailable(): void {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/config/content/formats/manage/filtered_html');
@@ -82,7 +82,7 @@ class EditorAdminTest extends BrowserTestBase {
/**
* Tests adding a text editor to an existing text format.
*/
- public function testAddEditorToExistingFormat() {
+ public function testAddEditorToExistingFormat(): void {
$this->enableUnicornEditor();
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/config/content/formats/manage/filtered_html');
@@ -103,7 +103,7 @@ class EditorAdminTest extends BrowserTestBase {
/**
* Tests adding a text editor to a new text format.
*/
- public function testAddEditorToNewFormat() {
+ public function testAddEditorToNewFormat(): void {
$this->addEditorToNewFormat('monoceros', 'Monoceros');
$this->verifyUnicornEditorConfiguration('monoceros');
}
@@ -111,7 +111,7 @@ class EditorAdminTest extends BrowserTestBase {
/**
* Tests format disabling.
*/
- public function testDisableFormatWithEditor() {
+ public function testDisableFormatWithEditor(): void {
$formats = ['monoceros' => 'Monoceros', 'tattoo' => 'Tattoo'];
// Install the node module.
@@ -161,7 +161,7 @@ class EditorAdminTest extends BrowserTestBase {
/**
* Tests switching text editor to none does not throw a TypeError.
*/
- public function testSwitchEditorToNone() {
+ public function testSwitchEditorToNone(): void {
$this->enableUnicornEditor();
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/config/content/formats/manage/filtered_html');
diff --git a/core/modules/editor/tests/src/Functional/EditorLoadingTest.php b/core/modules/editor/tests/src/Functional/EditorLoadingTest.php
index 5b08b95f8eb..49bbfee754e 100644
--- a/core/modules/editor/tests/src/Functional/EditorLoadingTest.php
+++ b/core/modules/editor/tests/src/Functional/EditorLoadingTest.php
@@ -132,7 +132,7 @@ class EditorLoadingTest extends BrowserTestBase {
/**
* Tests loading of text editors.
*/
- public function testLoading() {
+ public function testLoading(): void {
// Only associate a text editor with the "Full HTML" text format.
$editor = Editor::create([
'format' => 'full_html',
@@ -247,7 +247,7 @@ class EditorLoadingTest extends BrowserTestBase {
/**
* Tests supported element types.
*/
- public function testSupportedElementTypes() {
+ public function testSupportedElementTypes(): void {
// Associate the unicorn text editor with the "Full HTML" text format.
$editor = Editor::create([
'format' => 'full_html',
diff --git a/core/modules/editor/tests/src/Functional/EditorPrivateFileReferenceFilterTest.php b/core/modules/editor/tests/src/Functional/EditorPrivateFileReferenceFilterTest.php
index 5dcea7ee3f5..d838b476c99 100644
--- a/core/modules/editor/tests/src/Functional/EditorPrivateFileReferenceFilterTest.php
+++ b/core/modules/editor/tests/src/Functional/EditorPrivateFileReferenceFilterTest.php
@@ -42,7 +42,7 @@ class EditorPrivateFileReferenceFilterTest extends BrowserTestBase {
/**
* Tests the editor file reference filter with private files.
*/
- public function testEditorPrivateFileReferenceFilter() {
+ public function testEditorPrivateFileReferenceFilter(): void {
$author = $this->drupalCreateUser();
$this->drupalLogin($author);
diff --git a/core/modules/editor/tests/src/Functional/EditorSecurityTest.php b/core/modules/editor/tests/src/Functional/EditorSecurityTest.php
index 619fff339a4..79a96944fb0 100644
--- a/core/modules/editor/tests/src/Functional/EditorSecurityTest.php
+++ b/core/modules/editor/tests/src/Functional/EditorSecurityTest.php
@@ -239,7 +239,7 @@ class EditorSecurityTest extends BrowserTestBase {
*
* Tests 8 scenarios. Tests only with a text editor that is not XSS-safe.
*/
- public function testInitialSecurity() {
+ public function testInitialSecurity(): void {
$expected = [
[
'node_id' => 1,
@@ -315,7 +315,7 @@ class EditorSecurityTest extends BrowserTestBase {
* format and contains a <script> tag to the Full HTML text format, the
* <script> tag would be executed. Unless we apply appropriate filtering.
*/
- public function testSwitchingSecurity() {
+ public function testSwitchingSecurity(): void {
$expected = [
[
'node_id' => 1,
@@ -441,7 +441,7 @@ class EditorSecurityTest extends BrowserTestBase {
/**
* Tests the standard text editor XSS filter being overridden.
*/
- public function testEditorXssFilterOverride() {
+ public function testEditorXssFilterOverride(): void {
// First: the Standard text editor XSS filter.
$this->drupalLogin($this->normalUser);
$this->drupalGet('node/2/edit');
diff --git a/core/modules/editor/tests/src/FunctionalJavascript/EditorAdminTest.php b/core/modules/editor/tests/src/FunctionalJavascript/EditorAdminTest.php
index d83d594c3e1..25a1e9869d5 100644
--- a/core/modules/editor/tests/src/FunctionalJavascript/EditorAdminTest.php
+++ b/core/modules/editor/tests/src/FunctionalJavascript/EditorAdminTest.php
@@ -47,7 +47,7 @@ class EditorAdminTest extends WebDriverTestBase {
/**
* Tests that editor selection can be toggled without breaking ajax.
*/
- public function testEditorSelection() {
+ public function testEditorSelection(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -75,7 +75,7 @@ class EditorAdminTest extends WebDriverTestBase {
* because the form state must change accordingly.
* @see https://www.drupal.org/project/drupal/issues/3230829
*/
- public function testEditorCreation() {
+ public function testEditorCreation(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php b/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php
index 6f5218ef10a..62bf8573f02 100644
--- a/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php
+++ b/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php
@@ -56,7 +56,7 @@ class EditorFileReferenceFilterTest extends KernelTestBase {
/**
* Tests the editor file reference filter.
*/
- public function testEditorFileReferenceFilter() {
+ public function testEditorFileReferenceFilter(): void {
$filter = $this->filters['editor_file_reference'];
$test = function ($input) use ($filter) {
diff --git a/core/modules/editor/tests/src/Kernel/EditorFileUsageTest.php b/core/modules/editor/tests/src/Kernel/EditorFileUsageTest.php
index 826710f04a5..fa29a8471dc 100644
--- a/core/modules/editor/tests/src/Kernel/EditorFileUsageTest.php
+++ b/core/modules/editor/tests/src/Kernel/EditorFileUsageTest.php
@@ -83,7 +83,7 @@ class EditorFileUsageTest extends EntityKernelTestBase {
/**
* Tests file save operations when node with referenced files is saved.
*/
- public function testFileSaveOperations() {
+ public function testFileSaveOperations(): void {
$permanent_image = File::create([
'uri' => 'core/misc/druplicon.png',
'status' => 1,
@@ -122,7 +122,7 @@ class EditorFileUsageTest extends EntityKernelTestBase {
/**
* Tests the configurable text editor manager.
*/
- public function testEditorEntityHooks() {
+ public function testEditorEntityHooks(): void {
$image_paths = [
0 => 'core/misc/druplicon.png',
1 => 'core/misc/tree.png',
diff --git a/core/modules/editor/tests/src/Kernel/EditorFilterIntegrationTest.php b/core/modules/editor/tests/src/Kernel/EditorFilterIntegrationTest.php
index c8a108d4a9c..b9423e04ab9 100644
--- a/core/modules/editor/tests/src/Kernel/EditorFilterIntegrationTest.php
+++ b/core/modules/editor/tests/src/Kernel/EditorFilterIntegrationTest.php
@@ -23,7 +23,7 @@ class EditorFilterIntegrationTest extends KernelTestBase {
/**
* Tests text format removal or disabling.
*/
- public function testTextFormatIntegration() {
+ public function testTextFormatIntegration(): void {
// Create an arbitrary text format.
$format = FilterFormat::create([
'format' => $this->randomMachineName(),
diff --git a/core/modules/editor/tests/src/Kernel/EditorManagerTest.php b/core/modules/editor/tests/src/Kernel/EditorManagerTest.php
index f57654d7b50..3eb105a1f45 100644
--- a/core/modules/editor/tests/src/Kernel/EditorManagerTest.php
+++ b/core/modules/editor/tests/src/Kernel/EditorManagerTest.php
@@ -57,7 +57,7 @@ class EditorManagerTest extends KernelTestBase {
/**
* Tests the configurable text editor manager.
*/
- public function testManager() {
+ public function testManager(): void {
$this->editorManager = $this->container->get('plugin.manager.editor');
// Case 1: no text editor available:
diff --git a/core/modules/editor/tests/src/Kernel/EntityUpdateTest.php b/core/modules/editor/tests/src/Kernel/EntityUpdateTest.php
index 067fa46fabc..413c371540d 100644
--- a/core/modules/editor/tests/src/Kernel/EntityUpdateTest.php
+++ b/core/modules/editor/tests/src/Kernel/EntityUpdateTest.php
@@ -46,7 +46,7 @@ class EntityUpdateTest extends EntityKernelTestBase {
*
* @see editor_test_entity_update()
*/
- public function testEntityUpdate() {
+ public function testEntityUpdate(): void {
// Create a node.
$node = Node::create([
'type' => 'page',
diff --git a/core/modules/editor/tests/src/Unit/EditorConfigEntityUnitTest.php b/core/modules/editor/tests/src/Unit/EditorConfigEntityUnitTest.php
index ac7af5b79d5..b33fe90d22b 100644
--- a/core/modules/editor/tests/src/Unit/EditorConfigEntityUnitTest.php
+++ b/core/modules/editor/tests/src/Unit/EditorConfigEntityUnitTest.php
@@ -93,7 +93,7 @@ class EditorConfigEntityUnitTest extends UnitTestCase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependencies() {
+ public function testCalculateDependencies(): void {
$format_id = 'filter.format.test';
$values = ['editor' => $this->editorId, 'format' => $format_id];
diff --git a/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php b/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php
index 60ad4d94a1b..30adc3dbc60 100644
--- a/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php
+++ b/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php
@@ -539,7 +539,7 @@ xss:ex/*XSS*//*/*/pression(alert("XSS"))\'>',
*
* @dataProvider providerTestFilterXss
*/
- public function testFilterXss($input, $expected_output) {
+ public function testFilterXss($input, $expected_output): void {
$output = Standard::filterXss($input, $this->format);
$this->assertSame($expected_output, $output);
}
@@ -563,7 +563,7 @@ xss:ex/*XSS*//*/*/pression(alert("XSS"))\'>',
*
* @dataProvider providerTestBlackListMode
*/
- public function testBlacklistMode($value, $expected, $message, array $disallowed_tags) {
+ public function testBlacklistMode($value, $expected, $message, array $disallowed_tags): void {
$value = Standard::filter($value, $disallowed_tags);
$this->assertSame($expected, $value, $message);
}
diff --git a/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php b/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php
index 3d2145afc61..6306f66a50a 100644
--- a/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php
+++ b/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php
@@ -64,7 +64,7 @@ class BooleanFieldTest extends BrowserTestBase {
/**
* Tests boolean field.
*/
- public function testBooleanField() {
+ public function testBooleanField(): void {
$on = $this->randomMachineName();
$off = $this->randomMachineName();
$label = $this->randomMachineName();
@@ -185,7 +185,7 @@ class BooleanFieldTest extends BrowserTestBase {
/**
* Tests field access.
*/
- public function testFormAccess() {
+ public function testFormAccess(): void {
$on = 'boolean_on';
$off = 'boolean_off';
$label = 'boolean_label';
diff --git a/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php b/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php
index bab7cd36051..266c3dbbb9f 100644
--- a/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php
+++ b/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php
@@ -90,7 +90,7 @@ class BooleanFormatterSettingsTest extends BrowserTestBase {
/**
* Tests the formatter settings page for the Boolean formatter.
*/
- public function testBooleanFormatterSettings() {
+ public function testBooleanFormatterSettings(): void {
// List the options we expect to see on the settings form. Omit the one
// with the Unicode check/x characters, which does not appear to work
// well in BrowserTestBase.
diff --git a/core/modules/field/tests/src/Functional/Email/EmailFieldTest.php b/core/modules/field/tests/src/Functional/Email/EmailFieldTest.php
index f9d04093c42..cf024258ea4 100644
--- a/core/modules/field/tests/src/Functional/Email/EmailFieldTest.php
+++ b/core/modules/field/tests/src/Functional/Email/EmailFieldTest.php
@@ -58,7 +58,7 @@ class EmailFieldTest extends BrowserTestBase {
/**
* Tests email field.
*/
- public function testEmailField() {
+ public function testEmailField(): void {
// Create a field with settings to validate.
$field_name = $this->randomMachineName();
$this->fieldStorage = FieldStorageConfig::create([
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php
index 2301a68fdbe..58272b6eca8 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php
@@ -79,7 +79,7 @@ class EntityReferenceAdminTest extends BrowserTestBase {
/**
* Tests the Entity Reference Admin UI.
*/
- public function testFieldAdminHandler() {
+ public function testFieldAdminHandler(): void {
$bundle_path = 'admin/structure/types/manage/' . $this->type;
// Create a new view and display it as an entity reference.
$edit = [
@@ -260,7 +260,7 @@ class EntityReferenceAdminTest extends BrowserTestBase {
/**
* Tests the formatters for the Entity References.
*/
- public function testAvailableFormatters() {
+ public function testAvailableFormatters(): void {
// Create a new vocabulary.
Vocabulary::create(['vid' => 'tags', 'name' => 'tags'])->save();
@@ -321,7 +321,7 @@ class EntityReferenceAdminTest extends BrowserTestBase {
* The tested entity reference field has multiple target bundles and is set
* to auto-create the target entity.
*/
- public function testMultipleTargetBundles() {
+ public function testMultipleTargetBundles(): void {
/** @var \Drupal\taxonomy\Entity\Vocabulary[] $vocabularies */
$vocabularies = [];
for ($i = 0; $i < 2; $i++) {
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
index b7305cb0c5c..5de1e0a9b8b 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
@@ -107,7 +107,7 @@ class EntityReferenceAutoCreateTest extends BrowserTestBase {
/**
* Tests the autocomplete input element and entity auto-creation.
*/
- public function testAutoCreate() {
+ public function testAutoCreate(): void {
$this->drupalGet('node/add/' . $this->referencingType);
$target = $this->assertSession()->fieldExists("edit-test-field-0-target-id");
$this->assertTrue($target->hasClass("form-autocomplete"));
@@ -160,7 +160,7 @@ class EntityReferenceAutoCreateTest extends BrowserTestBase {
* Tests if an entity reference field having multiple target bundles is
* storing the auto-created entity in the right destination.
*/
- public function testMultipleTargetBundles() {
+ public function testMultipleTargetBundles(): void {
/** @var \Drupal\taxonomy\Entity\Vocabulary[] $vocabularies */
$vocabularies = [];
for ($i = 0; $i < 2; $i++) {
@@ -255,7 +255,7 @@ class EntityReferenceAutoCreateTest extends BrowserTestBase {
/**
* Tests autocreation for an entity that has no bundles.
*/
- public function testNoBundles() {
+ public function testNoBundles(): void {
$account = $this->drupalCreateUser([
'access content',
"create $this->referencingType content",
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php
index 229306a44d8..86daa6d1a10 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php
@@ -62,7 +62,7 @@ class EntityReferenceFieldDefaultValueTest extends BrowserTestBase {
/**
* Tests that default values are correctly translated to UUIDs in config.
*/
- public function testEntityReferenceDefaultValue() {
+ public function testEntityReferenceDefaultValue(): void {
// Create a node to be referenced.
$referenced_node = $this->drupalCreateNode(['type' => 'referenced_content']);
@@ -126,7 +126,7 @@ class EntityReferenceFieldDefaultValueTest extends BrowserTestBase {
*
* @see \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::onDependencyRemoval()
*/
- public function testEntityReferenceDefaultConfigValue() {
+ public function testEntityReferenceDefaultConfigValue(): void {
// Create a node to be referenced.
$referenced_node_type = $this->drupalCreateContentType(['type' => 'referenced_config_to_delete']);
$referenced_node_type2 = $this->drupalCreateContentType(['type' => 'referenced_config_to_preserve']);
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
index 864223fd582..777dc86b0e0 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
@@ -163,7 +163,7 @@ class EntityReferenceFieldTranslatedReferenceViewTest extends BrowserTestBase {
/**
* Tests if the entity is displayed in an entity reference field.
*/
- public function testEntityReferenceDisplay() {
+ public function testEntityReferenceDisplay(): void {
// Create a translated referrer entity.
$this->referrerEntity = $this->createReferrerEntity();
$this->assertEntityReferenceDisplay();
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFileUploadTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFileUploadTest.php
index 74f9920d73b..d18cfb1cafc 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFileUploadTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFileUploadTest.php
@@ -125,7 +125,7 @@ class EntityReferenceFileUploadTest extends BrowserTestBase {
/**
* Tests that the autocomplete input element does not cause ajax fatal.
*/
- public function testFileUpload() {
+ public function testFileUpload(): void {
$user1 = $this->drupalCreateUser([
'access content',
"create $this->referencingType content",
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php
index 302466b8691..ce2f385a8b4 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php
@@ -71,7 +71,7 @@ class EntityReferenceIntegrationTest extends BrowserTestBase {
/**
* Tests the entity reference field with all its supported field widgets.
*/
- public function testSupportedEntityTypesAndWidgets() {
+ public function testSupportedEntityTypesAndWidgets(): void {
foreach ($this->getTestEntities() as $key => $referenced_entities) {
$this->fieldName = 'field_test_' . $referenced_entities[0]->getEntityTypeId();
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceXSSTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceXSSTest.php
index 6017fb4059f..5bb52d6206f 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceXSSTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceXSSTest.php
@@ -41,7 +41,7 @@ class EntityReferenceXSSTest extends BrowserTestBase {
/**
* Tests markup is escaped in the entity reference select and label formatter.
*/
- public function testEntityReferenceXSS() {
+ public function testEntityReferenceXSS(): void {
$this->drupalCreateContentType(['type' => 'article']);
// Create a node with markup in the title.
diff --git a/core/modules/field/tests/src/Functional/EntityReference/Views/SelectionTest.php b/core/modules/field/tests/src/Functional/EntityReference/Views/SelectionTest.php
index ea0fa36604c..d0a167608dd 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/Views/SelectionTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/Views/SelectionTest.php
@@ -86,7 +86,7 @@ class SelectionTest extends BrowserTestBase {
/**
* Tests that the Views selection handles the views output properly.
*/
- public function testAutocompleteOutput() {
+ public function testAutocompleteOutput(): void {
// Reset any internal static caching.
\Drupal::service('entity_type.manager')->getStorage('node')->resetCache();
diff --git a/core/modules/field/tests/src/Functional/FieldAccessTest.php b/core/modules/field/tests/src/Functional/FieldAccessTest.php
index 47b1ebc6091..6a357184b73 100644
--- a/core/modules/field/tests/src/Functional/FieldAccessTest.php
+++ b/core/modules/field/tests/src/Functional/FieldAccessTest.php
@@ -86,7 +86,7 @@ class FieldAccessTest extends FieldTestBase {
/**
* Tests that hook_entity_field_access() is called.
*/
- public function testFieldAccess() {
+ public function testFieldAccess(): void {
// Assert the text is visible.
$this->drupalGet('node/' . $this->node->id());
diff --git a/core/modules/field/tests/src/Functional/FieldDefaultValueCallbackTest.php b/core/modules/field/tests/src/Functional/FieldDefaultValueCallbackTest.php
index 41537e37c8d..f9405facbc6 100644
--- a/core/modules/field/tests/src/Functional/FieldDefaultValueCallbackTest.php
+++ b/core/modules/field/tests/src/Functional/FieldDefaultValueCallbackTest.php
@@ -60,7 +60,7 @@ class FieldDefaultValueCallbackTest extends BrowserTestBase {
}
- public function testDefaultValueCallbackForm() {
+ public function testDefaultValueCallbackForm(): void {
// Create a field and storage for checking.
/** @var \Drupal\field\Entity\FieldStorageConfig $field_storage */
FieldStorageConfig::create([
diff --git a/core/modules/field/tests/src/Functional/FieldHelpTest.php b/core/modules/field/tests/src/Functional/FieldHelpTest.php
index 40a2a07811d..14991493a28 100644
--- a/core/modules/field/tests/src/Functional/FieldHelpTest.php
+++ b/core/modules/field/tests/src/Functional/FieldHelpTest.php
@@ -46,7 +46,7 @@ class FieldHelpTest extends BrowserTestBase {
/**
* Tests the Field module's help page.
*/
- public function testFieldHelp() {
+ public function testFieldHelp(): void {
// Log in the admin user.
$this->drupalLogin($this->adminUser);
diff --git a/core/modules/field/tests/src/Functional/FieldImportDeleteUninstallUiTest.php b/core/modules/field/tests/src/Functional/FieldImportDeleteUninstallUiTest.php
index ed065630965..c7dbb38eeac 100644
--- a/core/modules/field/tests/src/Functional/FieldImportDeleteUninstallUiTest.php
+++ b/core/modules/field/tests/src/Functional/FieldImportDeleteUninstallUiTest.php
@@ -48,7 +48,7 @@ class FieldImportDeleteUninstallUiTest extends FieldTestBase {
/**
* Tests deleting field storages and fields as part of config import.
*/
- public function testImportDeleteUninstall() {
+ public function testImportDeleteUninstall(): void {
// Create a telephone field.
$field_storage = FieldStorageConfig::create([
'field_name' => 'field_tel',
diff --git a/core/modules/field/tests/src/Functional/FormTest.php b/core/modules/field/tests/src/Functional/FormTest.php
index aed41e76c27..80fcfd6198c 100644
--- a/core/modules/field/tests/src/Functional/FormTest.php
+++ b/core/modules/field/tests/src/Functional/FormTest.php
@@ -113,7 +113,7 @@ class FormTest extends FieldTestBase {
];
}
- public function testFieldFormSingle() {
+ public function testFieldFormSingle(): void {
$field_storage = $this->fieldStorageSingle;
$field_name = $field_storage['field_name'];
$this->field['field_name'] = $field_name;
@@ -195,7 +195,7 @@ class FormTest extends FieldTestBase {
/**
* Tests field widget default values on entity forms.
*/
- public function testFieldFormDefaultValue() {
+ public function testFieldFormDefaultValue(): void {
$field_storage = $this->fieldStorageSingle;
$field_name = $field_storage['field_name'];
$this->field['field_name'] = $field_name;
@@ -225,7 +225,7 @@ class FormTest extends FieldTestBase {
$this->assertTrue($entity->{$field_name}->isEmpty(), 'Field is now empty.');
}
- public function testFieldFormSingleRequired() {
+ public function testFieldFormSingleRequired(): void {
$field_storage = $this->fieldStorageSingle;
$field_name = $field_storage['field_name'];
$this->field['field_name'] = $field_name;
@@ -265,7 +265,7 @@ class FormTest extends FieldTestBase {
$this->assertSession()->pageTextContains("{$this->field['label']} field is required.");
}
- public function testFieldFormUnlimited() {
+ public function testFieldFormUnlimited(): void {
$field_storage = $this->fieldStorageUnlimited;
$field_name = $field_storage['field_name'];
$this->field['field_name'] = $field_name;
@@ -360,7 +360,7 @@ class FormTest extends FieldTestBase {
/**
* Tests the position of the required label.
*/
- public function testFieldFormUnlimitedRequired() {
+ public function testFieldFormUnlimitedRequired(): void {
$field_name = $this->fieldStorageUnlimited['field_name'];
$this->field['field_name'] = $field_name;
$this->field['required'] = TRUE;
@@ -384,7 +384,7 @@ class FormTest extends FieldTestBase {
/**
* Tests widget handling of multiple required radios.
*/
- public function testFieldFormMultivalueWithRequiredRadio() {
+ public function testFieldFormMultivalueWithRequiredRadio(): void {
/** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
$display_repository = \Drupal::service('entity_display.repository');
@@ -439,7 +439,7 @@ class FormTest extends FieldTestBase {
/**
* Tests widgets handling multiple values.
*/
- public function testFieldFormMultipleWidget() {
+ public function testFieldFormMultipleWidget(): void {
// Create a field with fixed cardinality, configure the form to use a
// "multiple" widget.
$field_storage = $this->fieldStorageMultiple;
@@ -495,7 +495,7 @@ class FormTest extends FieldTestBase {
/**
* Tests fields with no 'edit' access.
*/
- public function testFieldFormAccess() {
+ public function testFieldFormAccess(): void {
/** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
$display_repository = \Drupal::service('entity_display.repository');
@@ -593,7 +593,7 @@ class FormTest extends FieldTestBase {
/**
* Tests hiding a field in a form.
*/
- public function testHiddenField() {
+ public function testHiddenField(): void {
$entity_type = 'entity_test_rev';
$field_storage = $this->fieldStorageSingle;
$field_storage['entity_type'] = $entity_type;
@@ -668,7 +668,7 @@ class FormTest extends FieldTestBase {
/**
* Tests the form display of the label for multi-value fields.
*/
- public function testLabelOnMultiValueFields() {
+ public function testLabelOnMultiValueFields(): void {
$user = $this->drupalCreateUser(['administer entity_test content']);
$this->drupalLogin($user);
@@ -707,28 +707,28 @@ class FormTest extends FieldTestBase {
/**
* Tests hook_field_widget_complete_form_alter().
*/
- public function testFieldFormMultipleWidgetAlter() {
+ public function testFieldFormMultipleWidgetAlter(): void {
$this->widgetAlterTest('hook_field_widget_complete_form_alter', 'test_field_widget_multiple');
}
/**
* Tests hook_field_widget_complete_form_alter() with single value elements.
*/
- public function testFieldFormMultipleWidgetAlterSingleValues() {
+ public function testFieldFormMultipleWidgetAlterSingleValues(): void {
$this->widgetAlterTest('hook_field_widget_complete_form_alter', 'test_field_widget_multiple_single_value');
}
/**
* Tests hook_field_widget_complete_WIDGET_TYPE_form_alter().
*/
- public function testFieldFormMultipleWidgetTypeAlter() {
+ public function testFieldFormMultipleWidgetTypeAlter(): void {
$this->widgetAlterTest('hook_field_widget_complete_WIDGET_TYPE_form_alter', 'test_field_widget_multiple');
}
/**
* Tests hook_field_widget_complete_WIDGET_TYPE_form_alter() with single value elements.
*/
- public function testFieldFormMultipleWidgetTypeAlterSingleValues() {
+ public function testFieldFormMultipleWidgetTypeAlterSingleValues(): void {
$this->widgetAlterTest('hook_field_widget_complete_WIDGET_TYPE_form_alter', 'test_field_widget_multiple_single_value');
}
diff --git a/core/modules/field/tests/src/Functional/FunctionalString/StringFieldTest.php b/core/modules/field/tests/src/Functional/FunctionalString/StringFieldTest.php
index 2484584441f..bb8b98eb8c8 100644
--- a/core/modules/field/tests/src/Functional/FunctionalString/StringFieldTest.php
+++ b/core/modules/field/tests/src/Functional/FunctionalString/StringFieldTest.php
@@ -55,7 +55,7 @@ class StringFieldTest extends BrowserTestBase {
/**
* Tests widgets.
*/
- public function testTextfieldWidgets() {
+ public function testTextfieldWidgets(): void {
$this->_testTextfieldWidgets('string', 'string_textfield');
$this->_testTextfieldWidgets('string_long', 'string_textarea');
}
diff --git a/core/modules/field/tests/src/Functional/NestedFormTest.php b/core/modules/field/tests/src/Functional/NestedFormTest.php
index 1d981dfc899..d0c7703b94a 100644
--- a/core/modules/field/tests/src/Functional/NestedFormTest.php
+++ b/core/modules/field/tests/src/Functional/NestedFormTest.php
@@ -81,7 +81,7 @@ class NestedFormTest extends FieldTestBase {
/**
* Tests Field API form integration within a subform.
*/
- public function testNestedFieldForm() {
+ public function testNestedFieldForm(): void {
/** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
$display_repository = \Drupal::service('entity_display.repository');
@@ -203,7 +203,7 @@ class NestedFormTest extends FieldTestBase {
/**
* Tests entity level validation within subforms.
*/
- public function testNestedEntityFormEntityLevelValidation() {
+ public function testNestedEntityFormEntityLevelValidation(): void {
// Create two entities.
$storage = $this->container->get('entity_type.manager')
->getStorage('entity_test_constraints');
diff --git a/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php b/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php
index 51ea7bdcf8a..8ddf0b9e18d 100644
--- a/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php
+++ b/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php
@@ -48,7 +48,7 @@ class NumberFieldTest extends BrowserTestBase {
/**
* Tests decimal field.
*/
- public function testNumberDecimalField() {
+ public function testNumberDecimalField(): void {
// Create a field with settings to validate.
$field_name = $this->randomMachineName();
FieldStorageConfig::create([
@@ -136,7 +136,7 @@ class NumberFieldTest extends BrowserTestBase {
/**
* Tests integer field.
*/
- public function testNumberIntegerField() {
+ public function testNumberIntegerField(): void {
$minimum = rand(-4000, -2000);
$maximum = rand(2000, 4000);
@@ -302,7 +302,7 @@ class NumberFieldTest extends BrowserTestBase {
/**
* Tests float field.
*/
- public function testNumberFloatField() {
+ public function testNumberFloatField(): void {
// Create a field with settings to validate.
$field_name = $this->randomMachineName();
FieldStorageConfig::create([
@@ -395,7 +395,7 @@ class NumberFieldTest extends BrowserTestBase {
/**
* Tests setting the minimum value of a float field through the interface.
*/
- public function testCreateNumberFloatField() {
+ public function testCreateNumberFloatField(): void {
// Create a float field.
$field_name = $this->randomMachineName();
FieldStorageConfig::create([
@@ -420,7 +420,7 @@ class NumberFieldTest extends BrowserTestBase {
/**
* Tests setting the minimum value of a decimal field through the interface.
*/
- public function testCreateNumberDecimalField() {
+ public function testCreateNumberDecimalField(): void {
// Create a decimal field.
$field_name = $this->randomMachineName();
FieldStorageConfig::create([
diff --git a/core/modules/field/tests/src/Functional/ReEnableModuleFieldTest.php b/core/modules/field/tests/src/Functional/ReEnableModuleFieldTest.php
index 957c7c91b5c..56668ca3214 100644
--- a/core/modules/field/tests/src/Functional/ReEnableModuleFieldTest.php
+++ b/core/modules/field/tests/src/Functional/ReEnableModuleFieldTest.php
@@ -54,7 +54,7 @@ class ReEnableModuleFieldTest extends BrowserTestBase {
*
* @see field_system_info_alter()
*/
- public function testReEnabledField() {
+ public function testReEnabledField(): void {
// Add a telephone field to the article content type.
$field_storage = FieldStorageConfig::create([
'field_name' => 'field_telephone',
diff --git a/core/modules/field/tests/src/Functional/TranslationWebTest.php b/core/modules/field/tests/src/Functional/TranslationWebTest.php
index 2593984dedb..ecdae5e5243 100644
--- a/core/modules/field/tests/src/Functional/TranslationWebTest.php
+++ b/core/modules/field/tests/src/Functional/TranslationWebTest.php
@@ -95,7 +95,7 @@ class TranslationWebTest extends FieldTestBase {
/**
* Tests field translations when creating a new revision.
*/
- public function testFieldFormTranslationRevisions() {
+ public function testFieldFormTranslationRevisions(): void {
$web_user = $this->drupalCreateUser([
'view test entity',
'administer entity_test content',
diff --git a/core/modules/field/tests/src/Functional/Views/FieldUITest.php b/core/modules/field/tests/src/Functional/Views/FieldUITest.php
index df2f79551fd..e96d17bb282 100644
--- a/core/modules/field/tests/src/Functional/Views/FieldUITest.php
+++ b/core/modules/field/tests/src/Functional/Views/FieldUITest.php
@@ -58,7 +58,7 @@ class FieldUITest extends FieldTestBase {
/**
* Tests basic field handler settings in the UI.
*/
- public function testHandlerUI() {
+ public function testHandlerUI(): void {
$url = "admin/structure/views/nojs/handler/test_view_fieldapi/default/field/field_name_0";
$this->drupalGet($url);
@@ -107,7 +107,7 @@ class FieldUITest extends FieldTestBase {
/**
* Tests the basic field handler form when aggregation is enabled.
*/
- public function testHandlerUIAggregation() {
+ public function testHandlerUIAggregation(): void {
// Enable aggregation.
$edit = ['group_by' => '1'];
$this->drupalGet('admin/structure/views/nojs/display/test_view_fieldapi/default/group_by');
@@ -129,7 +129,7 @@ class FieldUITest extends FieldTestBase {
/**
* Tests adding a boolean field filter handler.
*/
- public function testBooleanFilterHandler() {
+ public function testBooleanFilterHandler(): void {
// Create a boolean field.
$field_name = 'field_boolean';
$field_storage = FieldStorageConfig::create([
diff --git a/core/modules/field/tests/src/FunctionalJavascript/Boolean/BooleanFormatterSettingsTest.php b/core/modules/field/tests/src/FunctionalJavascript/Boolean/BooleanFormatterSettingsTest.php
index 47c31b320c9..085f11cd41e 100644
--- a/core/modules/field/tests/src/FunctionalJavascript/Boolean/BooleanFormatterSettingsTest.php
+++ b/core/modules/field/tests/src/FunctionalJavascript/Boolean/BooleanFormatterSettingsTest.php
@@ -89,7 +89,7 @@ class BooleanFormatterSettingsTest extends WebDriverTestBase {
/**
* Tests the formatter settings page for the Boolean formatter.
*/
- public function testBooleanFormatterSettings() {
+ public function testBooleanFormatterSettings(): void {
// List the options we expect to see on the settings form. Omit the one
// with the Unicode check/x characters, which does not appear to work
// well in BrowserTestBase.
diff --git a/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php b/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php
index 9249c4ebfd6..85f84b0ad41 100644
--- a/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php
+++ b/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php
@@ -113,7 +113,7 @@ class EntityReferenceAdminTest extends WebDriverTestBase {
/**
* Tests the Entity Reference Admin UI.
*/
- public function testFieldAdminHandler() {
+ public function testFieldAdminHandler(): void {
$bundle_path = 'admin/structure/types/manage/' . $this->type;
$page = $this->getSession()->getPage();
diff --git a/core/modules/field/tests/src/FunctionalJavascript/MultipleValueWidgetTest.php b/core/modules/field/tests/src/FunctionalJavascript/MultipleValueWidgetTest.php
index a25f0481015..442cbf40f1b 100644
--- a/core/modules/field/tests/src/FunctionalJavascript/MultipleValueWidgetTest.php
+++ b/core/modules/field/tests/src/FunctionalJavascript/MultipleValueWidgetTest.php
@@ -66,7 +66,7 @@ class MultipleValueWidgetTest extends WebDriverTestBase {
/**
* Tests the 'Add more' functionality.
*/
- public function testFieldMultipleValueWidget() {
+ public function testFieldMultipleValueWidget(): void {
$this->drupalGet('entity_test/add');
$assert_session = $this->assertSession();
@@ -172,7 +172,7 @@ class MultipleValueWidgetTest extends WebDriverTestBase {
/**
* Tests that no validation occurs on field on "Add more" click.
*/
- public function testFieldMultipleValueWidgetAddMoreNoValidation() {
+ public function testFieldMultipleValueWidgetAddMoreNoValidation(): void {
// Set unlimited field to be required.
$field_name = 'field_unlimited';
$field = FieldConfig::loadByName('entity_test', 'entity_test', $field_name);
diff --git a/core/modules/field/tests/src/FunctionalJavascript/Number/NumberFieldTest.php b/core/modules/field/tests/src/FunctionalJavascript/Number/NumberFieldTest.php
index e960706ff01..9a9f95420e1 100644
--- a/core/modules/field/tests/src/FunctionalJavascript/Number/NumberFieldTest.php
+++ b/core/modules/field/tests/src/FunctionalJavascript/Number/NumberFieldTest.php
@@ -46,7 +46,7 @@ class NumberFieldTest extends WebDriverTestBase {
/**
* Tests default formatter behavior.
*/
- public function testNumberFormatter() {
+ public function testNumberFormatter(): void {
$type = $this->randomMachineName();
$float_field = $this->randomMachineName();
$integer_field = $this->randomMachineName();
diff --git a/core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php b/core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php
index 2a3a9e22033..c37ccc0db25 100644
--- a/core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php
@@ -107,7 +107,7 @@ class BooleanFormatterTest extends KernelTestBase {
/**
* Tests boolean formatter output.
*/
- public function testBooleanFormatter() {
+ public function testBooleanFormatter(): void {
$data = [];
$data[] = [0, [], 'Off'];
$data[] = [1, [], 'On'];
diff --git a/core/modules/field/tests/src/Kernel/Boolean/BooleanItemTest.php b/core/modules/field/tests/src/Kernel/Boolean/BooleanItemTest.php
index 1c3d9d9c711..8f20fee0896 100644
--- a/core/modules/field/tests/src/Kernel/Boolean/BooleanItemTest.php
+++ b/core/modules/field/tests/src/Kernel/Boolean/BooleanItemTest.php
@@ -48,7 +48,7 @@ class BooleanItemTest extends FieldKernelTestBase {
/**
* Tests using entity fields of the boolean field type.
*/
- public function testBooleanItem() {
+ public function testBooleanItem(): void {
// Verify entity creation.
$entity = EntityTest::create();
$value = '1';
diff --git a/core/modules/field/tests/src/Kernel/BulkDeleteTest.php b/core/modules/field/tests/src/Kernel/BulkDeleteTest.php
index eaa497802ee..2653dc4a2e5 100644
--- a/core/modules/field/tests/src/Kernel/BulkDeleteTest.php
+++ b/core/modules/field/tests/src/Kernel/BulkDeleteTest.php
@@ -166,7 +166,7 @@ class BulkDeleteTest extends FieldKernelTestBase {
* This tests how EntityFieldQuery interacts with field deletion and could be
* moved to FieldCrudTestCase, but depends on this class's setUp().
*/
- public function testDeleteField() {
+ public function testDeleteField(): void {
$bundle = reset($this->bundles);
$field_storage = reset($this->fieldStorages);
$field_name = $field_storage->getName();
@@ -227,7 +227,7 @@ class BulkDeleteTest extends FieldKernelTestBase {
/**
* Tests that recreating a field with the name as a deleted field works.
*/
- public function testPurgeWithDeletedAndActiveField() {
+ public function testPurgeWithDeletedAndActiveField(): void {
$bundle = reset($this->bundles);
// Create another field storage.
$field_name = 'bf_3';
@@ -323,7 +323,7 @@ class BulkDeleteTest extends FieldKernelTestBase {
* Verify that field data items and fields are purged when a field storage is
* deleted.
*/
- public function testPurgeField() {
+ public function testPurgeField(): void {
// Start recording hook invocations.
field_test_memorize();
@@ -384,7 +384,7 @@ class BulkDeleteTest extends FieldKernelTestBase {
* Verify that field storages are preserved and purged correctly as multiple
* fields are deleted and purged.
*/
- public function testPurgeFieldStorage() {
+ public function testPurgeFieldStorage(): void {
// Start recording hook invocations.
field_test_memorize();
diff --git a/core/modules/field/tests/src/Kernel/ConfigFieldDefinitionTest.php b/core/modules/field/tests/src/Kernel/ConfigFieldDefinitionTest.php
index 933adbea9ac..41c46b3e3a8 100644
--- a/core/modules/field/tests/src/Kernel/ConfigFieldDefinitionTest.php
+++ b/core/modules/field/tests/src/Kernel/ConfigFieldDefinitionTest.php
@@ -44,7 +44,7 @@ class ConfigFieldDefinitionTest extends FieldKernelTestBase {
/**
* Makes sure a field definition is exposed for a configurable field.
*/
- public function testBundleFieldDefinition() {
+ public function testBundleFieldDefinition(): void {
$definitions = \Drupal::service('entity_field.manager')->getFieldDefinitions($this->entityType, $this->bundle);
$this->assertTrue(isset($definitions[$this->fieldTestData->field->getName()]));
$this->assertInstanceOf(FieldDefinitionInterface::class, $definitions[$this->fieldTestData->field->getName()]);
@@ -55,7 +55,7 @@ class ConfigFieldDefinitionTest extends FieldKernelTestBase {
/**
* Makes sure a field storage definition is exposed for a configurable field.
*/
- public function testFieldStorageDefinition() {
+ public function testFieldStorageDefinition(): void {
$field_storage_definitions = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions($this->entityType);
$this->assertTrue(isset($field_storage_definitions[$this->fieldTestData->field->getName()]));
$this->assertInstanceOf(FieldStorageDefinitionInterface::class, $field_storage_definitions[$this->fieldTestData->field->getName()]);
diff --git a/core/modules/field/tests/src/Kernel/DisplayApiTest.php b/core/modules/field/tests/src/Kernel/DisplayApiTest.php
index 33df6d7e806..fb4e446cfa2 100644
--- a/core/modules/field/tests/src/Kernel/DisplayApiTest.php
+++ b/core/modules/field/tests/src/Kernel/DisplayApiTest.php
@@ -132,7 +132,7 @@ class DisplayApiTest extends FieldKernelTestBase {
/**
* Tests the FieldItemListInterface::view() method.
*/
- public function testFieldItemListView() {
+ public function testFieldItemListView(): void {
$items = $this->entity->get($this->fieldName);
\Drupal::service('theme_installer')->install(['stark']);
@@ -231,7 +231,7 @@ class DisplayApiTest extends FieldKernelTestBase {
/**
* Tests the FieldItemInterface::view() method.
*/
- public function testFieldItemView() {
+ public function testFieldItemView(): void {
// No display settings: check that default display settings are used.
$settings = \Drupal::service('plugin.manager.field.formatter')->getDefaultSettings('field_test_default');
$setting = $settings['test_formatter_setting'];
@@ -295,7 +295,7 @@ class DisplayApiTest extends FieldKernelTestBase {
/**
* Tests that the prepareView() formatter method still fires for empty values.
*/
- public function testFieldEmpty() {
+ public function testFieldEmpty(): void {
// Uses \Drupal\field_test\Plugin\Field\FieldFormatter\TestFieldEmptyFormatter.
$display = [
'label' => 'hidden',
diff --git a/core/modules/field/tests/src/Kernel/DisplayModeUpdateTest.php b/core/modules/field/tests/src/Kernel/DisplayModeUpdateTest.php
index fa71871db81..473b24ac8ae 100644
--- a/core/modules/field/tests/src/Kernel/DisplayModeUpdateTest.php
+++ b/core/modules/field/tests/src/Kernel/DisplayModeUpdateTest.php
@@ -110,7 +110,7 @@ class DisplayModeUpdateTest extends FieldKernelTestBase {
/**
* Ensure display modes are updated when fields are created.
*/
- public function testDisplayModeUpdateAfterFieldCreation() {
+ public function testDisplayModeUpdateAfterFieldCreation(): void {
// Sanity test: field has not been created yet, so should not exist in display.
$this->assertArrayNotHasKey('field_test', \Drupal::config($this->defaultViewDisplayName)->get('hidden'));
diff --git a/core/modules/field/tests/src/Kernel/Email/EmailItemTest.php b/core/modules/field/tests/src/Kernel/Email/EmailItemTest.php
index 8bdbeafc630..3b80f9333a9 100644
--- a/core/modules/field/tests/src/Kernel/Email/EmailItemTest.php
+++ b/core/modules/field/tests/src/Kernel/Email/EmailItemTest.php
@@ -48,7 +48,7 @@ class EmailItemTest extends FieldKernelTestBase {
/**
* Tests using entity fields of the email field type.
*/
- public function testEmailItem() {
+ public function testEmailItem(): void {
// Verify entity creation.
$entity = EntityTest::create();
$value = 'test@example.com';
diff --git a/core/modules/field/tests/src/Kernel/Entity/Update/SqlContentEntityStorageSchemaColumnTest.php b/core/modules/field/tests/src/Kernel/Entity/Update/SqlContentEntityStorageSchemaColumnTest.php
index 584abc849c8..8fbb3ce637d 100644
--- a/core/modules/field/tests/src/Kernel/Entity/Update/SqlContentEntityStorageSchemaColumnTest.php
+++ b/core/modules/field/tests/src/Kernel/Entity/Update/SqlContentEntityStorageSchemaColumnTest.php
@@ -100,7 +100,7 @@ class SqlContentEntityStorageSchemaColumnTest extends KernelTestBase {
/**
* Tests that column-level schema changes are detected for fields with data.
*/
- public function testColumnUpdate() {
+ public function testColumnUpdate(): void {
// Change the field type in the stored schema.
$schema = \Drupal::keyValue('entity.storage_schema.sql')->get('entity_test_rev.field_schema_data.test');
$schema['entity_test_rev__test']['fields']['test_value']['type'] = 'varchar_ascii';
@@ -117,7 +117,7 @@ class SqlContentEntityStorageSchemaColumnTest extends KernelTestBase {
/**
* Tests that schema changes are updated for fields with data with the flag.
*/
- public function testColumnUpdateWithFlag() {
+ public function testColumnUpdateWithFlag(): void {
// Change the field type in the stored schema.
$schema = \Drupal::keyValue('entity.storage_schema.sql')->get('entity_test_rev.field_schema_data.test');
$schema['entity_test_rev__test']['fields']['test_value']['type'] = 'varchar_ascii';
diff --git a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php
index f6d25969e7a..640b19ae3d5 100644
--- a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php
@@ -129,7 +129,7 @@ class EntityReferenceFormatterTest extends EntityKernelTestBase {
/**
* Assert inaccessible items don't change the data of the fields.
*/
- public function testAccess() {
+ public function testAccess(): void {
// Revoke the 'view test entity' permission for this test.
Role::load(RoleInterface::ANONYMOUS_ID)
->revokePermission('view test entity')
@@ -171,7 +171,7 @@ class EntityReferenceFormatterTest extends EntityKernelTestBase {
/**
* Tests the merging of cache metadata.
*/
- public function testCustomCacheTagFormatter() {
+ public function testCustomCacheTagFormatter(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$formatter = 'entity_reference_custom_cache_tag';
@@ -184,7 +184,7 @@ class EntityReferenceFormatterTest extends EntityKernelTestBase {
/**
* Tests the ID formatter.
*/
- public function testIdFormatter() {
+ public function testIdFormatter(): void {
$formatter = 'entity_reference_entity_id';
$build = $this->buildRenderArray([$this->referencedEntity, $this->unsavedReferencedEntity], $formatter);
@@ -196,7 +196,7 @@ class EntityReferenceFormatterTest extends EntityKernelTestBase {
/**
* Tests the entity formatter.
*/
- public function testEntityFormatter() {
+ public function testEntityFormatter(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$formatter = 'entity_reference_entity_view';
@@ -236,7 +236,7 @@ class EntityReferenceFormatterTest extends EntityKernelTestBase {
/**
* Tests the recursive rendering protection of the entity formatter.
*/
- public function testEntityFormatterRecursiveRendering() {
+ public function testEntityFormatterRecursiveRendering(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$formatter = 'entity_reference_entity_view';
@@ -300,7 +300,7 @@ class EntityReferenceFormatterTest extends EntityKernelTestBase {
/**
* Renders the same entity referenced from different places.
*/
- public function testEntityReferenceRecursiveProtectionWithManyRenderedEntities() {
+ public function testEntityReferenceRecursiveProtectionWithManyRenderedEntities(): void {
$formatter = 'entity_reference_entity_view';
$view_builder = $this->entityTypeManager->getViewBuilder($this->entityType);
@@ -343,7 +343,7 @@ class EntityReferenceFormatterTest extends EntityKernelTestBase {
/**
* Tests the label formatter.
*/
- public function testLabelFormatter() {
+ public function testLabelFormatter(): void {
$this->installEntitySchema('entity_test_label');
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
diff --git a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php
index 96eae7307db..5f23894ee22 100644
--- a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php
+++ b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php
@@ -131,7 +131,7 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
/**
* Tests the entity reference field type for referencing content entities.
*/
- public function testContentEntityReferenceItem() {
+ public function testContentEntityReferenceItem(): void {
$tid = $this->term->id();
// Just being able to create the entity like this verifies a lot of code.
@@ -220,7 +220,7 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
/**
* Tests the ::generateSampleValue() method.
*/
- public function testGenerateSampleValue() {
+ public function testGenerateSampleValue(): void {
$entity = EntityTest::create();
// Test while a term exists.
@@ -238,7 +238,7 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
/**
* Tests the ::generateSampleValue() method when it has a circular reference.
*/
- public function testGenerateSampleValueCircularReference() {
+ public function testGenerateSampleValueCircularReference(): void {
// Delete the existing entity.
$this->entityStringId->delete();
@@ -251,7 +251,7 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
/**
* Tests referencing content entities with string IDs.
*/
- public function testContentEntityReferenceItemWithStringId() {
+ public function testContentEntityReferenceItemWithStringId(): void {
$entity = EntityTest::create();
$entity->field_test_entity_test_string_id->target_id = $this->entityStringId->id();
$entity->save();
@@ -267,7 +267,7 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
/**
* Tests the entity reference field type for referencing config entities.
*/
- public function testConfigEntityReferenceItem() {
+ public function testConfigEntityReferenceItem(): void {
$referenced_entity_id = $this->vocabulary->id();
// Just being able to create the entity like this verifies a lot of code.
@@ -314,7 +314,7 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
/**
* Tests entity auto create.
*/
- public function testEntityAutoCreate() {
+ public function testEntityAutoCreate(): void {
// The term entity is unsaved here.
$term = Term::create([
'name' => $this->randomMachineName(),
@@ -338,7 +338,7 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
/**
* Tests saving order sequence doesn't matter.
*/
- public function testEntitySaveOrder() {
+ public function testEntitySaveOrder(): void {
// The term entity is unsaved here.
$term = Term::create([
'name' => $this->randomMachineName(),
@@ -365,7 +365,7 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
/**
* Tests that the 'handler' field setting stores the proper plugin ID.
*/
- public function testSelectionHandlerSettings() {
+ public function testSelectionHandlerSettings(): void {
$field_name = $this->randomMachineName();
$field_storage = FieldStorageConfig::create([
'field_name' => $field_name,
@@ -422,7 +422,7 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
/**
* Tests ValidReferenceConstraint with newly created and unsaved entities.
*/
- public function testAutocreateValidation() {
+ public function testAutocreateValidation(): void {
// The term entity is unsaved here.
$term = Term::create([
'name' => $this->randomMachineName(),
diff --git a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php
index 39cef2ebd64..b52bb98957d 100644
--- a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php
+++ b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php
@@ -90,7 +90,7 @@ class EntityReferenceSettingsTest extends KernelTestBase {
/**
* Tests that config bundle deletions are mirrored in field config settings.
*/
- public function testConfigTargetBundleDeletion() {
+ public function testConfigTargetBundleDeletion(): void {
// Create two vocabularies.
/** @var \Drupal\taxonomy\Entity\Vocabulary[] $vocabularies */
$vocabularies = [];
@@ -150,7 +150,7 @@ class EntityReferenceSettingsTest extends KernelTestBase {
/**
* Tests that deletions of custom bundles are mirrored in field settings.
*/
- public function testCustomTargetBundleDeletion() {
+ public function testCustomTargetBundleDeletion(): void {
// Attach an entity reference field to $this->nodeType.
$name = $this->randomMachineName();
$label = $this->randomString();
diff --git a/core/modules/field/tests/src/Kernel/EntityReference/Views/EntityReferenceRelationshipTest.php b/core/modules/field/tests/src/Kernel/EntityReference/Views/EntityReferenceRelationshipTest.php
index bfa42e40877..9c29942da67 100644
--- a/core/modules/field/tests/src/Kernel/EntityReference/Views/EntityReferenceRelationshipTest.php
+++ b/core/modules/field/tests/src/Kernel/EntityReference/Views/EntityReferenceRelationshipTest.php
@@ -91,7 +91,7 @@ class EntityReferenceRelationshipTest extends ViewsKernelTestBase {
/**
* Tests using the views relationship.
*/
- public function testNoDataTableRelationship() {
+ public function testNoDataTableRelationship(): void {
// Create some test entities which link each other.
$referenced_entity = EntityTestMul::create();
@@ -171,7 +171,7 @@ class EntityReferenceRelationshipTest extends ViewsKernelTestBase {
*
* @see entity_reference_field_views_data()
*/
- public function testDataTableRelationship() {
+ public function testDataTableRelationship(): void {
// Create some test entities which link each other.
$referenced_entity = EntityTest::create();
@@ -252,7 +252,7 @@ class EntityReferenceRelationshipTest extends ViewsKernelTestBase {
*
* @see entity_reference_field_views_data()
*/
- public function testDataTableRelationshipWithLongFieldName() {
+ public function testDataTableRelationshipWithLongFieldName(): void {
// Create some test entities which link each other.
$referenced_entity = EntityTest::create();
$referenced_entity->save();
@@ -293,7 +293,7 @@ class EntityReferenceRelationshipTest extends ViewsKernelTestBase {
/**
* Tests group by with optional and empty relationship.
*/
- public function testGroupByWithEmptyRelationships() {
+ public function testGroupByWithEmptyRelationships(): void {
$entities = [];
// Create 4 entities with name1 and 3 entities with name2.
for ($i = 1; $i <= 4; $i++) {
@@ -354,7 +354,7 @@ class EntityReferenceRelationshipTest extends ViewsKernelTestBase {
/**
* Test that config entities don't get relationships added.
*/
- public function testEntityReferenceConfigEntity() {
+ public function testEntityReferenceConfigEntity(): void {
// Create reference from entity_test to a config entity.
$this->createEntityReferenceField('entity_test', 'entity_test', 'field_test_config_entity', 'field_test_config_entity', 'user_role');
Views::viewsData()->clear();
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 7ea1311ef70..2ba0b7ae0d6 100644
--- a/core/modules/field/tests/src/Kernel/EntityReference/Views/SelectionTest.php
+++ b/core/modules/field/tests/src/Kernel/EntityReference/Views/SelectionTest.php
@@ -94,7 +94,7 @@ class SelectionTest extends KernelTestBase {
/**
* Tests the selection handler.
*/
- public function testSelectionHandler() {
+ public function testSelectionHandler(): void {
// Tests the selection handler.
$this->assertResults($this->selectionHandler->getReferenceableEntities());
@@ -139,7 +139,7 @@ class SelectionTest extends KernelTestBase {
* If we expect our output to not have the <a> tags, and this matches what's
* produced by the tag-stripping method, we'll know that it's working.
*/
- public function testAnchorTagStripping() {
+ public function testAnchorTagStripping(): void {
$filtered_rendered_results_formatted = [];
foreach ($this->selectionHandler->getReferenceableEntities() as $subresults) {
$filtered_rendered_results_formatted += array_map(fn(MarkupInterface $markup): string => (string) $markup, $subresults);
diff --git a/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php b/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php
index e68d874f617..fffd2a500ef 100644
--- a/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php
@@ -27,7 +27,7 @@ class FieldAttachOtherTest extends FieldKernelTestBase {
/**
* Tests rendering fields with EntityDisplay build().
*/
- public function testEntityDisplayBuild() {
+ public function testEntityDisplayBuild(): void {
$this->createFieldWithStorage('_2');
$entity_type = 'entity_test';
@@ -137,7 +137,7 @@ class FieldAttachOtherTest extends FieldKernelTestBase {
/**
* Tests rendering fields with EntityDisplay::buildMultiple().
*/
- public function testEntityDisplayViewMultiple() {
+ public function testEntityDisplayViewMultiple(): void {
// Use a formatter that has a prepareView() step.
$display = \Drupal::service('entity_display.repository')
->getViewDisplay('entity_test', 'entity_test', 'full')
@@ -165,7 +165,7 @@ class FieldAttachOtherTest extends FieldKernelTestBase {
* Complements unit test coverage in
* \Drupal\Tests\Core\Entity\Sql\SqlContentEntityStorageTest.
*/
- public function testEntityCache() {
+ public function testEntityCache(): void {
// Initialize random values and a test entity.
$entity_init = EntityTest::create(['type' => $this->fieldTestData->field->getTargetBundle()]);
$values = $this->_generateTestFieldValues($this->fieldTestData->field_storage->getCardinality());
@@ -248,7 +248,7 @@ class FieldAttachOtherTest extends FieldKernelTestBase {
* This could be much more thorough, but it does verify that the correct
* widgets show up.
*/
- public function testEntityFormDisplayBuildForm() {
+ public function testEntityFormDisplayBuildForm(): void {
$this->createFieldWithStorage('_2');
$entity_type = 'entity_test';
@@ -300,7 +300,7 @@ class FieldAttachOtherTest extends FieldKernelTestBase {
/**
* Tests \Drupal\Core\Entity\Display\EntityFormDisplayInterface::extractFormValues().
*/
- public function testEntityFormDisplayExtractFormValues() {
+ public function testEntityFormDisplayExtractFormValues(): void {
$this->createFieldWithStorage('_2');
$entity_type = 'entity_test';
diff --git a/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php b/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php
index 1bb91b4aabf..e72cae7c29e 100644
--- a/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php
@@ -29,7 +29,7 @@ class FieldAttachStorageTest extends FieldKernelTestBase {
* Works independently of the underlying field storage backend. Inserts or
* updates random field data and then loads and verifies the data.
*/
- public function testFieldAttachSaveLoad() {
+ public function testFieldAttachSaveLoad(): void {
$entity_type = 'entity_test_rev';
$this->createFieldWithStorage('', $entity_type);
$cardinality = $this->fieldTestData->field_storage->getCardinality();
@@ -78,7 +78,7 @@ class FieldAttachStorageTest extends FieldKernelTestBase {
/**
* Tests the 'multiple' load feature.
*/
- public function testFieldAttachLoadMultiple() {
+ public function testFieldAttachLoadMultiple(): void {
$entity_type = 'entity_test_rev';
// Define 2 bundles.
@@ -149,7 +149,7 @@ class FieldAttachStorageTest extends FieldKernelTestBase {
/**
* Tests insert and update with empty or NULL fields.
*/
- public function testFieldAttachSaveEmptyData() {
+ public function testFieldAttachSaveEmptyData(): void {
$entity_type = 'entity_test';
$this->createFieldWithStorage('', $entity_type);
@@ -197,7 +197,7 @@ class FieldAttachStorageTest extends FieldKernelTestBase {
/**
* Tests insert with empty or NULL fields, with default value.
*/
- public function testFieldAttachSaveEmptyDataDefaultValue() {
+ public function testFieldAttachSaveEmptyDataDefaultValue(): void {
$entity_type = 'entity_test_rev';
$this->createFieldWithStorage('', $entity_type);
@@ -230,7 +230,7 @@ class FieldAttachStorageTest extends FieldKernelTestBase {
/**
* Tests entity deletion.
*/
- public function testFieldAttachDelete() {
+ public function testFieldAttachDelete(): void {
$entity_type = 'entity_test_rev';
$this->createFieldWithStorage('', $entity_type);
$cardinality = $this->fieldTestData->field_storage->getCardinality();
@@ -291,7 +291,7 @@ class FieldAttachStorageTest extends FieldKernelTestBase {
/**
* Tests entity_bundle_create().
*/
- public function testEntityCreateBundle() {
+ public function testEntityCreateBundle(): void {
$entity_type = 'entity_test_rev';
$this->createFieldWithStorage('', $entity_type);
$cardinality = $this->fieldTestData->field_storage->getCardinality();
@@ -319,7 +319,7 @@ class FieldAttachStorageTest extends FieldKernelTestBase {
/**
* Tests entity_bundle_delete().
*/
- public function testEntityDeleteBundle() {
+ public function testEntityDeleteBundle(): void {
$entity_type = 'entity_test_rev';
$this->createFieldWithStorage('', $entity_type);
diff --git a/core/modules/field/tests/src/Kernel/FieldCrudTest.php b/core/modules/field/tests/src/Kernel/FieldCrudTest.php
index e95f8c56468..57ebe04bf31 100644
--- a/core/modules/field/tests/src/Kernel/FieldCrudTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldCrudTest.php
@@ -69,7 +69,7 @@ class FieldCrudTest extends FieldKernelTestBase {
/**
* Tests the creation of a field.
*/
- public function testCreateField() {
+ public function testCreateField(): void {
$field = FieldConfig::create($this->fieldDefinition);
$field->save();
@@ -130,7 +130,7 @@ class FieldCrudTest extends FieldKernelTestBase {
* @covers ::setPropertyConstraints
* @covers ::addPropertyConstraints
*/
- public function testFieldPropertyConstraints() {
+ public function testFieldPropertyConstraints(): void {
$field = FieldConfig::create($this->fieldDefinition);
$field->save();
$field_name = $this->fieldStorage->getName();
@@ -202,7 +202,7 @@ class FieldCrudTest extends FieldKernelTestBase {
/**
* Tests creating a field with custom storage set.
*/
- public function testCreateFieldCustomStorage() {
+ public function testCreateFieldCustomStorage(): void {
$field_name = $this->randomMachineName();
\Drupal::state()->set('field_test_custom_storage', $field_name);
@@ -240,7 +240,7 @@ class FieldCrudTest extends FieldKernelTestBase {
/**
* Tests reading back a field definition.
*/
- public function testReadField() {
+ public function testReadField(): void {
FieldConfig::create($this->fieldDefinition)->save();
// Read the field back.
@@ -253,7 +253,7 @@ class FieldCrudTest extends FieldKernelTestBase {
/**
* Tests the update of a field.
*/
- public function testUpdateField() {
+ public function testUpdateField(): void {
FieldConfig::create($this->fieldDefinition)->save();
// Check that basic changes are saved.
@@ -275,7 +275,7 @@ class FieldCrudTest extends FieldKernelTestBase {
/**
* Tests the deletion of a field with no data.
*/
- public function testDeleteFieldNoData() {
+ public function testDeleteFieldNoData(): void {
// Deleting and purging fields with data is tested in
// \Drupal\Tests\field\Kernel\BulkDeleteTest.
@@ -309,7 +309,7 @@ class FieldCrudTest extends FieldKernelTestBase {
/**
* Tests the cross deletion behavior between field storages and fields.
*/
- public function testDeleteFieldCrossDeletion() {
+ public function testDeleteFieldCrossDeletion(): void {
$field_definition_2 = $this->fieldDefinition;
$field_definition_2['bundle'] .= '_another_bundle';
entity_test_create_bundle($field_definition_2['bundle']);
diff --git a/core/modules/field/tests/src/Kernel/FieldDataCountTest.php b/core/modules/field/tests/src/Kernel/FieldDataCountTest.php
index 8dc4f61950f..5de98028c45 100644
--- a/core/modules/field/tests/src/Kernel/FieldDataCountTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldDataCountTest.php
@@ -48,7 +48,7 @@ class FieldDataCountTest extends FieldKernelTestBase {
/**
* Tests entityCount() and hadData() methods.
*/
- public function testEntityCountAndHasData() {
+ public function testEntityCountAndHasData(): void {
// Create a field with a cardinality of 2 to show that we are counting
// entities and not rows in a table.
/** @var \Drupal\field\Entity\FieldStorageConfig $field_storage */
@@ -146,7 +146,7 @@ class FieldDataCountTest extends FieldKernelTestBase {
/**
* Verify that we can count a table that contains an entry with index 0.
*/
- public function testCountWithIndex0() {
+ public function testCountWithIndex0(): void {
// Create a field that will require dedicated storage.
/** @var \Drupal\field\Entity\FieldStorageConfig $field_storage */
$field_storage = FieldStorageConfig::create([
diff --git a/core/modules/field/tests/src/Kernel/FieldDefinitionIntegrityTest.php b/core/modules/field/tests/src/Kernel/FieldDefinitionIntegrityTest.php
index 8089374ee27..c453aba24bf 100644
--- a/core/modules/field/tests/src/Kernel/FieldDefinitionIntegrityTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldDefinitionIntegrityTest.php
@@ -27,7 +27,7 @@ class FieldDefinitionIntegrityTest extends KernelTestBase {
/**
* Tests the integrity of field plugin definitions.
*/
- public function testFieldPluginDefinitionIntegrity() {
+ public function testFieldPluginDefinitionIntegrity(): void {
// Enable all core modules that provide field plugins, and their
// dependencies.
$this->enableModules(
@@ -92,7 +92,7 @@ class FieldDefinitionIntegrityTest extends KernelTestBase {
/**
* Tests to load field plugin definitions used in core's existing entities.
*/
- public function testFieldPluginDefinitionAvailability() {
+ public function testFieldPluginDefinitionAvailability(): void {
$this->enableModules(
$this->modulesWithSubdirectory('src' . DIRECTORY_SEPARATOR . 'Entity')
);
diff --git a/core/modules/field/tests/src/Kernel/FieldDisplayTest.php b/core/modules/field/tests/src/Kernel/FieldDisplayTest.php
index 0dd66a50c71..a73bf5ee810 100644
--- a/core/modules/field/tests/src/Kernel/FieldDisplayTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldDisplayTest.php
@@ -101,7 +101,7 @@ class FieldDisplayTest extends KernelTestBase {
/**
* Tests that visually hidden works with core.
*/
- public function testFieldVisualHidden() {
+ public function testFieldVisualHidden(): void {
$value = $this->randomMachineName();
// Set the formatter to link to the entity.
diff --git a/core/modules/field/tests/src/Kernel/FieldFormatterTest.php b/core/modules/field/tests/src/Kernel/FieldFormatterTest.php
index 7755d4c5889..3d34a77d5fb 100644
--- a/core/modules/field/tests/src/Kernel/FieldFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldFormatterTest.php
@@ -87,7 +87,7 @@ class FieldFormatterTest extends KernelTestBase {
/**
* Tests availability of third party settings in field render arrays.
*/
- public function testThirdPartySettings() {
+ public function testThirdPartySettings(): void {
$third_party_settings = [
'field_test' => [
'foo' => 'bar',
diff --git a/core/modules/field/tests/src/Kernel/FieldImportChangeTest.php b/core/modules/field/tests/src/Kernel/FieldImportChangeTest.php
index 3bb49e37c1b..d1f328dd293 100644
--- a/core/modules/field/tests/src/Kernel/FieldImportChangeTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldImportChangeTest.php
@@ -27,7 +27,7 @@ class FieldImportChangeTest extends FieldKernelTestBase {
/**
* Tests importing an updated field.
*/
- public function testImportChange() {
+ public function testImportChange(): void {
entity_test_create_bundle('test_bundle');
$this->installConfig(['field_test_config']);
diff --git a/core/modules/field/tests/src/Kernel/FieldImportCreateTest.php b/core/modules/field/tests/src/Kernel/FieldImportCreateTest.php
index bbc13945b67..4848a29a076 100644
--- a/core/modules/field/tests/src/Kernel/FieldImportCreateTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldImportCreateTest.php
@@ -18,7 +18,7 @@ class FieldImportCreateTest extends FieldKernelTestBase {
/**
* Tests creating field storages and fields during default config import.
*/
- public function testImportCreateDefault() {
+ public function testImportCreateDefault(): void {
$field_name = 'field_test_import';
$field_storage_id = "entity_test.$field_name";
$field_id = "entity_test.entity_test.$field_name";
@@ -74,7 +74,7 @@ class FieldImportCreateTest extends FieldKernelTestBase {
/**
* Tests creating field storages and fields during config import.
*/
- public function testImportCreate() {
+ public function testImportCreate(): void {
// A field storage with one single field.
$field_name = 'field_test_import_sync';
$field_storage_id = "entity_test.$field_name";
diff --git a/core/modules/field/tests/src/Kernel/FieldImportDeleteTest.php b/core/modules/field/tests/src/Kernel/FieldImportDeleteTest.php
index 9dc6f0af9e9..13ebe5166bd 100644
--- a/core/modules/field/tests/src/Kernel/FieldImportDeleteTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldImportDeleteTest.php
@@ -29,7 +29,7 @@ class FieldImportDeleteTest extends FieldKernelTestBase {
/**
* Tests deleting field storages and fields as part of config import.
*/
- public function testImportDelete() {
+ public function testImportDelete(): void {
entity_test_create_bundle('test_bundle');
$this->installConfig(['field_test_config']);
diff --git a/core/modules/field/tests/src/Kernel/FieldImportDeleteUninstallTest.php b/core/modules/field/tests/src/Kernel/FieldImportDeleteUninstallTest.php
index 517cb85ea3c..44eabcbfa9a 100644
--- a/core/modules/field/tests/src/Kernel/FieldImportDeleteUninstallTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldImportDeleteUninstallTest.php
@@ -38,7 +38,7 @@ class FieldImportDeleteUninstallTest extends FieldKernelTestBase {
/**
* Tests deleting field storages and fields as part of config import.
*/
- public function testImportDeleteUninstall() {
+ public function testImportDeleteUninstall(): void {
// Create a field to delete to prove that
// \Drupal\field\ConfigImporterFieldPurger does not purge fields that are
// not related to the configuration synchronization.
@@ -113,7 +113,7 @@ class FieldImportDeleteUninstallTest extends FieldKernelTestBase {
/**
* Tests purging previously deleted fields and storages in config import.
*/
- public function testImportAlreadyDeletedUninstall() {
+ public function testImportAlreadyDeletedUninstall(): void {
// Create a telephone field for validation.
$field_storage = FieldStorageConfig::create([
'field_name' => 'field_test',
diff --git a/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php b/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php
index ce9900e248d..683602c2e71 100644
--- a/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php
@@ -34,7 +34,7 @@ class FieldStorageCrudTest extends FieldKernelTestBase {
/**
* Tests the creation of a field storage.
*/
- public function testCreate() {
+ public function testCreate(): void {
$field_storage_definition = [
'field_name' => 'field_2',
'entity_type' => 'entity_test',
@@ -189,7 +189,7 @@ class FieldStorageCrudTest extends FieldKernelTestBase {
* This behavior is needed to allow field storage creation within updates,
* since plugin classes (and thus the field type schema) cannot be accessed.
*/
- public function testCreateWithExplicitSchema() {
+ public function testCreateWithExplicitSchema(): void {
$schema = [
'dummy' => 'foobar',
];
@@ -205,7 +205,7 @@ class FieldStorageCrudTest extends FieldKernelTestBase {
/**
* Tests reading field storage definitions.
*/
- public function testRead() {
+ public function testRead(): void {
$field_storage_definition = [
'field_name' => 'field_1',
'entity_type' => 'entity_test',
@@ -244,7 +244,7 @@ class FieldStorageCrudTest extends FieldKernelTestBase {
/**
* Tests creation of indexes on data column.
*/
- public function testIndexes() {
+ public function testIndexes(): void {
// Check that indexes specified by the field type are used by default.
$field_storage = FieldStorageConfig::create([
'field_name' => 'field_1',
@@ -294,7 +294,7 @@ class FieldStorageCrudTest extends FieldKernelTestBase {
/**
* Tests the deletion of a field storage.
*/
- public function testDeleteNoData() {
+ public function testDeleteNoData(): void {
// Deleting and purging field storages with data is tested in
// \Drupal\Tests\field\Kernel\BulkDeleteTest.
@@ -374,7 +374,7 @@ class FieldStorageCrudTest extends FieldKernelTestBase {
}
}
- public function testUpdateFieldType() {
+ public function testUpdateFieldType(): void {
$field_storage = FieldStorageConfig::create([
'field_name' => 'field_type',
'entity_type' => 'entity_test',
@@ -395,7 +395,7 @@ class FieldStorageCrudTest extends FieldKernelTestBase {
/**
* Tests changing a field storage type.
*/
- public function testUpdateEntityType() {
+ public function testUpdateEntityType(): void {
$field_storage = FieldStorageConfig::create([
'field_name' => 'field_type',
'entity_type' => 'entity_test',
@@ -413,7 +413,7 @@ class FieldStorageCrudTest extends FieldKernelTestBase {
/**
* Tests changing a field storage entity type.
*/
- public function testUpdateEntityTargetType() {
+ public function testUpdateEntityTargetType(): void {
$field_storage = FieldStorageConfig::create([
'field_name' => 'field_type',
'entity_type' => 'entity_test',
@@ -431,7 +431,7 @@ class FieldStorageCrudTest extends FieldKernelTestBase {
/**
* Tests updating a field storage.
*/
- public function testUpdate() {
+ public function testUpdate(): void {
// Create a field with a defined cardinality, so that we can ensure it's
// respected. Since cardinality enforcement is consistent across database
// systems, it makes a good test case.
@@ -473,7 +473,7 @@ class FieldStorageCrudTest extends FieldKernelTestBase {
/**
* Tests field type modules forbidding an update.
*/
- public function testUpdateForbid() {
+ public function testUpdateForbid(): void {
$field_storage = FieldStorageConfig::create([
'field_name' => 'forbidden',
'entity_type' => 'entity_test',
diff --git a/core/modules/field/tests/src/Kernel/FieldTypeCategoryDiscoveryTest.php b/core/modules/field/tests/src/Kernel/FieldTypeCategoryDiscoveryTest.php
index 9afb4f64a23..317460c8624 100644
--- a/core/modules/field/tests/src/Kernel/FieldTypeCategoryDiscoveryTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldTypeCategoryDiscoveryTest.php
@@ -25,7 +25,7 @@ class FieldTypeCategoryDiscoveryTest extends KernelTestBase {
/**
* Tests custom field type categories created by modules.
*/
- public function testFieldTypeCategories() {
+ public function testFieldTypeCategories(): void {
$category = \Drupal::service('plugin.manager.field.field_type_category')->createInstance('test_category');
$expected = [
'Test category',
diff --git a/core/modules/field/tests/src/Kernel/FieldTypePluginManagerTest.php b/core/modules/field/tests/src/Kernel/FieldTypePluginManagerTest.php
index c356e900d8d..fec0c06148d 100644
--- a/core/modules/field/tests/src/Kernel/FieldTypePluginManagerTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldTypePluginManagerTest.php
@@ -18,7 +18,7 @@ class FieldTypePluginManagerTest extends FieldKernelTestBase {
/**
* Tests the default settings convenience methods.
*/
- public function testDefaultSettings() {
+ public function testDefaultSettings(): void {
$field_type_manager = \Drupal::service('plugin.manager.field.field_type');
foreach (['test_field', 'shape', 'hidden_test_field'] as $type) {
$definition = $field_type_manager->getDefinition($type);
@@ -30,7 +30,7 @@ class FieldTypePluginManagerTest extends FieldKernelTestBase {
/**
* Tests creation of field item instances.
*/
- public function testCreateInstance() {
+ public function testCreateInstance(): void {
/** @var \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager */
$field_type_manager = \Drupal::service('plugin.manager.field.field_type');
foreach (['test_field', 'shape', 'hidden_test_field'] as $type) {
@@ -57,7 +57,7 @@ class FieldTypePluginManagerTest extends FieldKernelTestBase {
/**
* Tests creation of field item instances.
*/
- public function testCreateInstanceWithConfig() {
+ public function testCreateInstanceWithConfig(): void {
/** @var \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager */
$field_type_manager = \Drupal::service('plugin.manager.field.field_type');
$type = 'test_field';
@@ -89,7 +89,7 @@ class FieldTypePluginManagerTest extends FieldKernelTestBase {
/**
* Tests all field items provide an existing main property.
*/
- public function testMainProperty() {
+ public function testMainProperty(): void {
// Let's enable all Drupal modules in Drupal core, so we test any field
// type plugin.
$this->enableAllCoreModules();
@@ -115,7 +115,7 @@ class FieldTypePluginManagerTest extends FieldKernelTestBase {
/**
* Tests UI definitions per entity type.
*/
- public function testUiDefinitionsPerEntityType() {
+ public function testUiDefinitionsPerEntityType(): void {
/** @var \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager */
$field_type_manager = \Drupal::service('plugin.manager.field.field_type');
$definitions = $field_type_manager->getEntityTypeUiDefinitions('node');
diff --git a/core/modules/field/tests/src/Kernel/FieldValidationTest.php b/core/modules/field/tests/src/Kernel/FieldValidationTest.php
index dd31a4d6ad8..83c6f44351c 100644
--- a/core/modules/field/tests/src/Kernel/FieldValidationTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldValidationTest.php
@@ -47,7 +47,7 @@ class FieldValidationTest extends FieldKernelTestBase {
/**
* Tests that the number of values is validated against the field cardinality.
*/
- public function testCardinalityConstraint() {
+ public function testCardinalityConstraint(): void {
$cardinality = $this->fieldTestData->field_storage->getCardinality();
$entity = $this->entity;
@@ -67,7 +67,7 @@ class FieldValidationTest extends FieldKernelTestBase {
/**
* Tests that constraints defined by the field type are validated.
*/
- public function testFieldConstraints() {
+ public function testFieldConstraints(): void {
$cardinality = $this->fieldTestData->field_storage->getCardinality();
$entity = $this->entity;
diff --git a/core/modules/field/tests/src/Kernel/FormatterPluginManagerTest.php b/core/modules/field/tests/src/Kernel/FormatterPluginManagerTest.php
index 7d2717cd548..06b4654541e 100644
--- a/core/modules/field/tests/src/Kernel/FormatterPluginManagerTest.php
+++ b/core/modules/field/tests/src/Kernel/FormatterPluginManagerTest.php
@@ -18,7 +18,7 @@ class FormatterPluginManagerTest extends FieldKernelTestBase {
*
* @see \Drupal\field\Tests\WidgetPluginManagerTest::testNotApplicableFallback()
*/
- public function testNotApplicableFallback() {
+ public function testNotApplicableFallback(): void {
/** @var \Drupal\Core\Field\FormatterPluginManager $formatter_plugin_manager */
$formatter_plugin_manager = \Drupal::service('plugin.manager.field.formatter');
diff --git a/core/modules/field/tests/src/Kernel/KernelString/RawStringFormatterTest.php b/core/modules/field/tests/src/Kernel/KernelString/RawStringFormatterTest.php
index 7c9fdc24ba9..f57a25e4b6a 100644
--- a/core/modules/field/tests/src/Kernel/KernelString/RawStringFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/KernelString/RawStringFormatterTest.php
@@ -109,7 +109,7 @@ class RawStringFormatterTest extends KernelTestBase {
/**
* Tests string formatter output.
*/
- public function testStringFormatter() {
+ public function testStringFormatter(): void {
$value = $this->randomString();
$value .= "\n\n<strong>" . $this->randomString() . '</strong>';
$value .= "\n\n" . $this->randomString();
diff --git a/core/modules/field/tests/src/Kernel/KernelString/StringFormatterTest.php b/core/modules/field/tests/src/Kernel/KernelString/StringFormatterTest.php
index b9395cc4b5e..6c55462e257 100644
--- a/core/modules/field/tests/src/Kernel/KernelString/StringFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/KernelString/StringFormatterTest.php
@@ -121,7 +121,7 @@ class StringFormatterTest extends KernelTestBase {
/**
* Tests string formatter output.
*/
- public function testStringFormatter() {
+ public function testStringFormatter(): void {
$value = $this->randomString();
$value .= "\n\n<strong>" . $this->randomString() . '</strong>';
$value .= "\n\n" . $this->randomString();
@@ -194,7 +194,7 @@ class StringFormatterTest extends KernelTestBase {
/**
* Test "link_to_entity" feature on fields which are added to config entity.
*/
- public function testLinkToContentForEntitiesWithNoCanonicalPath() {
+ public function testLinkToContentForEntitiesWithNoCanonicalPath(): void {
$this->enableModules(['entity_test']);
$field_name = 'test_field_name';
$entity_type = $bundle = 'entity_test_label';
diff --git a/core/modules/field/tests/src/Kernel/KernelString/UuidFormatterTest.php b/core/modules/field/tests/src/Kernel/KernelString/UuidFormatterTest.php
index f4013e66ea6..4ad35a1303e 100644
--- a/core/modules/field/tests/src/Kernel/KernelString/UuidFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/KernelString/UuidFormatterTest.php
@@ -35,7 +35,7 @@ class UuidFormatterTest extends KernelTestBase {
/**
* Tests string formatter output.
*/
- public function testUuidStringFormatter() {
+ public function testUuidStringFormatter(): void {
$entity = EntityTest::create([]);
$entity->save();
diff --git a/core/modules/field/tests/src/Kernel/KernelString/UuidItemTest.php b/core/modules/field/tests/src/Kernel/KernelString/UuidItemTest.php
index 1009c4b65a5..68cab88881d 100644
--- a/core/modules/field/tests/src/Kernel/KernelString/UuidItemTest.php
+++ b/core/modules/field/tests/src/Kernel/KernelString/UuidItemTest.php
@@ -18,7 +18,7 @@ class UuidItemTest extends FieldKernelTestBase {
/**
* Tests 'uuid' random values.
*/
- public function testSampleValue() {
+ public function testSampleValue(): void {
$entity = EntityTest::create([]);
$entity->save();
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 2000ef2addd..c2955f2d112 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldFormatterSettingsTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldFormatterSettingsTest.php
@@ -47,7 +47,7 @@ class MigrateFieldFormatterSettingsTest extends MigrateDrupal6TestBase {
/**
* Tests that migrated entity display settings can be loaded using D8 API's.
*/
- public function testEntityDisplaySettings() {
+ public function testEntityDisplaySettings(): void {
// Run tests.
$field_name = "field_test";
$expected = [
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceLabelDescriptionTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceLabelDescriptionTest.php
index 935ef567f78..62114c591f7 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceLabelDescriptionTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceLabelDescriptionTest.php
@@ -59,7 +59,7 @@ class MigrateFieldInstanceLabelDescriptionTest extends MigrateDrupal6TestBase im
/**
* Tests migration of field label and description translations.
*/
- public function testFieldInstanceLabelDescriptionTranslationMigration() {
+ public function testFieldInstanceLabelDescriptionTranslationMigration(): void {
$language_manager = $this->container->get('language_manager');
// Tests fields on 'story' node type.
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceOptionTranslationTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceOptionTranslationTest.php
index 0c2d9fbc9b7..b3eaccf1a0a 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceOptionTranslationTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceOptionTranslationTest.php
@@ -42,7 +42,7 @@ class MigrateFieldInstanceOptionTranslationTest extends MigrateDrupal6TestBase {
/**
* Tests migration of file variables to file.settings.yml.
*/
- public function testFieldInstanceOptionTranslation() {
+ public function testFieldInstanceOptionTranslation(): void {
$language_manager = $this->container->get('language_manager');
/** @var \Drupal\language\Config\LanguageConfigOverride $config_translation */
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceTest.php
index 6ca40283739..e85f216de1c 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceTest.php
@@ -24,7 +24,7 @@ class MigrateFieldInstanceTest extends MigrateDrupal6TestBase {
/**
* Tests migration of file variables to file.settings.yml.
*/
- public function testFieldInstanceMigration() {
+ public function testFieldInstanceMigration(): void {
$this->migrateFields();
$this->installConfig(['comment']);
$this->executeMigration('d6_comment_type');
@@ -179,7 +179,7 @@ class MigrateFieldInstanceTest extends MigrateDrupal6TestBase {
/**
* Tests migrating fields into non-existent content types.
*/
- public function testMigrateFieldIntoUnknownNodeType() {
+ public function testMigrateFieldIntoUnknownNodeType(): void {
$this->sourceDatabase->delete('node_type')
->condition('type', 'test_planet')
->execute();
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldOptionTranslationTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldOptionTranslationTest.php
index 4f2223d888c..8a06b183df0 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldOptionTranslationTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldOptionTranslationTest.php
@@ -38,7 +38,7 @@ class MigrateFieldOptionTranslationTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 field to Drupal 8 migration.
*/
- public function testFieldOptionTranslation() {
+ public function testFieldOptionTranslation(): void {
$language_manager = $this->container->get('language_manager');
// Test a select list with allowed values of key only.
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldTest.php
index 7b01ce525be..789fac2fab3 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldTest.php
@@ -25,7 +25,7 @@ class MigrateFieldTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 field to Drupal 8 migration.
*/
- public function testFields() {
+ public function testFields(): void {
// Text field.
/** @var \Drupal\field\Entity\FieldStorageConfig $field_storage */
$field_storage = FieldStorageConfig::load('node.field_test');
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php
index 3ef3b6a6f41..6e2bf60c00c 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php
@@ -32,7 +32,7 @@ class MigrateFieldWidgetSettingsTest extends MigrateDrupal6TestBase {
/**
* Tests that migrated view modes can be loaded using D8 API's.
*/
- public function testWidgetSettings() {
+ public function testWidgetSettings(): void {
// Test the config can be loaded.
$form_display = EntityFormDisplay::load('node.story.default');
$this->assertNotNull($form_display);
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 867b612a052..ad426e82865 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php
@@ -95,7 +95,7 @@ class MigrateFieldFormatterSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests migration of D7 field formatter settings.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertEntity('comment.comment_node_article.default');
$this->assertComponent('comment.comment_node_article.default', 'comment_body', 'text_default', 'hidden', 0);
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceLabelDescriptionTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceLabelDescriptionTest.php
index 0ff526cd546..191ee44a869 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceLabelDescriptionTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceLabelDescriptionTest.php
@@ -78,7 +78,7 @@ class MigrateFieldInstanceLabelDescriptionTest extends MigrateDrupal7TestBase im
/**
* Tests migration of file variables to file.settings.yml.
*/
- public function testFieldInstanceLabelDescriptionTranslationMigration() {
+ public function testFieldInstanceLabelDescriptionTranslationMigration(): void {
$language_manager = $this->container->get('language_manager');
// Check that the deleted field with translations was skipped.
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceOptionTranslationTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceOptionTranslationTest.php
index 8e3c4723416..4dc437991d6 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceOptionTranslationTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceOptionTranslationTest.php
@@ -51,7 +51,7 @@ class MigrateFieldInstanceOptionTranslationTest extends MigrateDrupal7TestBase {
/**
* Migrate field instance option translations.
*/
- public function testFieldInstanceOptionTranslation() {
+ public function testFieldInstanceOptionTranslation(): void {
$language_manager = $this->container->get('language_manager');
/** @var \Drupal\language\Config\LanguageConfigOverride $config_translation */
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 69cf915eac3..e3eb6744ba7 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php
@@ -108,7 +108,7 @@ class MigrateFieldInstanceTest extends MigrateDrupal7TestBase {
/**
* Tests migrating D7 field instances to field_config entities.
*/
- public function testFieldInstances() {
+ public function testFieldInstances(): void {
$this->assertEntity('comment.comment_node_page.comment_body', 'Comment', 'text_long', TRUE, FALSE);
$this->assertEntity('node.page.body', 'Body', 'text_with_summary', FALSE, FALSE);
$this->assertEntity('comment.comment_node_article.comment_body', 'Comment', 'text_long', TRUE, FALSE);
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 6db3e78b4c6..2415b3edee8 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php
@@ -86,7 +86,7 @@ class MigrateFieldInstanceWidgetSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests that migrated view modes can be loaded using D8 APIs.
*/
- public function testWidgetSettings() {
+ public function testWidgetSettings(): void {
$this->assertEntity('node.page.default', 'node', 'page');
$this->assertComponent('node.page.default', 'body', 'text_textarea_with_summary', -4);
$this->assertComponent('node.page.default', 'field_text_plain', 'string_textfield', -2);
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldOptionTranslationTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldOptionTranslationTest.php
index 43f2800257e..cb3e8662c25 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldOptionTranslationTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldOptionTranslationTest.php
@@ -49,7 +49,7 @@ class MigrateFieldOptionTranslationTest extends MigrateDrupal7TestBase {
/**
* Tests the Drupal 7 field option translation to Drupal 8 migration.
*/
- public function testFieldOptionTranslation() {
+ public function testFieldOptionTranslation(): void {
$language_manager = $this->container->get('language_manager');
/** @var \Drupal\language\Config\LanguageConfigOverride $config_translation */
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 9021b9586b6..81631820ce6 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php
@@ -70,7 +70,7 @@ class MigrateFieldTest extends MigrateDrupal7TestBase {
/**
* Tests migrating D7 fields to field_storage_config entities.
*/
- public function testFields() {
+ public function testFields(): void {
\Drupal::service('module_installer')->install(['datetime_range']);
$this->installConfig(static::$modules);
$this->executeMigration('d7_field');
@@ -196,7 +196,7 @@ class MigrateFieldTest extends MigrateDrupal7TestBase {
/**
* Tests migrating D7 datetime fields.
*/
- public function testDatetimeFields() {
+ public function testDatetimeFields(): void {
$this->installConfig(static::$modules);
$this->executeMigration('d7_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 6edb1b63334..08ff4c30ff2 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateViewModesTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateViewModesTest.php
@@ -50,7 +50,7 @@ class MigrateViewModesTest extends MigrateDrupal7TestBase {
/**
* Tests migration of D7 view mode variables to D8 config entities.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertEntity('comment.full', 'Full', 'comment');
$this->assertEntity('node.teaser', 'Teaser', 'node');
$this->assertEntity('node.full', 'Full', 'node');
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackFieldInstanceTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackFieldInstanceTest.php
index 2ab197f6a6f..650db8a2945 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackFieldInstanceTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackFieldInstanceTest.php
@@ -17,7 +17,7 @@ class RollbackFieldInstanceTest extends MigrateFieldInstanceTest {
/**
* Tests migrating D7 fields to field_storage_config entities, then rolling back.
*/
- public function testFieldInstances() {
+ public function testFieldInstances(): void {
// Test that the field instances have migrated (prior to rollback).
parent::testFieldInstances();
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackFieldTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackFieldTest.php
index 0e7629c3eb3..3e0d22d966d 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackFieldTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackFieldTest.php
@@ -17,7 +17,7 @@ class RollbackFieldTest extends MigrateFieldTest {
/**
* Tests migrating D7 fields to field_storage_config entities, then rolling back.
*/
- public function testFields() {
+ public function testFields(): void {
// Test that the fields have migrated (prior to rollback).
parent::testFields();
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackViewModesTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackViewModesTest.php
index f69a9f9316d..7099294a78e 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackViewModesTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackViewModesTest.php
@@ -22,7 +22,7 @@ class RollbackViewModesTest extends MigrateViewModesTest {
/**
* Tests migrating D7 view modes, then rolling back.
*/
- public function testMigration() {
+ public function testMigration(): void {
// Test that the view modes have migrated (prior to rollback).
parent::testMigration();
diff --git a/core/modules/field/tests/src/Kernel/Number/NumberItemTest.php b/core/modules/field/tests/src/Kernel/Number/NumberItemTest.php
index 091bcc43859..ce72c0e4ab0 100644
--- a/core/modules/field/tests/src/Kernel/Number/NumberItemTest.php
+++ b/core/modules/field/tests/src/Kernel/Number/NumberItemTest.php
@@ -52,7 +52,7 @@ class NumberItemTest extends FieldKernelTestBase {
/**
* Tests using entity fields of the number field type.
*/
- public function testNumberItem() {
+ public function testNumberItem(): void {
// Verify entity creation.
$entity = EntityTest::create();
$integer = rand(0, 10);
@@ -148,7 +148,7 @@ class NumberItemTest extends FieldKernelTestBase {
*
* @throws \Drupal\Core\Entity\EntityStorageException
*/
- public function testConstraints($type, $min, $max, $value, $expect_constraints, $expected_constraint_message = '') {
+ public function testConstraints($type, $min, $max, $value, $expect_constraints, $expected_constraint_message = ''): void {
$field = FieldConfig::loadByName('entity_test', 'entity_test', 'field_' . $type);
$field->setSetting('min', $min);
$field->setSetting('max', $max);
diff --git a/core/modules/field/tests/src/Kernel/ShapeItemTest.php b/core/modules/field/tests/src/Kernel/ShapeItemTest.php
index 61a9b843b3f..e33c04a6140 100644
--- a/core/modules/field/tests/src/Kernel/ShapeItemTest.php
+++ b/core/modules/field/tests/src/Kernel/ShapeItemTest.php
@@ -53,7 +53,7 @@ class ShapeItemTest extends FieldKernelTestBase {
/**
* Tests using entity fields of the shape field type.
*/
- public function testShapeItem() {
+ public function testShapeItem(): void {
// Verify entity creation.
$entity = EntityTest::create();
$shape = 'cube';
diff --git a/core/modules/field/tests/src/Kernel/TestItemTest.php b/core/modules/field/tests/src/Kernel/TestItemTest.php
index 9185d6f9fb9..f5f1874d7dc 100644
--- a/core/modules/field/tests/src/Kernel/TestItemTest.php
+++ b/core/modules/field/tests/src/Kernel/TestItemTest.php
@@ -54,7 +54,7 @@ class TestItemTest extends FieldKernelTestBase {
/**
* Tests using entity fields of the test field type.
*/
- public function testTestItem() {
+ public function testTestItem(): void {
// Verify entity creation.
$entity = EntityTest::create();
$value = rand(1, 10);
diff --git a/core/modules/field/tests/src/Kernel/TestItemWithDependenciesTest.php b/core/modules/field/tests/src/Kernel/TestItemWithDependenciesTest.php
index 51ce521596e..6a1e0fce116 100644
--- a/core/modules/field/tests/src/Kernel/TestItemWithDependenciesTest.php
+++ b/core/modules/field/tests/src/Kernel/TestItemWithDependenciesTest.php
@@ -31,7 +31,7 @@ class TestItemWithDependenciesTest extends FieldKernelTestBase {
/**
* Tests that field types can add dependencies to field config entities.
*/
- public function testTestItemWithDependencies() {
+ public function testTestItemWithDependencies(): void {
// Create a 'test_field_with_dependencies' field and storage for validation.
FieldStorageConfig::create([
'field_name' => $this->fieldName,
diff --git a/core/modules/field/tests/src/Kernel/TestObjectItemTest.php b/core/modules/field/tests/src/Kernel/TestObjectItemTest.php
index 5338f3083d2..c90262bc891 100644
--- a/core/modules/field/tests/src/Kernel/TestObjectItemTest.php
+++ b/core/modules/field/tests/src/Kernel/TestObjectItemTest.php
@@ -44,7 +44,7 @@ class TestObjectItemTest extends FieldKernelTestBase {
/**
* Tests the serialization of a field type that has an object.
*/
- public function testTestObjectItem() {
+ public function testTestObjectItem(): void {
$object = new \stdClass();
$object->foo = 'bar';
$entity = EntityTest::create();
diff --git a/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php b/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php
index 5e0a96bb451..c6a20ba2979 100644
--- a/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php
@@ -107,7 +107,7 @@ class TimestampFormatterTest extends KernelTestBase {
/**
* Tests TimestampFormatter.
*/
- public function testTimestampFormatter() {
+ public function testTimestampFormatter(): void {
$data = [];
// Test standard formats.
@@ -145,7 +145,7 @@ class TimestampFormatterTest extends KernelTestBase {
/**
* Tests TimestampAgoFormatter.
*/
- public function testTimestampAgoFormatter() {
+ public function testTimestampAgoFormatter(): void {
$data = [];
foreach ([1, 2, 3, 4, 5, 6, 7] as $granularity) {
diff --git a/core/modules/field/tests/src/Kernel/Timestamp/TimestampItemTest.php b/core/modules/field/tests/src/Kernel/Timestamp/TimestampItemTest.php
index 5a8a2aba8dc..7d097c38792 100644
--- a/core/modules/field/tests/src/Kernel/Timestamp/TimestampItemTest.php
+++ b/core/modules/field/tests/src/Kernel/Timestamp/TimestampItemTest.php
@@ -55,7 +55,7 @@ class TimestampItemTest extends FieldKernelTestBase {
/**
* Tests using entity fields of the datetime field type.
*/
- public function testDateTime() {
+ public function testDateTime(): void {
// Verify entity creation.
$entity = EntityTest::create();
$value = 1488914208;
diff --git a/core/modules/field/tests/src/Kernel/TranslationTest.php b/core/modules/field/tests/src/Kernel/TranslationTest.php
index 02e58e3108d..b021e108873 100644
--- a/core/modules/field/tests/src/Kernel/TranslationTest.php
+++ b/core/modules/field/tests/src/Kernel/TranslationTest.php
@@ -108,7 +108,7 @@ class TranslationTest extends FieldKernelTestBase {
/**
* Tests translatable fields storage/retrieval.
*/
- public function testTranslatableFieldSaveLoad() {
+ public function testTranslatableFieldSaveLoad(): void {
// Enable field translations for nodes.
field_test_entity_info_translatable('node', TRUE);
$entity_type = \Drupal::entityTypeManager()->getDefinition('node');
@@ -204,7 +204,7 @@ class TranslationTest extends FieldKernelTestBase {
*
* @see https://www.drupal.org/node/2404739
*/
- public function testFieldAccess() {
+ public function testFieldAccess(): void {
$access_control_handler = \Drupal::entityTypeManager()->getAccessControlHandler($this->entityType);
$this->assertTrue($access_control_handler->fieldAccess('view', $this->field));
}
diff --git a/core/modules/field/tests/src/Kernel/Uri/UriItemTest.php b/core/modules/field/tests/src/Kernel/Uri/UriItemTest.php
index ca4bbdbb35f..90a7c856d0d 100644
--- a/core/modules/field/tests/src/Kernel/Uri/UriItemTest.php
+++ b/core/modules/field/tests/src/Kernel/Uri/UriItemTest.php
@@ -35,7 +35,7 @@ class UriItemTest extends FieldKernelTestBase {
/**
* Tests URI field.
*/
- public function testUriField() {
+ public function testUriField(): void {
$label = $this->randomMachineName();
// Create a field with settings to validate.
diff --git a/core/modules/field/tests/src/Kernel/Views/HandlerFieldFieldTest.php b/core/modules/field/tests/src/Kernel/Views/HandlerFieldFieldTest.php
index 523cbccd304..def2a913fcd 100644
--- a/core/modules/field/tests/src/Kernel/Views/HandlerFieldFieldTest.php
+++ b/core/modules/field/tests/src/Kernel/Views/HandlerFieldFieldTest.php
@@ -66,7 +66,7 @@ class HandlerFieldFieldTest extends KernelTestBase {
/**
* Tests fields rendering in views.
*/
- public function testFieldRender() {
+ public function testFieldRender(): void {
$this->installConfig(['filter']);
$this->installEntitySchema('user');
$this->installEntitySchema('node');
diff --git a/core/modules/field/tests/src/Kernel/WidgetPluginManagerTest.php b/core/modules/field/tests/src/Kernel/WidgetPluginManagerTest.php
index 5c0a38569d9..d567a506d06 100644
--- a/core/modules/field/tests/src/Kernel/WidgetPluginManagerTest.php
+++ b/core/modules/field/tests/src/Kernel/WidgetPluginManagerTest.php
@@ -16,7 +16,7 @@ class WidgetPluginManagerTest extends FieldKernelTestBase {
/**
* Tests that the widget definitions alter hook works.
*/
- public function testWidgetDefinitionAlter() {
+ public function testWidgetDefinitionAlter(): void {
$widget_definition = \Drupal::service('plugin.manager.field.widget')->getDefinition('test_field_widget_multiple');
// Test if hook_field_widget_info_alter is being called.
@@ -28,7 +28,7 @@ class WidgetPluginManagerTest extends FieldKernelTestBase {
*
* @see \Drupal\field\Tests\FormatterPluginManagerTest::testNotApplicableFallback()
*/
- public function testNotApplicableFallback() {
+ public function testNotApplicableFallback(): void {
/** @var \Drupal\Core\Field\WidgetPluginManager $widget_plugin_manager */
$widget_plugin_manager = \Drupal::service('plugin.manager.field.widget');
diff --git a/core/modules/field/tests/src/Unit/FieldConfigAccessControlHandlerTest.php b/core/modules/field/tests/src/Unit/FieldConfigAccessControlHandlerTest.php
index 67d900c626e..53afa0e3830 100644
--- a/core/modules/field/tests/src/Unit/FieldConfigAccessControlHandlerTest.php
+++ b/core/modules/field/tests/src/Unit/FieldConfigAccessControlHandlerTest.php
@@ -37,7 +37,7 @@ class FieldConfigAccessControlHandlerTest extends FieldStorageConfigAccessContro
/**
* Ensures field config access is working properly.
*/
- public function testAccess() {
+ public function testAccess(): void {
$this->assertAllowOperations([], $this->anon);
$this->assertAllowOperations(['view', 'update', 'delete'], $this->member);
}
diff --git a/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php b/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php
index 5797c8a3520..51e564c3599 100644
--- a/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php
+++ b/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php
@@ -113,7 +113,7 @@ class FieldConfigEntityUnitTest extends UnitTestCase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependencies() {
+ public function testCalculateDependencies(): void {
// Mock the interfaces necessary to create a dependency on a bundle entity.
$target_entity_type = $this->createMock('\Drupal\Core\Entity\EntityTypeInterface');
$target_entity_type->expects($this->any())
@@ -151,7 +151,7 @@ class FieldConfigEntityUnitTest extends UnitTestCase {
/**
* Tests that invalid bundles are handled.
*/
- public function testCalculateDependenciesIncorrectBundle() {
+ public function testCalculateDependenciesIncorrectBundle(): void {
$storage = $this->createMock('\Drupal\Core\Config\Entity\ConfigEntityStorageInterface');
$storage->expects($this->any())
->method('load')
@@ -194,7 +194,7 @@ class FieldConfigEntityUnitTest extends UnitTestCase {
/**
* @covers ::onDependencyRemoval
*/
- public function testOnDependencyRemoval() {
+ public function testOnDependencyRemoval(): void {
$this->fieldTypePluginManager->expects($this->any())
->method('getDefinition')
->with('test_field')
@@ -223,7 +223,7 @@ class FieldConfigEntityUnitTest extends UnitTestCase {
/**
* @covers ::toArray
*/
- public function testToArray() {
+ public function testToArray(): void {
$field = new FieldConfig([
'field_name' => $this->fieldStorage->getName(),
'entity_type' => 'test_entity_type',
@@ -268,7 +268,7 @@ class FieldConfigEntityUnitTest extends UnitTestCase {
/**
* @covers ::getType
*/
- public function testGetType() {
+ public function testGetType(): void {
// Ensure that FieldConfig::getType() is not delegated to
// FieldStorage.
$this->entityFieldManager->expects($this->never())
diff --git a/core/modules/field/tests/src/Unit/FieldStorageConfigAccessControlHandlerTest.php b/core/modules/field/tests/src/Unit/FieldStorageConfigAccessControlHandlerTest.php
index ab0f9d2492e..8b31e5a7e1a 100644
--- a/core/modules/field/tests/src/Unit/FieldStorageConfigAccessControlHandlerTest.php
+++ b/core/modules/field/tests/src/Unit/FieldStorageConfigAccessControlHandlerTest.php
@@ -176,7 +176,7 @@ class FieldStorageConfigAccessControlHandlerTest extends UnitTestCase {
/**
* Ensures field storage config access is working properly.
*/
- public function testAccess() {
+ public function testAccess(): void {
$this->assertAllowOperations([], $this->anon);
$this->assertAllowOperations(['view', 'update', 'delete'], $this->member);
diff --git a/core/modules/field/tests/src/Unit/FieldStorageConfigEntityUnitTest.php b/core/modules/field/tests/src/Unit/FieldStorageConfigEntityUnitTest.php
index 937d0881090..43be1c5739c 100644
--- a/core/modules/field/tests/src/Unit/FieldStorageConfigEntityUnitTest.php
+++ b/core/modules/field/tests/src/Unit/FieldStorageConfigEntityUnitTest.php
@@ -67,7 +67,7 @@ class FieldStorageConfigEntityUnitTest extends UnitTestCase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependencies() {
+ public function testCalculateDependencies(): void {
// Create a mock entity type for FieldStorageConfig.
$fieldStorageConfigentityType = $this->createMock('\Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
$fieldStorageConfigentityType->expects($this->any())
@@ -116,7 +116,7 @@ class FieldStorageConfigEntityUnitTest extends UnitTestCase {
*
* @covers ::getCardinality
*/
- public function testStoredCardinality() {
+ public function testStoredCardinality(): void {
$this->fieldTypeManager->expects($this->any())
->method('getDefinition')
->with('test_field_type')
@@ -143,7 +143,7 @@ class FieldStorageConfigEntityUnitTest extends UnitTestCase {
*
* @covers ::getCardinality
*/
- public function testEnforcedCardinality() {
+ public function testEnforcedCardinality(): void {
$this->fieldTypeManager->expects($this->any())
->method('getDefinition')
->with('test_field_type')
@@ -175,7 +175,7 @@ class FieldStorageConfigEntityUnitTest extends UnitTestCase {
* @param mixed $enforced_cardinality
* Enforced cardinality
*/
- public function testInvalidEnforcedCardinality($enforced_cardinality) {
+ public function testInvalidEnforcedCardinality($enforced_cardinality): void {
$this->fieldTypeManager->expects($this->any())
->method('getDefinition')
->with('test_field_type')
diff --git a/core/modules/field/tests/src/Unit/FieldUninstallValidatorTest.php b/core/modules/field/tests/src/Unit/FieldUninstallValidatorTest.php
index ebd28aaacf4..dffb6798bdf 100644
--- a/core/modules/field/tests/src/Unit/FieldUninstallValidatorTest.php
+++ b/core/modules/field/tests/src/Unit/FieldUninstallValidatorTest.php
@@ -39,7 +39,7 @@ class FieldUninstallValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidateNoStorages() {
+ public function testValidateNoStorages(): void {
$this->fieldUninstallValidator->expects($this->once())
->method('getFieldStoragesByModule')
->willReturn([]);
@@ -53,7 +53,7 @@ class FieldUninstallValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidateDeleted() {
+ public function testValidateDeleted(): void {
$field_storage = $this->getMockBuilder('Drupal\field\Entity\FieldStorageConfig')
->disableOriginalConstructor()
->getMock();
@@ -73,7 +73,7 @@ class FieldUninstallValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidateNoDeleted() {
+ public function testValidateNoDeleted(): void {
$field_storage = $this->getMockBuilder('Drupal\field\Entity\FieldStorageConfig')
->disableOriginalConstructor()
->getMock();
diff --git a/core/modules/field/tests/src/Unit/Plugin/migrate/process/ProcessFieldTest.php b/core/modules/field/tests/src/Unit/Plugin/migrate/process/ProcessFieldTest.php
index 1014e9f056c..61d60f1c052 100644
--- a/core/modules/field/tests/src/Unit/Plugin/migrate/process/ProcessFieldTest.php
+++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/ProcessFieldTest.php
@@ -81,7 +81,7 @@ class ProcessFieldTest extends MigrateTestCase {
* @covers ::transform
* @dataProvider providerTestTransform
*/
- public function testTransform($method, $value, $expected_value, $migrate_exception = '', $plugin_not_found = FALSE) {
+ public function testTransform($method, $value, $expected_value, $migrate_exception = '', $plugin_not_found = FALSE): void {
if ($method) {
$this->fieldPlugin->$method($this->row->reveal())->willReturn($expected_value);
}
diff --git a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldInstanceSettingsTest.php b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldInstanceSettingsTest.php
index 06fa3e8f211..c22194ad520 100644
--- a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldInstanceSettingsTest.php
+++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldInstanceSettingsTest.php
@@ -23,7 +23,7 @@ class FieldInstanceSettingsTest extends UnitTestCase {
*
* @dataProvider getSettingsProvider
*/
- public function testGetSettings($field_type, $instance_settings, $expected) {
+ public function testGetSettings($field_type, $instance_settings, $expected): void {
$instance_settings = unserialize($instance_settings);
$migration = $this->createMock(MigrationInterface::class);
$plugin = new FieldInstanceSettings([], 'd6_field_field_settings', []);
diff --git a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldSettingsTest.php b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldSettingsTest.php
index d8307276d19..978bb9ea78a 100644
--- a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldSettingsTest.php
+++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldSettingsTest.php
@@ -21,7 +21,7 @@ class FieldSettingsTest extends UnitTestCase {
*
* @dataProvider getSettingsProvider
*/
- public function testGetSettings($field_type, $field_settings, $allowed_values) {
+ public function testGetSettings($field_type, $field_settings, $allowed_values): void {
$migration = $this->createMock(MigrationInterface::class);
$plugin = new FieldSettings([], 'd6_field_settings', []);
diff --git a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php
index d3f3c3b7b1a..8c15d4b96d6 100644
--- a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php
+++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php
@@ -29,7 +29,7 @@ class FieldTypeDefaultsTest extends MigrateProcessTestCase {
*
* @covers ::transform
*/
- public function testDefaults() {
+ public function testDefaults(): void {
$this->row->expects($this->once())
->method('getSourceProperty')
->willReturn('date');
@@ -48,7 +48,7 @@ class FieldTypeDefaultsTest extends MigrateProcessTestCase {
*
* @covers ::transform
*/
- public function testDefaultsException() {
+ public function testDefaultsException(): void {
$this->expectException(MigrateException::class);
$this->expectExceptionMessage(sprintf('Failed to lookup field type %s in the static map.', var_export([], TRUE)));
$this->plugin->transform([], $this->migrateExecutable, $this->row, 'property');
diff --git a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php
index c7c61905970..616735ed767 100644
--- a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php
+++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php
@@ -21,7 +21,7 @@ class FieldInstanceSettingsTest extends MigrateTestCase {
*
* @covers ::transform
*/
- public function testTransformImageSettings() {
+ public function testTransformImageSettings(): void {
$migration = $this->createMock(MigrationInterface::class);
$plugin = new FieldInstanceSettings([], 'd7_field_instance_settings', []);
diff --git a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php
index f7d53f61e09..86ab851cc8a 100644
--- a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php
+++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php
@@ -21,7 +21,7 @@ class FieldSettingsTest extends MigrateTestCase {
*
* @covers ::transform
*/
- public function testTransformImageSettings() {
+ public function testTransformImageSettings(): void {
$migration = $this->createMock(MigrationInterface::class);
$plugin = new FieldSettings([], 'd7_field_settings', []);
diff --git a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldTypeDefaultsTest.php b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldTypeDefaultsTest.php
index eef26b0c4e0..b7199367d81 100644
--- a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldTypeDefaultsTest.php
+++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldTypeDefaultsTest.php
@@ -28,7 +28,7 @@ class FieldTypeDefaultsTest extends MigrateProcessTestCase {
*
* @covers ::transform
*/
- public function testDefaults() {
+ public function testDefaults(): void {
// Assert common values are passed through without modification.
$this->assertNull($this->plugin->transform(NULL, $this->migrateExecutable, $this->row, 'property'));
$this->assertEquals('string', $this->plugin->transform('string', $this->migrateExecutable, $this->row, 'property'));
diff --git a/core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php b/core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php
index f1fbc3c8e77..ad0eea1df50 100644
--- a/core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php
+++ b/core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php
@@ -58,7 +58,7 @@ class FieldLayoutTest extends BrowserTestBase {
/**
* Tests an entity type that has fields shown by default.
*/
- public function testNodeView() {
+ public function testNodeView(): void {
// By default, the one-column layout is used.
$this->drupalGet('node/1');
$this->assertSession()->elementExists('css', '.layout--onecol');
@@ -72,7 +72,7 @@ class FieldLayoutTest extends BrowserTestBase {
/**
* Tests that changes to the regions still leave the fields visible.
*/
- public function testRegionChanges() {
+ public function testRegionChanges(): void {
$this->drupalGet('admin/structure/types/manage/article/display');
$this->assertEquals(['Content', 'Disabled'], $this->getRegionTitles());
$this->assertSession()->optionExists('fields[body][region]', 'content');
diff --git a/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php b/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php
index b00bced862a..485e0375d10 100644
--- a/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php
+++ b/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php
@@ -56,7 +56,7 @@ class FieldLayoutTest extends WebDriverTestBase {
/**
* Tests that layouts are unique per view mode.
*/
- public function testEntityViewModes() {
+ public function testEntityViewModes(): void {
// By default, the field is not visible.
$this->drupalGet('entity_test/1/test');
$this->assertSession()->elementNotExists('css', '.layout__region--content ');
@@ -84,7 +84,7 @@ class FieldLayoutTest extends WebDriverTestBase {
/**
* Tests the use of field layout for entity form displays.
*/
- public function testEntityForm() {
+ public function testEntityForm(): void {
// By default, the one-column layout is used.
$this->drupalGet('entity_test/manage/1/edit');
$this->assertFieldInRegion('field_test_text[0][value]', 'content');
@@ -153,7 +153,7 @@ class FieldLayoutTest extends WebDriverTestBase {
/**
* Tests the use of field layout for entity view displays.
*/
- public function testEntityView() {
+ public function testEntityView(): void {
// The one-column layout is in use.
$this->drupalGet('entity_test/structure/entity_test/display');
$this->assertEquals(['Content', 'Disabled'], $this->getRegionTitles());
@@ -216,7 +216,7 @@ class FieldLayoutTest extends WebDriverTestBase {
/**
* Tests layout plugins with forms.
*/
- public function testLayoutForms() {
+ public function testLayoutForms(): void {
$this->drupalGet('entity_test/structure/entity_test/display');
// Switch to a field layout with settings.
$this->click('#edit-field-layouts');
@@ -255,7 +255,7 @@ class FieldLayoutTest extends WebDriverTestBase {
/**
* Tests changing the formatter and region at the same time.
*/
- public function testChangingFormatterAndRegion() {
+ public function testChangingFormatterAndRegion(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php b/core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php
index 3d555629dbb..eeab5c8a640 100644
--- a/core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php
+++ b/core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php
@@ -29,7 +29,7 @@ class FieldLayoutEntityDisplayTest extends KernelTestBase {
* @covers ::preSave
* @covers ::calculateDependencies
*/
- public function testPreSave() {
+ public function testPreSave(): void {
// Create an entity display with one hidden and one visible field.
$entity_display = FieldLayoutEntityViewDisplay::create([
'targetEntityType' => 'entity_test',
diff --git a/core/modules/field_layout/tests/src/Kernel/FieldLayoutUninstallTest.php b/core/modules/field_layout/tests/src/Kernel/FieldLayoutUninstallTest.php
index 3998c0babbb..bf743bb5dbc 100644
--- a/core/modules/field_layout/tests/src/Kernel/FieldLayoutUninstallTest.php
+++ b/core/modules/field_layout/tests/src/Kernel/FieldLayoutUninstallTest.php
@@ -14,7 +14,7 @@ class FieldLayoutUninstallTest extends LayoutBuilderCompatibilityTestBase {
/**
* Ensures field layout can be uninstalled with layout builder enabled.
*/
- public function testFieldLayoutUninstall() {
+ public function testFieldLayoutUninstall(): void {
// Setup user schema so user hook uninstall hook doesn't break.
$this->installSchema('user', 'users_data');
diff --git a/core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php b/core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php
index fca15bb05c0..34d78abdba1 100644
--- a/core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php
+++ b/core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php
@@ -78,7 +78,7 @@ class FieldLayoutBuilderTest extends UnitTestCase {
* @covers ::buildView
* @covers ::getFields
*/
- public function testBuildView() {
+ public function testBuildView(): void {
$definitions = [];
$non_configurable_field_definition = $this->prophesize(FieldDefinitionInterface::class);
$non_configurable_field_definition->isDisplayConfigurable('view')->willReturn(FALSE);
@@ -167,7 +167,7 @@ class FieldLayoutBuilderTest extends UnitTestCase {
* @covers ::buildForm
* @covers ::getFields
*/
- public function testBuildForm() {
+ public function testBuildForm(): void {
$definitions = [];
$non_configurable_field_definition = $this->prophesize(FieldDefinitionInterface::class);
$non_configurable_field_definition->isDisplayConfigurable('form')->willReturn(FALSE);
@@ -267,7 +267,7 @@ class FieldLayoutBuilderTest extends UnitTestCase {
/**
* @covers ::buildForm
*/
- public function testBuildFormEmpty() {
+ public function testBuildFormEmpty(): void {
$definitions = [];
$non_configurable_field_definition = $this->prophesize(FieldDefinitionInterface::class);
$non_configurable_field_definition->isDisplayConfigurable('form')->willReturn(FALSE);
@@ -308,7 +308,7 @@ class FieldLayoutBuilderTest extends UnitTestCase {
/**
* @covers ::buildForm
*/
- public function testBuildFormNoLayout() {
+ public function testBuildFormNoLayout(): void {
$this->entityFieldManager->getFieldDefinitions(Argument::any(), Argument::any())->shouldNotBeCalled();
$build = [
diff --git a/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php b/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php
index 896d9ff4b86..a1fda50c8bb 100644
--- a/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php
+++ b/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php
@@ -47,7 +47,7 @@ class EntityDisplayModeTest extends BrowserTestBase {
/**
* Tests the EntityViewMode user interface.
*/
- public function testEntityViewModeUI() {
+ public function testEntityViewModeUI(): void {
// Test the listing page.
$this->drupalGet('admin/structure/display-modes/view');
$this->assertSession()->statusCodeEquals(403);
@@ -104,7 +104,7 @@ class EntityDisplayModeTest extends BrowserTestBase {
/**
* Tests the EntityFormMode user interface.
*/
- public function testEntityFormModeUI() {
+ public function testEntityFormModeUI(): void {
// Test the listing page.
$this->drupalGet('admin/structure/display-modes/form');
$this->assertSession()->statusCodeEquals(403);
@@ -164,7 +164,7 @@ class EntityDisplayModeTest extends BrowserTestBase {
*
* @see https://www.drupal.org/node/2858569
*/
- public function testAlphabeticalDisplaySettings() {
+ public function testAlphabeticalDisplaySettings(): void {
$this->drupalLogin($this->drupalCreateUser([
'access administration pages',
'administer content types',
diff --git a/core/modules/field_ui/tests/src/Functional/EntityDisplayTest.php b/core/modules/field_ui/tests/src/Functional/EntityDisplayTest.php
index 51c6e625595..3e6655cae90 100644
--- a/core/modules/field_ui/tests/src/Functional/EntityDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Functional/EntityDisplayTest.php
@@ -37,7 +37,7 @@ class EntityDisplayTest extends BrowserTestBase {
/**
* Tests the use of regions for entity view displays.
*/
- public function testEntityView() {
+ public function testEntityView(): void {
$this->drupalGet('entity_test/structure/entity_test/display');
$this->assertSession()->elementExists('css', '.region-content-message.region-empty');
$this->assertTrue($this->assertSession()->optionExists('fields[field_test_text][region]', 'hidden')->isSelected());
diff --git a/core/modules/field_ui/tests/src/Functional/FieldTypeCategoriesIntegrationTest.php b/core/modules/field_ui/tests/src/Functional/FieldTypeCategoriesIntegrationTest.php
index 72d5e4c1438..bfe52b35de3 100644
--- a/core/modules/field_ui/tests/src/Functional/FieldTypeCategoriesIntegrationTest.php
+++ b/core/modules/field_ui/tests/src/Functional/FieldTypeCategoriesIntegrationTest.php
@@ -43,7 +43,7 @@ class FieldTypeCategoriesIntegrationTest extends BrowserTestBase {
/**
* Tests if the libraries are loaded on FieldStorageAddForm.
*/
- public function testLibrariesLoaded() {
+ public function testLibrariesLoaded(): void {
$this->drupalGet('admin/structure/types/manage/' . $this->drupalCreateContentType()->id() . '/fields/add-field');
$settings = $this->getDrupalSettings();
$css_libraries = [
diff --git a/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php b/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php
index 834b4fd7e65..e412f8dc77d 100644
--- a/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php
+++ b/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php
@@ -74,7 +74,7 @@ class FieldUIDeleteTest extends BrowserTestBase {
/**
* Tests that deletion removes field storages and fields as expected.
*/
- public function testDeleteField() {
+ public function testDeleteField(): void {
$field_label = $this->randomMachineName();
$field_name_input = 'test';
$field_name = 'field_test';
diff --git a/core/modules/field_ui/tests/src/Functional/FieldUIIndentationTest.php b/core/modules/field_ui/tests/src/Functional/FieldUIIndentationTest.php
index e7aa52a41cf..5d95563b69b 100644
--- a/core/modules/field_ui/tests/src/Functional/FieldUIIndentationTest.php
+++ b/core/modules/field_ui/tests/src/Functional/FieldUIIndentationTest.php
@@ -44,7 +44,7 @@ class FieldUIIndentationTest extends BrowserTestBase {
}
- public function testIndentation() {
+ public function testIndentation(): void {
$this->drupalGet('admin/structure/types/manage/page/display');
$this->assertSession()->responseContains('js-indentation indentation');
}
diff --git a/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php b/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php
index 963143ea2b8..a720046ad33 100644
--- a/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php
+++ b/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php
@@ -48,7 +48,7 @@ class FieldUIRouteTest extends BrowserTestBase {
/**
* Ensures that entity types with bundles do not break following entity types.
*/
- public function testFieldUIRoutes() {
+ public function testFieldUIRoutes(): void {
$this->drupalGet('entity_test_no_id/structure/entity_test/fields');
$this->assertSession()->pageTextContains('No fields are present yet.');
@@ -131,7 +131,7 @@ class FieldUIRouteTest extends BrowserTestBase {
/**
* Asserts that admin routes are correctly marked as such.
*/
- public function testAdminRoute() {
+ public function testAdminRoute(): void {
$route = \Drupal::service('router.route_provider')->getRouteByName('entity.entity_test.field_ui_fields');
$is_admin = \Drupal::service('router.admin_context')->isAdminRoute($route);
$this->assertTrue($is_admin, 'Admin route correctly marked for "Manage fields" page.');
diff --git a/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php b/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
index b5cac2934d8..b70b7639cbd 100644
--- a/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
@@ -104,7 +104,7 @@ class ManageDisplayTest extends BrowserTestBase {
/**
* Tests switching view modes to use custom or 'default' settings'.
*/
- public function testViewModeCustom() {
+ public function testViewModeCustom(): void {
// Create a field, and a node with some data for the field.
$this->fieldUIAddNewField('admin/structure/types/manage/' . $this->type, 'test', 'Test field');
\Drupal::service('entity_field.manager')->clearCachedFieldDefinitions();
@@ -181,7 +181,7 @@ class ManageDisplayTest extends BrowserTestBase {
/**
* Tests the local tasks are displayed correctly for view modes.
*/
- public function testViewModeLocalTasks() {
+ public function testViewModeLocalTasks(): void {
$manage_display = 'admin/structure/types/manage/' . $this->type . '/display';
$this->drupalGet($manage_display);
$this->assertSession()->linkNotExists('Full content');
@@ -195,7 +195,7 @@ class ManageDisplayTest extends BrowserTestBase {
/**
* Tests that fields with no explicit display settings do not break.
*/
- public function testNonInitializedFields() {
+ public function testNonInitializedFields(): void {
// Create a test field.
$this->fieldUIAddNewField('admin/structure/types/manage/' . $this->type, 'test', 'Test');
@@ -227,7 +227,7 @@ class ManageDisplayTest extends BrowserTestBase {
/**
* Tests that a message is shown when there are no fields.
*/
- public function testNoFieldsDisplayOverview() {
+ public function testNoFieldsDisplayOverview(): void {
// Create a fresh content type without any fields.
NodeType::create([
'type' => 'no_fields',
@@ -242,7 +242,7 @@ class ManageDisplayTest extends BrowserTestBase {
/**
* Tests if display mode local tasks appear in alphabetical order by label.
*/
- public function testViewModeLocalTasksOrder() {
+ public function testViewModeLocalTasksOrder(): void {
$manage_display = 'admin/structure/types/manage/' . $this->type . '/display';
// Specify the 'rss' mode, check that the field is displayed the same.
@@ -267,7 +267,7 @@ class ManageDisplayTest extends BrowserTestBase {
/**
* Tests if form mode local tasks appear in alphabetical order by label.
*/
- public function testFormModeLocalTasksOrder() {
+ public function testFormModeLocalTasksOrder(): void {
EntityFormMode::create([
'id' => 'node.big',
'label' => 'Big Form',
diff --git a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
index fcf9fd50ded..b17646d2e9a 100644
--- a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
+++ b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
@@ -20,7 +20,7 @@ class ManageFieldsFunctionalTest extends ManageFieldsFunctionalTestBase {
/**
* Tests that default value is correctly validated and saved.
*/
- public function testDefaultValue() {
+ public function testDefaultValue(): void {
// Create a test field storage and field.
$field_name = 'test';
FieldStorageConfig::create([
@@ -112,7 +112,7 @@ class ManageFieldsFunctionalTest extends ManageFieldsFunctionalTestBase {
/**
* Tests that Field UI respects disallowed field names.
*/
- public function testDisallowedFieldNames() {
+ public function testDisallowedFieldNames(): void {
// Reset the field prefix so we can test properly.
$this->config('field_ui.settings')->set('field_prefix', '')->save();
@@ -144,7 +144,7 @@ class ManageFieldsFunctionalTest extends ManageFieldsFunctionalTestBase {
/**
* Tests that Field UI respects locked fields.
*/
- public function testLockedField() {
+ public function testLockedField(): void {
// Create a locked field and attach it to a bundle. We need to do this
// programmatically as there's no way to create a locked field through UI.
$field_name = $this->randomMachineName(8);
@@ -178,7 +178,7 @@ class ManageFieldsFunctionalTest extends ManageFieldsFunctionalTestBase {
/**
* Tests that Field UI respects the 'no_ui' flag in the field type definition.
*/
- public function testHiddenFields() {
+ public function testHiddenFields(): void {
// Check that the field type is not available in the 'add new field' row.
$this->drupalGet('admin/structure/types/manage/' . $this->contentType . '/fields/add-field');
$this->assertSession()->elementNotExists('css', "[name='new_storage_type'][value='hidden_test_field']");
@@ -244,7 +244,7 @@ class ManageFieldsFunctionalTest extends ManageFieldsFunctionalTestBase {
/**
* Tests that a duplicate field name is caught by validation.
*/
- public function testDuplicateFieldName() {
+ public function testDuplicateFieldName(): void {
// field_tags already exists, so we're expecting an error when trying to
// create a new field with the same name.
$url = 'admin/structure/types/manage/' . $this->contentType . '/fields/add-field';
@@ -266,7 +266,7 @@ class ManageFieldsFunctionalTest extends ManageFieldsFunctionalTestBase {
/**
* Tests that external URLs in the 'destinations' query parameter are blocked.
*/
- public function testExternalDestinations() {
+ public function testExternalDestinations(): void {
$options = [
'query' => ['destinations' => ['http://example.com']],
];
@@ -281,7 +281,7 @@ class ManageFieldsFunctionalTest extends ManageFieldsFunctionalTestBase {
/**
* Tests that deletion removes field storages and fields as expected for a term.
*/
- public function testDeleteTaxonomyField() {
+ public function testDeleteTaxonomyField(): void {
// Create a new field.
$bundle_path = 'admin/structure/taxonomy/manage/tags/overview';
@@ -299,7 +299,7 @@ class ManageFieldsFunctionalTest extends ManageFieldsFunctionalTestBase {
/**
* Tests that help descriptions render valid HTML.
*/
- public function testHelpDescriptions() {
+ public function testHelpDescriptions(): void {
// Create an image field.
FieldStorageConfig::create([
'field_name' => 'field_image',
@@ -346,7 +346,7 @@ class ManageFieldsFunctionalTest extends ManageFieldsFunctionalTestBase {
*
* @see \Drupal\Core\Field\PreconfiguredFieldUiOptionsInterface
*/
- public function testPreconfiguredFields() {
+ public function testPreconfiguredFields(): void {
$this->drupalGet('admin/structure/types/manage/article/fields/add-field');
// Check that the preconfigured field option exist alongside the regular
@@ -377,7 +377,7 @@ class ManageFieldsFunctionalTest extends ManageFieldsFunctionalTestBase {
/**
* Tests the access to non-existent field URLs.
*/
- public function testNonExistentFieldUrls() {
+ public function testNonExistentFieldUrls(): void {
$field_id = 'node.foo.bar';
$this->drupalGet('admin/structure/types/manage/' . $this->contentType . '/fields/' . $field_id);
@@ -387,7 +387,7 @@ class ManageFieldsFunctionalTest extends ManageFieldsFunctionalTestBase {
/**
* Tests that the 'field_prefix' setting works on Field UI.
*/
- public function testFieldPrefix() {
+ public function testFieldPrefix(): void {
// Change default field prefix.
$field_prefix = $this->randomMachineName(10);
$this->config('field_ui.settings')->set('field_prefix', $field_prefix)->save();
@@ -418,7 +418,7 @@ class ManageFieldsFunctionalTest extends ManageFieldsFunctionalTestBase {
/**
* Test translation defaults.
*/
- public function testTranslationDefaults() {
+ public function testTranslationDefaults(): void {
$this->fieldUIAddNewField('admin/structure/types/manage/' . $this->contentType, $this->fieldNameInput, $this->fieldLabel);
$field_storage = FieldStorageConfig::loadByName('node', 'field_' . $this->fieldNameInput);
$this->assertTrue($field_storage->isTranslatable(), 'Field storage translatable.');
diff --git a/core/modules/field_ui/tests/src/Functional/ManageFieldsLifecycleTest.php b/core/modules/field_ui/tests/src/Functional/ManageFieldsLifecycleTest.php
index 79964e41821..606fd72d347 100644
--- a/core/modules/field_ui/tests/src/Functional/ManageFieldsLifecycleTest.php
+++ b/core/modules/field_ui/tests/src/Functional/ManageFieldsLifecycleTest.php
@@ -22,7 +22,7 @@ class ManageFieldsLifecycleTest extends ManageFieldsFunctionalTestBase {
* In order to act on the same fields, and not create the fields over and over
* again the following tests create, update and delete the same fields.
*/
- public function testCRUDFields() {
+ public function testCRUDFields(): void {
$this->manageFieldsPage();
$this->createField();
$this->updateField();
diff --git a/core/modules/field_ui/tests/src/Functional/ManageFieldsMultipleTypesTest.php b/core/modules/field_ui/tests/src/Functional/ManageFieldsMultipleTypesTest.php
index 677d56da5e8..ff73c7902f2 100644
--- a/core/modules/field_ui/tests/src/Functional/ManageFieldsMultipleTypesTest.php
+++ b/core/modules/field_ui/tests/src/Functional/ManageFieldsMultipleTypesTest.php
@@ -23,7 +23,7 @@ class ManageFieldsMultipleTypesTest extends ManageFieldsFunctionalTestBase {
*
* @dataProvider entityTypesProvider
*/
- public function testReuseField($entity_type, $bundle1, $bundle2) {
+ public function testReuseField($entity_type, $bundle1, $bundle2): void {
$field_name = 'test_reuse';
$label = $this->randomMachineName();
@@ -52,7 +52,7 @@ class ManageFieldsMultipleTypesTest extends ManageFieldsFunctionalTestBase {
*
* @dataProvider entityTypesProvider
*/
- public function testReuseFieldMultipleDisplay($entity_type, $bundle1, $bundle2) {
+ public function testReuseFieldMultipleDisplay($entity_type, $bundle1, $bundle2): void {
// Create additional form mode and enable it on both bundles.
EntityFormMode::create([
'id' => "{$entity_type}.little",
diff --git a/core/modules/field_ui/tests/src/Functional/ManageFieldsTest.php b/core/modules/field_ui/tests/src/Functional/ManageFieldsTest.php
index eb584653320..3f49acb6379 100644
--- a/core/modules/field_ui/tests/src/Functional/ManageFieldsTest.php
+++ b/core/modules/field_ui/tests/src/Functional/ManageFieldsTest.php
@@ -59,7 +59,7 @@ class ManageFieldsTest extends BrowserTestBase {
/**
* Tests drop button operations on the manage fields page.
*/
- public function testFieldDropButtonOperations() {
+ public function testFieldDropButtonOperations(): void {
$assert_session = $this->assertSession();
$node_type = $this->drupalCreateContentType();
@@ -131,7 +131,7 @@ class ManageFieldsTest extends BrowserTestBase {
/**
* Tests adding a field.
*/
- public function testAddField() {
+ public function testAddField(): void {
$page = $this->getSession()->getPage();
$type = $this->drupalCreateContentType([
'name' => 'Article',
@@ -199,7 +199,7 @@ class ManageFieldsTest extends BrowserTestBase {
/**
* Tests multiple users adding a field with the same name.
*/
- public function testAddFieldWithMultipleUsers() {
+ public function testAddFieldWithMultipleUsers(): void {
$page = $this->getSession()->getPage();
// Create two users.
$user1 = $this->drupalCreateUser(['administer node fields']);
@@ -261,7 +261,7 @@ class ManageFieldsTest extends BrowserTestBase {
/**
* Tests editing field when the field exists in temp store.
*/
- public function testEditFieldWithLeftOverFieldInTempStore() {
+ public function testEditFieldWithLeftOverFieldInTempStore(): void {
$user = $this->drupalCreateUser(['administer node fields']);
$node_type = $this->drupalCreateContentType();
@@ -307,7 +307,7 @@ class ManageFieldsTest extends BrowserTestBase {
/**
* Tests creating entity reference field to non-bundleable entity type.
*/
- public function testEntityReferenceToNonBundleableEntity() {
+ public function testEntityReferenceToNonBundleableEntity(): void {
$type = $this->drupalCreateContentType([
'name' => 'kittens',
'type' => 'kittens',
@@ -329,7 +329,7 @@ class ManageFieldsTest extends BrowserTestBase {
*
* @group legacy
*/
- public function testFieldTypeCardinalityAlter() {
+ public function testFieldTypeCardinalityAlter(): void {
$node_type = $this->drupalCreateContentType();
$bundle = $node_type->id();
@@ -359,7 +359,7 @@ class ManageFieldsTest extends BrowserTestBase {
/**
* Tests hook_field_info_entity_type_ui_definitions_alter().
*/
- public function testFieldUiDefinitionsAlter() {
+ public function testFieldUiDefinitionsAlter(): void {
$user = $this->drupalCreateUser(['administer node fields']);
$node_type = $this->drupalCreateContentType();
$this->drupalLogin($user);
@@ -370,7 +370,7 @@ class ManageFieldsTest extends BrowserTestBase {
/**
* Ensure field category fallback works for field types without a description.
*/
- public function testFieldCategoryFallbackWithoutDescription() {
+ public function testFieldCategoryFallbackWithoutDescription(): void {
$user = $this->drupalCreateUser(['administer node fields']);
$node_type = $this->drupalCreateContentType();
$this->drupalLogin($user);
diff --git a/core/modules/field_ui/tests/src/FunctionalJavascript/DefaultValueWidgetTest.php b/core/modules/field_ui/tests/src/FunctionalJavascript/DefaultValueWidgetTest.php
index b6a12332bae..4db4b2cbb13 100644
--- a/core/modules/field_ui/tests/src/FunctionalJavascript/DefaultValueWidgetTest.php
+++ b/core/modules/field_ui/tests/src/FunctionalJavascript/DefaultValueWidgetTest.php
@@ -52,7 +52,7 @@ class DefaultValueWidgetTest extends WebDriverTestBase {
/**
* Tests default value options on field config change.
*/
- public function testDefaultValueOptionsForChangingBundles() {
+ public function testDefaultValueOptionsForChangingBundles(): void {
$vocab_1 = $this->createVocabulary(['name' => 'Colors']);
$this->createTerm($vocab_1, ['name' => 'red']);
$this->createTerm($vocab_1, ['name' => 'green']);
diff --git a/core/modules/field_ui/tests/src/FunctionalJavascript/DisplayModeBundleSelectionTest.php b/core/modules/field_ui/tests/src/FunctionalJavascript/DisplayModeBundleSelectionTest.php
index 0c640f1215c..7908418d3fb 100644
--- a/core/modules/field_ui/tests/src/FunctionalJavascript/DisplayModeBundleSelectionTest.php
+++ b/core/modules/field_ui/tests/src/FunctionalJavascript/DisplayModeBundleSelectionTest.php
@@ -69,7 +69,7 @@ class DisplayModeBundleSelectionTest extends WebDriverTestBase {
*
* @dataProvider providerBundleSelection
*/
- public function testBundleSelection($display_mode, $path, $custom_mode) {
+ public function testBundleSelection($display_mode, $path, $custom_mode): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/field_ui/tests/src/FunctionalJavascript/EntityDisplayTest.php b/core/modules/field_ui/tests/src/FunctionalJavascript/EntityDisplayTest.php
index ff0f5db89d8..0ef7b33165c 100644
--- a/core/modules/field_ui/tests/src/FunctionalJavascript/EntityDisplayTest.php
+++ b/core/modules/field_ui/tests/src/FunctionalJavascript/EntityDisplayTest.php
@@ -51,7 +51,7 @@ class EntityDisplayTest extends WebDriverTestBase {
/**
* Tests the use of regions for entity form displays.
*/
- public function testEntityForm() {
+ public function testEntityForm(): void {
$this->drupalGet('entity_test/manage/1/edit');
$this->assertSession()->fieldExists('field_test_text[0][value]');
@@ -73,7 +73,7 @@ class EntityDisplayTest extends WebDriverTestBase {
/**
* Tests the use of regions for entity view displays.
*/
- public function testEntityView() {
+ public function testEntityView(): void {
$this->drupalGet('entity_test/1');
$this->assertSession()->pageTextNotContains('The field test text value');
@@ -97,7 +97,7 @@ class EntityDisplayTest extends WebDriverTestBase {
/**
* Tests extra fields.
*/
- public function testExtraFields() {
+ public function testExtraFields(): void {
entity_test_create_bundle('bundle_with_extra_fields');
$this->drupalGet('entity_test/structure/bundle_with_extra_fields/display');
$this->assertSession()->waitForElement('css', '.tabledrag-handle');
diff --git a/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php b/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php
index 8efeab9183d..dd545533891 100644
--- a/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php
+++ b/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php
@@ -83,7 +83,7 @@ class ManageDisplayTest extends WebDriverTestBase {
/**
* Tests formatter settings.
*/
- public function testFormatterUI() {
+ public function testFormatterUI(): void {
$manage_fields = 'admin/structure/types/manage/' . $this->type;
$manage_display = $manage_fields . '/display';
@@ -254,7 +254,7 @@ class ManageDisplayTest extends WebDriverTestBase {
/**
* Tests widget settings.
*/
- public function testWidgetUI() {
+ public function testWidgetUI(): void {
// Admin Manage Fields page.
$manage_fields = 'admin/structure/types/manage/' . $this->type;
// Admin Manage Display page.
@@ -424,7 +424,7 @@ class ManageDisplayTest extends WebDriverTestBase {
/**
* Confirms that notifications to save appear when necessary.
*/
- public function testNotAppliedUntilSavedWarning() {
+ public function testNotAppliedUntilSavedWarning(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/field_ui/tests/src/FunctionalJavascript/ManageFieldsTest.php b/core/modules/field_ui/tests/src/FunctionalJavascript/ManageFieldsTest.php
index 53dc85e03eb..ace40dbe30e 100644
--- a/core/modules/field_ui/tests/src/FunctionalJavascript/ManageFieldsTest.php
+++ b/core/modules/field_ui/tests/src/FunctionalJavascript/ManageFieldsTest.php
@@ -87,7 +87,7 @@ class ManageFieldsTest extends WebDriverTestBase {
/**
* Tests re-using an existing field and the visibility of the re-use button.
*/
- public function testReuseExistingField() {
+ public function testReuseExistingField(): void {
$path = 'admin/structure/types/manage/article';
$path2 = 'admin/structure/types/manage/page';
$this->drupalGet($path2 . '/fields');
@@ -105,7 +105,7 @@ class ManageFieldsTest extends WebDriverTestBase {
/**
* Tests filter results in the re-use form.
*/
- public function testFilterInReuseForm() {
+ public function testFilterInReuseForm(): void {
$session = $this->getSession();
$page = $session->getPage();
$path = 'admin/structure/types/manage/article';
@@ -156,7 +156,7 @@ class ManageFieldsTest extends WebDriverTestBase {
/**
* Tests that field delete operation opens in modal.
*/
- public function testFieldDelete() {
+ public function testFieldDelete(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -175,7 +175,7 @@ class ManageFieldsTest extends WebDriverTestBase {
/**
* Tests field add.
*/
- public function testAddField() {
+ public function testAddField(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -298,7 +298,7 @@ class ManageFieldsTest extends WebDriverTestBase {
/**
* Tests the order in which the field types appear in the form.
*/
- public function testFieldTypeOrder() {
+ public function testFieldTypeOrder(): void {
$this->drupalGet('admin/structure/types/manage/article/fields/add-field');
$page = $this->getSession()->getPage();
$field_type_categories = [
@@ -337,7 +337,7 @@ class ManageFieldsTest extends WebDriverTestBase {
/**
* Tests the form validation for allowed values field.
*/
- public function testAllowedValuesFormValidation() {
+ public function testAllowedValuesFormValidation(): void {
FieldStorageConfig::create([
'field_name' => 'field_text',
'entity_type' => 'node',
@@ -359,7 +359,7 @@ class ManageFieldsTest extends WebDriverTestBase {
/**
* Tests the form validation for label field.
*/
- public function testLabelFieldFormValidation() {
+ public function testLabelFieldFormValidation(): void {
$this->drupalGet('/admin/structure/types/manage/article/fields/add-field');
$page = $this->getSession()->getPage();
diff --git a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
index f51339190e8..ae8472ac790 100644
--- a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
@@ -54,7 +54,7 @@ class EntityDisplayTest extends KernelTestBase {
/**
* Tests basic CRUD operations on entity display objects.
*/
- public function testEntityDisplayCRUD() {
+ public function testEntityDisplayCRUD(): void {
$display = EntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
@@ -134,7 +134,7 @@ class EntityDisplayTest extends KernelTestBase {
/**
* Tests sorting of components by name on basic CRUD operations.
*/
- public function testEntityDisplayCRUDSort() {
+ public function testEntityDisplayCRUDSort(): void {
$display = EntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
@@ -153,7 +153,7 @@ class EntityDisplayTest extends KernelTestBase {
/**
* @covers \Drupal\Core\Entity\EntityDisplayRepository::getViewDisplay
*/
- public function testEntityGetDisplay() {
+ public function testEntityGetDisplay(): void {
$display_repository = $this->container->get('entity_display.repository');
// Check that getViewDisplay() returns a fresh object when no configuration
@@ -175,7 +175,7 @@ class EntityDisplayTest extends KernelTestBase {
/**
* Tests the behavior of a field component within an entity display object.
*/
- public function testExtraFieldComponent() {
+ public function testExtraFieldComponent(): void {
entity_test_create_bundle('bundle_with_extra_fields');
$display = EntityViewDisplay::create([
'targetEntityType' => 'entity_test',
@@ -198,7 +198,7 @@ class EntityDisplayTest extends KernelTestBase {
/**
* Tests the behavior of an extra field component with initial invalid values.
*/
- public function testExtraFieldComponentInitialInvalidConfig() {
+ public function testExtraFieldComponentInitialInvalidConfig(): void {
entity_test_create_bundle('bundle_with_extra_fields');
$display = EntityViewDisplay::create([
'targetEntityType' => 'entity_test',
@@ -227,7 +227,7 @@ class EntityDisplayTest extends KernelTestBase {
/**
* Tests the behavior of a field component within an entity display object.
*/
- public function testFieldComponent() {
+ public function testFieldComponent(): void {
$field_name = 'test_field';
// Create a field storage and a field.
$field_storage = FieldStorageConfig::create([
@@ -287,7 +287,7 @@ class EntityDisplayTest extends KernelTestBase {
/**
* Tests the behavior of a field component for a base field.
*/
- public function testBaseFieldComponent() {
+ public function testBaseFieldComponent(): void {
$display = EntityViewDisplay::create([
'targetEntityType' => 'entity_test_base_field_display',
'bundle' => 'entity_test_base_field_display',
@@ -350,7 +350,7 @@ class EntityDisplayTest extends KernelTestBase {
/**
* Tests deleting a bundle.
*/
- public function testDeleteBundle() {
+ public function testDeleteBundle(): void {
// Create a node bundle, display and form display object.
$type = NodeType::create([
'type' => 'article',
@@ -374,7 +374,7 @@ class EntityDisplayTest extends KernelTestBase {
/**
* Tests deleting field.
*/
- public function testDeleteField() {
+ public function testDeleteField(): void {
$field_name = 'test_field';
// Create a field storage and a field.
$field_storage = FieldStorageConfig::create([
@@ -428,7 +428,7 @@ class EntityDisplayTest extends KernelTestBase {
/**
* Tests \Drupal\Core\Entity\EntityDisplayBase::onDependencyRemoval().
*/
- public function testOnDependencyRemoval() {
+ public function testOnDependencyRemoval(): void {
$this->enableModules(['field_plugins_test']);
$field_name = 'test_field';
@@ -473,7 +473,7 @@ class EntityDisplayTest extends KernelTestBase {
/**
* Ensure that entity view display changes invalidates cache tags.
*/
- public function testEntityDisplayInvalidateCacheTags() {
+ public function testEntityDisplayInvalidateCacheTags(): void {
$cache = \Drupal::cache();
$cache->set('cid', 'kittens', Cache::PERMANENT, ['config:entity_view_display_list']);
$display = EntityViewDisplay::create([
@@ -489,7 +489,7 @@ class EntityDisplayTest extends KernelTestBase {
/**
* Tests getDisplayModeOptions().
*/
- public function testGetDisplayModeOptions() {
+ public function testGetDisplayModeOptions(): void {
NodeType::create([
'type' => 'article',
'name' => 'Article',
@@ -539,7 +539,7 @@ class EntityDisplayTest extends KernelTestBase {
/**
* Tests components dependencies additions.
*/
- public function testComponentDependencies() {
+ public function testComponentDependencies(): void {
$this->enableModules(['dblog', 'help']);
$this->installSchema('dblog', ['watchdog']);
$this->installEntitySchema('user');
diff --git a/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php
index edfdfef1af0..4b88fd5ab61 100644
--- a/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php
@@ -45,7 +45,7 @@ class EntityFormDisplayTest extends KernelTestBase {
/**
* @covers \Drupal\Core\Entity\EntityDisplayRepository::getFormDisplay
*/
- public function testEntityGetFromDisplay() {
+ public function testEntityGetFromDisplay(): void {
/** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
$display_repository = \Drupal::service('entity_display.repository');
@@ -69,7 +69,7 @@ class EntityFormDisplayTest extends KernelTestBase {
/**
* Tests the behavior of a field component within an EntityFormDisplay object.
*/
- public function testFieldComponent() {
+ public function testFieldComponent(): void {
// Create a field storage and a field.
$field_name = 'test_field';
$field_storage = FieldStorageConfig::create([
@@ -134,7 +134,7 @@ class EntityFormDisplayTest extends KernelTestBase {
/**
* Tests the behavior of a field component for a base field.
*/
- public function testBaseFieldComponent() {
+ public function testBaseFieldComponent(): void {
$display = EntityFormDisplay::create([
'targetEntityType' => 'entity_test_base_field_display',
'bundle' => 'entity_test_base_field_display',
@@ -195,7 +195,7 @@ class EntityFormDisplayTest extends KernelTestBase {
/**
* Tests deleting field.
*/
- public function testDeleteField() {
+ public function testDeleteField(): void {
$field_name = 'test_field';
// Create a field storage and a field.
$field_storage = FieldStorageConfig::create([
@@ -249,7 +249,7 @@ class EntityFormDisplayTest extends KernelTestBase {
/**
* Tests \Drupal\Core\Entity\EntityDisplayBase::onDependencyRemoval().
*/
- public function testOnDependencyRemoval() {
+ public function testOnDependencyRemoval(): void {
$this->enableModules(['field_plugins_test']);
$field_name = 'test_field';
@@ -294,7 +294,7 @@ class EntityFormDisplayTest extends KernelTestBase {
/**
* Tests the serialization and unserialization of the class.
*/
- public function testSerialization() {
+ public function testSerialization(): void {
/** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
$display_repository = \Drupal::service('entity_display.repository');
diff --git a/core/modules/field_ui/tests/src/Unit/FieldConfigEditFormTest.php b/core/modules/field_ui/tests/src/Unit/FieldConfigEditFormTest.php
index caef52e9618..20c12c7179e 100644
--- a/core/modules/field_ui/tests/src/Unit/FieldConfigEditFormTest.php
+++ b/core/modules/field_ui/tests/src/Unit/FieldConfigEditFormTest.php
@@ -43,7 +43,7 @@ class FieldConfigEditFormTest extends UnitTestCase {
*
* @dataProvider providerRequired
*/
- public function testHasAnyRequired(array $element, bool $result) {
+ public function testHasAnyRequired(array $element, bool $result): void {
$reflection = new \ReflectionClass('\Drupal\field_ui\Form\FieldConfigEditForm');
$method = $reflection->getMethod('hasAnyRequired');
$this->assertEquals($result, $method->invoke($this->fieldConfigEditForm, $element));
diff --git a/core/modules/field_ui/tests/src/Unit/FieldUiTableTest.php b/core/modules/field_ui/tests/src/Unit/FieldUiTableTest.php
index 88b4c4da2fa..512aef17175 100644
--- a/core/modules/field_ui/tests/src/Unit/FieldUiTableTest.php
+++ b/core/modules/field_ui/tests/src/Unit/FieldUiTableTest.php
@@ -18,7 +18,7 @@ class FieldUiTableTest extends UnitTestCase {
*
* @dataProvider providerTestReduceOrder
*/
- public function testReduceOrder($array, $expected) {
+ public function testReduceOrder($array, $expected): void {
$this->assertSame($expected, array_reduce($array, ['Drupal\field_ui\Element\FieldUiTable', 'reduceOrder']));
}
diff --git a/core/modules/field_ui/tests/src/Unit/FieldUiTest.php b/core/modules/field_ui/tests/src/Unit/FieldUiTest.php
index 1130714566a..812ca8e4221 100644
--- a/core/modules/field_ui/tests/src/Unit/FieldUiTest.php
+++ b/core/modules/field_ui/tests/src/Unit/FieldUiTest.php
@@ -37,7 +37,7 @@ class FieldUiTest extends UnitTestCase {
/**
* @covers ::getNextDestination
*/
- public function testGetNextDestination() {
+ public function testGetNextDestination(): void {
$destinations = ['admin', 'admin/content'];
$expected_uri = 'base:admin';
$expected_query = [
@@ -51,7 +51,7 @@ class FieldUiTest extends UnitTestCase {
/**
* @covers ::getNextDestination
*/
- public function testGetNextDestinationEmpty() {
+ public function testGetNextDestinationEmpty(): void {
$destinations = [];
$actual = FieldUI::getNextDestination($destinations);
$this->assertNull($actual);
@@ -60,7 +60,7 @@ class FieldUiTest extends UnitTestCase {
/**
* @covers ::getNextDestination
*/
- public function testGetNextDestinationRouteName() {
+ public function testGetNextDestinationRouteName(): void {
$destinations = [['route_name' => 'system.admin'], ['route_name' => 'system.admin_content']];
$expected_route_name = 'system.admin';
$expected_query = [
diff --git a/core/modules/file/tests/src/Functional/DownloadTest.php b/core/modules/file/tests/src/Functional/DownloadTest.php
index 713b5a69402..1a86c184b74 100644
--- a/core/modules/file/tests/src/Functional/DownloadTest.php
+++ b/core/modules/file/tests/src/Functional/DownloadTest.php
@@ -48,7 +48,7 @@ class DownloadTest extends FileManagedTestBase {
/**
* Tests the public file transfer system.
*/
- public function testPublicFileTransfer() {
+ public function testPublicFileTransfer(): void {
// Test generating a URL to a created file.
$file = $this->createFile();
$url = $this->fileUrlGenerator->generateAbsoluteString($file->getFileUri());
@@ -72,7 +72,7 @@ class DownloadTest extends FileManagedTestBase {
/**
* Tests the private file transfer system.
*/
- public function testPrivateFileTransferWithoutPageCache() {
+ public function testPrivateFileTransferWithoutPageCache(): void {
$this->doPrivateFileTransferTest();
}
@@ -148,7 +148,7 @@ class DownloadTest extends FileManagedTestBase {
/**
* Test FileUrlGeneratorInterface::generateString()
*/
- public function testFileCreateUrl() {
+ public function testFileCreateUrl(): void {
// "Special" ASCII characters.
$basename = " -._~!$'\"()*@[]?&+%#,;=:\n\x00" .
// Characters that look like a percent-escaped string.
diff --git a/core/modules/file/tests/src/Functional/FileFieldAnonymousSubmissionTest.php b/core/modules/file/tests/src/Functional/FileFieldAnonymousSubmissionTest.php
index eb8fd620097..d1c2455d204 100644
--- a/core/modules/file/tests/src/Functional/FileFieldAnonymousSubmissionTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldAnonymousSubmissionTest.php
@@ -35,7 +35,7 @@ class FileFieldAnonymousSubmissionTest extends FileFieldTestBase {
/**
* Tests the basic node submission for an anonymous visitor.
*/
- public function testAnonymousNode() {
+ public function testAnonymousNode(): void {
$type = 'Article';
$title = 'test page';
@@ -64,7 +64,7 @@ class FileFieldAnonymousSubmissionTest extends FileFieldTestBase {
/**
* Tests file submission for an anonymous visitor.
*/
- public function testAnonymousNodeWithFile() {
+ public function testAnonymousNodeWithFile(): void {
$type = 'Article';
$title = 'Test page';
$this->createFileField('field_image', 'node', 'article', [], ['file_extensions' => 'txt png']);
@@ -100,7 +100,7 @@ class FileFieldAnonymousSubmissionTest extends FileFieldTestBase {
/**
* Tests file submission for an anonymous visitor with a missing node title.
*/
- public function testAnonymousNodeWithFileWithoutTitle() {
+ public function testAnonymousNodeWithFileWithoutTitle(): void {
$this->drupalLogout();
$this->doTestNodeWithFileWithoutTitle();
}
@@ -108,7 +108,7 @@ class FileFieldAnonymousSubmissionTest extends FileFieldTestBase {
/**
* Tests file submission for an authenticated user with a missing node title.
*/
- public function testAuthenticatedNodeWithFileWithoutTitle() {
+ public function testAuthenticatedNodeWithFileWithoutTitle(): void {
$admin_user = $this->drupalCreateUser([
'bypass node access',
'access content overview',
diff --git a/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php b/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php
index 6f0a4d6b8fe..7566930e379 100644
--- a/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php
@@ -26,7 +26,7 @@ class FileFieldDisplayTest extends FileFieldTestBase {
/**
* Tests normal formatter display on node display.
*/
- public function testNodeDisplay() {
+ public function testNodeDisplay(): void {
$field_name = $this->randomMachineName();
$type_name = 'article';
$field_storage_settings = [
@@ -132,7 +132,7 @@ class FileFieldDisplayTest extends FileFieldTestBase {
/**
* Tests default display of File Field.
*/
- public function testDefaultFileFieldDisplay() {
+ public function testDefaultFileFieldDisplay(): void {
$field_name = $this->randomMachineName();
$type_name = 'article';
$field_storage_settings = [
@@ -159,7 +159,7 @@ class FileFieldDisplayTest extends FileFieldTestBase {
/**
* Tests description toggle for field instance configuration.
*/
- public function testDescToggle() {
+ public function testDescToggle(): void {
$type_name = 'test';
$field_type = 'file';
$field_name = $this->randomMachineName();
@@ -191,7 +191,7 @@ class FileFieldDisplayTest extends FileFieldTestBase {
/**
* Tests description display of File Field.
*/
- public function testDescriptionDefaultFileFieldDisplay() {
+ public function testDescriptionDefaultFileFieldDisplay(): void {
$field_name = $this->randomMachineName();
$type_name = 'article';
$field_storage_settings = [
diff --git a/core/modules/file/tests/src/Functional/FileFieldFormatterAccessTest.php b/core/modules/file/tests/src/Functional/FileFieldFormatterAccessTest.php
index 058e41f53f1..243c75823d4 100644
--- a/core/modules/file/tests/src/Functional/FileFieldFormatterAccessTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldFormatterAccessTest.php
@@ -25,7 +25,7 @@ class FileFieldFormatterAccessTest extends FileFieldTestBase {
/**
* Tests the custom access handler is invoked.
*/
- public function testFileAccessHandler() {
+ public function testFileAccessHandler(): void {
$type_name = 'article';
$field_name = $this->randomMachineName();
$this->createFileField($field_name, 'node', $type_name);
diff --git a/core/modules/file/tests/src/Functional/FileFieldPathTest.php b/core/modules/file/tests/src/Functional/FileFieldPathTest.php
index 195cfe02064..0f4879afb54 100644
--- a/core/modules/file/tests/src/Functional/FileFieldPathTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldPathTest.php
@@ -21,7 +21,7 @@ class FileFieldPathTest extends FileFieldTestBase {
/**
* Tests the normal formatter display on node display.
*/
- public function testUploadPath() {
+ public function testUploadPath(): void {
/** @var \Drupal\node\NodeStorageInterface $node_storage */
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$field_name = $this->randomMachineName();
diff --git a/core/modules/file/tests/src/Functional/FileFieldRSSContentTest.php b/core/modules/file/tests/src/Functional/FileFieldRSSContentTest.php
index 6f4084822a8..798a2dc085d 100644
--- a/core/modules/file/tests/src/Functional/FileFieldRSSContentTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldRSSContentTest.php
@@ -28,7 +28,7 @@ class FileFieldRSSContentTest extends FileFieldTestBase {
/**
* Tests RSS enclosure formatter display for RSS feeds.
*/
- public function testFileFieldRSSContent() {
+ public function testFileFieldRSSContent(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$field_name = $this->randomMachineName();
$type_name = 'article';
diff --git a/core/modules/file/tests/src/Functional/FileFieldRevisionTest.php b/core/modules/file/tests/src/Functional/FileFieldRevisionTest.php
index 15183e118fc..9ccd57ac2df 100644
--- a/core/modules/file/tests/src/Functional/FileFieldRevisionTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldRevisionTest.php
@@ -30,7 +30,7 @@ class FileFieldRevisionTest extends FileFieldTestBase {
* - When the last revision that uses a file is deleted, the original file
* should be deleted also.
*/
- public function testRevisions() {
+ public function testRevisions(): void {
// This test expects unused managed files to be marked as a temporary file
// and then deleted up by file_cron().
$this->config('file.settings')
diff --git a/core/modules/file/tests/src/Functional/FileFieldValidateTest.php b/core/modules/file/tests/src/Functional/FileFieldValidateTest.php
index bd839ca08cb..651230da459 100644
--- a/core/modules/file/tests/src/Functional/FileFieldValidateTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldValidateTest.php
@@ -27,7 +27,7 @@ class FileFieldValidateTest extends FileFieldTestBase {
/**
* Tests the required property on file fields.
*/
- public function testRequired() {
+ public function testRequired(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$type_name = 'article';
$field_name = $this->randomMachineName();
@@ -77,7 +77,7 @@ class FileFieldValidateTest extends FileFieldTestBase {
/**
* Tests the max file size validator.
*/
- public function testFileMaxSize() {
+ public function testFileMaxSize(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$type_name = 'article';
$field_name = $this->randomMachineName();
@@ -129,7 +129,7 @@ class FileFieldValidateTest extends FileFieldTestBase {
/**
* Tests file extension checking.
*/
- public function testFileExtension() {
+ public function testFileExtension(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$type_name = 'article';
$field_name = $this->randomMachineName();
@@ -171,7 +171,7 @@ class FileFieldValidateTest extends FileFieldTestBase {
/**
* Checks that a file can always be removed if it does not pass validation.
*/
- public function testFileRemoval() {
+ public function testFileRemoval(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$type_name = 'article';
$field_name = 'file_test';
diff --git a/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php b/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php
index a548d3ed53d..13400de6c81 100644
--- a/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php
@@ -80,7 +80,7 @@ class FileFieldWidgetTest extends FileFieldTestBase {
/**
* Tests upload and remove buttons for a single-valued File field.
*/
- public function testSingleValuedWidget() {
+ public function testSingleValuedWidget(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$type_name = 'article';
$field_name = $this->randomMachineName();
@@ -121,7 +121,7 @@ class FileFieldWidgetTest extends FileFieldTestBase {
/**
* Tests upload and remove buttons for multiple multi-valued File fields.
*/
- public function testMultiValuedWidget() {
+ public function testMultiValuedWidget(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$type_name = 'article';
// Use explicit names instead of random names for those fields, because of a
@@ -246,7 +246,7 @@ class FileFieldWidgetTest extends FileFieldTestBase {
/**
* Tests a file field with a "Private files" upload destination setting.
*/
- public function testPrivateFileSetting() {
+ public function testPrivateFileSetting(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
// Grant the admin user required permissions.
user_role_grant_permissions($this->adminUser->roles[0]->target_id, ['administer node fields']);
@@ -286,7 +286,7 @@ class FileFieldWidgetTest extends FileFieldTestBase {
/**
* Tests that download restrictions on private files work on comments.
*/
- public function testPrivateFileComment() {
+ public function testPrivateFileComment(): void {
$user = $this->drupalCreateUser(['access comments']);
// Grant the admin user required comment permissions.
@@ -362,7 +362,7 @@ class FileFieldWidgetTest extends FileFieldTestBase {
/**
* Tests validation with the Upload button.
*/
- public function testWidgetValidation() {
+ public function testWidgetValidation(): void {
$type_name = 'article';
$field_name = $this->randomMachineName();
$this->createFileField($field_name, 'node', $type_name);
@@ -392,7 +392,7 @@ class FileFieldWidgetTest extends FileFieldTestBase {
/**
* Tests file widget element.
*/
- public function testWidgetElement() {
+ public function testWidgetElement(): void {
$field_name = $this->randomMachineName();
$html_name = str_replace('_', '-', $field_name);
$this->createFileField($field_name, 'node', 'article', ['cardinality' => FieldStorageConfig::CARDINALITY_UNLIMITED]);
@@ -429,7 +429,7 @@ class FileFieldWidgetTest extends FileFieldTestBase {
/**
* Tests exploiting the temporary file removal of another user using fid.
*/
- public function testTemporaryFileRemovalExploit() {
+ public function testTemporaryFileRemovalExploit(): void {
// Create a victim user.
$victim_user = $this->drupalCreateUser();
@@ -450,7 +450,7 @@ class FileFieldWidgetTest extends FileFieldTestBase {
/**
* Tests exploiting the temporary file removal for anonymous users using fid.
*/
- public function testTemporaryFileRemovalExploitAnonymous() {
+ public function testTemporaryFileRemovalExploitAnonymous(): void {
// Set up an anonymous victim user.
$victim_user = User::getAnonymousUser();
@@ -474,7 +474,7 @@ class FileFieldWidgetTest extends FileFieldTestBase {
/**
* Tests maximum upload file size validation.
*/
- public function testMaximumUploadFileSizeValidation() {
+ public function testMaximumUploadFileSizeValidation(): void {
// Grant the admin user required permissions.
user_role_grant_permissions($this->adminUser->roles[0]->target_id, ['administer node fields']);
@@ -501,7 +501,7 @@ class FileFieldWidgetTest extends FileFieldTestBase {
/**
* Tests configuring file field's allowed file extensions setting.
*/
- public function testFileExtensionsSetting() {
+ public function testFileExtensionsSetting(): void {
// Grant the admin user required permissions.
user_role_grant_permissions($this->adminUser->roles[0]->target_id, ['administer node fields']);
diff --git a/core/modules/file/tests/src/Functional/FileListingTest.php b/core/modules/file/tests/src/Functional/FileListingTest.php
index 532e6f0d6be..332a9c3bce4 100644
--- a/core/modules/file/tests/src/Functional/FileListingTest.php
+++ b/core/modules/file/tests/src/Functional/FileListingTest.php
@@ -80,7 +80,7 @@ class FileListingTest extends FileFieldTestBase {
/**
* Tests file overview with different user permissions.
*/
- public function testFileListingPages() {
+ public function testFileListingPages(): void {
$file_usage = $this->container->get('file.usage');
// Users without sufficient permissions should not see file listing.
$this->drupalLogin($this->baseUser);
@@ -210,7 +210,7 @@ class FileListingTest extends FileFieldTestBase {
/**
* Tests file listing usage page for entities with no canonical link template.
*/
- public function testFileListingUsageNoLink() {
+ public function testFileListingUsageNoLink(): void {
// Login with user with right permissions and test listing.
$this->drupalLogin($this->adminUser);
diff --git a/core/modules/file/tests/src/Functional/FileManagedFileElementTest.php b/core/modules/file/tests/src/Functional/FileManagedFileElementTest.php
index 29a354c681c..2d02bc48637 100644
--- a/core/modules/file/tests/src/Functional/FileManagedFileElementTest.php
+++ b/core/modules/file/tests/src/Functional/FileManagedFileElementTest.php
@@ -24,7 +24,7 @@ class FileManagedFileElementTest extends FileFieldTestBase {
/**
* Tests the managed_file element type.
*/
- public function testManagedFile() {
+ public function testManagedFile(): void {
// Check that $element['#size'] is passed to the child upload element.
$this->drupalGet('file/test');
$field = $this->assertSession()->fieldExists("files[nested_file]");
@@ -149,7 +149,7 @@ class FileManagedFileElementTest extends FileFieldTestBase {
/**
* Ensure that warning is shown if file on the field has been removed.
*/
- public function testManagedFileRemoved() {
+ public function testManagedFileRemoved(): void {
$this->drupalGet('file/test/1/0/1');
$test_file = $this->getTestFile('text');
$file_field_name = 'files[nested_file][]';
@@ -170,7 +170,7 @@ class FileManagedFileElementTest extends FileFieldTestBase {
/**
* Tests file names have leading . removed.
*/
- public function testFileNameTrim() {
+ public function testFileNameTrim(): void {
file_put_contents('public://.leading-period.txt', $this->randomString(32));
$last_fid_prior = $this->getLastFileId();
$this->drupalGet('file/test/0/0/0');
@@ -184,7 +184,7 @@ class FileManagedFileElementTest extends FileFieldTestBase {
/**
* Ensure a file entity can be saved when the file does not exist on disk.
*/
- public function testFileRemovedFromDisk() {
+ public function testFileRemovedFromDisk(): void {
$this->drupalGet('file/test/1/0/1');
$test_file = $this->getTestFile('text');
$file_field_name = 'files[nested_file][]';
@@ -207,7 +207,7 @@ class FileManagedFileElementTest extends FileFieldTestBase {
/**
* Verify that unused permanent files can be used.
*/
- public function testUnusedPermanentFileValidation() {
+ public function testUnusedPermanentFileValidation(): void {
// Create a permanent file without usages.
$file = $this->getTestFile('image');
diff --git a/core/modules/file/tests/src/Functional/FileOnTranslatedEntityTest.php b/core/modules/file/tests/src/Functional/FileOnTranslatedEntityTest.php
index 7b40b5cca10..bc97169642b 100644
--- a/core/modules/file/tests/src/Functional/FileOnTranslatedEntityTest.php
+++ b/core/modules/file/tests/src/Functional/FileOnTranslatedEntityTest.php
@@ -82,7 +82,7 @@ class FileOnTranslatedEntityTest extends FileFieldTestBase {
/**
* Tests synced file fields on translated nodes.
*/
- public function testSyncedFiles() {
+ public function testSyncedFiles(): void {
// Verify that the file field on the "Basic page" node type is translatable.
$definitions = \Drupal::service('entity_field.manager')->getFieldDefinitions('node', 'page');
$this->assertTrue($definitions[$this->fieldName]->isTranslatable(), 'Node file field is translatable.');
@@ -213,7 +213,7 @@ class FileOnTranslatedEntityTest extends FileFieldTestBase {
/**
* Tests if file field tracks file usages correctly on translated nodes.
*/
- public function testFileUsage() {
+ public function testFileUsage(): void {
/** @var \Drupal\file\FileUsage\FileUsageInterface $file_usage */
$file_usage = \Drupal::service('file.usage');
diff --git a/core/modules/file/tests/src/Functional/FilePrivateTest.php b/core/modules/file/tests/src/Functional/FilePrivateTest.php
index 84e4b125962..17175ad99d0 100644
--- a/core/modules/file/tests/src/Functional/FilePrivateTest.php
+++ b/core/modules/file/tests/src/Functional/FilePrivateTest.php
@@ -44,7 +44,7 @@ class FilePrivateTest extends FileFieldTestBase {
/**
* Tests file access for file uploaded to a private node.
*/
- public function testPrivateFile() {
+ public function testPrivateFile(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
diff --git a/core/modules/file/tests/src/Functional/FileTokenReplaceTest.php b/core/modules/file/tests/src/Functional/FileTokenReplaceTest.php
index 761a37cf327..4a68d731490 100644
--- a/core/modules/file/tests/src/Functional/FileTokenReplaceTest.php
+++ b/core/modules/file/tests/src/Functional/FileTokenReplaceTest.php
@@ -24,7 +24,7 @@ class FileTokenReplaceTest extends FileFieldTestBase {
/**
* Creates a file, then tests the tokens generated from it.
*/
- public function testFileTokenReplacement() {
+ public function testFileTokenReplacement(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$token_service = \Drupal::token();
$language_interface = \Drupal::languageManager()->getCurrentLanguage();
diff --git a/core/modules/file/tests/src/Functional/Formatter/FileAudioFormatterTest.php b/core/modules/file/tests/src/Functional/Formatter/FileAudioFormatterTest.php
index 4c17b2d86b8..a4591ed353c 100644
--- a/core/modules/file/tests/src/Functional/Formatter/FileAudioFormatterTest.php
+++ b/core/modules/file/tests/src/Functional/Formatter/FileAudioFormatterTest.php
@@ -23,7 +23,7 @@ class FileAudioFormatterTest extends FileMediaFormatterTestBase {
*
* @dataProvider dataProvider
*/
- public function testRender($tag_count, $formatter_settings) {
+ public function testRender($tag_count, $formatter_settings): void {
$field_config = $this->createMediaField('file_audio', 'mp3', $formatter_settings);
file_put_contents('public://file.mp3', str_repeat('t', 10));
diff --git a/core/modules/file/tests/src/Functional/Formatter/FileVideoFormatterTest.php b/core/modules/file/tests/src/Functional/Formatter/FileVideoFormatterTest.php
index fd4fe6899fa..651fefdff9c 100644
--- a/core/modules/file/tests/src/Functional/Formatter/FileVideoFormatterTest.php
+++ b/core/modules/file/tests/src/Functional/Formatter/FileVideoFormatterTest.php
@@ -23,7 +23,7 @@ class FileVideoFormatterTest extends FileMediaFormatterTestBase {
*
* @dataProvider dataProvider
*/
- public function testRender($tag_count, $formatter_settings) {
+ public function testRender($tag_count, $formatter_settings): void {
$field_config = $this->createMediaField('file_video', 'mp4', $formatter_settings);
file_put_contents('public://file.mp4', str_repeat('t', 10));
@@ -65,7 +65,7 @@ class FileVideoFormatterTest extends FileMediaFormatterTestBase {
/**
* Tests that the attributes added to the formatter are applied on render.
*/
- public function testAttributes() {
+ public function testAttributes(): void {
$field_config = $this->createMediaField(
'file_video',
'mp4',
diff --git a/core/modules/file/tests/src/Functional/MultipleFileUploadTest.php b/core/modules/file/tests/src/Functional/MultipleFileUploadTest.php
index 1d3a10ad9d8..f2aa592111d 100644
--- a/core/modules/file/tests/src/Functional/MultipleFileUploadTest.php
+++ b/core/modules/file/tests/src/Functional/MultipleFileUploadTest.php
@@ -36,7 +36,7 @@ class MultipleFileUploadTest extends BrowserTestBase {
/**
* Tests multiple file field with all file extensions.
*/
- public function testMultipleFileFieldWithAllFileExtensions() {
+ public function testMultipleFileFieldWithAllFileExtensions(): void {
$theme = 'test_theme_settings';
\Drupal::service('theme_installer')->install([$theme]);
$this->drupalGet("admin/appearance/settings/$theme");
diff --git a/core/modules/file/tests/src/Functional/PrivateFileOnTranslatedEntityTest.php b/core/modules/file/tests/src/Functional/PrivateFileOnTranslatedEntityTest.php
index 2ffa36180ea..41c1b19fa20 100644
--- a/core/modules/file/tests/src/Functional/PrivateFileOnTranslatedEntityTest.php
+++ b/core/modules/file/tests/src/Functional/PrivateFileOnTranslatedEntityTest.php
@@ -72,7 +72,7 @@ class PrivateFileOnTranslatedEntityTest extends FileFieldTestBase {
/**
* Tests private file fields on translated nodes.
*/
- public function testPrivateLanguageFile() {
+ public function testPrivateLanguageFile(): void {
// Verify that the file field on the "Basic page" node type is translatable.
$definitions = \Drupal::service('entity_field.manager')->getFieldDefinitions('node', 'page');
$this->assertTrue($definitions[$this->fieldName]->isTranslatable(), 'Node file field is translatable.');
diff --git a/core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php b/core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php
index 1383673df3c..b8f448d1654 100644
--- a/core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php
+++ b/core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php
@@ -200,7 +200,7 @@ abstract class FileResourceTestBase extends EntityResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPost() {
+ public function testPost(): void {
// Drupal does not allow creating file entities independently. It allows you
// to create file entities that are referenced from another entity (e.g. an
// image for a node's image field).
diff --git a/core/modules/file/tests/src/Functional/SaveUploadFormTest.php b/core/modules/file/tests/src/Functional/SaveUploadFormTest.php
index 30971e76fcd..e13b69d5c48 100644
--- a/core/modules/file/tests/src/Functional/SaveUploadFormTest.php
+++ b/core/modules/file/tests/src/Functional/SaveUploadFormTest.php
@@ -105,7 +105,7 @@ class SaveUploadFormTest extends FileManagedTestBase {
/**
* Tests the _file_save_upload_from_form() function.
*/
- public function testNormal() {
+ public function testNormal(): void {
$max_fid_after = (int) \Drupal::entityQueryAggregate('file')
->accessCheck(FALSE)
->aggregate('fid', 'max')
@@ -165,7 +165,7 @@ class SaveUploadFormTest extends FileManagedTestBase {
/**
* Tests extension handling.
*/
- public function testHandleExtension() {
+ public function testHandleExtension(): void {
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
// The file being tested is a .gif which is in the default safe list
@@ -230,7 +230,7 @@ class SaveUploadFormTest extends FileManagedTestBase {
/**
* Tests dangerous file handling.
*/
- public function testHandleDangerousFile() {
+ public function testHandleDangerousFile(): void {
$config = $this->config('system.file');
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
@@ -295,7 +295,7 @@ class SaveUploadFormTest extends FileManagedTestBase {
/**
* Tests file munge handling.
*/
- public function testHandleFileMunge() {
+ public function testHandleFileMunge(): void {
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
// Ensure insecure uploads are disabled for this test.
@@ -395,7 +395,7 @@ class SaveUploadFormTest extends FileManagedTestBase {
/**
* Tests renaming when uploading over a file that already exists.
*/
- public function testExistingRename() {
+ public function testExistingRename(): void {
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
$edit = [
@@ -414,7 +414,7 @@ class SaveUploadFormTest extends FileManagedTestBase {
/**
* Tests replacement when uploading over a file that already exists.
*/
- public function testExistingReplace() {
+ public function testExistingReplace(): void {
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
$edit = [
@@ -433,7 +433,7 @@ class SaveUploadFormTest extends FileManagedTestBase {
/**
* Tests for failure when uploading over a file that already exists.
*/
- public function testExistingError() {
+ public function testExistingError(): void {
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
$edit = [
@@ -452,7 +452,7 @@ class SaveUploadFormTest extends FileManagedTestBase {
/**
* Tests for no failures when not uploading a file.
*/
- public function testNoUpload() {
+ public function testNoUpload(): void {
$this->drupalGet('file-test/save_upload_from_form_test');
$this->submitForm([], 'Submit');
$this->assertSession()->pageTextNotContains("Epic upload FAIL!");
@@ -461,7 +461,7 @@ class SaveUploadFormTest extends FileManagedTestBase {
/**
* Tests for log entry on failing destination.
*/
- public function testDrupalMovingUploadedFileError() {
+ public function testDrupalMovingUploadedFileError(): void {
// Create a directory and make it not writable.
$test_directory = 'test_drupal_move_uploaded_file_fail';
\Drupal::service('file_system')->mkdir('temporary://' . $test_directory, 0000);
@@ -493,7 +493,7 @@ class SaveUploadFormTest extends FileManagedTestBase {
/**
* Tests that form validation does not change error messages.
*/
- public function testErrorMessagesAreNotChanged() {
+ public function testErrorMessagesAreNotChanged(): void {
$error = 'An error message set before _file_save_upload_from_form()';
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
@@ -549,7 +549,7 @@ class SaveUploadFormTest extends FileManagedTestBase {
/**
* Tests that multiple validation errors are combined in one message.
*/
- public function testCombinedErrorMessages() {
+ public function testCombinedErrorMessages(): void {
$text_file = current($this->drupalGetTestFiles('text'));
$this->assertFileExists($text_file->uri);
@@ -579,7 +579,7 @@ class SaveUploadFormTest extends FileManagedTestBase {
/**
* Tests highlighting of file upload field when it has an error.
*/
- public function testUploadFieldIsHighlighted() {
+ public function testUploadFieldIsHighlighted(): void {
$this->assertCount(0, $this->cssSelect('input[name="files[file_test_upload][]"].error'), 'Successful file upload has no error.');
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
diff --git a/core/modules/file/tests/src/Functional/SaveUploadTest.php b/core/modules/file/tests/src/Functional/SaveUploadTest.php
index 8d71b1f38da..17f6fb678e6 100644
--- a/core/modules/file/tests/src/Functional/SaveUploadTest.php
+++ b/core/modules/file/tests/src/Functional/SaveUploadTest.php
@@ -113,7 +113,7 @@ class SaveUploadTest extends FileManagedTestBase {
/**
* Tests the file_save_upload() function.
*/
- public function testNormal() {
+ public function testNormal(): void {
$max_fid_after = (int) \Drupal::entityQueryAggregate('file')
->accessCheck(FALSE)
->aggregate('fid', 'max')
@@ -171,7 +171,7 @@ class SaveUploadTest extends FileManagedTestBase {
/**
* Tests uploading a duplicate file.
*/
- public function testDuplicate() {
+ public function testDuplicate(): void {
// It should not be possible to create two managed files with the same URI.
$image1 = current($this->drupalGetTestFiles('image'));
$edit = ['files[file_test_upload]' => \Drupal::service('file_system')->realpath($image1->uri)];
@@ -207,7 +207,7 @@ class SaveUploadTest extends FileManagedTestBase {
/**
* Tests extension handling.
*/
- public function testHandleExtension() {
+ public function testHandleExtension(): void {
// The file being tested is a .gif which is in the default safe list
// of extensions to allow when the extension validator isn't used. This is
// implicitly tested at the testNormal() test. Here we tell
@@ -291,7 +291,7 @@ class SaveUploadTest extends FileManagedTestBase {
/**
* Tests dangerous file handling.
*/
- public function testHandleDangerousFile() {
+ public function testHandleDangerousFile(): void {
$config = $this->config('system.file');
// Allow the .php extension and make sure it gets munged and given a .txt
// extension for safety. Also check to make sure its MIME type was changed.
@@ -385,7 +385,7 @@ class SaveUploadTest extends FileManagedTestBase {
/**
* Test dangerous file handling.
*/
- public function testHandleDotFile() {
+ public function testHandleDotFile(): void {
$dot_file = $this->siteDirectory . '/.test';
file_put_contents($dot_file, 'This is a test');
$config = $this->config('system.file');
@@ -442,7 +442,7 @@ class SaveUploadTest extends FileManagedTestBase {
/**
* Tests file munge handling.
*/
- public function testHandleFileMunge() {
+ public function testHandleFileMunge(): void {
// Ensure insecure uploads are disabled for this test.
$this->config('system.file')->set('allow_insecure_uploads', 0)->save();
$original_image_uri = $this->image->getFileUri();
@@ -599,7 +599,7 @@ class SaveUploadTest extends FileManagedTestBase {
/**
* Tests renaming when uploading over a file that already exists.
*/
- public function testExistingRename() {
+ public function testExistingRename(): void {
$edit = [
'file_test_replace' => FileExists::Rename->name,
'files[file_test_upload]' => \Drupal::service('file_system')->realpath($this->image->getFileUri()),
@@ -617,7 +617,7 @@ class SaveUploadTest extends FileManagedTestBase {
/**
* Tests replacement when uploading over a file that already exists.
*/
- public function testExistingReplace() {
+ public function testExistingReplace(): void {
$edit = [
'file_test_replace' => FileExists::Replace->name,
'files[file_test_upload]' => \Drupal::service('file_system')->realpath($this->image->getFileUri()),
@@ -635,7 +635,7 @@ class SaveUploadTest extends FileManagedTestBase {
/**
* Tests for failure when uploading over a file that already exists.
*/
- public function testExistingError() {
+ public function testExistingError(): void {
$edit = [
'file_test_replace' => FileExists::Error->name,
'files[file_test_upload]' => \Drupal::service('file_system')->realpath($this->image->getFileUri()),
@@ -652,7 +652,7 @@ class SaveUploadTest extends FileManagedTestBase {
/**
* Tests for no failures when not uploading a file.
*/
- public function testNoUpload() {
+ public function testNoUpload(): void {
$this->drupalGet('file-test/upload');
$this->submitForm([], 'Submit');
$this->assertSession()->pageTextNotContains("Epic upload FAIL!");
@@ -661,7 +661,7 @@ class SaveUploadTest extends FileManagedTestBase {
/**
* Tests for log entry on failing destination.
*/
- public function testDrupalMovingUploadedFileError() {
+ public function testDrupalMovingUploadedFileError(): void {
// Create a directory and make it not writable.
$test_directory = 'test_drupal_move_uploaded_file_fail';
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
@@ -693,7 +693,7 @@ class SaveUploadTest extends FileManagedTestBase {
/**
* Tests that filenames containing invalid UTF-8 are rejected.
*/
- public function testInvalidUtf8FilenameUpload() {
+ public function testInvalidUtf8FilenameUpload(): void {
$this->drupalGet('file-test/upload');
// Filename containing invalid UTF-8.
@@ -749,7 +749,7 @@ class SaveUploadTest extends FileManagedTestBase {
/**
* Tests the file_save_upload() function when the field is required.
*/
- public function testRequired() {
+ public function testRequired(): void {
// Reset the hook counters to get rid of the 'load' we just called.
file_test_reset();
@@ -771,7 +771,7 @@ class SaveUploadTest extends FileManagedTestBase {
/**
* Tests filename sanitization.
*/
- public function testSanitization() {
+ public function testSanitization(): void {
$file = $this->generateFile('TÉXT-œ', 64, 5, 'text');
$this->drupalGet('file-test/upload');
diff --git a/core/modules/file/tests/src/FunctionalJavascript/AjaxFileManagedMultipleTest.php b/core/modules/file/tests/src/FunctionalJavascript/AjaxFileManagedMultipleTest.php
index 31170648994..e7fb4e3e701 100644
--- a/core/modules/file/tests/src/FunctionalJavascript/AjaxFileManagedMultipleTest.php
+++ b/core/modules/file/tests/src/FunctionalJavascript/AjaxFileManagedMultipleTest.php
@@ -32,7 +32,7 @@ class AjaxFileManagedMultipleTest extends WebDriverTestBase {
/**
* Tests if managed file form element works well with multiple files upload.
*/
- public function testMultipleFilesUpload() {
+ public function testMultipleFilesUpload(): void {
$file_system = \Drupal::service('file_system');
$file_storage = \Drupal::entityTypeManager()->getStorage('file');
$page = $this->getSession()->getPage();
diff --git a/core/modules/file/tests/src/FunctionalJavascript/FileFieldValidateTest.php b/core/modules/file/tests/src/FunctionalJavascript/FileFieldValidateTest.php
index 315d7983bda..724b80db8e3 100644
--- a/core/modules/file/tests/src/FunctionalJavascript/FileFieldValidateTest.php
+++ b/core/modules/file/tests/src/FunctionalJavascript/FileFieldValidateTest.php
@@ -34,7 +34,7 @@ class FileFieldValidateTest extends WebDriverTestBase {
/**
* Tests the validation message is displayed only once for ajax uploads.
*/
- public function testAjaxValidationMessage() {
+ public function testAjaxValidationMessage(): void {
$field_name = $this->randomMachineName();
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
$this->createFileField($field_name, 'node', 'article', [], ['file_extensions' => 'txt']);
diff --git a/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php b/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php
index a73482afe36..d73603b3441 100644
--- a/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php
+++ b/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php
@@ -62,7 +62,7 @@ class FileFieldWidgetTest extends WebDriverTestBase {
/**
* Tests upload and remove buttons for multiple multi-valued File fields.
*/
- public function testMultiValuedWidget() {
+ public function testMultiValuedWidget(): void {
$type_name = 'article';
$field_name = 'test_file_field_1';
$field_name2 = 'test_file_field_2';
@@ -137,7 +137,7 @@ class FileFieldWidgetTest extends WebDriverTestBase {
/**
* Tests uploading and remove buttons for a single-valued File field.
*/
- public function testSingleValuedWidget() {
+ public function testSingleValuedWidget(): void {
$type_name = 'article';
$field_name = 'test_file_field_1';
$cardinality = 1;
@@ -187,7 +187,7 @@ class FileFieldWidgetTest extends WebDriverTestBase {
/**
* Tests uploading more files than allowed at once.
*/
- public function testUploadingMoreFilesThanAllowed() {
+ public function testUploadingMoreFilesThanAllowed(): void {
$type_name = 'article';
$field_name = 'test_file_field_1';
$cardinality = 2;
diff --git a/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php b/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php
index 67efd3eab91..8924703c8fd 100644
--- a/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php
+++ b/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php
@@ -54,7 +54,7 @@ class FileManagedFileElementTest extends WebDriverTestBase {
/**
* Tests the managed_file element type.
*/
- public function testManagedFile() {
+ public function testManagedFile(): void {
// Perform the tests with all permutations of $form['#tree'],
// $element['#extended'], and $element['#multiple'].
$filename = \Drupal::service('file_system')->tempnam('temporary://', "testManagedFile") . '.txt';
diff --git a/core/modules/file/tests/src/FunctionalJavascript/MaximumFileSizeExceededUploadTest.php b/core/modules/file/tests/src/FunctionalJavascript/MaximumFileSizeExceededUploadTest.php
index 7f6d0685f82..57e01039ee3 100644
--- a/core/modules/file/tests/src/FunctionalJavascript/MaximumFileSizeExceededUploadTest.php
+++ b/core/modules/file/tests/src/FunctionalJavascript/MaximumFileSizeExceededUploadTest.php
@@ -97,7 +97,7 @@ class MaximumFileSizeExceededUploadTest extends WebDriverTestBase {
/**
* Tests that uploading files exceeding maximum size are handled correctly.
*/
- public function testUploadFileExceedingMaximumFileSize() {
+ public function testUploadFileExceedingMaximumFileSize(): void {
$session = $this->getSession();
// Create a test file that exceeds the maximum POST size with 1 kilobyte.
diff --git a/core/modules/file/tests/src/Kernel/AccessTest.php b/core/modules/file/tests/src/Kernel/AccessTest.php
index a3a1e2551a2..7f9005bcc15 100644
--- a/core/modules/file/tests/src/Kernel/AccessTest.php
+++ b/core/modules/file/tests/src/Kernel/AccessTest.php
@@ -41,7 +41,7 @@ class AccessTest extends KernelTestBase {
/**
* Tests 'update' and 'delete' access to file entities.
*/
- public function testFileAccess() {
+ public function testFileAccess(): void {
// Create a user so the tested users do not have the magic ID of user 1.
$this->createUser();
@@ -120,7 +120,7 @@ class AccessTest extends KernelTestBase {
*
* @see \Drupal\file\FileAccessControlHandler::checkFieldAccess()
*/
- public function testCheckFieldAccess() {
+ public function testCheckFieldAccess(): void {
$this->setUpCurrentUser();
/** @var \Drupal\file\FileInterface $file */
$file = File::create([
@@ -147,7 +147,7 @@ class AccessTest extends KernelTestBase {
*
* @see \Drupal\file\FileAccessControlHandler::checkCreateAccess()
*/
- public function testCreateAccess() {
+ public function testCreateAccess(): void {
$user1 = $this->createUser([
'delete own files',
]);
@@ -168,7 +168,7 @@ class AccessTest extends KernelTestBase {
/**
* Tests cacheability metadata.
*/
- public function testFileCacheability() {
+ public function testFileCacheability(): void {
$file = File::create([
'filename' => 'green-scarf',
'uri' => 'private://green-scarf',
diff --git a/core/modules/file/tests/src/Kernel/ComputedFileUrlTest.php b/core/modules/file/tests/src/Kernel/ComputedFileUrlTest.php
index 7c38ce36091..46a37bdafc5 100644
--- a/core/modules/file/tests/src/Kernel/ComputedFileUrlTest.php
+++ b/core/modules/file/tests/src/Kernel/ComputedFileUrlTest.php
@@ -27,7 +27,7 @@ class ComputedFileUrlTest extends KernelTestBase {
/**
* @covers ::getValue
*/
- public function testGetValue() {
+ public function testGetValue(): void {
$entity = $this->prophesize(FileInterface::class);
$entity->getFileUri()
->willReturn($this->testUrl);
@@ -52,7 +52,7 @@ class ComputedFileUrlTest extends KernelTestBase {
/**
* @covers ::setValue
*/
- public function testSetValue() {
+ public function testSetValue(): void {
$name = $this->randomMachineName();
$parent = $this->prophesize(FieldItemInterface::class);
$parent->onChange($name)
@@ -74,7 +74,7 @@ class ComputedFileUrlTest extends KernelTestBase {
/**
* @covers ::setValue
*/
- public function testSetValueNoNotify() {
+ public function testSetValueNoNotify(): void {
$name = $this->randomMachineName();
$parent = $this->prophesize(FieldItemInterface::class);
$parent->onChange($name)
diff --git a/core/modules/file/tests/src/Kernel/CopyTest.php b/core/modules/file/tests/src/Kernel/CopyTest.php
index 512f360b53e..7f3f70b759d 100644
--- a/core/modules/file/tests/src/Kernel/CopyTest.php
+++ b/core/modules/file/tests/src/Kernel/CopyTest.php
@@ -40,7 +40,7 @@ class CopyTest extends FileManagedUnitTestBase {
*
* @covers ::copy
*/
- public function testNormal() {
+ public function testNormal(): void {
$contents = $this->randomMachineName(10);
$source = $this->createFile(NULL, $contents);
$desired_uri = 'public://' . $this->randomMachineName();
@@ -71,7 +71,7 @@ class CopyTest extends FileManagedUnitTestBase {
*
* @covers ::copy
*/
- public function testExistingRename() {
+ public function testExistingRename(): void {
// Setup a file to overwrite.
$contents = $this->randomMachineName(10);
$source = $this->createFile(NULL, $contents);
@@ -113,7 +113,7 @@ class CopyTest extends FileManagedUnitTestBase {
*
* @covers ::copy
*/
- public function testExistingReplace() {
+ public function testExistingReplace(): void {
// Setup a file to overwrite.
$contents = $this->randomMachineName(10);
$source = $this->createFile(NULL, $contents);
@@ -153,7 +153,7 @@ class CopyTest extends FileManagedUnitTestBase {
*
* @covers ::copy
*/
- public function testExistingError() {
+ public function testExistingError(): void {
$contents = $this->randomMachineName(10);
$source = $this->createFile();
$target = $this->createFile(NULL, $contents);
@@ -185,7 +185,7 @@ class CopyTest extends FileManagedUnitTestBase {
*
* @covers ::copy
*/
- public function testInvalidStreamWrapper() {
+ public function testInvalidStreamWrapper(): void {
$this->expectException(InvalidStreamWrapperException::class);
$this->expectExceptionMessage('Invalid stream wrapper: foo://');
$source = $this->createFile();
@@ -197,7 +197,7 @@ class CopyTest extends FileManagedUnitTestBase {
*
* @covers ::copy
*/
- public function testEntityStorageException() {
+ public function testEntityStorageException(): void {
/** @var \Drupal\Core\Entity\EntityTypeManager $entityTypeManager */
$entityTypeManager = $this->prophesize(EntityTypeManager::class);
$entityTypeManager->getStorage('file')
diff --git a/core/modules/file/tests/src/Kernel/DeleteTest.php b/core/modules/file/tests/src/Kernel/DeleteTest.php
index 2024f39f665..e7e9a90a537 100644
--- a/core/modules/file/tests/src/Kernel/DeleteTest.php
+++ b/core/modules/file/tests/src/Kernel/DeleteTest.php
@@ -17,7 +17,7 @@ class DeleteTest extends FileManagedUnitTestBase {
/**
* Tries deleting a normal file (as opposed to a directory, symlink, etc).
*/
- public function testUnused() {
+ public function testUnused(): void {
$file = $this->createFile();
// Check that deletion removes the file and database record.
@@ -31,7 +31,7 @@ class DeleteTest extends FileManagedUnitTestBase {
/**
* Tries deleting a file that is in use.
*/
- public function testInUse() {
+ public function testInUse(): void {
// This test expects unused managed files to be marked as a temporary file
// and then deleted up by file_cron().
$this->config('file.settings')
@@ -82,7 +82,7 @@ class DeleteTest extends FileManagedUnitTestBase {
/**
* Tries to run cron deletion on file deleted from the file-system.
*/
- public function testCronDeleteNonExistingTemporary() {
+ public function testCronDeleteNonExistingTemporary(): void {
$file = $this->createFile();
// Delete the file, but leave it in the file_managed table.
\Drupal::service('file_system')->delete($file->getFileUri());
diff --git a/core/modules/file/tests/src/Kernel/FileItemTest.php b/core/modules/file/tests/src/Kernel/FileItemTest.php
index db196eba8bb..9a00dace1cb 100644
--- a/core/modules/file/tests/src/Kernel/FileItemTest.php
+++ b/core/modules/file/tests/src/Kernel/FileItemTest.php
@@ -82,7 +82,7 @@ class FileItemTest extends FieldKernelTestBase {
/**
* Tests using entity fields of the file field type.
*/
- public function testFileItem() {
+ public function testFileItem(): void {
// Check that the selection handler was automatically assigned to
// 'default:file'.
$field_definition = FieldConfig::load('entity_test.entity_test.file_test');
diff --git a/core/modules/file/tests/src/Kernel/FileItemValidationTest.php b/core/modules/file/tests/src/Kernel/FileItemValidationTest.php
index f92e3e7643e..6358163c866 100644
--- a/core/modules/file/tests/src/Kernel/FileItemValidationTest.php
+++ b/core/modules/file/tests/src/Kernel/FileItemValidationTest.php
@@ -62,7 +62,7 @@ class FileItemValidationTest extends KernelTestBase {
* @covers \Drupal\file\Plugin\Validation\Constraint\FileValidationConstraintValidator
* @dataProvider getFileTypes
*/
- public function testFileValidationConstraint($file_type) {
+ public function testFileValidationConstraint($file_type): void {
$field_storage = FieldStorageConfig::create([
'field_name' => 'field_test_file',
'entity_type' => 'entity_test',
diff --git a/core/modules/file/tests/src/Kernel/FileManagedAccessTest.php b/core/modules/file/tests/src/Kernel/FileManagedAccessTest.php
index bf31abfc1bf..e986a5a8d48 100644
--- a/core/modules/file/tests/src/Kernel/FileManagedAccessTest.php
+++ b/core/modules/file/tests/src/Kernel/FileManagedAccessTest.php
@@ -32,7 +32,7 @@ class FileManagedAccessTest extends KernelTestBase {
/**
* Tests if public file is always accessible.
*/
- public function testFileAccess() {
+ public function testFileAccess(): void {
$this->installEntitySchema('user');
$this->installEntitySchema('file');
$this->installSchema('file', ['file_usage']);
diff --git a/core/modules/file/tests/src/Kernel/FileRepositoryTest.php b/core/modules/file/tests/src/Kernel/FileRepositoryTest.php
index fc3e41a204b..fc5283c620c 100644
--- a/core/modules/file/tests/src/Kernel/FileRepositoryTest.php
+++ b/core/modules/file/tests/src/Kernel/FileRepositoryTest.php
@@ -49,7 +49,7 @@ class FileRepositoryTest extends FileManagedUnitTestBase {
*
* @covers ::writeData
*/
- public function testWithFilename() {
+ public function testWithFilename(): void {
$contents = $this->randomMachineName();
// Using filename with non-latin characters.
@@ -79,7 +79,7 @@ class FileRepositoryTest extends FileManagedUnitTestBase {
*
* @covers ::writeData
*/
- public function testExistingRename() {
+ public function testExistingRename(): void {
// Setup a file to overwrite.
$existing = $this->createFile();
$contents = $this->randomMachineName();
@@ -111,7 +111,7 @@ class FileRepositoryTest extends FileManagedUnitTestBase {
*
* @covers ::writeData
*/
- public function testExistingReplace() {
+ public function testExistingReplace(): void {
// Setup a file to overwrite.
$existing = $this->createFile();
$contents = $this->randomMachineName();
@@ -142,7 +142,7 @@ class FileRepositoryTest extends FileManagedUnitTestBase {
*
* @covers ::writeData
*/
- public function testExistingError() {
+ public function testExistingError(): void {
$contents = $this->randomMachineName();
$existing = $this->createFile(NULL, $contents);
@@ -170,7 +170,7 @@ class FileRepositoryTest extends FileManagedUnitTestBase {
*
* @covers ::writeData
*/
- public function testInvalidStreamWrapper() {
+ public function testInvalidStreamWrapper(): void {
$this->expectException(InvalidStreamWrapperException::class);
$this->expectExceptionMessage('Invalid stream wrapper: foo://');
$this->fileRepository->writeData('asdf', 'foo://');
@@ -181,7 +181,7 @@ class FileRepositoryTest extends FileManagedUnitTestBase {
*
* @covers ::writeData
*/
- public function testEntityStorageException() {
+ public function testEntityStorageException(): void {
/** @var \Drupal\Core\Entity\EntityTypeManager $entityTypeManager */
$entityTypeManager = $this->prophesize(EntityTypeManager::class);
$entityTypeManager->getStorage('file')
@@ -206,7 +206,7 @@ class FileRepositoryTest extends FileManagedUnitTestBase {
*
* @covers ::loadByUri
*/
- public function testLoadByUri() {
+ public function testLoadByUri(): void {
$source = $this->createFile();
$result = $this->fileRepository->loadByUri($source->getFileUri());
$this->assertSameFile($source, $result);
@@ -217,7 +217,7 @@ class FileRepositoryTest extends FileManagedUnitTestBase {
*
* @covers ::loadByUri
*/
- public function testLoadByUriCaseSensitive() {
+ public function testLoadByUriCaseSensitive(): void {
$source = $this->createFile('FooBar.txt');
$result = $this->fileRepository->loadByUri('public://FooBar.txt');
$this->assertSameFile($source, $result);
diff --git a/core/modules/file/tests/src/Kernel/FileUriItemTest.php b/core/modules/file/tests/src/Kernel/FileUriItemTest.php
index 245f54b241f..52904831677 100644
--- a/core/modules/file/tests/src/Kernel/FileUriItemTest.php
+++ b/core/modules/file/tests/src/Kernel/FileUriItemTest.php
@@ -19,7 +19,7 @@ class FileUriItemTest extends FileManagedUnitTestBase {
/**
* Tests the file entity override of the URI field.
*/
- public function testCustomFileUriField() {
+ public function testCustomFileUriField(): void {
$uri = 'public://druplicon.txt';
// Create a new file entity.
diff --git a/core/modules/file/tests/src/Kernel/FileUrlTest.php b/core/modules/file/tests/src/Kernel/FileUrlTest.php
index 6672d2f5961..aca3a93a8f9 100644
--- a/core/modules/file/tests/src/Kernel/FileUrlTest.php
+++ b/core/modules/file/tests/src/Kernel/FileUrlTest.php
@@ -16,7 +16,7 @@ class FileUrlTest extends FileManagedUnitTestBase {
/**
* Tests public files with a different host name from settings.
*/
- public function testFilesUrlWithDifferentHostName() {
+ public function testFilesUrlWithDifferentHostName(): void {
$test_base_url = 'http://www.example.com/cdn';
$this->setSetting('file_public_base_url', $test_base_url);
$filepath = \Drupal::service('file_system')->createFilename('test.txt', '');
diff --git a/core/modules/file/tests/src/Kernel/Formatter/FileEntityFormatterTest.php b/core/modules/file/tests/src/Kernel/Formatter/FileEntityFormatterTest.php
index 9f6da0eddc0..ea5adfe6b11 100644
--- a/core/modules/file/tests/src/Kernel/Formatter/FileEntityFormatterTest.php
+++ b/core/modules/file/tests/src/Kernel/Formatter/FileEntityFormatterTest.php
@@ -79,7 +79,7 @@ class FileEntityFormatterTest extends KernelTestBase {
/**
* Tests the file_link field formatter.
*/
- public function testFormatterFileLink() {
+ public function testFormatterFileLink(): void {
$entity_display = EntityViewDisplay::create([
'targetEntityType' => 'file',
'bundle' => 'file',
@@ -94,7 +94,7 @@ class FileEntityFormatterTest extends KernelTestBase {
/**
* Tests the file_link field formatter.
*/
- public function testFormatterFileUri() {
+ public function testFormatterFileUri(): void {
$entity_display = EntityViewDisplay::create([
'targetEntityType' => 'file',
'bundle' => 'file',
@@ -117,7 +117,7 @@ class FileEntityFormatterTest extends KernelTestBase {
/**
* Tests the file_extension field formatter.
*/
- public function testFormatterFileExtension() {
+ public function testFormatterFileExtension(): void {
$entity_display = EntityViewDisplay::create([
'targetEntityType' => 'file',
'bundle' => 'file',
@@ -142,7 +142,7 @@ class FileEntityFormatterTest extends KernelTestBase {
/**
* Tests the file_extension field formatter.
*/
- public function testFormatterFileMime() {
+ public function testFormatterFileMime(): void {
$entity_display = EntityViewDisplay::create([
'targetEntityType' => 'file',
'bundle' => 'file',
@@ -159,7 +159,7 @@ class FileEntityFormatterTest extends KernelTestBase {
/**
* Tests the file_size field formatter.
*/
- public function testFormatterFileSize() {
+ public function testFormatterFileSize(): void {
$entity_display = EntityViewDisplay::create([
'targetEntityType' => 'file',
'bundle' => 'file',
@@ -176,7 +176,7 @@ class FileEntityFormatterTest extends KernelTestBase {
/**
* Tests the file_link field formatter using a query string.
*/
- public function testFormatterFileLinkWithQueryString() {
+ public function testFormatterFileLinkWithQueryString(): void {
$file = File::create([
'uri' => 'dummy-external-readonly://file-query-string?foo=bar',
'filename' => 'file-query-string',
diff --git a/core/modules/file/tests/src/Kernel/LoadTest.php b/core/modules/file/tests/src/Kernel/LoadTest.php
index 89fc87313f4..38ab5a69a6f 100644
--- a/core/modules/file/tests/src/Kernel/LoadTest.php
+++ b/core/modules/file/tests/src/Kernel/LoadTest.php
@@ -17,7 +17,7 @@ class LoadTest extends FileManagedUnitTestBase {
/**
* Try to load a non-existent file by fid.
*/
- public function testLoadMissingFid() {
+ public function testLoadMissingFid(): void {
$this->assertNull(File::load(-1), 'Try to load an invalid fid fails.');
$this->assertFileHooksCalled([]);
}
@@ -25,7 +25,7 @@ class LoadTest extends FileManagedUnitTestBase {
/**
* Try to load a non-existent file by URI.
*/
- public function testLoadMissingFilepath() {
+ public function testLoadMissingFilepath(): void {
$files = \Drupal::entityTypeManager()->getStorage('file')->loadByProperties(['uri' => 'foobar://misc/druplicon.png']);
$this->assertFalse(reset($files), "Try to load a file that doesn't exist in the database fails.");
$this->assertFileHooksCalled([]);
@@ -34,7 +34,7 @@ class LoadTest extends FileManagedUnitTestBase {
/**
* Try to load a non-existent file by status.
*/
- public function testLoadInvalidStatus() {
+ public function testLoadInvalidStatus(): void {
$files = \Drupal::entityTypeManager()->getStorage('file')->loadByProperties(['status' => -99]);
$this->assertFalse(reset($files), 'Trying to load a file with an invalid status fails.');
$this->assertFileHooksCalled([]);
@@ -43,7 +43,7 @@ class LoadTest extends FileManagedUnitTestBase {
/**
* Load a single file and ensure that the correct values are returned.
*/
- public function testSingleValues() {
+ public function testSingleValues(): void {
// Create a new file entity from scratch so we know the values.
$file = $this->createFile('druplicon.txt', NULL, 'public');
$by_fid_file = File::load($file->id());
@@ -60,7 +60,7 @@ class LoadTest extends FileManagedUnitTestBase {
/**
* This will test loading file data from the database.
*/
- public function testMultiple() {
+ public function testMultiple(): void {
// Create a new file entity.
$file = $this->createFile('druplicon.txt', NULL, 'public');
@@ -86,7 +86,7 @@ class LoadTest extends FileManagedUnitTestBase {
/**
* Loads a single file and ensure that the correct values are returned.
*/
- public function testUuidValues() {
+ public function testUuidValues(): void {
// Create a new file entity from scratch so we know the values.
$file = $this->createFile('druplicon.txt', NULL, 'public');
$file->save();
diff --git a/core/modules/file/tests/src/Kernel/ManagedFileTest.php b/core/modules/file/tests/src/Kernel/ManagedFileTest.php
index 6a0b4476bf2..d91c17e556d 100644
--- a/core/modules/file/tests/src/Kernel/ManagedFileTest.php
+++ b/core/modules/file/tests/src/Kernel/ManagedFileTest.php
@@ -47,7 +47,7 @@ class ManagedFileTest extends FileManagedUnitTestBase implements FormInterface {
/**
* Tests that managed file elements can be programmatically submitted.
*/
- public function testManagedFileElement() {
+ public function testManagedFileElement(): void {
$form_state = new FormState();
$values['managed_file'] = NULL;
$form_state->setValues($values);
diff --git a/core/modules/file/tests/src/Kernel/Migrate/MigrateFileStubTest.php b/core/modules/file/tests/src/Kernel/Migrate/MigrateFileStubTest.php
index 03d573e9577..ec38ffa8d13 100644
--- a/core/modules/file/tests/src/Kernel/Migrate/MigrateFileStubTest.php
+++ b/core/modules/file/tests/src/Kernel/Migrate/MigrateFileStubTest.php
@@ -32,7 +32,7 @@ class MigrateFileStubTest extends MigrateDrupalTestBase {
/**
* Tests creation of file stubs.
*/
- public function testStub() {
+ public function testStub(): void {
$this->performStubTest('file');
}
diff --git a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileConfigsTest.php b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileConfigsTest.php
index fc2f8087012..0f5e8248977 100644
--- a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileConfigsTest.php
+++ b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileConfigsTest.php
@@ -27,7 +27,7 @@ class MigrateFileConfigsTest extends MigrateDrupal6TestBase {
/**
* Tests migration of file variables to file.settings.yml.
*/
- public function testFileSettings() {
+ public function testFileSettings(): void {
$config = $this->config('file.settings');
$this->assertSame('textfield', $config->get('description.type'));
$this->assertSame(128, $config->get('description.length'));
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 5cd53790803..e2a1ab3ccfe 100644
--- a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php
+++ b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php
@@ -75,7 +75,7 @@ class MigrateFileTest extends MigrateDrupal6TestBase implements MigrateDumpAlter
/**
* Tests the Drupal 6 files to Drupal 8 migration.
*/
- public function testFiles() {
+ public function testFiles(): void {
$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);
diff --git a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadEntityDisplayTest.php b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadEntityDisplayTest.php
index 7e4284a9e01..d6a071ecaad 100644
--- a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadEntityDisplayTest.php
+++ b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadEntityDisplayTest.php
@@ -30,7 +30,7 @@ class MigrateUploadEntityDisplayTest extends MigrateDrupal6TestBase {
/**
* Tests Drupal 6 upload settings to Drupal 8 entity display migration.
*/
- public function testUploadEntityDisplay() {
+ public function testUploadEntityDisplay(): void {
$this->executeMigration('d6_upload_entity_display');
$display = EntityViewDisplay::load('node.page.default');
@@ -55,7 +55,7 @@ class MigrateUploadEntityDisplayTest extends MigrateDrupal6TestBase {
* Entity displays should be ignored when they belong to node types which
* were not migrated.
*/
- public function testSkipNonExistentNodeType() {
+ public function testSkipNonExistentNodeType(): void {
// The "story" node type is migrated by d6_node_type but we need to pretend
// that it didn't occur, so record that in the map table.
$this->mockFailure('d6_node_type', ['type' => 'story']);
diff --git a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadEntityFormDisplayTest.php b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadEntityFormDisplayTest.php
index 9ae623d9da4..481658d167a 100644
--- a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadEntityFormDisplayTest.php
+++ b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadEntityFormDisplayTest.php
@@ -30,7 +30,7 @@ class MigrateUploadEntityFormDisplayTest extends MigrateDrupal6TestBase {
/**
* Tests Drupal 6 upload settings to Drupal 8 entity form display migration.
*/
- public function testUploadEntityFormDisplay() {
+ public function testUploadEntityFormDisplay(): void {
$this->executeMigration('d6_upload_entity_form_display');
$display = EntityFormDisplay::load('node.page.default');
@@ -55,7 +55,7 @@ class MigrateUploadEntityFormDisplayTest extends MigrateDrupal6TestBase {
* Entity displays should be ignored when they belong to node types which
* were not migrated.
*/
- public function testSkipNonExistentNodeType() {
+ public function testSkipNonExistentNodeType(): void {
// The "story" node type is migrated by d6_node_type but we need to pretend
// that it didn't occur, so record that in the map table.
$this->mockFailure('d6_node_type', ['type' => 'story']);
diff --git a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadFieldTest.php b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadFieldTest.php
index b46b4bf70a0..981711e6f8b 100644
--- a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadFieldTest.php
+++ b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadFieldTest.php
@@ -30,7 +30,7 @@ class MigrateUploadFieldTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 upload settings to Drupal 8 field migration.
*/
- public function testUpload() {
+ public function testUpload(): void {
$field_storage = FieldStorageConfig::load('node.upload');
$this->assertSame('node.upload', $field_storage->id());
$this->assertSame([['node', 'upload']], $this->getMigration('d6_upload_field')->getIdMap()->lookupDestinationIds(['']));
diff --git a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadInstanceTest.php b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadInstanceTest.php
index 4722d14dd72..041689e0b34 100644
--- a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadInstanceTest.php
+++ b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadInstanceTest.php
@@ -30,7 +30,7 @@ class MigrateUploadInstanceTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 upload settings to Drupal 8 field instance migration.
*/
- public function testUploadFieldInstance() {
+ public function testUploadFieldInstance(): void {
$field = FieldConfig::load('node.page.upload');
$settings = $field->getSettings();
$this->assertSame('node.page.upload', $field->id());
diff --git a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadTest.php b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadTest.php
index ba5ff07e57a..53dbba91926 100644
--- a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadTest.php
+++ b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadTest.php
@@ -68,7 +68,7 @@ class MigrateUploadTest extends MigrateDrupal6TestBase {
/**
* Tests upload migration from Drupal 6 to Drupal 8.
*/
- public function testUpload() {
+ public function testUpload(): void {
$this->container->get('entity_type.manager')
->getStorage('node')
->resetCache([1, 2, 12]);
diff --git a/core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileConfigsTest.php b/core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileConfigsTest.php
index 4e34e1b546f..8082aa9bcd7 100644
--- a/core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileConfigsTest.php
+++ b/core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileConfigsTest.php
@@ -27,7 +27,7 @@ class MigrateFileConfigsTest extends MigrateDrupal7TestBase {
/**
* Tests migration of file variables to file.settings.yml.
*/
- public function testFileSettings() {
+ public function testFileSettings(): void {
$config = $this->config('file.settings');
$this->assertSame('textfield', $config->get('description.type'));
$this->assertSame(256, $config->get('description.length'));
diff --git a/core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileTest.php b/core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileTest.php
index abd22af7549..0bd4363247d 100644
--- a/core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileTest.php
+++ b/core/modules/file/tests/src/Kernel/Migrate/d7/MigrateFileTest.php
@@ -44,7 +44,7 @@ class MigrateFileTest extends MigrateDrupal7TestBase {
/**
* Tests that all expected files are migrated.
*/
- public function testFileMigration() {
+ public function testFileMigration(): void {
$this->assertEntity(1, 'cube.jpeg', 'public://cube.jpeg', 'image/jpeg', 3620, 1421727515, 1421727515, '1');
// Ensure temporary file was not migrated.
$this->assertNull(File::load(4));
diff --git a/core/modules/file/tests/src/Kernel/Migrate/d7/MigratePrivateFileTest.php b/core/modules/file/tests/src/Kernel/Migrate/d7/MigratePrivateFileTest.php
index 1b16a168c74..259c2e171e6 100644
--- a/core/modules/file/tests/src/Kernel/Migrate/d7/MigratePrivateFileTest.php
+++ b/core/modules/file/tests/src/Kernel/Migrate/d7/MigratePrivateFileTest.php
@@ -54,7 +54,7 @@ class MigratePrivateFileTest extends MigrateDrupal7TestBase {
/**
* Tests that all expected files are migrated.
*/
- public function testFileMigration() {
+ public function testFileMigration(): void {
$this->assertEntity(3, 'Babylon5.txt', 'private://Babylon5.txt', 'text/plain', 3, 1486104045, 1486104045, '1');
}
diff --git a/core/modules/file/tests/src/Kernel/MoveTest.php b/core/modules/file/tests/src/Kernel/MoveTest.php
index fbe70c77cb8..e82626c1f21 100644
--- a/core/modules/file/tests/src/Kernel/MoveTest.php
+++ b/core/modules/file/tests/src/Kernel/MoveTest.php
@@ -40,7 +40,7 @@ class MoveTest extends FileManagedUnitTestBase {
*
* @covers ::move
*/
- public function testNormal() {
+ public function testNormal(): void {
$contents = $this->randomMachineName(10);
$source = $this->createFile(NULL, $contents);
$desired_filepath = 'public://' . $this->randomMachineName();
@@ -72,7 +72,7 @@ class MoveTest extends FileManagedUnitTestBase {
*
* @covers ::move
*/
- public function testExistingRename() {
+ public function testExistingRename(): void {
// Setup a file to overwrite.
$contents = $this->randomMachineName(10);
$source = $this->createFile(NULL, $contents);
@@ -109,7 +109,7 @@ class MoveTest extends FileManagedUnitTestBase {
*
* @covers ::move
*/
- public function testExistingReplace() {
+ public function testExistingReplace(): void {
// Setup a file to overwrite.
$contents = $this->randomMachineName(10);
$source = $this->createFile(NULL, $contents);
@@ -143,7 +143,7 @@ class MoveTest extends FileManagedUnitTestBase {
*
* @covers ::move
*/
- public function testExistingReplaceSelf() {
+ public function testExistingReplaceSelf(): void {
// Setup a file to overwrite.
$contents = $this->randomMachineName(10);
$source = $this->createFile(NULL, $contents);
@@ -173,7 +173,7 @@ class MoveTest extends FileManagedUnitTestBase {
*
* @covers ::move
*/
- public function testExistingError() {
+ public function testExistingError(): void {
$contents = $this->randomMachineName(10);
$source = $this->createFile();
$target = $this->createFile(NULL, $contents);
@@ -208,7 +208,7 @@ class MoveTest extends FileManagedUnitTestBase {
*
* @covers ::move
*/
- public function testInvalidStreamWrapper() {
+ public function testInvalidStreamWrapper(): void {
$this->expectException(InvalidStreamWrapperException::class);
$this->expectExceptionMessage('Invalid stream wrapper: foo://');
$source = $this->createFile();
@@ -220,7 +220,7 @@ class MoveTest extends FileManagedUnitTestBase {
*
* @covers ::move
*/
- public function testEntityStorageException() {
+ public function testEntityStorageException(): void {
/** @var \Drupal\Core\Entity\EntityTypeManager $entityTypeManager */
$entityTypeManager = $this->prophesize(EntityTypeManager::class);
$entityTypeManager->getStorage('file')
diff --git a/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileExtensionConstraintValidatorTest.php b/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileExtensionConstraintValidatorTest.php
index ac035d783d4..c4f58956a01 100644
--- a/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileExtensionConstraintValidatorTest.php
+++ b/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileExtensionConstraintValidatorTest.php
@@ -28,7 +28,7 @@ class FileExtensionConstraintValidatorTest extends FileValidatorTestBase {
* @dataProvider providerTestFileValidateExtensionsOnUri
* @covers ::validate
*/
- public function testFileExtensionOnUri(array $file_properties, array $extensions, array $expected_errors) {
+ public function testFileExtensionOnUri(array $file_properties, array $extensions, array $expected_errors): void {
$file = File::create($file_properties);
// Test for failure.
$validators = [
diff --git a/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileImageDimensionsConstraintValidatorTest.php b/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileImageDimensionsConstraintValidatorTest.php
index 049c222eb01..a42aa8c25f8 100644
--- a/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileImageDimensionsConstraintValidatorTest.php
+++ b/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileImageDimensionsConstraintValidatorTest.php
@@ -54,7 +54,7 @@ class FileImageDimensionsConstraintValidatorTest extends FileValidatorTestBase {
*
* @covers ::validate
*/
- public function testFileValidateImageResolution() {
+ public function testFileValidateImageResolution(): void {
// Non-images.
$validators = ['FileImageDimensions' => []];
$violations = $this->validator->validate($this->nonImage, $validators);
diff --git a/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileIsImageConstraintValidatorTest.php b/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileIsImageConstraintValidatorTest.php
index 99531303cb9..c98b0997220 100644
--- a/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileIsImageConstraintValidatorTest.php
+++ b/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileIsImageConstraintValidatorTest.php
@@ -52,7 +52,7 @@ class FileIsImageConstraintValidatorTest extends FileValidatorTestBase {
*
* @covers ::validate
*/
- public function testFileIsImage() {
+ public function testFileIsImage(): void {
$this->assertFileExists($this->image->getFileUri());
$validators = [
'FileIsImage' => [],
diff --git a/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileNameLengthConstraintValidatorTest.php b/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileNameLengthConstraintValidatorTest.php
index 12de4da09dd..cab7a5ae719 100644
--- a/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileNameLengthConstraintValidatorTest.php
+++ b/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileNameLengthConstraintValidatorTest.php
@@ -20,7 +20,7 @@ class FileNameLengthConstraintValidatorTest extends FileValidatorTestBase {
*
* @covers ::validate
*/
- public function testFileValidateNameLength() {
+ public function testFileValidateNameLength(): void {
// Create a new file entity.
$file = File::create();
diff --git a/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileSizeLimitConstraintValidatorTest.php b/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileSizeLimitConstraintValidatorTest.php
index d1d938b94d4..74d2ee2912a 100644
--- a/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileSizeLimitConstraintValidatorTest.php
+++ b/core/modules/file/tests/src/Kernel/Plugin/Validation/Constraint/FileSizeLimitConstraintValidatorTest.php
@@ -17,7 +17,7 @@ class FileSizeLimitConstraintValidatorTest extends FileValidatorTestBase {
/**
* @covers ::validate
*/
- public function testFileValidateSize() {
+ public function testFileValidateSize(): void {
$validators = ['FileSizeLimit' => []];
$violations = $this->validator->validate($this->file, $validators);
$this->assertCount(0, $violations, 'No limits means no errors.');
diff --git a/core/modules/file/tests/src/Kernel/SaveTest.php b/core/modules/file/tests/src/Kernel/SaveTest.php
index 341177ec5e0..82113681ade 100644
--- a/core/modules/file/tests/src/Kernel/SaveTest.php
+++ b/core/modules/file/tests/src/Kernel/SaveTest.php
@@ -21,7 +21,7 @@ class SaveTest extends FileManagedUnitTestBase {
*/
protected bool $usesSuperUserAccessPolicy = TRUE;
- public function testFileSave() {
+ public function testFileSave(): void {
// Create a new file entity.
$file = File::create([
'uid' => 1,
diff --git a/core/modules/file/tests/src/Kernel/SpaceUsedTest.php b/core/modules/file/tests/src/Kernel/SpaceUsedTest.php
index 8bbba2f860a..d8792a28147 100644
--- a/core/modules/file/tests/src/Kernel/SpaceUsedTest.php
+++ b/core/modules/file/tests/src/Kernel/SpaceUsedTest.php
@@ -60,7 +60,7 @@ class SpaceUsedTest extends FileManagedUnitTestBase {
/**
* Tests different users with the default status.
*/
- public function testFileSpaceUsed() {
+ public function testFileSpaceUsed(): void {
$file = $this->container->get('entity_type.manager')->getStorage('file');
// Test different users with default status.
$this->assertEquals(70, $file->spaceUsed(2));
diff --git a/core/modules/file/tests/src/Kernel/UsageTest.php b/core/modules/file/tests/src/Kernel/UsageTest.php
index a4d04dc9339..8a17e7fa556 100644
--- a/core/modules/file/tests/src/Kernel/UsageTest.php
+++ b/core/modules/file/tests/src/Kernel/UsageTest.php
@@ -22,7 +22,7 @@ class UsageTest extends FileManagedUnitTestBase {
/**
* Tests \Drupal\file\FileUsage\DatabaseFileUsageBackend::listUsage().
*/
- public function testGetUsage() {
+ public function testGetUsage(): void {
$file = $this->createFile();
$connection = Database::getConnection();
$connection->insert('file_usage')
@@ -56,7 +56,7 @@ class UsageTest extends FileManagedUnitTestBase {
/**
* Tests \Drupal\file\FileUsage\DatabaseFileUsageBackend::add().
*/
- public function testAddUsage() {
+ public function testAddUsage(): void {
$file = $this->createFile();
$file_usage = $this->container->get('file.usage');
$file_usage->add($file, 'testing', 'foo', 1);
@@ -82,7 +82,7 @@ class UsageTest extends FileManagedUnitTestBase {
/**
* Tests file usage deletion when files are made temporary.
*/
- public function testRemoveUsageTemporary() {
+ public function testRemoveUsageTemporary(): void {
$this->config('file.settings')
->set('make_unused_managed_files_temporary', TRUE)
->save();
@@ -93,7 +93,7 @@ class UsageTest extends FileManagedUnitTestBase {
/**
* Tests file usage deletion when files are made temporary.
*/
- public function testRemoveUsageNonTemporary() {
+ public function testRemoveUsageNonTemporary(): void {
$this->config('file.settings')
->set('make_unused_managed_files_temporary', FALSE)
->save();
@@ -196,7 +196,7 @@ class UsageTest extends FileManagedUnitTestBase {
/**
* Ensure that temporary files are removed by default.
*/
- public function testTempFileCleanupDefault() {
+ public function testTempFileCleanupDefault(): void {
[$temp_old, $temp_new, $perm_old, $perm_new] = $this->createTempFiles();
// Run cron and then ensure that only the old, temp file was deleted.
@@ -210,7 +210,7 @@ class UsageTest extends FileManagedUnitTestBase {
/**
* Ensure that temporary files are kept as configured.
*/
- public function testTempFileNoCleanup() {
+ public function testTempFileNoCleanup(): void {
[$temp_old, $temp_new, $perm_old, $perm_new] = $this->createTempFiles();
// Set the max age to 0, meaning no temporary files will be deleted.
@@ -229,7 +229,7 @@ class UsageTest extends FileManagedUnitTestBase {
/**
* Ensure that temporary files are kept as configured.
*/
- public function testTempFileCustomCleanup() {
+ public function testTempFileCustomCleanup(): void {
[$temp_old, $temp_new, $perm_old, $perm_new] = $this->createTempFiles();
// Set the max age to older than default.
@@ -248,7 +248,7 @@ class UsageTest extends FileManagedUnitTestBase {
/**
* Tests file usage with translated entities.
*/
- public function testFileUsageWithEntityTranslation() {
+ public function testFileUsageWithEntityTranslation(): void {
/** @var \Drupal\file\FileUsage\FileUsageInterface $file_usage */
$file_usage = $this->container->get('file.usage');
diff --git a/core/modules/file/tests/src/Kernel/Views/ExtensionViewsFieldTest.php b/core/modules/file/tests/src/Kernel/Views/ExtensionViewsFieldTest.php
index d0344df2eea..32b07cd0d43 100644
--- a/core/modules/file/tests/src/Kernel/Views/ExtensionViewsFieldTest.php
+++ b/core/modules/file/tests/src/Kernel/Views/ExtensionViewsFieldTest.php
@@ -66,7 +66,7 @@ class ExtensionViewsFieldTest extends ViewsKernelTestBase {
/**
* Tests file extension views field handler extension_detect_tar option.
*/
- public function testFileExtensionTarOption() {
+ public function testFileExtensionTarOption(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
diff --git a/core/modules/file/tests/src/Kernel/Views/FileViewsFieldAccessTest.php b/core/modules/file/tests/src/Kernel/Views/FileViewsFieldAccessTest.php
index e6ae3adc566..34e27896ed7 100644
--- a/core/modules/file/tests/src/Kernel/Views/FileViewsFieldAccessTest.php
+++ b/core/modules/file/tests/src/Kernel/Views/FileViewsFieldAccessTest.php
@@ -33,7 +33,7 @@ class FileViewsFieldAccessTest extends FieldFieldAccessTestBase {
/**
* Check access for file fields.
*/
- public function testFileFields() {
+ public function testFileFields(): void {
ConfigurableLanguage::create([
'id' => 'fr',
'label' => 'French',
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldTest.php
index 0e9017cab23..c1fd7f58c2a 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldTest.php
@@ -52,7 +52,7 @@ class FileFieldTest extends UnitTestCase {
/**
* @covers ::defineValueProcessPipeline
*/
- public function testDefineValueProcessPipeline($method = 'defineValueProcessPipeline') {
+ public function testDefineValueProcessPipeline($method = 'defineValueProcessPipeline'): void {
$this->plugin->$method($this->migration, 'field_name', []);
$expected = [
@@ -77,7 +77,7 @@ class FileFieldTest extends UnitTestCase {
* @covers ::getFieldType
* @dataProvider getFieldTypeProvider
*/
- public function testGetFieldType($expected_type, $widget_type, array $settings = []) {
+ public function testGetFieldType($expected_type, $widget_type, array $settings = []): void {
$row = new Row();
$row->setSourceProperty('widget_type', $widget_type);
$row->setSourceProperty('global_settings', $settings);
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php
index df8fc52a13c..b5517b4cd82 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php
@@ -52,7 +52,7 @@ class FileFieldTest extends UnitTestCase {
/**
* @covers ::defineValueProcessPipeline
*/
- public function testDefineValueProcessPipeline($method = 'defineValueProcessPipeline') {
+ public function testDefineValueProcessPipeline($method = 'defineValueProcessPipeline'): void {
$this->plugin->$method($this->migration, 'field_name', []);
$expected = [
@@ -82,7 +82,7 @@ class FileFieldTest extends UnitTestCase {
* @covers ::getFieldType
* @dataProvider getFieldTypeProvider
*/
- public function testGetFieldType($expected_type, $widget_type, array $settings = []) {
+ public function testGetFieldType($expected_type, $widget_type, array $settings = []): void {
$row = new Row();
$row->setSourceProperty('widget_type', $widget_type);
$row->setSourceProperty('global_settings', $settings);
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FieldFileTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FieldFileTest.php
index be96d280e92..37c1c008b97 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FieldFileTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FieldFileTest.php
@@ -19,7 +19,7 @@ class FieldFileTest extends UnitTestCase {
/**
* Tests that alt and title attributes are included in transformed values.
*/
- public function testTransformAltTitle() {
+ public function testTransformAltTitle(): void {
$executable = $this->prophesize(MigrateExecutableInterface::class)->reveal();
$row = $this->prophesize(Row::class)->reveal();
$migration = $this->prophesize(MigrationInterface::class)->reveal();
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FileUriTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FileUriTest.php
index a984e42424c..15763338883 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FileUriTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FileUriTest.php
@@ -19,7 +19,7 @@ class FileUriTest extends MigrateTestCase {
'id' => 'test',
];
- public function testPublic() {
+ public function testPublic(): void {
$value = [
'sites/default/files/foo.jpg',
'sites/default/files',
@@ -29,7 +29,7 @@ class FileUriTest extends MigrateTestCase {
$this->assertEquals('public://foo.jpg', $this->doTransform($value));
}
- public function testPublicUnknownBasePath() {
+ public function testPublicUnknownBasePath(): void {
$value = [
'/path/to/public/files/foo.jpg',
'sites/default/files',
@@ -39,7 +39,7 @@ class FileUriTest extends MigrateTestCase {
$this->assertEquals('public://path/to/public/files/foo.jpg', $this->doTransform($value));
}
- public function testPrivate() {
+ public function testPrivate(): void {
$value = [
'sites/default/files/baz.gif',
'sites/default/files',
@@ -49,7 +49,7 @@ class FileUriTest extends MigrateTestCase {
$this->assertEquals('private://baz.gif', $this->doTransform($value));
}
- public function testPrivateUnknownBasePath() {
+ public function testPrivateUnknownBasePath(): void {
$value = [
'/path/to/private/files/baz.gif',
'sites/default/files',
@@ -59,7 +59,7 @@ class FileUriTest extends MigrateTestCase {
$this->assertEquals('private://path/to/private/files/baz.gif', $this->doTransform($value));
}
- public function testTemporary() {
+ public function testTemporary(): void {
$value = [
'/tmp/bar.png',
'sites/default/files',
diff --git a/core/modules/file/tests/src/Unit/SanitizeNameTest.php b/core/modules/file/tests/src/Unit/SanitizeNameTest.php
index a2c4d7e55da..cf2b5f17c6e 100644
--- a/core/modules/file/tests/src/Unit/SanitizeNameTest.php
+++ b/core/modules/file/tests/src/Unit/SanitizeNameTest.php
@@ -43,7 +43,7 @@ class SanitizeNameTest extends UnitTestCase {
* @covers \Drupal\file\EventSubscriber\FileEventSubscriber::sanitizeFilename
* @covers \Drupal\Core\File\Event\FileUploadSanitizeNameEvent::__construct
*/
- public function testFileNameTransliteration($original, $expected, array $options, $language_id = 'en') {
+ public function testFileNameTransliteration($original, $expected, array $options, $language_id = 'en'): void {
$sanitization_options = [
'transliterate' => $options[0],
'replacement_character' => $options[1],
diff --git a/core/modules/filter/tests/src/Functional/FilterAdminTest.php b/core/modules/filter/tests/src/Functional/FilterAdminTest.php
index 9029ee313c1..e35db530f0c 100644
--- a/core/modules/filter/tests/src/Functional/FilterAdminTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterAdminTest.php
@@ -128,7 +128,7 @@ class FilterAdminTest extends BrowserTestBase {
/**
* Tests the format administration functionality.
*/
- public function testFormatAdmin() {
+ public function testFormatAdmin(): void {
// Add text format.
$this->drupalGet('admin/config/content/formats');
$this->clickLink('Add text format');
@@ -197,7 +197,7 @@ class FilterAdminTest extends BrowserTestBase {
/**
* Tests filter administration functionality.
*/
- public function testFilterAdmin() {
+ public function testFilterAdmin(): void {
$first_filter = 'filter_autop';
$second_filter = 'filter_url';
@@ -375,7 +375,7 @@ class FilterAdminTest extends BrowserTestBase {
/**
* Tests the URL filter settings form is properly validated.
*/
- public function testUrlFilterAdmin() {
+ public function testUrlFilterAdmin(): void {
// The form does not save with an invalid filter URL length.
$edit = [
'filters[filter_url][settings][filter_url_length]' => $this->randomMachineName(4),
@@ -388,7 +388,7 @@ class FilterAdminTest extends BrowserTestBase {
/**
* Tests whether filter tips page is not HTML escaped.
*/
- public function testFilterTipHtmlEscape() {
+ public function testFilterTipHtmlEscape(): void {
$this->drupalLogin($this->adminUser);
global $base_url;
@@ -413,7 +413,7 @@ class FilterAdminTest extends BrowserTestBase {
/**
* Tests whether a field using a disabled format is rendered.
*/
- public function testDisabledFormat() {
+ public function testDisabledFormat(): void {
// Create a node type and add a standard body field.
$node_type = NodeType::create([
'type' => $this->randomMachineName(),
diff --git a/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php b/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php
index cd8f3432e27..7d55563b04e 100644
--- a/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php
@@ -29,7 +29,7 @@ class FilterDefaultFormatTest extends BrowserTestBase {
/**
* Tests if the default text format is accessible to users.
*/
- public function testDefaultTextFormats() {
+ public function testDefaultTextFormats(): void {
// Create two text formats, and two users. The first user has access to
// both formats, but the second user only has access to the second one.
$admin_user = $this->drupalCreateUser(['administer filters']);
diff --git a/core/modules/filter/tests/src/Functional/FilterFormTest.php b/core/modules/filter/tests/src/Functional/FilterFormTest.php
index 1ca8a35cf9a..051cb828d32 100644
--- a/core/modules/filter/tests/src/Functional/FilterFormTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterFormTest.php
@@ -70,7 +70,7 @@ class FilterFormTest extends BrowserTestBase {
/**
* Tests various different configurations of the 'text_format' element.
*/
- public function testFilterForm() {
+ public function testFilterForm(): void {
$this->doFilterFormTestAsAdmin();
$this->doFilterFormTestAsNonAdmin();
// Ensure that enabling modules which provide filter plugins behaves
diff --git a/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php b/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php
index c1a30760660..7b69235cfcd 100644
--- a/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php
@@ -130,7 +130,7 @@ class FilterFormatAccessTest extends BrowserTestBase {
/**
* Tests the Filter format access permissions functionality.
*/
- public function testFormatPermissions() {
+ public function testFormatPermissions(): void {
// Make sure that a regular user only has access to the text formats for
// which they were granted access.
$fallback_format = FilterFormat::load(filter_fallback_format());
@@ -186,7 +186,7 @@ class FilterFormatAccessTest extends BrowserTestBase {
/**
* Tests if text format is available to a role.
*/
- public function testFormatRoles() {
+ public function testFormatRoles(): void {
// Get the role ID assigned to the regular user.
$roles = $this->webUser->getRoles(TRUE);
$rid = $roles[0];
@@ -218,7 +218,7 @@ class FilterFormatAccessTest extends BrowserTestBase {
* be edited by administrators only, but that the administrator is forced to
* choose a new format before saving the page.
*/
- public function testFormatWidgetPermissions() {
+ public function testFormatWidgetPermissions(): void {
$body_value_key = 'body[0][value]';
$body_format_key = 'body[0][format]';
diff --git a/core/modules/filter/tests/src/Functional/FilterHooksTest.php b/core/modules/filter/tests/src/Functional/FilterHooksTest.php
index 7c64b13e7a1..85a64efcf5d 100644
--- a/core/modules/filter/tests/src/Functional/FilterHooksTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterHooksTest.php
@@ -32,7 +32,7 @@ class FilterHooksTest extends BrowserTestBase {
* Tests that hooks run correctly on creating, editing, and deleting a text
* format.
*/
- public function testFilterHooks() {
+ public function testFilterHooks(): void {
// Create content type, with underscores.
$type_name = 'test_' . $this->randomMachineName();
$type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
diff --git a/core/modules/filter/tests/src/Functional/FilterHtmlImageSecureTest.php b/core/modules/filter/tests/src/Functional/FilterHtmlImageSecureTest.php
index 75011a108cc..d62be2f7860 100644
--- a/core/modules/filter/tests/src/Functional/FilterHtmlImageSecureTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterHtmlImageSecureTest.php
@@ -78,7 +78,7 @@ class FilterHtmlImageSecureTest extends BrowserTestBase {
/**
* Tests removal of images having a non-local source.
*/
- public function testImageSource() {
+ public function testImageSource(): void {
global $base_url;
$node = $this->drupalCreateNode();
diff --git a/core/modules/filter/tests/src/Functional/FilterSecurityTest.php b/core/modules/filter/tests/src/Functional/FilterSecurityTest.php
index 6832912ade5..74cc2872df7 100644
--- a/core/modules/filter/tests/src/Functional/FilterSecurityTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterSecurityTest.php
@@ -63,7 +63,7 @@ class FilterSecurityTest extends BrowserTestBase {
* Tests that filtered content is emptied when an actively used filter module
* is disabled.
*/
- public function testDisableFilterModule() {
+ public function testDisableFilterModule(): void {
// Create a new node.
$node = $this->drupalCreateNode(['promote' => 1]);
$body_raw = $node->body->value;
@@ -95,7 +95,7 @@ class FilterSecurityTest extends BrowserTestBase {
/**
* Tests that security filters are enforced even when marked to be skipped.
*/
- public function testSkipSecurityFilters() {
+ public function testSkipSecurityFilters(): void {
$text = "Text with some disallowed tags: <script />, <p><object>unicorn</object></p>, <i><table></i>.";
$expected_filtered_text = "Text with some disallowed tags: , <p>unicorn</p>, .";
$this->assertSame($expected_filtered_text, (string) check_markup($text, 'filtered_html', '', []), 'Expected filter result.');
diff --git a/core/modules/filter/tests/src/Kernel/FilterAPITest.php b/core/modules/filter/tests/src/Kernel/FilterAPITest.php
index bbde9ae5682..6dde2022fd9 100644
--- a/core/modules/filter/tests/src/Kernel/FilterAPITest.php
+++ b/core/modules/filter/tests/src/Kernel/FilterAPITest.php
@@ -35,7 +35,7 @@ class FilterAPITest extends EntityKernelTestBase {
/**
* Tests that the filter order is respected.
*/
- public function testCheckMarkupFilterOrder() {
+ public function testCheckMarkupFilterOrder(): void {
// Create crazy HTML format.
$crazy_format = FilterFormat::create([
'format' => 'crazy',
@@ -66,7 +66,7 @@ class FilterAPITest extends EntityKernelTestBase {
/**
* Tests the ability to apply only a subset of filters.
*/
- public function testCheckMarkupFilterSubset() {
+ public function testCheckMarkupFilterSubset(): void {
$text = "Text with <marquee>evil content and</marquee> a URL: https://www.drupal.org!";
$expected_filtered_text = "Text with evil content and a URL: <a href=\"https://www.drupal.org\">https://www.drupal.org</a>!";
$expected_filter_text_without_html_generators = "Text with evil content and a URL: https://www.drupal.org!";
@@ -89,7 +89,7 @@ class FilterAPITest extends EntityKernelTestBase {
* @covers \Drupal\filter\Entity\FilterFormat::getHtmlRestrictions
* @covers \Drupal\filter\Entity\FilterFormat::getFilterTypes
*/
- public function testFilterFormatAPI() {
+ public function testFilterFormatAPI(): void {
// Test on filtered_html.
$filtered_html_format = FilterFormat::load('filtered_html');
$this->assertSame(
@@ -247,7 +247,7 @@ class FilterAPITest extends EntityKernelTestBase {
* #lazy_builder callbacks.
* This test focuses solely on those advanced features.
*/
- public function testProcessedTextElement() {
+ public function testProcessedTextElement(): void {
FilterFormat::create([
'format' => 'element_test',
'name' => 'processed_text element test format',
@@ -325,7 +325,7 @@ class FilterAPITest extends EntityKernelTestBase {
/**
* Tests the function of the typed data type.
*/
- public function testTypedDataAPI() {
+ public function testTypedDataAPI(): void {
$definition = DataDefinition::create('filter_format');
$data = \Drupal::typedDataManager()->create($definition);
@@ -396,7 +396,7 @@ class FilterAPITest extends EntityKernelTestBase {
/**
* Tests that FilterFormat::preSave() only saves customized plugins.
*/
- public function testFilterFormatPreSave() {
+ public function testFilterFormatPreSave(): void {
/** @var \Drupal\filter\FilterFormatInterface $crazy_format */
$crazy_format = FilterFormat::create([
'format' => 'crazy',
@@ -469,7 +469,7 @@ class FilterAPITest extends EntityKernelTestBase {
* @see \Drupal\filter\Entity\FilterFormat::onDependencyRemoval()
* @see filter_system_info_alter()
*/
- public function testDependencyRemoval() {
+ public function testDependencyRemoval(): void {
$this->installSchema('user', ['users_data']);
$filter_format = FilterFormat::load('filtered_html');
@@ -512,7 +512,7 @@ class FilterAPITest extends EntityKernelTestBase {
/**
* Tests that format entities are serialized without their plugin collection.
*/
- public function testSleep() {
+ public function testSleep(): void {
$filter_format = FilterFormat::load('filtered_html');
$this->assertNull($filter_format->get('filterCollection'));
diff --git a/core/modules/filter/tests/src/Kernel/FilterCaptionTwigDebugTest.php b/core/modules/filter/tests/src/Kernel/FilterCaptionTwigDebugTest.php
index ed8874fe129..4bdce6be762 100644
--- a/core/modules/filter/tests/src/Kernel/FilterCaptionTwigDebugTest.php
+++ b/core/modules/filter/tests/src/Kernel/FilterCaptionTwigDebugTest.php
@@ -35,7 +35,7 @@ class FilterCaptionTwigDebugTest extends KernelTestBase {
/**
* Tests the caption filter with Twig debugging on.
*/
- public function testCaptionFilter() {
+ public function testCaptionFilter(): void {
$manager = $this->container->get('plugin.manager.filter');
$bag = new FilterPluginCollection($manager, []);
$filter = $bag->get('filter_caption');
diff --git a/core/modules/filter/tests/src/Kernel/FilterCrudTest.php b/core/modules/filter/tests/src/Kernel/FilterCrudTest.php
index 12042e97bbb..67a91100b06 100644
--- a/core/modules/filter/tests/src/Kernel/FilterCrudTest.php
+++ b/core/modules/filter/tests/src/Kernel/FilterCrudTest.php
@@ -24,7 +24,7 @@ class FilterCrudTest extends KernelTestBase {
/**
* Tests CRUD operations for text formats and filters.
*/
- public function testTextFormatCrud() {
+ public function testTextFormatCrud(): void {
// Add a text format with minimum data only.
$format = FilterFormat::create([
'format' => 'empty_format',
@@ -75,7 +75,7 @@ class FilterCrudTest extends KernelTestBase {
/**
* Tests disabling the fallback text format.
*/
- public function testDisableFallbackFormat() {
+ public function testDisableFallbackFormat(): void {
$this->installConfig(['filter']);
$message = '\LogicException with message "The fallback text format \'plain_text\' cannot be disabled." was thrown.';
try {
diff --git a/core/modules/filter/tests/src/Kernel/FilterDefaultConfigTest.php b/core/modules/filter/tests/src/Kernel/FilterDefaultConfigTest.php
index 8423747fcda..6ef4a3307ef 100644
--- a/core/modules/filter/tests/src/Kernel/FilterDefaultConfigTest.php
+++ b/core/modules/filter/tests/src/Kernel/FilterDefaultConfigTest.php
@@ -35,7 +35,7 @@ class FilterDefaultConfigTest extends KernelTestBase {
/**
* Tests installation of default formats.
*/
- public function testInstallation() {
+ public function testInstallation(): void {
// Verify that the format was installed correctly.
$format = FilterFormat::load('filter_test');
$this->assertTrue((bool) $format);
@@ -70,7 +70,7 @@ class FilterDefaultConfigTest extends KernelTestBase {
/**
* Tests that changes to FilterFormat::$roles do not have an effect.
*/
- public function testUpdateRoles() {
+ public function testUpdateRoles(): void {
// Verify role permissions declared in default config.
$format = FilterFormat::load('filter_test');
$this->assertEquals([RoleInterface::ANONYMOUS_ID, RoleInterface::AUTHENTICATED_ID], array_keys(filter_get_roles_by_format($format)));
diff --git a/core/modules/filter/tests/src/Kernel/FilterKernelTest.php b/core/modules/filter/tests/src/Kernel/FilterKernelTest.php
index 619952a9f75..7aa39242699 100644
--- a/core/modules/filter/tests/src/Kernel/FilterKernelTest.php
+++ b/core/modules/filter/tests/src/Kernel/FilterKernelTest.php
@@ -47,7 +47,7 @@ class FilterKernelTest extends KernelTestBase {
/**
* Tests the align filter.
*/
- public function testAlignFilter() {
+ public function testAlignFilter(): void {
$filter = $this->filters['filter_align'];
$test = function ($input) use ($filter) {
@@ -102,7 +102,7 @@ class FilterKernelTest extends KernelTestBase {
/**
* Tests the caption filter.
*/
- public function testCaptionFilter() {
+ public function testCaptionFilter(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
$filter = $this->filters['filter_caption'];
@@ -330,7 +330,7 @@ class FilterKernelTest extends KernelTestBase {
/**
* Tests the combination of the align and caption filters.
*/
- public function testAlignAndCaptionFilters() {
+ public function testAlignAndCaptionFilters(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
$align_filter = $this->filters['filter_align'];
@@ -405,7 +405,7 @@ class FilterKernelTest extends KernelTestBase {
/**
* Tests the line break filter.
*/
- public function testLineBreakFilter() {
+ public function testLineBreakFilter(): void {
// Get FilterAutoP object.
$filter = $this->filters['filter_autop'];
@@ -548,7 +548,7 @@ class FilterKernelTest extends KernelTestBase {
* @todo Class, id, name and xmlns should be added to the list of forbidden
* attributes, or, better yet, use an allowed attribute list.
*/
- public function testHtmlFilter() {
+ public function testHtmlFilter(): void {
// Get FilterHtml object.
$filter = $this->filters['filter_html'];
$filter->setConfiguration([
@@ -648,7 +648,7 @@ class FilterKernelTest extends KernelTestBase {
/**
* Tests the spam deterrent.
*/
- public function testNoFollowFilter() {
+ public function testNoFollowFilter(): void {
// Get FilterHtml object.
$filter = $this->filters['filter_html'];
$filter->setConfiguration([
@@ -681,7 +681,7 @@ class FilterKernelTest extends KernelTestBase {
/**
* Tests the HTML escaping filter.
*/
- public function testHtmlEscapeFilter() {
+ public function testHtmlEscapeFilter(): void {
// Get FilterHtmlEscape object.
$filter = $this->filters['filter_html_escape'];
@@ -698,7 +698,7 @@ class FilterKernelTest extends KernelTestBase {
/**
* Tests the URL filter.
*/
- public function testUrlFilter() {
+ public function testUrlFilter(): void {
// Get FilterUrl object.
$filter = $this->filters['filter_url'];
$filter->setConfiguration([
@@ -1028,7 +1028,7 @@ class FilterKernelTest extends KernelTestBase {
* - Mix of absolute and partial URLs, and email addresses in one content.
* - Input that exceeds PCRE backtracking limit.
*/
- public function testUrlFilterContent() {
+ public function testUrlFilterContent(): void {
// Get FilterUrl object.
$filter = $this->filters['filter_url'];
$filter->setConfiguration([
@@ -1067,7 +1067,7 @@ class FilterKernelTest extends KernelTestBase {
*
* @todo This test could really use some validity checking function.
*/
- public function testHtmlCorrectorFilter() {
+ public function testHtmlCorrectorFilter(): void {
// Tag closing.
$f = Html::normalize('<p>text');
$this->assertEquals('<p>text</p>', $f, 'HTML corrector -- tag closing at the end of input.');
diff --git a/core/modules/filter/tests/src/Kernel/FilterNoFormatTest.php b/core/modules/filter/tests/src/Kernel/FilterNoFormatTest.php
index 4d9ceb67570..164fe056ce2 100644
--- a/core/modules/filter/tests/src/Kernel/FilterNoFormatTest.php
+++ b/core/modules/filter/tests/src/Kernel/FilterNoFormatTest.php
@@ -24,7 +24,7 @@ class FilterNoFormatTest extends KernelTestBase {
* Tests if text with no format is filtered the same way as text in the
* fallback format.
*/
- public function testCheckMarkupNoFormat() {
+ public function testCheckMarkupNoFormat(): void {
$this->installConfig(['filter']);
// Create some text. Include some HTML and line breaks, so we get a good
diff --git a/core/modules/filter/tests/src/Kernel/Migrate/d6/FilterFormatPermissionTest.php b/core/modules/filter/tests/src/Kernel/Migrate/d6/FilterFormatPermissionTest.php
index 160ed43c566..2deeed64cd3 100644
--- a/core/modules/filter/tests/src/Kernel/Migrate/d6/FilterFormatPermissionTest.php
+++ b/core/modules/filter/tests/src/Kernel/Migrate/d6/FilterFormatPermissionTest.php
@@ -22,7 +22,7 @@ class FilterFormatPermissionTest extends MigrateDrupalTestBase {
*
* @covers ::__construct
*/
- public function testConfigurableFilterFormat() {
+ public function testConfigurableFilterFormat(): void {
$migration = Migration::create($this->container, [], 'custom_migration', []);
$filterFormatPermissionMigration = FilterFormatPermission::create($this->container, ['migration' => 'custom_filter_format'], 'custom_filter_format', [], $migration);
$reflected_config = new \ReflectionProperty($filterFormatPermissionMigration, 'configuration');
diff --git a/core/modules/filter/tests/src/Kernel/Migrate/d6/MigrateFilterFormatTest.php b/core/modules/filter/tests/src/Kernel/Migrate/d6/MigrateFilterFormatTest.php
index 211a6b27be0..89e5702e114 100644
--- a/core/modules/filter/tests/src/Kernel/Migrate/d6/MigrateFilterFormatTest.php
+++ b/core/modules/filter/tests/src/Kernel/Migrate/d6/MigrateFilterFormatTest.php
@@ -26,7 +26,7 @@ class MigrateFilterFormatTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 filter format to Drupal 8 migration.
*/
- public function testFilterFormat() {
+ public function testFilterFormat(): void {
$filter_format = FilterFormat::load('filtered_html');
// Check filter status.
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 d9d78ea9258..40a17534982 100644
--- a/core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterFormatTest.php
+++ b/core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterFormatTest.php
@@ -89,7 +89,7 @@ class MigrateFilterFormatTest extends MigrateDrupal7TestBase implements MigrateD
/**
* Tests the Drupal 7 filter format to Drupal 8 migration.
*/
- public function testFilterFormat() {
+ public function testFilterFormat(): void {
$this->assertEntity('custom_text_format', 'Custom Text format', ['filter_autop' => 0, 'filter_html' => -10], 0, TRUE);
$this->assertEntity('filtered_html', 'Filtered HTML', ['filter_autop' => 2, 'filter_html' => 1, 'filter_htmlcorrector' => 10, 'filter_url' => 0], 0, TRUE);
$this->assertEntity('full_html', 'Full HTML', ['filter_autop' => 1, 'filter_htmlcorrector' => 10, 'filter_url' => 0], 1, TRUE);
diff --git a/core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterSettingsTest.php b/core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterSettingsTest.php
index 89d7107b193..3a7c17cf614 100644
--- a/core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterSettingsTest.php
+++ b/core/modules/filter/tests/src/Kernel/Migrate/d7/MigrateFilterSettingsTest.php
@@ -27,7 +27,7 @@ class MigrateFilterSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests migration of Filter variables to configuration.
*/
- public function testFilterSettings() {
+ public function testFilterSettings(): void {
$this->assertSame('plain_text', $this->config('filter.settings')->get('fallback_format'));
}
diff --git a/core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php b/core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php
index fadad6b883c..9c18b7ce7c0 100644
--- a/core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php
+++ b/core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php
@@ -56,7 +56,7 @@ class FilterIdTest extends KernelTestBase {
*
* @covers ::transform
*/
- public function testTransform($value, $expected_value, $invalid_id = NULL, $stop_pipeline = FALSE) {
+ public function testTransform($value, $expected_value, $invalid_id = NULL, $stop_pipeline = FALSE): void {
$configuration = [
'bypass' => TRUE,
'map' => [
diff --git a/core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterSettingsTest.php b/core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterSettingsTest.php
index 131583693ae..cda81aa5335 100644
--- a/core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterSettingsTest.php
+++ b/core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterSettingsTest.php
@@ -24,7 +24,7 @@ class FilterSettingsTest extends MigrateTestCase {
* @dataProvider dataProvider
* @covers ::transform
*/
- public function testTransform($value, $destination_id, $expected_value) {
+ public function testTransform($value, $destination_id, $expected_value): void {
$migration = $this->createMock(MigrationInterface::class);
$plugin = new FilterSettings([], 'filter_settings', []);
diff --git a/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php b/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php
index 3f412606c3a..43f6105a578 100644
--- a/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php
+++ b/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php
@@ -119,7 +119,7 @@ class TextFormatElementFormTest extends KernelTestBase implements FormInterface
/**
* Tests that values are returned.
*/
- public function testTextFormatElement() {
+ public function testTextFormatElement(): void {
/** @var \Drupal\Core\Form\FormBuilder $form_builder */
$form_builder = $this->container->get('form_builder');
$form = $form_builder->getForm($this);
diff --git a/core/modules/filter/tests/src/Unit/FilterHtmlTest.php b/core/modules/filter/tests/src/Unit/FilterHtmlTest.php
index 7733948534c..5566b3d683b 100644
--- a/core/modules/filter/tests/src/Unit/FilterHtmlTest.php
+++ b/core/modules/filter/tests/src/Unit/FilterHtmlTest.php
@@ -42,7 +42,7 @@ class FilterHtmlTest extends UnitTestCase {
* @param string $expected
* The expected output string.
*/
- public function testFilterAttributes($html, $expected) {
+ public function testFilterAttributes($html, $expected): void {
$this->assertSame($expected, $this->filter->filterAttributes($html));
}
@@ -82,7 +82,7 @@ class FilterHtmlTest extends UnitTestCase {
/**
* @covers ::setConfiguration
*/
- public function testSetConfiguration() {
+ public function testSetConfiguration(): void {
$configuration['settings'] = [
// New lines and spaces are replaced with a single space.
'allowed_html' => "<a> <br>\r\n <p>",
diff --git a/core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php b/core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php
index 85fcbe31848..e79c6d23b1b 100644
--- a/core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php
+++ b/core/modules/filter/tests/src/Unit/FilterUninstallValidatorTest.php
@@ -34,7 +34,7 @@ class FilterUninstallValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidateNoPlugins() {
+ public function testValidateNoPlugins(): void {
$this->filterUninstallValidator->expects($this->once())
->method('getFilterDefinitionsByProvider')
->willReturn([]);
@@ -50,7 +50,7 @@ class FilterUninstallValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidateNoFormats() {
+ public function testValidateNoFormats(): void {
$this->filterUninstallValidator->expects($this->once())
->method('getFilterDefinitionsByProvider')
->willReturn([
@@ -72,7 +72,7 @@ class FilterUninstallValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidateNoMatchingFormats() {
+ public function testValidateNoMatchingFormats(): void {
$this->filterUninstallValidator->expects($this->once())
->method('getFilterDefinitionsByProvider')
->willReturn([
diff --git a/core/modules/help/tests/src/Functional/ExperimentalHelpTest.php b/core/modules/help/tests/src/Functional/ExperimentalHelpTest.php
index 40436b0915c..ff47b5aa751 100644
--- a/core/modules/help/tests/src/Functional/ExperimentalHelpTest.php
+++ b/core/modules/help/tests/src/Functional/ExperimentalHelpTest.php
@@ -50,7 +50,7 @@ class ExperimentalHelpTest extends BrowserTestBase {
/**
* Verifies that a warning message is displayed for experimental modules.
*/
- public function testExperimentalHelp() {
+ public function testExperimentalHelp(): void {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/help/experimental_module_test');
$this->assertSession()->statusMessageContains('This module is experimental.', 'warning');
diff --git a/core/modules/help/tests/src/Functional/HelpBlockTest.php b/core/modules/help/tests/src/Functional/HelpBlockTest.php
index 8ab495d1c04..074629593ce 100644
--- a/core/modules/help/tests/src/Functional/HelpBlockTest.php
+++ b/core/modules/help/tests/src/Functional/HelpBlockTest.php
@@ -46,7 +46,7 @@ class HelpBlockTest extends BrowserTestBase {
/**
* Logs in users, tests help pages.
*/
- public function testHelp() {
+ public function testHelp(): void {
$this->drupalGet('help_page_test/has_help');
$this->assertSession()->pageTextContains('I have help!');
$this->assertSession()->pageTextContains($this->helpBlock->label());
diff --git a/core/modules/help/tests/src/Functional/HelpPageOrderTest.php b/core/modules/help/tests/src/Functional/HelpPageOrderTest.php
index 972428c2e3a..3013d5671c1 100644
--- a/core/modules/help/tests/src/Functional/HelpPageOrderTest.php
+++ b/core/modules/help/tests/src/Functional/HelpPageOrderTest.php
@@ -51,7 +51,7 @@ class HelpPageOrderTest extends BrowserTestBase {
/**
* Tests the order of the help page.
*/
- public function testHelp() {
+ public function testHelp(): void {
$pos = 0;
$this->drupalGet('admin/help');
$page_text = $this->getTextContent();
diff --git a/core/modules/help/tests/src/Functional/HelpTest.php b/core/modules/help/tests/src/Functional/HelpTest.php
index e617c860bf2..152ccc94b31 100644
--- a/core/modules/help/tests/src/Functional/HelpTest.php
+++ b/core/modules/help/tests/src/Functional/HelpTest.php
@@ -66,7 +66,7 @@ class HelpTest extends BrowserTestBase {
/**
* Logs in users, tests help pages.
*/
- public function testHelp() {
+ public function testHelp(): void {
// Log in the root user to ensure as many admin links appear as possible on
// the module overview pages.
$this->drupalLogin($this->drupalCreateUser([
diff --git a/core/modules/help/tests/src/Functional/HelpTopicSearchTest.php b/core/modules/help/tests/src/Functional/HelpTopicSearchTest.php
index 8b693644206..6ea8a997891 100644
--- a/core/modules/help/tests/src/Functional/HelpTopicSearchTest.php
+++ b/core/modules/help/tests/src/Functional/HelpTopicSearchTest.php
@@ -97,7 +97,7 @@ class HelpTopicSearchTest extends HelpTopicTranslatedTestBase {
/**
* Tests help topic search.
*/
- public function testHelpSearch() {
+ public function testHelpSearch(): void {
$german = \Drupal::languageManager()->getLanguage('de');
$session = $this->assertSession();
@@ -254,7 +254,7 @@ class HelpTopicSearchTest extends HelpTopicTranslatedTestBase {
/**
* Tests uninstalling the help_topics module.
*/
- public function testUninstall() {
+ public function testUninstall(): void {
\Drupal::service('module_installer')->uninstall(['help_topics_test']);
// Ensure we can uninstall help_topics and use the help system without
// breaking.
@@ -275,7 +275,7 @@ class HelpTopicSearchTest extends HelpTopicTranslatedTestBase {
/**
* Tests uninstalling the search module.
*/
- public function testUninstallSearch() {
+ public function testUninstallSearch(): void {
// Ensure we can uninstall search and use the help system without
// breaking.
$this->drupalLogin($this->createUser([
diff --git a/core/modules/help/tests/src/Functional/HelpTopicTest.php b/core/modules/help/tests/src/Functional/HelpTopicTest.php
index 8f2e25baf9b..d1155055824 100644
--- a/core/modules/help/tests/src/Functional/HelpTopicTest.php
+++ b/core/modules/help/tests/src/Functional/HelpTopicTest.php
@@ -96,7 +96,7 @@ class HelpTopicTest extends BrowserTestBase {
/**
* Tests the main help page and individual pages for topics.
*/
- public function testHelp() {
+ public function testHelp(): void {
$session = $this->assertSession();
// Log in the regular user.
@@ -185,7 +185,7 @@ class HelpTopicTest extends BrowserTestBase {
/**
* Verifies links on various topic pages.
*/
- public function testHelpLinks() {
+ public function testHelpLinks(): void {
$session = $this->assertSession();
$this->drupalLogin($this->adminUser);
diff --git a/core/modules/help/tests/src/Functional/HelpTopicTranslationTest.php b/core/modules/help/tests/src/Functional/HelpTopicTranslationTest.php
index 38c10e396f8..082eba8c348 100644
--- a/core/modules/help/tests/src/Functional/HelpTopicTranslationTest.php
+++ b/core/modules/help/tests/src/Functional/HelpTopicTranslationTest.php
@@ -35,7 +35,7 @@ class HelpTopicTranslationTest extends HelpTopicTranslatedTestBase {
/**
* Tests help topic translations.
*/
- public function testHelpTopicTranslations() {
+ public function testHelpTopicTranslations(): void {
$session = $this->assertSession();
// Verify that help topic link is translated on admin/help.
diff --git a/core/modules/help/tests/src/Functional/HelpTopicsSyntaxTest.php b/core/modules/help/tests/src/Functional/HelpTopicsSyntaxTest.php
index dda97aeb9f0..53a42d82628 100644
--- a/core/modules/help/tests/src/Functional/HelpTopicsSyntaxTest.php
+++ b/core/modules/help/tests/src/Functional/HelpTopicsSyntaxTest.php
@@ -37,7 +37,7 @@ class HelpTopicsSyntaxTest extends BrowserTestBase {
/**
* Tests that all Core help topics can be rendered and have good syntax.
*/
- public function testHelpTopics() {
+ public function testHelpTopics(): void {
$this->drupalLogin($this->createUser([
'administer modules',
'access help pages',
diff --git a/core/modules/help/tests/src/Functional/NoHelpTest.php b/core/modules/help/tests/src/Functional/NoHelpTest.php
index 8252583f182..17ebecb8ba0 100644
--- a/core/modules/help/tests/src/Functional/NoHelpTest.php
+++ b/core/modules/help/tests/src/Functional/NoHelpTest.php
@@ -43,7 +43,7 @@ class NoHelpTest extends BrowserTestBase {
/**
* Ensures modules not implementing help do not appear on admin/help.
*/
- public function testMainPageNoHelp() {
+ public function testMainPageNoHelp(): void {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/help');
diff --git a/core/modules/help/tests/src/Kernel/HelpEmptyPageTest.php b/core/modules/help/tests/src/Kernel/HelpEmptyPageTest.php
index 7d1ba000733..ea469b3f574 100644
--- a/core/modules/help/tests/src/Kernel/HelpEmptyPageTest.php
+++ b/core/modules/help/tests/src/Kernel/HelpEmptyPageTest.php
@@ -33,7 +33,7 @@ class HelpEmptyPageTest extends KernelTestBase {
/**
* Ensures that no URL generator is called on a page without hook_help().
*/
- public function testEmptyHookHelp() {
+ public function testEmptyHookHelp(): void {
$all_modules = \Drupal::service('extension.list.module')->getList();
$all_modules = array_filter($all_modules, function ($module) {
// Filter contrib, hidden, already enabled modules and modules in the
diff --git a/core/modules/help/tests/src/Kernel/HelpSearchPluginTest.php b/core/modules/help/tests/src/Kernel/HelpSearchPluginTest.php
index 6da0b4a9d1f..6a94762f42e 100644
--- a/core/modules/help/tests/src/Kernel/HelpSearchPluginTest.php
+++ b/core/modules/help/tests/src/Kernel/HelpSearchPluginTest.php
@@ -25,7 +25,7 @@ class HelpSearchPluginTest extends KernelTestBase {
/**
* Tests search plugin annotation and interfaces.
*/
- public function testAnnotation() {
+ public function testAnnotation(): void {
/** @var \Drupal\search\SearchPluginManager $manager */
$manager = \Drupal::service('plugin.manager.search');
/** @var \Drupal\help\Plugin\Search\HelpSearch $plugin */
diff --git a/core/modules/help/tests/src/Unit/HelpTopicDiscoveryTest.php b/core/modules/help/tests/src/Unit/HelpTopicDiscoveryTest.php
index 7ee16b4b40a..a9737f7d286 100644
--- a/core/modules/help/tests/src/Unit/HelpTopicDiscoveryTest.php
+++ b/core/modules/help/tests/src/Unit/HelpTopicDiscoveryTest.php
@@ -21,7 +21,7 @@ class HelpTopicDiscoveryTest extends UnitTestCase {
/**
* @covers ::findAll
*/
- public function testDiscoveryExceptionMissingLabel() {
+ public function testDiscoveryExceptionMissingLabel(): void {
vfsStream::setup('root');
vfsStream::create([
@@ -44,7 +44,7 @@ class HelpTopicDiscoveryTest extends UnitTestCase {
/**
* @covers ::findAll
*/
- public function testDiscoveryExceptionInvalidYamlKey() {
+ public function testDiscoveryExceptionInvalidYamlKey(): void {
vfsStream::setup('root');
$topic_content = <<<EOF
---
@@ -72,7 +72,7 @@ EOF;
/**
* @covers ::findAll
*/
- public function testDiscoveryExceptionInvalidTopLevel() {
+ public function testDiscoveryExceptionInvalidTopLevel(): void {
vfsStream::setup('root');
$topic_content = <<<EOF
---
@@ -100,7 +100,7 @@ EOF;
/**
* @covers ::findAll
*/
- public function testDiscoveryExceptionInvalidRelated() {
+ public function testDiscoveryExceptionInvalidRelated(): void {
vfsStream::setup('root');
$topic_content = <<<EOF
---
@@ -128,7 +128,7 @@ EOF;
/**
* @covers ::findAll
*/
- public function testHelpTopicsExtensionProviderSpecialCase() {
+ public function testHelpTopicsExtensionProviderSpecialCase(): void {
vfsStream::setup('root');
$topic_content = <<<EOF
---
@@ -153,7 +153,7 @@ EOF;
/**
* @covers ::findAll
*/
- public function testHelpTopicsInCore() {
+ public function testHelpTopicsInCore(): void {
vfsStream::setup('root');
$topic_content = <<<EOF
---
@@ -176,7 +176,7 @@ EOF;
/**
* @covers ::findAll
*/
- public function testHelpTopicsBrokenYaml() {
+ public function testHelpTopicsBrokenYaml(): void {
vfsStream::setup('root');
$topic_content = <<<EOF
---
@@ -203,7 +203,7 @@ EOF;
/**
* @covers ::findAll
*/
- public function testHelpTopicsDefinition() {
+ public function testHelpTopicsDefinition(): void {
$container = new ContainerBuilder();
$container->set('string_translation', $this->getStringTranslationStub());
\Drupal::setContainer($container);
diff --git a/core/modules/help/tests/src/Unit/HelpTopicTwigLoaderTest.php b/core/modules/help/tests/src/Unit/HelpTopicTwigLoaderTest.php
index df47e13b930..a271daf6056 100644
--- a/core/modules/help/tests/src/Unit/HelpTopicTwigLoaderTest.php
+++ b/core/modules/help/tests/src/Unit/HelpTopicTwigLoaderTest.php
@@ -58,7 +58,7 @@ class HelpTopicTwigLoaderTest extends UnitTestCase {
/**
* @covers ::__construct
*/
- public function testConstructor() {
+ public function testConstructor(): void {
// Verify that the module/theme directories were added in the constructor,
// and non-existent directories were omitted.
$paths = $this->helpLoader->getPaths(HelpTopicTwigLoader::MAIN_NAMESPACE);
@@ -70,7 +70,7 @@ class HelpTopicTwigLoaderTest extends UnitTestCase {
/**
* @covers ::getSourceContext
*/
- public function testGetSourceContext() {
+ public function testGetSourceContext(): void {
$source = $this->helpLoader->getSourceContext('@' . HelpTopicTwigLoader::MAIN_NAMESPACE . '/test.topic.html.twig');
$this->assertEquals('{% line 4 %}<h2>Test</h2>', $source->getCode());
}
@@ -78,7 +78,7 @@ class HelpTopicTwigLoaderTest extends UnitTestCase {
/**
* @covers ::getSourceContext
*/
- public function testGetSourceContextException() {
+ public function testGetSourceContextException(): void {
$this->expectException(LoaderError::class);
$this->expectExceptionMessage("Malformed YAML in help topic \"vfs://root/modules/test/help_topics/test.invalid_yaml.html.twig\":");
diff --git a/core/modules/help/tests/src/Unit/HelpTopicTwigTest.php b/core/modules/help/tests/src/Unit/HelpTopicTwigTest.php
index 01fef4ec5b8..7c9fd975162 100644
--- a/core/modules/help/tests/src/Unit/HelpTopicTwigTest.php
+++ b/core/modules/help/tests/src/Unit/HelpTopicTwigTest.php
@@ -59,7 +59,7 @@ class HelpTopicTwigTest extends UnitTestCase {
* @covers ::getBody
* @covers ::getLabel
*/
- public function testText() {
+ public function testText(): void {
$this->assertEquals($this->helpTopic->getBody(),
['#markup' => self::PLUGIN_INFORMATION['body']]);
$this->assertEquals($this->helpTopic->getLabel(),
@@ -71,7 +71,7 @@ class HelpTopicTwigTest extends UnitTestCase {
* @covers ::isTopLevel
* @covers ::getRelated
*/
- public function testDefinition() {
+ public function testDefinition(): void {
$this->assertEquals($this->helpTopic->getProvider(),
self::PLUGIN_INFORMATION['provider']);
$this->assertEquals($this->helpTopic->isTopLevel(),
@@ -85,7 +85,7 @@ class HelpTopicTwigTest extends UnitTestCase {
* @covers ::getCacheTags
* @covers ::getCacheMaxAge
*/
- public function testCacheInfo() {
+ public function testCacheInfo(): void {
$this->assertEquals([], $this->helpTopic->getCacheContexts());
$this->assertEquals(['core.extension'], $this->helpTopic->getCacheTags());
$this->assertEquals(Cache::PERMANENT, $this->helpTopic->getCacheMaxAge());
diff --git a/core/modules/history/tests/src/Functional/HistoryTest.php b/core/modules/history/tests/src/Functional/HistoryTest.php
index e5e7a5283ef..8a7c50ab5b7 100644
--- a/core/modules/history/tests/src/Functional/HistoryTest.php
+++ b/core/modules/history/tests/src/Functional/HistoryTest.php
@@ -106,7 +106,7 @@ class HistoryTest extends BrowserTestBase {
/**
* Verifies that the history endpoints work.
*/
- public function testHistory() {
+ public function testHistory(): void {
$nid = $this->testNode->id();
// Verify that previews of new entities do not create the history.
diff --git a/core/modules/history/tests/src/Kernel/Views/HistoryTimestampTest.php b/core/modules/history/tests/src/Kernel/Views/HistoryTimestampTest.php
index a6e6b1c7856..f8af02a31ba 100644
--- a/core/modules/history/tests/src/Kernel/Views/HistoryTimestampTest.php
+++ b/core/modules/history/tests/src/Kernel/Views/HistoryTimestampTest.php
@@ -51,7 +51,7 @@ class HistoryTimestampTest extends ViewsKernelTestBase {
/**
* Tests the handlers.
*/
- public function testHandlers() {
+ public function testHandlers(): void {
$nodes = [];
$node = Node::create([
'title' => 'n1',
diff --git a/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php b/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php
index 5233bc888ca..bddf7ef0634 100644
--- a/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php
+++ b/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php
@@ -61,7 +61,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
/**
* Tests creating an image style with a numeric name.
*/
- public function testNumericStyleName() {
+ public function testNumericStyleName(): void {
$style_name = rand();
$style_label = $this->randomString();
$edit = [
@@ -78,7 +78,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
/**
* General test to add a style, add/remove/edit effects to it, then delete it.
*/
- public function testStyle() {
+ public function testStyle(): void {
$admin_path = 'admin/config/media/image-styles';
// Setup a style to be created and effects to add to it.
@@ -307,7 +307,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
/**
* Tests deleting a style and choosing a replacement style.
*/
- public function testStyleReplacement() {
+ public function testStyleReplacement(): void {
// Create a new style.
$style_name = $this->randomMachineName(10);
$style_label = $this->randomString();
@@ -374,7 +374,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
/**
* Verifies that editing an image effect does not cause it to be duplicated.
*/
- public function testEditEffect() {
+ public function testEditEffect(): void {
// Add a scale effect.
$style_name = 'test_style_effect_edit';
$this->drupalGet('admin/config/media/image-styles/add');
@@ -429,7 +429,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
/**
* Tests flush user interface.
*/
- public function testFlushUserInterface() {
+ public function testFlushUserInterface(): void {
$admin_path = 'admin/config/media/image-styles';
// Create a new style.
@@ -461,7 +461,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
/**
* Tests image style configuration import that does a delete.
*/
- public function testConfigImport() {
+ public function testConfigImport(): void {
// Create a new style.
$style_name = $this->randomMachineName(10);
$style_label = $this->randomString();
@@ -511,7 +511,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
/**
* Tests access for the image style listing.
*/
- public function testImageStyleAccess() {
+ public function testImageStyleAccess(): void {
$style = ImageStyle::create(['name' => 'style_foo', 'label' => $this->randomString()]);
$style->save();
diff --git a/core/modules/image/tests/src/Functional/ImageDimensionsTest.php b/core/modules/image/tests/src/Functional/ImageDimensionsTest.php
index e1a58aa96b0..dbf6ee77aa2 100644
--- a/core/modules/image/tests/src/Functional/ImageDimensionsTest.php
+++ b/core/modules/image/tests/src/Functional/ImageDimensionsTest.php
@@ -38,7 +38,7 @@ class ImageDimensionsTest extends BrowserTestBase {
/**
* Tests styled image dimensions cumulatively.
*/
- public function testImageDimensions() {
+ public function testImageDimensions(): void {
$image_factory = $this->container->get('image.factory');
// Create a working copy of the file.
$files = $this->drupalGetTestFiles('image');
diff --git a/core/modules/image/tests/src/Functional/ImageEffect/ConvertTest.php b/core/modules/image/tests/src/Functional/ImageEffect/ConvertTest.php
index 6ca7b06955e..ff61902c152 100644
--- a/core/modules/image/tests/src/Functional/ImageEffect/ConvertTest.php
+++ b/core/modules/image/tests/src/Functional/ImageEffect/ConvertTest.php
@@ -28,7 +28,7 @@ class ConvertTest extends BrowserTestBase {
/**
* Tests that files stored in the root folder are converted properly.
*/
- public function testConvertFileInRoot() {
+ public function testConvertFileInRoot(): void {
// Create the test image style with a Convert effect.
$image_style = ImageStyle::create([
'name' => 'image_effect_test',
diff --git a/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php b/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php
index 6da021fdcc7..242bb31d72f 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php
@@ -42,7 +42,7 @@ class ImageFieldDefaultImagesTest extends ImageFieldTestBase {
/**
* Tests CRUD for fields and field storages with default images.
*/
- public function testDefaultImages() {
+ public function testDefaultImages(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
// Create files to use as the default images.
$files = $this->drupalGetTestFiles('image');
@@ -260,7 +260,7 @@ class ImageFieldDefaultImagesTest extends ImageFieldTestBase {
/**
* Tests image field and field storage having an invalid default image.
*/
- public function testInvalidDefaultImage() {
+ public function testInvalidDefaultImage(): void {
$field_storage = FieldStorageConfig::create([
'field_name' => $this->randomMachineName(),
'entity_type' => 'node',
diff --git a/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php b/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php
index 78dacd79a70..e37aa3b36ae 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php
@@ -42,14 +42,14 @@ class ImageFieldDisplayTest extends ImageFieldTestBase {
/**
* Tests image formatters on node display for public files.
*/
- public function testImageFieldFormattersPublic() {
+ public function testImageFieldFormattersPublic(): void {
$this->_testImageFieldFormatters('public');
}
/**
* Tests image formatters on node display for private files.
*/
- public function testImageFieldFormattersPrivate() {
+ public function testImageFieldFormattersPrivate(): void {
// Remove access content permission from anonymous users.
user_role_change_permissions(RoleInterface::ANONYMOUS_ID, ['access content' => FALSE]);
$this->_testImageFieldFormatters('private');
@@ -243,7 +243,7 @@ class ImageFieldDisplayTest extends ImageFieldTestBase {
/**
* Tests for image field settings.
*/
- public function testImageFieldSettings() {
+ public function testImageFieldSettings(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
@@ -477,7 +477,7 @@ class ImageFieldDisplayTest extends ImageFieldTestBase {
/**
* Tests use of a default image with an image field.
*/
- public function testImageFieldDefaultImage() {
+ public function testImageFieldDefaultImage(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
diff --git a/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php b/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php
index b7f567cff4d..32c97382d5f 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php
@@ -28,7 +28,7 @@ class ImageFieldValidateTest extends ImageFieldTestBase {
/**
* Tests image validity.
*/
- public function testValid() {
+ public function testValid(): void {
$file_system = $this->container->get('file_system');
$image_files = $this->drupalGetTestFiles('image');
@@ -90,7 +90,7 @@ class ImageFieldValidateTest extends ImageFieldTestBase {
/**
* Tests min/max dimensions settings.
*/
- public function testResolution() {
+ public function testResolution(): void {
$field_names = [
0 => $this->randomMachineName(),
1 => $this->randomMachineName(),
@@ -165,7 +165,7 @@ class ImageFieldValidateTest extends ImageFieldTestBase {
/**
* Tests that required alt/title fields gets validated right.
*/
- public function testRequiredAttributes() {
+ public function testRequiredAttributes(): void {
$field_name = $this->randomMachineName();
$field_settings = [
'alt_field' => 1,
@@ -222,7 +222,7 @@ class ImageFieldValidateTest extends ImageFieldTestBase {
*
* @dataProvider providerTestEmpty
*/
- public function testEmpty($field_name, $required, $cardinality, $form_element_name, $expected_page_text_when_edit_access_allowed, $expected_page_text_when_edit_access_forbidden) {
+ public function testEmpty($field_name, $required, $cardinality, $form_element_name, $expected_page_text_when_edit_access_allowed, $expected_page_text_when_edit_access_forbidden): void {
$this->createImageField($field_name, 'node', 'article', ['cardinality' => $cardinality], ['required' => $required]);
// Test with field edit access allowed.
diff --git a/core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php b/core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php
index 976e77cde77..2bf7c652ea4 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php
@@ -21,7 +21,7 @@ class ImageFieldWidgetTest extends ImageFieldTestBase {
/**
* Tests file widget element.
*/
- public function testWidgetElement() {
+ public function testWidgetElement(): void {
// Check for image widget in add/node/article page
$field_name = $this->randomMachineName();
$min_resolution = 50;
diff --git a/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php b/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php
index 52a78e2138d..40795627017 100644
--- a/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php
+++ b/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php
@@ -82,7 +82,7 @@ class ImageOnTranslatedEntityTest extends ImageFieldTestBase {
/**
* Tests synced file fields on translated nodes.
*/
- public function testSyncedImages() {
+ public function testSyncedImages(): void {
// Enable translation for "Basic page" nodes.
$this->enableContentTranslation('node', 'basic_page');
static::setFieldTranslatable('node', 'basic_page', $this->fieldName, TRUE);
diff --git a/core/modules/image/tests/src/Functional/ImageStyleDeleteTest.php b/core/modules/image/tests/src/Functional/ImageStyleDeleteTest.php
index 4d8bbf15583..bb23675bd0f 100644
--- a/core/modules/image/tests/src/Functional/ImageStyleDeleteTest.php
+++ b/core/modules/image/tests/src/Functional/ImageStyleDeleteTest.php
@@ -32,7 +32,7 @@ class ImageStyleDeleteTest extends ImageFieldTestBase {
/**
* Tests image style deletion.
*/
- public function testDelete() {
+ public function testDelete(): void {
$this->drupalGet('admin/config/media/image-styles/manage/medium/delete');
// Checks that the 'replacement' select element is displayed.
$this->assertSession()->fieldExists('replacement');
diff --git a/core/modules/image/tests/src/Functional/ImageStyleDownloadAccessControlTest.php b/core/modules/image/tests/src/Functional/ImageStyleDownloadAccessControlTest.php
index 430a16c6051..0e37e81883a 100644
--- a/core/modules/image/tests/src/Functional/ImageStyleDownloadAccessControlTest.php
+++ b/core/modules/image/tests/src/Functional/ImageStyleDownloadAccessControlTest.php
@@ -75,7 +75,7 @@ class ImageStyleDownloadAccessControlTest extends BrowserTestBase {
/**
* Ensures that private:// access is forbidden through image.style_public.
*/
- public function testPrivateThroughPublicRoute() {
+ public function testPrivateThroughPublicRoute(): void {
$this->fileSystem->copy(\Drupal::root() . '/core/tests/fixtures/files/image-1.png', 'private://image.png');
// Manually create the file record for the private:// file as we want it
@@ -114,7 +114,7 @@ class ImageStyleDownloadAccessControlTest extends BrowserTestBase {
/**
* Ensures that public:// access is forbidden through image.style.private.
*/
- public function testPublicThroughPrivateRoute() {
+ public function testPublicThroughPrivateRoute(): void {
$this->fileSystem->copy(\Drupal::root() . '/core/tests/fixtures/files/image-1.png', 'public://image.png');
$token = $this->style->getPathToken('public://image.png');
$private_route_public_scheme = Url::fromRoute(
diff --git a/core/modules/image/tests/src/Functional/ImageStyleFlushTest.php b/core/modules/image/tests/src/Functional/ImageStyleFlushTest.php
index 9d8af312145..40da3985df3 100644
--- a/core/modules/image/tests/src/Functional/ImageStyleFlushTest.php
+++ b/core/modules/image/tests/src/Functional/ImageStyleFlushTest.php
@@ -58,7 +58,7 @@ class ImageStyleFlushTest extends ImageFieldTestBase {
/**
* General test to flush a style.
*/
- public function testFlush() {
+ public function testFlush(): void {
// Setup a style to be created and effects to add to it.
$style_name = $this->randomMachineName(10);
diff --git a/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php b/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php
index f82e52e3960..11ce965a761 100644
--- a/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php
+++ b/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php
@@ -62,7 +62,7 @@ class ImageStylesPathAndUrlTest extends BrowserTestBase {
/**
* Tests \Drupal\image\ImageStyleInterface::buildUri().
*/
- public function testImageStylePath() {
+ public function testImageStylePath(): void {
$scheme = 'public';
$actual = $this->style->buildUri("$scheme://foo/bar.gif");
$expected = "$scheme://styles/" . $this->style->id() . "/$scheme/foo/bar.gif";
@@ -76,49 +76,49 @@ class ImageStylesPathAndUrlTest extends BrowserTestBase {
/**
* Tests an image style URL using the "public://" scheme.
*/
- public function testImageStyleUrlAndPathPublic() {
+ public function testImageStyleUrlAndPathPublic(): void {
$this->doImageStyleUrlAndPathTests('public');
}
/**
* Tests an image style URL using the "private://" scheme.
*/
- public function testImageStyleUrlAndPathPrivate() {
+ public function testImageStyleUrlAndPathPrivate(): void {
$this->doImageStyleUrlAndPathTests('private');
}
/**
* Tests an image style URL with the "public://" scheme and unclean URLs.
*/
- public function testImageStyleUrlAndPathPublicUnclean() {
+ public function testImageStyleUrlAndPathPublicUnclean(): void {
$this->doImageStyleUrlAndPathTests('public', FALSE);
}
/**
* Tests an image style URL with the "private://" schema and unclean URLs.
*/
- public function testImageStyleUrlAndPathPrivateUnclean() {
+ public function testImageStyleUrlAndPathPrivateUnclean(): void {
$this->doImageStyleUrlAndPathTests('private', FALSE);
}
/**
* Tests an image style URL with the "public://" schema and language prefix.
*/
- public function testImageStyleUrlAndPathPublicLanguage() {
+ public function testImageStyleUrlAndPathPublicLanguage(): void {
$this->doImageStyleUrlAndPathTests('public', TRUE, TRUE, 'fr');
}
/**
* Tests an image style URL with the "private://" schema and language prefix.
*/
- public function testImageStyleUrlAndPathPrivateLanguage() {
+ public function testImageStyleUrlAndPathPrivateLanguage(): void {
$this->doImageStyleUrlAndPathTests('private', TRUE, TRUE, 'fr');
}
/**
* Tests an image style URL with a file URL that has an extra slash in it.
*/
- public function testImageStyleUrlExtraSlash() {
+ public function testImageStyleUrlExtraSlash(): void {
$this->doImageStyleUrlAndPathTests('public', TRUE, TRUE);
}
@@ -141,7 +141,7 @@ class ImageStylesPathAndUrlTest extends BrowserTestBase {
/**
* Tests that an invalid source image returns a 404.
*/
- public function testImageStyleUrlForMissingSourceImage() {
+ public function testImageStyleUrlForMissingSourceImage(): void {
$non_existent_uri = 'public://foo.png';
$generated_url = $this->style->buildUrl($non_existent_uri);
$this->drupalGet($generated_url);
diff --git a/core/modules/image/tests/src/Functional/Rest/ImageStyleXmlAnonTest.php b/core/modules/image/tests/src/Functional/Rest/ImageStyleXmlAnonTest.php
index a508fc7a2b2..d7e43ab03a1 100644
--- a/core/modules/image/tests/src/Functional/Rest/ImageStyleXmlAnonTest.php
+++ b/core/modules/image/tests/src/Functional/Rest/ImageStyleXmlAnonTest.php
@@ -33,7 +33,7 @@ class ImageStyleXmlAnonTest extends ImageStyleResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testGet() {
+ public function testGet(): void {
// @todo Remove this method override in https://www.drupal.org/node/2905655
$this->markTestSkipped();
}
diff --git a/core/modules/image/tests/src/Functional/Rest/ImageStyleXmlBasicAuthTest.php b/core/modules/image/tests/src/Functional/Rest/ImageStyleXmlBasicAuthTest.php
index f0bfdbf8dbf..269b32aafa8 100644
--- a/core/modules/image/tests/src/Functional/Rest/ImageStyleXmlBasicAuthTest.php
+++ b/core/modules/image/tests/src/Functional/Rest/ImageStyleXmlBasicAuthTest.php
@@ -43,7 +43,7 @@ class ImageStyleXmlBasicAuthTest extends ImageStyleResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testGet() {
+ public function testGet(): void {
// @todo Remove this method override in https://www.drupal.org/node/2905655
$this->markTestSkipped();
}
diff --git a/core/modules/image/tests/src/Functional/Rest/ImageStyleXmlCookieTest.php b/core/modules/image/tests/src/Functional/Rest/ImageStyleXmlCookieTest.php
index b802543f66a..b3e9c820e88 100644
--- a/core/modules/image/tests/src/Functional/Rest/ImageStyleXmlCookieTest.php
+++ b/core/modules/image/tests/src/Functional/Rest/ImageStyleXmlCookieTest.php
@@ -38,7 +38,7 @@ class ImageStyleXmlCookieTest extends ImageStyleResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testGet() {
+ public function testGet(): void {
// @todo Remove this method override in https://www.drupal.org/node/2905655
$this->markTestSkipped();
}
diff --git a/core/modules/image/tests/src/FunctionalJavascript/ImageAdminStylesTest.php b/core/modules/image/tests/src/FunctionalJavascript/ImageAdminStylesTest.php
index 9bf24b6a33e..faea9dd8d4b 100644
--- a/core/modules/image/tests/src/FunctionalJavascript/ImageAdminStylesTest.php
+++ b/core/modules/image/tests/src/FunctionalJavascript/ImageAdminStylesTest.php
@@ -21,7 +21,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
/**
* Tests editing Ajax-enabled image effect forms.
*/
- public function testAjaxEnabledEffectForm() {
+ public function testAjaxEnabledEffectForm(): void {
$admin_path = 'admin/config/media/image-styles';
// Setup a style to be created and effects to add to it.
diff --git a/core/modules/image/tests/src/FunctionalJavascript/ImageFieldValidateTest.php b/core/modules/image/tests/src/FunctionalJavascript/ImageFieldValidateTest.php
index 51920aefed7..9c9839b15c6 100644
--- a/core/modules/image/tests/src/FunctionalJavascript/ImageFieldValidateTest.php
+++ b/core/modules/image/tests/src/FunctionalJavascript/ImageFieldValidateTest.php
@@ -22,7 +22,7 @@ class ImageFieldValidateTest extends ImageFieldTestBase {
/**
* Tests the validation message is displayed only once for ajax uploads.
*/
- public function testAJAXValidationMessage() {
+ public function testAJAXValidationMessage(): void {
$field_name = $this->randomMachineName();
$this->createImageField($field_name, 'node', 'article', ['cardinality' => -1]);
@@ -42,7 +42,7 @@ class ImageFieldValidateTest extends ImageFieldTestBase {
/**
* Tests that image field validation works with other form submit handlers.
*/
- public function testFriendlyAjaxValidation() {
+ public function testFriendlyAjaxValidation(): void {
// Add a custom field to the Article content type that contains an AJAX
// handler on a select field.
$field_storage = FieldStorageConfig::create([
diff --git a/core/modules/image/tests/src/Kernel/ImageEffectsTest.php b/core/modules/image/tests/src/Kernel/ImageEffectsTest.php
index 9d02930e097..6b7662e33e4 100644
--- a/core/modules/image/tests/src/Kernel/ImageEffectsTest.php
+++ b/core/modules/image/tests/src/Kernel/ImageEffectsTest.php
@@ -47,7 +47,7 @@ class ImageEffectsTest extends KernelTestBase {
/**
* Tests the 'image_resize' effect.
*/
- public function testResizeEffect() {
+ public function testResizeEffect(): void {
$this->assertImageEffect(['resize'], 'image_resize', [
'width' => 1,
'height' => 2,
@@ -64,7 +64,7 @@ class ImageEffectsTest extends KernelTestBase {
/**
* Tests the 'image_scale' effect.
*/
- public function testScaleEffect() {
+ public function testScaleEffect(): void {
// @todo Test also image upscaling in #3040887.
// @see https://www.drupal.org/project/drupal/issues/3040887
$this->assertImageEffect(['scale'], 'image_scale', [
@@ -83,7 +83,7 @@ class ImageEffectsTest extends KernelTestBase {
/**
* Tests the 'image_crop' effect.
*/
- public function testCropEffect() {
+ public function testCropEffect(): void {
// @todo Test also keyword offsets in #3040887.
// @see https://www.drupal.org/project/drupal/issues/3040887
$this->assertImageEffect(['crop'], 'image_crop', [
@@ -107,7 +107,7 @@ class ImageEffectsTest extends KernelTestBase {
/**
* Tests the 'image_convert' effect.
*/
- public function testConvertEffect() {
+ public function testConvertEffect(): void {
// Test jpeg.
$this->assertImageEffect(['convert'], 'image_convert', [
'extension' => 'jpeg',
@@ -122,7 +122,7 @@ class ImageEffectsTest extends KernelTestBase {
/**
* Tests the 'image_scale_and_crop' effect.
*/
- public function testScaleAndCropEffect() {
+ public function testScaleAndCropEffect(): void {
$this->assertImageEffect(['scale_and_crop'], 'image_scale_and_crop', [
'width' => 5,
'height' => 10,
@@ -143,7 +143,7 @@ class ImageEffectsTest extends KernelTestBase {
/**
* Tests the 'image_scale_and_crop' effect with an anchor.
*/
- public function testScaleAndCropEffectWithAnchor() {
+ public function testScaleAndCropEffectWithAnchor(): void {
$this->assertImageEffect(['scale_and_crop'], 'image_scale_and_crop', [
'anchor' => 'top-1',
'width' => 5,
@@ -165,7 +165,7 @@ class ImageEffectsTest extends KernelTestBase {
/**
* Tests the 'image_desaturate' effect.
*/
- public function testDesaturateEffect() {
+ public function testDesaturateEffect(): void {
$this->assertImageEffect(['desaturate'], 'image_desaturate', []);
// Check the parameters.
@@ -177,7 +177,7 @@ class ImageEffectsTest extends KernelTestBase {
/**
* Tests the image_rotate_effect() function.
*/
- public function testRotateEffect() {
+ public function testRotateEffect(): void {
// @todo Test also with 'random' === TRUE in #3040887.
// @see https://www.drupal.org/project/drupal/issues/3040887
$this->assertImageEffect(['rotate'], 'image_rotate', [
@@ -196,7 +196,7 @@ class ImageEffectsTest extends KernelTestBase {
/**
* Tests image effect caching.
*/
- public function testImageEffectsCaching() {
+ public function testImageEffectsCaching(): void {
$state = $this->container->get('state');
// The 'image_module_test.counter' state variable value is incremented in
@@ -221,7 +221,7 @@ class ImageEffectsTest extends KernelTestBase {
/**
* Tests that validation errors are passed from the plugin to the parent form.
*/
- public function testEffectFormValidationErrors() {
+ public function testEffectFormValidationErrors(): void {
$form_builder = $this->container->get('form_builder');
/** @var \Drupal\image\ImageStyleInterface $image_style */
diff --git a/core/modules/image/tests/src/Kernel/ImageFormatterTest.php b/core/modules/image/tests/src/Kernel/ImageFormatterTest.php
index 4cc1b795ac2..ac84e6a80e7 100644
--- a/core/modules/image/tests/src/Kernel/ImageFormatterTest.php
+++ b/core/modules/image/tests/src/Kernel/ImageFormatterTest.php
@@ -89,7 +89,7 @@ class ImageFormatterTest extends FieldKernelTestBase {
/**
* Tests the cache tags from image formatters.
*/
- public function testImageFormatterCacheTags() {
+ public function testImageFormatterCacheTags(): void {
// Create a test entity with the image field set.
$entity = EntityTest::create([
'name' => $this->randomMachineName(),
@@ -109,7 +109,7 @@ class ImageFormatterTest extends FieldKernelTestBase {
*
* @requires extension gd
*/
- public function testImageFormatterSvg() {
+ public function testImageFormatterSvg(): void {
// Install the default image styles.
$this->installConfig(['image']);
@@ -179,7 +179,7 @@ class ImageFormatterTest extends FieldKernelTestBase {
/**
* Tests Image Formatter URL options handling.
*/
- public function testImageFormatterUrlOptions() {
+ public function testImageFormatterUrlOptions(): void {
$this->display->setComponent($this->fieldName, ['settings' => ['image_link' => 'content']]);
// Create a test entity with the image field set.
diff --git a/core/modules/image/tests/src/Kernel/ImageImportTest.php b/core/modules/image/tests/src/Kernel/ImageImportTest.php
index 1f945f605b4..0797627b198 100644
--- a/core/modules/image/tests/src/Kernel/ImageImportTest.php
+++ b/core/modules/image/tests/src/Kernel/ImageImportTest.php
@@ -22,7 +22,7 @@ class ImageImportTest extends KernelTestBase {
/**
* Tests importing image styles.
*/
- public function testImport() {
+ public function testImport(): void {
$style = ImageStyle::create([
'name' => 'test',
'label' => 'Test',
diff --git a/core/modules/image/tests/src/Kernel/ImageItemTest.php b/core/modules/image/tests/src/Kernel/ImageItemTest.php
index b96805627d8..28561deb384 100644
--- a/core/modules/image/tests/src/Kernel/ImageItemTest.php
+++ b/core/modules/image/tests/src/Kernel/ImageItemTest.php
@@ -99,7 +99,7 @@ class ImageItemTest extends FieldKernelTestBase {
/**
* Tests using entity fields of the image field type.
*/
- public function testImageItem() {
+ public function testImageItem(): void {
// Create a test entity with the image field set.
$entity = EntityTest::create();
$entity->image_test->target_id = $this->image->id();
@@ -158,7 +158,7 @@ class ImageItemTest extends FieldKernelTestBase {
/**
* Tests generateSampleItems() method under different dimensions.
*/
- public function testImageItemSampleValueGeneration() {
+ public function testImageItemSampleValueGeneration(): void {
// Default behavior. No dimensions configuration.
$entity = EntityTest::create();
@@ -177,7 +177,7 @@ class ImageItemTest extends FieldKernelTestBase {
/**
* Tests a malformed image.
*/
- public function testImageItemMalformed() {
+ public function testImageItemMalformed(): void {
\Drupal::service('module_installer')->install(['dblog']);
// Validate entity is an image and don't gather dimensions if it is not.
diff --git a/core/modules/image/tests/src/Kernel/ImageStyleCustomStreamWrappersTest.php b/core/modules/image/tests/src/Kernel/ImageStyleCustomStreamWrappersTest.php
index e1a8718266c..1132d97296a 100644
--- a/core/modules/image/tests/src/Kernel/ImageStyleCustomStreamWrappersTest.php
+++ b/core/modules/image/tests/src/Kernel/ImageStyleCustomStreamWrappersTest.php
@@ -79,7 +79,7 @@ class ImageStyleCustomStreamWrappersTest extends KernelTestBase {
* @param string $expected_scheme
* The derivative expected stream wrapper scheme.
*/
- public function testCustomStreamWrappers($source_scheme, $expected_scheme) {
+ public function testCustomStreamWrappers($source_scheme, $expected_scheme): void {
$derivative_uri = $this->imageStyle->buildUri("$source_scheme://some/path/image.png");
$derivative_scheme = StreamWrapperManager::getScheme($derivative_uri);
diff --git a/core/modules/image/tests/src/Kernel/ImageStyleIntegrationTest.php b/core/modules/image/tests/src/Kernel/ImageStyleIntegrationTest.php
index d8b58055be8..1c25ab7fe44 100644
--- a/core/modules/image/tests/src/Kernel/ImageStyleIntegrationTest.php
+++ b/core/modules/image/tests/src/Kernel/ImageStyleIntegrationTest.php
@@ -42,7 +42,7 @@ class ImageStyleIntegrationTest extends KernelTestBase {
/**
* Tests the dependency between ImageStyle and entity display components.
*/
- public function testEntityDisplayDependency() {
+ public function testEntityDisplayDependency(): void {
// Create two image styles.
/** @var \Drupal\image\ImageStyleInterface $style */
$style = ImageStyle::create([
@@ -136,7 +136,7 @@ class ImageStyleIntegrationTest extends KernelTestBase {
/**
* Tests renaming the ImageStyle.
*/
- public function testEntityDisplayDependencyRename() {
+ public function testEntityDisplayDependencyRename(): void {
// Create an image style.
/** @var \Drupal\image\ImageStyleInterface $style */
$style = ImageStyle::create([
diff --git a/core/modules/image/tests/src/Kernel/ImageThemeFunctionTest.php b/core/modules/image/tests/src/Kernel/ImageThemeFunctionTest.php
index e5a55644c21..cb846983acd 100644
--- a/core/modules/image/tests/src/Kernel/ImageThemeFunctionTest.php
+++ b/core/modules/image/tests/src/Kernel/ImageThemeFunctionTest.php
@@ -86,7 +86,7 @@ class ImageThemeFunctionTest extends KernelTestBase {
/**
* Tests usage of the image field formatters.
*/
- public function testImageFormatterTheme() {
+ public function testImageFormatterTheme(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
@@ -148,7 +148,7 @@ class ImageThemeFunctionTest extends KernelTestBase {
/**
* Tests usage of the image style theme function.
*/
- public function testImageStyleTheme() {
+ public function testImageStyleTheme(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
@@ -185,7 +185,7 @@ class ImageThemeFunctionTest extends KernelTestBase {
/**
* Tests image alt attribute functionality.
*/
- public function testImageAltFunctionality() {
+ public function testImageAltFunctionality(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
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 ed2caf36ca7..9b3615b99e6 100644
--- a/core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageCacheTest.php
+++ b/core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageCacheTest.php
@@ -29,7 +29,7 @@ class MigrateImageCacheTest extends MigrateDrupal6TestBase {
/**
* Tests that an exception is thrown when ImageCache is not installed.
*/
- public function testMissingTable() {
+ public function testMissingTable(): void {
$this->sourceDatabase->update('system')
->fields([
'status' => 0,
@@ -47,7 +47,7 @@ class MigrateImageCacheTest extends MigrateDrupal6TestBase {
/**
* Tests basic passing migrations.
*/
- public function testPassingMigration() {
+ public function testPassingMigration(): void {
$this->executeMigration('d6_imagecache_presets');
/** @var \Drupal\image\Entity\ImageStyle $style */
@@ -84,7 +84,7 @@ class MigrateImageCacheTest extends MigrateDrupal6TestBase {
/**
* Tests that missing actions causes failures.
*/
- public function testMissingEffectPlugin() {
+ public function testMissingEffectPlugin(): void {
Database::getConnection('default', 'migrate')->insert("imagecache_action")
->fields([
'presetid',
@@ -112,7 +112,7 @@ class MigrateImageCacheTest extends MigrateDrupal6TestBase {
/**
* Tests that missing action's causes failures.
*/
- public function testInvalidCropValues() {
+ public function testInvalidCropValues(): void {
Database::getConnection('default', 'migrate')->insert("imagecache_action")
->fields([
'presetid',
diff --git a/core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageTest.php b/core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageTest.php
index 0d5218a65e1..4f0b99b4f3d 100644
--- a/core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageTest.php
+++ b/core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageTest.php
@@ -40,7 +40,7 @@ class MigrateImageTest extends MigrateNodeTestBase {
/**
* Tests image migration from Drupal 6 to 8.
*/
- public function testNode() {
+ public function testNode(): void {
$node = Node::load(9);
// Test the image field sub fields.
$this->assertSame('2', $node->field_test_imagefield->target_id);
diff --git a/core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageSettingsTest.php b/core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageSettingsTest.php
index 1e8a23c7130..e8ce5a8ddbe 100644
--- a/core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageSettingsTest.php
+++ b/core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageSettingsTest.php
@@ -26,7 +26,7 @@ class MigrateImageSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests the migration.
*/
- public function testMigration() {
+ public function testMigration(): void {
$config = $this->config('image.settings');
// These settings are not recommended...
$this->assertTrue($config->get('allow_insecure_derivatives'));
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 d9d10fe1cfb..006653f7acf 100644
--- a/core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageStylesTest.php
+++ b/core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageStylesTest.php
@@ -33,7 +33,7 @@ class MigrateImageStylesTest extends MigrateDrupal7TestBase {
/**
* Tests the image styles migration.
*/
- public function testImageStylesMigration() {
+ public function testImageStylesMigration(): void {
$this->assertEntity('custom_image_style_1', "Custom image style 1", ['image_scale_and_crop', 'image_desaturate'], [['width' => 55, 'height' => 55, 'anchor' => 'center-center'], []]);
$this->assertEntity('custom_image_style_2', "Custom image style 2", ['image_resize', 'image_rotate'], [['width' => 55, 'height' => 100], ['degrees' => 45, 'bgcolor' => '#FFFFFF', 'random' => FALSE]]);
$this->assertEntity('custom_image_style_3', "Custom image style 3", ['image_scale', 'image_crop'], [['width' => 150, 'height' => NULL, 'upscale' => FALSE], ['width' => 50, 'height' => 50, 'anchor' => 'left-top']]);
diff --git a/core/modules/image/tests/src/Kernel/Views/ImageViewsDataTest.php b/core/modules/image/tests/src/Kernel/Views/ImageViewsDataTest.php
index 31cdeb6a653..a8e0883b4c3 100644
--- a/core/modules/image/tests/src/Kernel/Views/ImageViewsDataTest.php
+++ b/core/modules/image/tests/src/Kernel/Views/ImageViewsDataTest.php
@@ -45,7 +45,7 @@ class ImageViewsDataTest extends ViewsKernelTestBase {
* @see image_field_views_data()
* @see image_field_views_data_views_data_alter()
*/
- public function testRelationshipViewsData() {
+ public function testRelationshipViewsData(): void {
// Create image field to entity_test.
FieldStorageConfig::create([
'entity_type' => 'entity_test',
diff --git a/core/modules/image/tests/src/Kernel/Views/RelationshipUserImageDataTest.php b/core/modules/image/tests/src/Kernel/Views/RelationshipUserImageDataTest.php
index 5f9612ee4b7..49223494000 100644
--- a/core/modules/image/tests/src/Kernel/Views/RelationshipUserImageDataTest.php
+++ b/core/modules/image/tests/src/Kernel/Views/RelationshipUserImageDataTest.php
@@ -72,7 +72,7 @@ class RelationshipUserImageDataTest extends ViewsKernelTestBase {
/**
* Tests using the views image relationship.
*/
- public function testViewsHandlerRelationshipUserImageData() {
+ public function testViewsHandlerRelationshipUserImageData(): void {
$file = File::create([
'fid' => 2,
'uid' => 2,
diff --git a/core/modules/image/tests/src/Unit/ImageStyleTest.php b/core/modules/image/tests/src/Unit/ImageStyleTest.php
index 6b4685148fc..d247642b3cd 100644
--- a/core/modules/image/tests/src/Unit/ImageStyleTest.php
+++ b/core/modules/image/tests/src/Unit/ImageStyleTest.php
@@ -98,7 +98,7 @@ class ImageStyleTest extends UnitTestCase {
/**
* @covers ::getDerivativeExtension
*/
- public function testGetDerivativeExtension() {
+ public function testGetDerivativeExtension(): void {
$image_effect_id = $this->randomMachineName();
$logger = $this->getMockBuilder('\Psr\Log\LoggerInterface')->getMock();
$image_effect = $this->getMockBuilder('\Drupal\image\ImageEffectBase')
@@ -120,7 +120,7 @@ class ImageStyleTest extends UnitTestCase {
/**
* @covers ::buildUri
*/
- public function testBuildUri() {
+ public function testBuildUri(): void {
// Image style that changes the extension.
$image_effect_id = $this->randomMachineName();
$logger = $this->getMockBuilder('\Psr\Log\LoggerInterface')->getMock();
@@ -150,7 +150,7 @@ class ImageStyleTest extends UnitTestCase {
/**
* @covers ::getPathToken
*/
- public function testGetPathToken() {
+ public function testGetPathToken(): void {
$logger = $this->getMockBuilder('\Psr\Log\LoggerInterface')->getMock();
$private_key = $this->randomMachineName();
$hash_salt = $this->randomMachineName();
@@ -202,7 +202,7 @@ class ImageStyleTest extends UnitTestCase {
/**
* @covers ::flush
*/
- public function testFlush() {
+ public function testFlush(): void {
$cache_tag_invalidator = $this->createMock('\Drupal\Core\Cache\CacheTagsInvalidator');
$file_system = $this->createMock('\Drupal\Core\File\FileSystemInterface');
$module_handler = $this->createMock('\Drupal\Core\Extension\ModuleHandlerInterface');
diff --git a/core/modules/image/tests/src/Unit/PageCache/DenyPrivateImageStyleDownloadTest.php b/core/modules/image/tests/src/Unit/PageCache/DenyPrivateImageStyleDownloadTest.php
index eb6866f1738..e98965ce4f2 100644
--- a/core/modules/image/tests/src/Unit/PageCache/DenyPrivateImageStyleDownloadTest.php
+++ b/core/modules/image/tests/src/Unit/PageCache/DenyPrivateImageStyleDownloadTest.php
@@ -62,7 +62,7 @@ class DenyPrivateImageStyleDownloadTest extends UnitTestCase {
* @dataProvider providerPrivateImageStyleDownloadPolicy
* @covers ::check
*/
- public function testPrivateImageStyleDownloadPolicy($expected_result, $route_name) {
+ public function testPrivateImageStyleDownloadPolicy($expected_result, $route_name): void {
$this->routeMatch->expects($this->once())
->method('getRouteName')
->willReturn($route_name);
diff --git a/core/modules/inline_form_errors/tests/src/Functional/FormErrorHandlerFileUploadTest.php b/core/modules/inline_form_errors/tests/src/Functional/FormErrorHandlerFileUploadTest.php
index bcb1bf981cb..54d3f482f6e 100644
--- a/core/modules/inline_form_errors/tests/src/Functional/FormErrorHandlerFileUploadTest.php
+++ b/core/modules/inline_form_errors/tests/src/Functional/FormErrorHandlerFileUploadTest.php
@@ -91,7 +91,7 @@ class FormErrorHandlerFileUploadTest extends BrowserTestBase {
/**
* Tests that the required field error is displayed as inline error message.
*/
- public function testFileUploadErrors() {
+ public function testFileUploadErrors(): void {
$this->drupalGet('node/add/page');
$edit = [
'edit-title-0-value' => $this->randomString(),
diff --git a/core/modules/inline_form_errors/tests/src/FunctionalJavascript/FormErrorHandlerCKEditor5Test.php b/core/modules/inline_form_errors/tests/src/FunctionalJavascript/FormErrorHandlerCKEditor5Test.php
index 0cbd8ae38ae..c0b50328ed1 100644
--- a/core/modules/inline_form_errors/tests/src/FunctionalJavascript/FormErrorHandlerCKEditor5Test.php
+++ b/core/modules/inline_form_errors/tests/src/FunctionalJavascript/FormErrorHandlerCKEditor5Test.php
@@ -87,7 +87,7 @@ class FormErrorHandlerCKEditor5Test extends WebDriverTestBase {
/**
* Tests if the fragment link to a textarea works with CKEditor 5 enabled.
*/
- public function testFragmentLink() {
+ public function testFragmentLink(): void {
$session = $this->getSession();
$web_assert = $this->assertSession();
$ckeditor_class = '.ck-editor';
diff --git a/core/modules/inline_form_errors/tests/src/Kernel/FormElementInlineErrorTest.php b/core/modules/inline_form_errors/tests/src/Kernel/FormElementInlineErrorTest.php
index 012a4c0ee5c..288230dcf4a 100644
--- a/core/modules/inline_form_errors/tests/src/Kernel/FormElementInlineErrorTest.php
+++ b/core/modules/inline_form_errors/tests/src/Kernel/FormElementInlineErrorTest.php
@@ -22,7 +22,7 @@ class FormElementInlineErrorTest extends KernelTestBase {
/**
* Tests that no inline form errors are shown when disabled for a form.
*/
- public function testDisplayErrorMessagesNotInline() {
+ public function testDisplayErrorMessagesNotInline(): void {
$form_id = 'test';
$form = [
diff --git a/core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php b/core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php
index d40f4190c83..2d4f07ff312 100644
--- a/core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php
+++ b/core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php
@@ -119,7 +119,7 @@ class FormErrorHandlerTest extends UnitTestCase {
* @covers ::displayErrorMessages
* @covers ::setElementErrorsFromFormState
*/
- public function testErrorMessagesInline() {
+ public function testErrorMessagesInline(): void {
$messages = [
'no title given',
'element is invisible',
@@ -169,7 +169,7 @@ class FormErrorHandlerTest extends UnitTestCase {
/**
* Tests that opting out of Inline Form Errors works.
*/
- public function testErrorMessagesNotInline() {
+ public function testErrorMessagesNotInline(): void {
// Asserts all messages are summarized.
$messages = [
'invalid',
diff --git a/core/modules/jsonapi/tests/src/Functional/BlockContentTest.php b/core/modules/jsonapi/tests/src/Functional/BlockContentTest.php
index 0b9347d7c89..7d35326abc6 100644
--- a/core/modules/jsonapi/tests/src/Functional/BlockContentTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/BlockContentTest.php
@@ -260,7 +260,7 @@ class BlockContentTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testCollectionFilterAccess() {
+ public function testCollectionFilterAccess(): void {
$this->entity->setPublished()->save();
$this->doTestCollectionFilterAccessForPublishableEntities('info', NULL, 'administer block content');
}
diff --git a/core/modules/jsonapi/tests/src/Functional/CommentTest.php b/core/modules/jsonapi/tests/src/Functional/CommentTest.php
index a5f85fe90a0..da7d6a7d822 100644
--- a/core/modules/jsonapi/tests/src/Functional/CommentTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/CommentTest.php
@@ -322,7 +322,7 @@ class CommentTest extends ResourceTestBase {
* - base fields that are marked as required, but yet can still result in
* validation errors other than "missing required field".
*/
- public function testPostIndividualDxWithoutCriticalBaseFields() {
+ public function testPostIndividualDxWithoutCriticalBaseFields(): void {
$this->setUpAuthorization('POST');
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
@@ -362,7 +362,7 @@ class CommentTest extends ResourceTestBase {
/**
* Tests POSTing a comment with and without 'skip comment approval'.
*/
- public function testPostIndividualSkipCommentApproval() {
+ public function testPostIndividualSkipCommentApproval(): void {
$this->setUpAuthorization('POST');
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
@@ -425,7 +425,7 @@ class CommentTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testCollectionFilterAccess() {
+ public function testCollectionFilterAccess(): void {
// Verify the expected behavior in the common case.
$this->doTestCollectionFilterAccessForPublishableEntities('subject', 'access comments', 'administer comments');
@@ -468,7 +468,7 @@ class CommentTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchIndividual() {
+ public function testPatchIndividual(): void {
// Ensure ::getModifiedEntityForPatchTesting() can pick an alternative value
// for the 'entity_id' field.
EntityTest::create([
@@ -476,7 +476,7 @@ class CommentTest extends ResourceTestBase {
'type' => 'bar',
])->save();
- return parent::testPatchIndividual();
+ parent::testPatchIndividual();
}
}
diff --git a/core/modules/jsonapi/tests/src/Functional/ConfigurableLanguageTest.php b/core/modules/jsonapi/tests/src/Functional/ConfigurableLanguageTest.php
index d5a6586125a..9e170ba2c5b 100644
--- a/core/modules/jsonapi/tests/src/Functional/ConfigurableLanguageTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/ConfigurableLanguageTest.php
@@ -122,7 +122,7 @@ class ConfigurableLanguageTest extends ConfigEntityResourceTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/2915539
*/
- public function testGetIndividualDefaultConfig() {
+ public function testGetIndividualDefaultConfig(): void {
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
$url = Url::fromRoute('jsonapi.configurable_language--configurable_language.individual', ['entity' => ConfigurableLanguage::load('en')->uuid()]);
/* $url = ConfigurableLanguage::load('en')->toUrl('jsonapi'); */
diff --git a/core/modules/jsonapi/tests/src/Functional/EntryPointTest.php b/core/modules/jsonapi/tests/src/Functional/EntryPointTest.php
index b4334085035..d6fc9884175 100644
--- a/core/modules/jsonapi/tests/src/Functional/EntryPointTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/EntryPointTest.php
@@ -40,7 +40,7 @@ class EntryPointTest extends BrowserTestBase {
/**
* Test GET to the entry point.
*/
- public function testEntryPoint() {
+ public function testEntryPoint(): void {
$request_options = [];
$request_options[RequestOptions::HEADERS]['Accept'] = 'application/vnd.api+json';
$response = $this->request('GET', Url::fromUri('base://jsonapi'), $request_options);
diff --git a/core/modules/jsonapi/tests/src/Functional/ExternalNormalizersTest.php b/core/modules/jsonapi/tests/src/Functional/ExternalNormalizersTest.php
index c0b9131aff6..dfdadeedc97 100644
--- a/core/modules/jsonapi/tests/src/Functional/ExternalNormalizersTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/ExternalNormalizersTest.php
@@ -113,7 +113,7 @@ class ExternalNormalizersTest extends BrowserTestBase {
*
* @dataProvider providerTestFormatAgnosticNormalizers
*/
- public function testFormatAgnosticNormalizers($test_module, $expected_value_jsonapi_normalization, $expected_value_jsonapi_denormalization) {
+ public function testFormatAgnosticNormalizers($test_module, $expected_value_jsonapi_normalization, $expected_value_jsonapi_denormalization): void {
assert(in_array($expected_value_jsonapi_normalization, [static::VALUE_ORIGINAL, static::VALUE_OVERRIDDEN], TRUE));
assert(in_array($expected_value_jsonapi_denormalization, [static::VALUE_ORIGINAL, static::VALUE_OVERRIDDEN], TRUE));
diff --git a/core/modules/jsonapi/tests/src/Functional/FileTest.php b/core/modules/jsonapi/tests/src/Functional/FileTest.php
index b4a7b71676f..899bcbdc78f 100644
--- a/core/modules/jsonapi/tests/src/Functional/FileTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/FileTest.php
@@ -203,7 +203,7 @@ class FileTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPostIndividual() {
+ public function testPostIndividual(): void {
// @todo https://www.drupal.org/node/1927648
$this->markTestSkipped();
}
@@ -223,7 +223,7 @@ class FileTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testCollectionFilterAccess() {
+ public function testCollectionFilterAccess(): void {
$label_field_name = 'filename';
// Verify the expected behavior in the common case: when the file is public.
$this->doTestCollectionFilterAccessBasedOnPermissions($label_field_name, 'access content');
diff --git a/core/modules/jsonapi/tests/src/Functional/FileUploadTest.php b/core/modules/jsonapi/tests/src/Functional/FileUploadTest.php
index dba03609038..354904df389 100644
--- a/core/modules/jsonapi/tests/src/Functional/FileUploadTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/FileUploadTest.php
@@ -150,42 +150,42 @@ class FileUploadTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testGetIndividual() {
+ public function testGetIndividual(): void {
$this->markTestSkipped('Irrelevant for this test');
}
/**
* {@inheritdoc}
*/
- public function testPostIndividual() {
+ public function testPostIndividual(): void {
$this->markTestSkipped('Irrelevant for this test');
}
/**
* {@inheritdoc}
*/
- public function testPatchIndividual() {
+ public function testPatchIndividual(): void {
$this->markTestSkipped('Irrelevant for this test');
}
/**
* {@inheritdoc}
*/
- public function testDeleteIndividual() {
+ public function testDeleteIndividual(): void {
$this->markTestSkipped('Irrelevant for this test');
}
/**
* {@inheritdoc}
*/
- public function testCollection() {
+ public function testCollection(): void {
$this->markTestSkipped('Irrelevant for this test');
}
/**
* {@inheritdoc}
*/
- public function testRelationships() {
+ public function testRelationships(): void {
$this->markTestSkipped('Irrelevant for this test');
}
@@ -207,7 +207,7 @@ class FileUploadTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testRelated() {
+ public function testRelated(): void {
\Drupal::service('router.builder')->rebuild();
parent::testRelated();
}
@@ -215,7 +215,7 @@ class FileUploadTest extends ResourceTestBase {
/**
* Tests using the file upload POST route; needs second request to "use" file.
*/
- public function testPostFileUpload() {
+ public function testPostFileUpload(): void {
\Drupal::service('router.builder')->rebuild();
$uri = Url::fromUri('base:' . static::$postUri);
@@ -280,7 +280,7 @@ class FileUploadTest extends ResourceTestBase {
/**
* Tests using the 'file upload and "use" file in single request" POST route.
*/
- public function testPostFileUploadAndUseInSingleRequest() {
+ public function testPostFileUploadAndUseInSingleRequest(): void {
\Drupal::service('router.builder')->rebuild();
// Update the test entity so it already has a file. This allows verifying
// that this route appends files, and does not replace them.
@@ -431,7 +431,7 @@ class FileUploadTest extends ResourceTestBase {
*
* A new file should be created with a suffixed name.
*/
- public function testPostFileUploadDuplicateFile() {
+ public function testPostFileUploadDuplicateFile(): void {
\Drupal::service('router.builder')->rebuild();
$this->setUpAuthorization('POST');
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
@@ -472,7 +472,7 @@ class FileUploadTest extends ResourceTestBase {
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#Directives
*/
- public function testFileUploadStrippedFilePath() {
+ public function testFileUploadStrippedFilePath(): void {
\Drupal::service('router.builder')->rebuild();
$this->setUpAuthorization('POST');
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
@@ -519,7 +519,7 @@ class FileUploadTest extends ResourceTestBase {
/**
* Tests invalid file uploads.
*/
- public function testInvalidFileUploads() {
+ public function testInvalidFileUploads(): void {
\Drupal::service('router.builder')->rebuild();
$this->setUpAuthorization('POST');
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
@@ -532,7 +532,7 @@ class FileUploadTest extends ResourceTestBase {
/**
* Tests using the file upload route with a unicode file name.
*/
- public function testFileUploadUnicodeFilename() {
+ public function testFileUploadUnicodeFilename(): void {
\Drupal::service('router.builder')->rebuild();
$this->setUpAuthorization('POST');
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
@@ -551,7 +551,7 @@ class FileUploadTest extends ResourceTestBase {
/**
* Tests using the file upload route with a zero byte file.
*/
- public function testFileUploadZeroByteFile() {
+ public function testFileUploadZeroByteFile(): void {
\Drupal::service('router.builder')->rebuild();
$this->setUpAuthorization('POST');
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
@@ -723,7 +723,7 @@ class FileUploadTest extends ResourceTestBase {
/**
* Tests using the file upload POST route no configuration.
*/
- public function testFileUploadNoConfiguration() {
+ public function testFileUploadNoConfiguration(): void {
$this->setUpAuthorization('POST');
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
diff --git a/core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php b/core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php
index 09b9a18d6d5..e2e1481617c 100644
--- a/core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php
@@ -91,7 +91,7 @@ class InternalEntitiesTest extends BrowserTestBase {
/**
* Ensures that internal resources types aren't present in the entry point.
*/
- public function testEntryPoint() {
+ public function testEntryPoint(): void {
$document = $this->jsonapiGet('/jsonapi');
$this->assertArrayNotHasKey(
"{$this->internalEntity->getEntityTypeId()}--{$this->internalEntity->bundle()}",
@@ -103,7 +103,7 @@ class InternalEntitiesTest extends BrowserTestBase {
/**
* Ensures that internal resources types aren't present in the routes.
*/
- public function testRoutes() {
+ public function testRoutes(): void {
// This cannot be in a data provider because it needs values created by the
// setUp method.
$paths = [
@@ -121,7 +121,7 @@ class InternalEntitiesTest extends BrowserTestBase {
/**
* Asserts that internal entities are not included in compound documents.
*/
- public function testIncludes() {
+ public function testIncludes(): void {
$document = $this->getIndividual($this->referencingEntity, [
'query' => ['include' => 'field_internal'],
]);
@@ -135,7 +135,7 @@ class InternalEntitiesTest extends BrowserTestBase {
/**
* Asserts that links to internal relationships aren't generated.
*/
- public function testLinks() {
+ public function testLinks(): void {
$document = $this->getIndividual($this->referencingEntity);
$this->assertArrayNotHasKey(
'related',
diff --git a/core/modules/jsonapi/tests/src/Functional/JsonApiFilterRegressionTest.php b/core/modules/jsonapi/tests/src/Functional/JsonApiFilterRegressionTest.php
index b715e119834..4b6af8d4d6a 100644
--- a/core/modules/jsonapi/tests/src/Functional/JsonApiFilterRegressionTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/JsonApiFilterRegressionTest.php
@@ -45,7 +45,7 @@ class JsonApiFilterRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/2953207
*/
- public function testBundleSpecificTargetEntityTypeFromIssue2953207() {
+ public function testBundleSpecificTargetEntityTypeFromIssue2953207(): void {
// Set up data model.
$this->assertTrue($this->container->get('module_installer')->install(['comment'], TRUE), 'Installed modules.');
$this->addDefaultCommentField('taxonomy_term', 'tags', 'comment', CommentItemInterface::OPEN, 'tcomment');
@@ -81,7 +81,7 @@ class JsonApiFilterRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/3015759
*/
- public function testFilterByIdFromIssue3015759() {
+ public function testFilterByIdFromIssue3015759(): void {
// Set up data model.
$this->assertTrue($this->container->get('module_installer')->install(['shortcut'], TRUE), 'Installed modules.');
$this->rebuildAll();
@@ -121,7 +121,7 @@ class JsonApiFilterRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/jsonapi/issues/3025372
*/
- public function testEmptyRelationshipFilteringFromIssue3025372() {
+ public function testEmptyRelationshipFilteringFromIssue3025372(): void {
// Set up data model.
$this->drupalCreateContentType(['type' => 'folder']);
$this->createEntityReferenceField(
@@ -181,7 +181,7 @@ class JsonApiFilterRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/3036593
*/
- public function testFilteringEntitiesByEntityReferenceTargetId() {
+ public function testFilteringEntitiesByEntityReferenceTargetId(): void {
// Create two config entities to be the config targets of an entity
// reference. In this case, the `roles` field.
$role_llamalovers = $this->drupalCreateRole([], 'llamalovers', 'Llama Lovers');
diff --git a/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalDateFieldTest.php b/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalDateFieldTest.php
index 8301d8a9fbd..eebd9388af0 100644
--- a/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalDateFieldTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalDateFieldTest.php
@@ -55,7 +55,7 @@ class JsonApiFunctionalDateFieldTest extends JsonApiFunctionalTestBase {
/**
* Tests the GET method.
*/
- public function testRead() {
+ public function testRead(): void {
/** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */
$date_formatter = $this->container->get('date.formatter');
diff --git a/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalMultilingualTest.php b/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalMultilingualTest.php
index d60a0e3df15..2b1992fb189 100644
--- a/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalMultilingualTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalMultilingualTest.php
@@ -66,7 +66,7 @@ class JsonApiFunctionalMultilingualTest extends JsonApiFunctionalTestBase {
/**
* Tests reading multilingual content.
*/
- public function testReadMultilingual() {
+ public function testReadMultilingual(): void {
// Different databases have different sort orders, so a sort is required so
// test expectations do not need to vary per database.
$default_sort = ['sort' => 'drupal_internal__nid'];
@@ -99,7 +99,7 @@ class JsonApiFunctionalMultilingualTest extends JsonApiFunctionalTestBase {
/**
* Tests updating a translation.
*/
- public function testPatchTranslation() {
+ public function testPatchTranslation(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
$node = $this->nodes[0];
$uuid = $node->uuid();
@@ -198,7 +198,7 @@ class JsonApiFunctionalMultilingualTest extends JsonApiFunctionalTestBase {
/**
* Tests updating a translation fallback.
*/
- public function testPatchTranslationFallback() {
+ public function testPatchTranslationFallback(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
$node = $this->nodes[0];
$uuid = $node->uuid();
@@ -239,7 +239,7 @@ class JsonApiFunctionalMultilingualTest extends JsonApiFunctionalTestBase {
/**
* Tests creating a translation.
*/
- public function testPostTranslation() {
+ public function testPostTranslation(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
$this->grantPermissions(Role::load(RoleInterface::ANONYMOUS_ID), [
'bypass node access',
@@ -303,7 +303,7 @@ class JsonApiFunctionalMultilingualTest extends JsonApiFunctionalTestBase {
/**
* Tests deleting multilingual content.
*/
- public function testDeleteMultilingual() {
+ public function testDeleteMultilingual(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
$this->grantPermissions(Role::load(RoleInterface::ANONYMOUS_ID), [
'bypass node access',
diff --git a/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTest.php b/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTest.php
index 211eae28377..59908f19ac3 100644
--- a/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTest.php
@@ -33,7 +33,7 @@ class JsonApiFunctionalTest extends JsonApiFunctionalTestBase {
/**
* Tests the GET method.
*/
- public function testRead() {
+ public function testRead(): void {
$this->createDefaultContent(61, 5, TRUE, TRUE, static::IS_NOT_MULTILINGUAL, FALSE);
// Unpublish the last entity, so we can check access.
$this->nodes[60]->setUnpublished()->save();
@@ -554,7 +554,7 @@ class JsonApiFunctionalTest extends JsonApiFunctionalTestBase {
/**
* Tests the GET method on articles referencing the same tag twice.
*/
- public function testReferencingTwiceRead() {
+ public function testReferencingTwiceRead(): void {
$this->createDefaultContent(1, 1, FALSE, FALSE, static::IS_NOT_MULTILINGUAL, TRUE);
// 1. Load all articles (1st page).
@@ -568,7 +568,7 @@ class JsonApiFunctionalTest extends JsonApiFunctionalTestBase {
/**
* Tests POST, PATCH and DELETE.
*/
- public function testWrite() {
+ public function testWrite(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
$this->createDefaultContent(0, 3, FALSE, FALSE, static::IS_NOT_MULTILINGUAL, FALSE);
diff --git a/core/modules/jsonapi/tests/src/Functional/JsonApiPatchRegressionTest.php b/core/modules/jsonapi/tests/src/Functional/JsonApiPatchRegressionTest.php
index c2cd0d9e6cf..b36cb8ce8ae 100644
--- a/core/modules/jsonapi/tests/src/Functional/JsonApiPatchRegressionTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/JsonApiPatchRegressionTest.php
@@ -48,7 +48,7 @@ class JsonApiPatchRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/2953207
*/
- public function testBundleSpecificTargetEntityTypeFromIssue2953207() {
+ public function testBundleSpecificTargetEntityTypeFromIssue2953207(): void {
// Set up data model.
$this->assertTrue($this->container->get('module_installer')->install(['comment'], TRUE), 'Installed modules.');
$this->addDefaultCommentField('taxonomy_term', 'tags', 'comment', CommentItemInterface::OPEN, 'tcomment');
@@ -84,7 +84,7 @@ class JsonApiPatchRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/2976371
*/
- public function testBundlelessRelationshipMutationFromIssue2973681() {
+ public function testBundlelessRelationshipMutationFromIssue2973681(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
// Set up data model.
@@ -135,7 +135,7 @@ class JsonApiPatchRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/2968972
*/
- public function testDanglingReferencesInAnEntityReferenceFieldFromIssue2968972() {
+ public function testDanglingReferencesInAnEntityReferenceFieldFromIssue2968972(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
// Set up data model.
@@ -206,7 +206,7 @@ class JsonApiPatchRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/3021194
*/
- public function testPatchingDateTimeFieldsFromIssue3021194() {
+ public function testPatchingDateTimeFieldsFromIssue3021194(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
// Set up data model.
@@ -289,7 +289,7 @@ class JsonApiPatchRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/3026030
*/
- public function testPatchToIncludeUrlDoesNotReturnIncludeFromIssue3026030() {
+ public function testPatchToIncludeUrlDoesNotReturnIncludeFromIssue3026030(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
// Set up data model.
@@ -335,7 +335,7 @@ class JsonApiPatchRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/3043168
*/
- public function testNonTranslatableEntityUpdatesFromIssue3043168() {
+ public function testNonTranslatableEntityUpdatesFromIssue3043168(): void {
// Enable write-mode.
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
// Set the site language to Russian.
@@ -399,7 +399,7 @@ class JsonApiPatchRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/3127883
*/
- public function testPatchInvalidFieldPropertyFromIssue3127883() {
+ public function testPatchInvalidFieldPropertyFromIssue3127883(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
// Set up data model.
diff --git a/core/modules/jsonapi/tests/src/Functional/JsonApiRegressionTest.php b/core/modules/jsonapi/tests/src/Functional/JsonApiRegressionTest.php
index d40774144c3..81bbf299067 100644
--- a/core/modules/jsonapi/tests/src/Functional/JsonApiRegressionTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/JsonApiRegressionTest.php
@@ -52,7 +52,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/2973681
*/
- public function testDeepNestedIncludeMultiTargetEntityTypeFieldFromIssue2973681() {
+ public function testDeepNestedIncludeMultiTargetEntityTypeFieldFromIssue2973681(): void {
// Set up data model.
$this->assertTrue($this->container->get('module_installer')->install(['comment'], TRUE), 'Installed modules.');
$this->addDefaultCommentField('node', 'article');
@@ -116,7 +116,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/2977879
*/
- public function testGetTermWhenMultipleVocabulariesExistFromIssue2977879() {
+ public function testGetTermWhenMultipleVocabulariesExistFromIssue2977879(): void {
// Set up data model.
$this->assertTrue($this->container->get('module_installer')->install(['taxonomy'], TRUE), 'Installed modules.');
Vocabulary::create([
@@ -152,7 +152,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/2984964
*/
- public function testGetNodeCollectionWithHookNodeGrantsImplementationsFromIssue2984964() {
+ public function testGetNodeCollectionWithHookNodeGrantsImplementationsFromIssue2984964(): void {
// Set up data model.
$this->assertTrue($this->container->get('module_installer')->install(['node_access_test'], TRUE), 'Installed modules.');
node_access_rebuild();
@@ -183,7 +183,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/2984647
*/
- public function testDanglingReferencesInAnEntityReferenceFieldFromIssue2984647() {
+ public function testDanglingReferencesInAnEntityReferenceFieldFromIssue2984647(): void {
// Set up data model.
$this->drupalCreateContentType(['type' => 'journal_issue']);
$this->drupalCreateContentType(['type' => 'journal_conference']);
@@ -317,7 +317,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/2984886
*/
- public function testThatRoutesAreRebuiltAfterDataModelChangesFromIssue2984886() {
+ public function testThatRoutesAreRebuiltAfterDataModelChangesFromIssue2984886(): void {
$user = $this->drupalCreateUser(['access content']);
$request_options = [
RequestOptions::AUTH => [
@@ -380,7 +380,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
* @see https://www.drupal.org/project/drupal/issues/3007113
* @see https://www.drupal.org/project/jsonapi_extras/issues/3004582#comment-12817261
*/
- public function testDenormalizeAliasedRelationshipFromIssue2953207() {
+ public function testDenormalizeAliasedRelationshipFromIssue2953207(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
// Since the JSON:API module does not have an explicit mechanism to set up
@@ -437,7 +437,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/3009596
*/
- public function testPageCacheFromIssue3009596() {
+ public function testPageCacheFromIssue3009596(): void {
$anonymous_role = Role::load(RoleInterface::ANONYMOUS_ID);
$anonymous_role->grantPermission('access content');
$anonymous_role->trustData()->save();
@@ -475,7 +475,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/2999438
*/
- public function testPatchingDateTimeNormalizedWrongTimeZoneIssue3021194() {
+ public function testPatchingDateTimeNormalizedWrongTimeZoneIssue3021194(): void {
// Set up data model.
$this->assertTrue($this->container->get('module_installer')->install(['datetime'], TRUE), 'Installed modules.');
$this->drupalCreateContentType(['type' => 'page']);
@@ -524,7 +524,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/3026030
*/
- public function testPostToIncludeUrlDoesNotReturnIncludeFromIssue3026030() {
+ public function testPostToIncludeUrlDoesNotReturnIncludeFromIssue3026030(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
// Set up data model.
@@ -561,7 +561,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/3040590
*/
- public function testMapFieldTypeNormalizationFromIssue3040590() {
+ public function testMapFieldTypeNormalizationFromIssue3040590(): void {
$this->assertTrue($this->container->get('module_installer')->install(['entity_test'], TRUE), 'Installed modules.');
// Create data.
@@ -606,7 +606,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
/**
* Tests that the response still has meaningful error messages.
*/
- public function testRecursionDetectedWhenResponseContainsViolationsFrom3042124() {
+ public function testRecursionDetectedWhenResponseContainsViolationsFrom3042124(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
// Set up default request.
@@ -656,7 +656,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/3052954
*/
- public function testInvalidDataTriggersUnprocessableEntityErrorFromIssue3052954() {
+ public function testInvalidDataTriggersUnprocessableEntityErrorFromIssue3052954(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
// Set up data model.
@@ -686,7 +686,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
/**
* Ensure optional `@FieldType=map` fields are denormalized correctly.
*/
- public function testEmptyMapFieldTypeDenormalization() {
+ public function testEmptyMapFieldTypeDenormalization(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
// Set up data model.
@@ -727,7 +727,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
/**
* Ensure EntityAccessDeniedHttpException cacheability is taken into account.
*/
- public function testLeakCacheMetadataInOmitted() {
+ public function testLeakCacheMetadataInOmitted(): void {
$term = Term::create([
'name' => 'Llama term',
'vid' => 'tags',
@@ -787,7 +787,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
* @see https://www.drupal.org/project/drupal/issues/3034786
* @see https://www.drupal.org/project/drupal/issues/3035544
*/
- public function testAliasedFieldsWithVirtualRelationships() {
+ public function testAliasedFieldsWithVirtualRelationships(): void {
// Set up the data model.
$this->assertTrue($this->container->get('module_installer')->install([
'taxonomy',
@@ -834,7 +834,7 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/3072076
*/
- public function testNonCacheableMethods() {
+ public function testNonCacheableMethods(): void {
$this->container->get('module_installer')->install([
'jsonapi_test_non_cacheable_methods',
], TRUE);
diff --git a/core/modules/jsonapi/tests/src/Functional/MediaTest.php b/core/modules/jsonapi/tests/src/Functional/MediaTest.php
index 055bc931946..e733e773bc4 100644
--- a/core/modules/jsonapi/tests/src/Functional/MediaTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/MediaTest.php
@@ -360,7 +360,7 @@ class MediaTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPostIndividual() {
+ public function testPostIndividual(): void {
// @todo Mimic \Drupal\Tests\rest\Functional\EntityResource\Media\MediaResourceTestBase::testPost()
// @todo Later, use https://www.drupal.org/project/drupal/issues/2958554 to upload files rather than the REST module.
parent::testPostIndividual();
@@ -406,7 +406,7 @@ class MediaTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testCollectionFilterAccess() {
+ public function testCollectionFilterAccess(): void {
$this->doTestCollectionFilterAccessForPublishableEntities('name', 'view media', 'administer media');
}
diff --git a/core/modules/jsonapi/tests/src/Functional/MenuLinkContentTest.php b/core/modules/jsonapi/tests/src/Functional/MenuLinkContentTest.php
index b1130951263..93b3d830680 100644
--- a/core/modules/jsonapi/tests/src/Functional/MenuLinkContentTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/MenuLinkContentTest.php
@@ -187,7 +187,7 @@ class MenuLinkContentTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testCollectionFilterAccess() {
+ public function testCollectionFilterAccess(): void {
$this->doTestCollectionFilterAccessBasedOnPermissions('title', 'administer menu');
}
@@ -196,7 +196,7 @@ class MenuLinkContentTest extends ResourceTestBase {
*
* @see https://security.drupal.org/node/161923
*/
- public function testLinkOptionsSerialization() {
+ public function testLinkOptionsSerialization(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
$document = $this->getPostDocument();
diff --git a/core/modules/jsonapi/tests/src/Functional/MessageTest.php b/core/modules/jsonapi/tests/src/Functional/MessageTest.php
index d1ab23e2043..ed23715b073 100644
--- a/core/modules/jsonapi/tests/src/Functional/MessageTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/MessageTest.php
@@ -121,7 +121,7 @@ class MessageTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testGetIndividual() {
+ public function testGetIndividual(): void {
// Contact Message entities are not stored, so they cannot be retrieved.
$this->expectException(RouteNotFoundException::class);
$this->expectExceptionMessage('Route "jsonapi.contact_message--camelids.individual" does not exist.');
@@ -132,7 +132,7 @@ class MessageTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchIndividual() {
+ public function testPatchIndividual(): void {
// Contact Message entities are not stored, so they cannot be modified.
$this->expectException(RouteNotFoundException::class);
$this->expectExceptionMessage('Route "jsonapi.contact_message--camelids.individual" does not exist.');
@@ -143,7 +143,7 @@ class MessageTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testDeleteIndividual() {
+ public function testDeleteIndividual(): void {
// Contact Message entities are not stored, so they cannot be deleted.
$this->expectException(RouteNotFoundException::class);
$this->expectExceptionMessage('Route "jsonapi.contact_message--camelids.individual" does not exist.');
@@ -154,7 +154,7 @@ class MessageTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testRelated() {
+ public function testRelated(): void {
// Contact Message entities are not stored, so they cannot be retrieved.
$this->expectException(RouteNotFoundException::class);
$this->expectExceptionMessage('Route "jsonapi.contact_message--camelids.related" does not exist.');
@@ -165,7 +165,7 @@ class MessageTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testRelationships() {
+ public function testRelationships(): void {
// Contact Message entities are not stored, so they cannot be retrieved.
$this->expectException(RouteNotFoundException::class);
$this->expectExceptionMessage('Route "jsonapi.contact_message--camelids.relationship.get" does not exist.');
@@ -176,7 +176,7 @@ class MessageTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testCollection() {
+ public function testCollection(): void {
$collection_url = Url::fromRoute('jsonapi.contact_message--camelids.collection.post')->setAbsolute(TRUE);
$request_options = [];
$request_options[RequestOptions::HEADERS]['Accept'] = 'application/vnd.api+json';
@@ -192,7 +192,7 @@ class MessageTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testRevisions() {
+ public function testRevisions(): void {
// Contact Message entities are not stored, so they cannot be retrieved.
$this->expectException(RouteNotFoundException::class);
$this->expectExceptionMessage('Route "jsonapi.contact_message--camelids.individual" does not exist.');
diff --git a/core/modules/jsonapi/tests/src/Functional/NodeTest.php b/core/modules/jsonapi/tests/src/Functional/NodeTest.php
index d684c583313..710fa6577f4 100644
--- a/core/modules/jsonapi/tests/src/Functional/NodeTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/NodeTest.php
@@ -281,7 +281,7 @@ class NodeTest extends ResourceTestBase {
* @see \Drupal\Tests\jsonapi\Functional\TermTest::testPatchPath()
* @see \Drupal\Tests\rest\Functional\EntityResource\Term\TermResourceTestBase::testPatchPath()
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
$this->setUpAuthorization('GET');
$this->setUpAuthorization('PATCH');
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
@@ -319,7 +319,7 @@ class NodeTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testGetIndividual() {
+ public function testGetIndividual(): void {
// Cacheable normalizations are written after the response is flushed to
// the client. We use WaitTerminateTestTrait to wait for Drupal to perform
// its termination work before continuing.
@@ -429,7 +429,7 @@ class NodeTest extends ResourceTestBase {
*
* @see https://github.com/json-api/json-api/issues/1033
*/
- public function testPostNonExistingAuthor() {
+ public function testPostNonExistingAuthor(): void {
$this->setUpAuthorization('POST');
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
$this->grantPermissionsToTestedRole(['administer nodes']);
@@ -470,7 +470,7 @@ class NodeTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testCollectionFilterAccess() {
+ public function testCollectionFilterAccess(): void {
$label_field_name = 'title';
$this->doTestCollectionFilterAccessForPublishableEntities($label_field_name, 'access content', 'bypass node access');
diff --git a/core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php b/core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
index f54943a9b9d..f95f4a4c1c3 100644
--- a/core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
+++ b/core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
@@ -930,7 +930,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
/**
* Tests GETting an individual resource, plus edge cases to ensure good DX.
*/
- public function testGetIndividual() {
+ public function testGetIndividual(): void {
// The URL and Guzzle request options that will be used in this test. The
// request options will be modified/expanded throughout this test:
// - to first test all mistakes a developer might make, and assert that the
@@ -1088,7 +1088,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
/**
* Tests GETting a collection of resources.
*/
- public function testCollection() {
+ public function testCollection(): void {
$entity_collection = $this->getData();
assert(count($entity_collection) > 1, 'A collection must have more that one entity in it.');
@@ -1318,7 +1318,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
* single expected ResourceResponse. This is repeated for every relationship
* field of the resource type under test.
*/
- public function testRelated() {
+ public function testRelated(): void {
$request_options = [];
$request_options[RequestOptions::HEADERS]['Accept'] = 'application/vnd.api+json';
$request_options = NestedArray::mergeDeep($request_options, $this->getAuthenticationRequestOptions());
@@ -1337,7 +1337,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
* targeted resource and the target resource IDs. These type+ID combos are
* referred to as "resource identifiers."
*/
- public function testRelationships() {
+ public function testRelationships(): void {
if ($this->entity instanceof ConfigEntityInterface) {
$this->markTestSkipped('Configuration entities cannot have relationships.');
}
@@ -1984,7 +1984,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
/**
* Tests POSTing an individual resource, plus edge cases to ensure good DX.
*/
- public function testPostIndividual() {
+ public function testPostIndividual(): void {
// @todo Remove this in https://www.drupal.org/node/2300677.
if ($this->entity instanceof ConfigEntityInterface) {
$this->markTestSkipped('POSTing config entities is not yet supported.');
@@ -2199,7 +2199,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
/**
* Tests PATCHing an individual resource, plus edge cases to ensure good DX.
*/
- public function testPatchIndividual() {
+ public function testPatchIndividual(): void {
// @todo Remove this in https://www.drupal.org/node/2300677.
if ($this->entity instanceof ConfigEntityInterface) {
$this->markTestSkipped('PATCHing config entities is not yet supported.');
@@ -2527,7 +2527,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
/**
* Tests DELETEing an individual resource, plus edge cases to ensure good DX.
*/
- public function testDeleteIndividual() {
+ public function testDeleteIndividual(): void {
// @todo Remove this in https://www.drupal.org/node/2300677.
if ($this->entity instanceof ConfigEntityInterface) {
$this->markTestSkipped('DELETEing config entities is not yet supported.');
@@ -2804,7 +2804,7 @@ abstract class ResourceTestBase extends BrowserTestBase {
/**
* Tests individual and collection revisions.
*/
- public function testRevisions() {
+ public function testRevisions(): void {
if (!$this->entity->getEntityType()->isRevisionable() || !$this->entity instanceof FieldableEntityInterface) {
return;
}
diff --git a/core/modules/jsonapi/tests/src/Functional/RestExportJsonApiUnsupported.php b/core/modules/jsonapi/tests/src/Functional/RestExportJsonApiUnsupported.php
index 35b2d039aff..8d71894b92f 100644
--- a/core/modules/jsonapi/tests/src/Functional/RestExportJsonApiUnsupported.php
+++ b/core/modules/jsonapi/tests/src/Functional/RestExportJsonApiUnsupported.php
@@ -42,7 +42,7 @@ class RestExportJsonApiUnsupported extends ViewTestBase {
/**
* Tests that 'api_json' is not a RestExport format option.
*/
- public function testFormatOptions() {
+ public function testFormatOptions(): void {
$this->assertSame(['json' => 'serialization', 'xml' => 'serialization'], $this->container->getParameter('serializer.format_providers'));
$this->drupalGet('admin/structure/views/nojs/display/test_serializer_display_entity/rest_export_1/style_options');
diff --git a/core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php b/core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php
index 22f5ff77b4f..ade4cf3b690 100644
--- a/core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php
+++ b/core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php
@@ -88,7 +88,7 @@ class RestJsonApiUnsupported extends ResourceTestBase {
*
* @see \Drupal\jsonapi\EventSubscriber\JsonApiRequestValidator::validateQueryParams()
*/
- public function testApiJsonNotSupportedInRest() {
+ public function testApiJsonNotSupportedInRest(): void {
$this->assertSame(['json', 'xml'], $this->container->getParameter('serializer.formats'));
$this->provisionResource(['api_json'], []);
diff --git a/core/modules/jsonapi/tests/src/Functional/ShortcutTest.php b/core/modules/jsonapi/tests/src/Functional/ShortcutTest.php
index 54f2ce2cef8..adaff9b9eba 100644
--- a/core/modules/jsonapi/tests/src/Functional/ShortcutTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/ShortcutTest.php
@@ -159,7 +159,7 @@ class ShortcutTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testCollectionFilterAccess() {
+ public function testCollectionFilterAccess(): void {
$label_field_name = 'title';
// Verify the expected behavior in the common case: default shortcut set.
$this->grantPermissionsToTestedRole(['customize shortcut links']);
diff --git a/core/modules/jsonapi/tests/src/Functional/TermTest.php b/core/modules/jsonapi/tests/src/Functional/TermTest.php
index 3488320df32..2e8348f2156 100644
--- a/core/modules/jsonapi/tests/src/Functional/TermTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/TermTest.php
@@ -401,7 +401,7 @@ class TermTest extends ResourceTestBase {
* @see \Drupal\Tests\jsonapi\Functional\NodeTest::testPatchPath()
* @see \Drupal\Tests\rest\Functional\EntityResource\Node\NodeResourceTestBase::testPatchPath()
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
$this->setUpAuthorization('GET');
$this->setUpAuthorization('PATCH');
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
@@ -460,7 +460,7 @@ class TermTest extends ResourceTestBase {
*
* @dataProvider providerTestGetIndividualTermWithParent
*/
- public function testGetIndividualTermWithParent(array $parent_term_ids) {
+ public function testGetIndividualTermWithParent(array $parent_term_ids): void {
// Create all possible parent terms.
Term::create(['vid' => Vocabulary::load('camelids')->id()])
->setName('Lamoids')
@@ -506,7 +506,7 @@ class TermTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testCollectionFilterAccess() {
+ public function testCollectionFilterAccess(): void {
$this->doTestCollectionFilterAccessBasedOnPermissions('name', 'access content');
}
diff --git a/core/modules/jsonapi/tests/src/Functional/UserTest.php b/core/modules/jsonapi/tests/src/Functional/UserTest.php
index 2aa931dae09..a7db8bd9aa5 100644
--- a/core/modules/jsonapi/tests/src/Functional/UserTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/UserTest.php
@@ -128,7 +128,7 @@ class UserTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testDeleteIndividual() {
+ public function testDeleteIndividual(): void {
$this->config('user.settings')->set('cancel_method', 'user_cancel_delete')->save(TRUE);
parent::testDeleteIndividual();
@@ -217,7 +217,7 @@ class UserTest extends ResourceTestBase {
/**
* Tests PATCHing security-sensitive base fields of the logged in account.
*/
- public function testPatchDxForSecuritySensitiveBaseFields() {
+ public function testPatchDxForSecuritySensitiveBaseFields(): void {
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
$url = Url::fromRoute(sprintf('jsonapi.user--user.individual'), ['entity' => $this->account->uuid()]);
/* $url = $this->account->toUrl('jsonapi'); */
@@ -337,7 +337,7 @@ class UserTest extends ResourceTestBase {
/**
* Tests PATCHing security-sensitive base fields to change other users.
*/
- public function testPatchSecurityOtherUser() {
+ public function testPatchSecurityOtherUser(): void {
// @todo Remove line below in favor of commented line in https://www.drupal.org/project/drupal/issues/2878463.
$url = Url::fromRoute(sprintf('jsonapi.user--user.individual'), ['entity' => $this->account->uuid()]);
/* $url = $this->account->toUrl('jsonapi'); */
@@ -378,7 +378,7 @@ class UserTest extends ResourceTestBase {
/**
* Tests GETting privacy-sensitive base fields.
*/
- public function testGetMailFieldOnlyVisibleToOwner() {
+ public function testGetMailFieldOnlyVisibleToOwner(): void {
// Create user B, with the same roles (and hence permissions) as user A.
$user_a = $this->account;
$pass = \Drupal::service('password_generator')->generate();
@@ -446,7 +446,7 @@ class UserTest extends ResourceTestBase {
/**
* Tests good error DX when trying to filter users by role.
*/
- public function testQueryInvolvingRoles() {
+ public function testQueryInvolvingRoles(): void {
$this->setUpAuthorization('GET');
$collection_url = Url::fromRoute('jsonapi.user--user.collection', [], ['query' => ['filter[roles.id][value]' => 'e9b1de3f-9517-4c27-bef0-0301229de792']]);
@@ -465,7 +465,7 @@ class UserTest extends ResourceTestBase {
/**
* Tests that the collection contains the anonymous user.
*/
- public function testCollectionContainsAnonymousUser() {
+ public function testCollectionContainsAnonymousUser(): void {
$url = Url::fromRoute('jsonapi.user--user.collection', [], ['query' => ['sort' => 'drupal_internal__uid']]);
$request_options = [];
$request_options[RequestOptions::HEADERS]['Accept'] = 'application/vnd.api+json';
@@ -482,7 +482,7 @@ class UserTest extends ResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testCollectionFilterAccess() {
+ public function testCollectionFilterAccess(): void {
// Set up data model.
$this->assertTrue($this->container->get('module_installer')->install(['node'], TRUE), 'Installed modules.');
FieldStorageConfig::create([
@@ -589,7 +589,7 @@ class UserTest extends ResourceTestBase {
/**
* Tests users with altered display names.
*/
- public function testResaveAccountName() {
+ public function testResaveAccountName(): void {
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
$this->setUpAuthorization('PATCH');
@@ -617,7 +617,7 @@ class UserTest extends ResourceTestBase {
/**
* Tests if JSON:API respects user.settings.cancel_method: user_cancel_block.
*/
- public function testDeleteRespectsUserCancelBlock() {
+ public function testDeleteRespectsUserCancelBlock(): void {
$cancel_method = 'user_cancel_block';
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
$this->config('user.settings')->set('cancel_method', $cancel_method)->save(TRUE);
@@ -647,7 +647,7 @@ class UserTest extends ResourceTestBase {
/**
* Tests if JSON:API respects user.settings.cancel_method: user_cancel_block_unpublish.
*/
- public function testDeleteRespectsUserCancelBlockUnpublish() {
+ public function testDeleteRespectsUserCancelBlockUnpublish(): void {
$cancel_method = 'user_cancel_block_unpublish';
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
$this->config('user.settings')->set('cancel_method', $cancel_method)->save(TRUE);
@@ -678,7 +678,7 @@ class UserTest extends ResourceTestBase {
* Tests if JSON:API respects user.settings.cancel_method: user_cancel_block_unpublish.
* @group jsonapi
*/
- public function testDeleteRespectsUserCancelBlockUnpublishAndProcessesBatches() {
+ public function testDeleteRespectsUserCancelBlockUnpublishAndProcessesBatches(): void {
$cancel_method = 'user_cancel_block_unpublish';
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
$this->config('user.settings')->set('cancel_method', $cancel_method)->save(TRUE);
@@ -724,7 +724,7 @@ class UserTest extends ResourceTestBase {
/**
* Tests if JSON:API respects user.settings.cancel_method: user_cancel_reassign.
*/
- public function testDeleteRespectsUserCancelReassign() {
+ public function testDeleteRespectsUserCancelReassign(): void {
$cancel_method = 'user_cancel_reassign';
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
$this->config('user.settings')->set('cancel_method', $cancel_method)->save(TRUE);
@@ -755,7 +755,7 @@ class UserTest extends ResourceTestBase {
/**
* Tests if JSON:API respects user.settings.cancel_method: user_cancel_delete.
*/
- public function testDeleteRespectsUserCancelDelete() {
+ public function testDeleteRespectsUserCancelDelete(): void {
$cancel_method = 'user_cancel_delete';
$this->config('jsonapi.settings')->set('read_only', FALSE)->save(TRUE);
$this->config('user.settings')->set('cancel_method', $cancel_method)->save(TRUE);
diff --git a/core/modules/jsonapi/tests/src/Kernel/Context/FieldResolverTest.php b/core/modules/jsonapi/tests/src/Kernel/Context/FieldResolverTest.php
index 14c610f48b0..de7aed89105 100644
--- a/core/modules/jsonapi/tests/src/Kernel/Context/FieldResolverTest.php
+++ b/core/modules/jsonapi/tests/src/Kernel/Context/FieldResolverTest.php
@@ -89,7 +89,7 @@ class FieldResolverTest extends JsonapiKernelTestBase {
* @covers ::resolveInternalEntityQueryPath
* @dataProvider resolveInternalIncludePathProvider
*/
- public function testResolveInternalIncludePath($expect, $external_path, $entity_type_id = 'entity_test_with_bundle', $bundle = 'bundle1') {
+ public function testResolveInternalIncludePath($expect, $external_path, $entity_type_id = 'entity_test_with_bundle', $bundle = 'bundle1'): void {
$path_parts = explode('.', $external_path);
$resource_type = $this->resourceTypeRepository->get($entity_type_id, $bundle);
$this->assertEquals($expect, $this->sut->resolveInternalIncludePath($resource_type, $path_parts));
@@ -131,7 +131,7 @@ class FieldResolverTest extends JsonapiKernelTestBase {
* @covers ::resolveInternalIncludePath
* @dataProvider resolveInternalIncludePathErrorProvider
*/
- public function testResolveInternalIncludePathError($entity_type, $bundle, $external_path, $expected_message = '') {
+ public function testResolveInternalIncludePathError($entity_type, $bundle, $external_path, $expected_message = ''): void {
$path_parts = explode('.', $external_path);
$this->expectException(CacheableBadRequestHttpException::class);
if (!empty($expected_message)) {
@@ -174,7 +174,7 @@ class FieldResolverTest extends JsonapiKernelTestBase {
* @covers ::resolveInternalEntityQueryPath
* @dataProvider resolveInternalEntityQueryPathProvider
*/
- public function testResolveInternalEntityQueryPath($expect, $external_path, $entity_type_id = 'entity_test_with_bundle', $bundle = 'bundle1') {
+ public function testResolveInternalEntityQueryPath($expect, $external_path, $entity_type_id = 'entity_test_with_bundle', $bundle = 'bundle1'): void {
$resource_type = $this->resourceTypeRepository->get($entity_type_id, $bundle);
$this->assertEquals($expect, $this->sut->resolveInternalEntityQueryPath($resource_type, $external_path));
}
@@ -255,7 +255,7 @@ class FieldResolverTest extends JsonapiKernelTestBase {
* @covers ::resolveInternalEntityQueryPath
* @dataProvider resolveInternalEntityQueryPathErrorProvider
*/
- public function testResolveInternalEntityQueryPathError($entity_type, $bundle, $external_path, $expected_message = '') {
+ public function testResolveInternalEntityQueryPathError($entity_type, $bundle, $external_path, $expected_message = ''): void {
$this->expectException(CacheableBadRequestHttpException::class);
if (!empty($expected_message)) {
$this->expectExceptionMessage($expected_message);
diff --git a/core/modules/jsonapi/tests/src/Kernel/Controller/EntityResourceTest.php b/core/modules/jsonapi/tests/src/Kernel/Controller/EntityResourceTest.php
index 0c330e56a2b..4c5291eb1d9 100644
--- a/core/modules/jsonapi/tests/src/Kernel/Controller/EntityResourceTest.php
+++ b/core/modules/jsonapi/tests/src/Kernel/Controller/EntityResourceTest.php
@@ -195,7 +195,7 @@ class EntityResourceTest extends JsonapiKernelTestBase {
/**
* @covers ::getCollection
*/
- public function testGetPagedCollection() {
+ public function testGetPagedCollection(): void {
$request = Request::create('/jsonapi/node/article');
$request->query = new InputBag([
'sort' => 'nid',
@@ -224,7 +224,7 @@ class EntityResourceTest extends JsonapiKernelTestBase {
/**
* @covers ::getCollection
*/
- public function testGetEmptyCollection() {
+ public function testGetEmptyCollection(): void {
$request = Request::create('/jsonapi/node/article');
$request->query = new InputBag(['filter' => ['id' => 'invalid']]);
diff --git a/core/modules/jsonapi/tests/src/Kernel/Controller/FileUploadTest.php b/core/modules/jsonapi/tests/src/Kernel/Controller/FileUploadTest.php
index a4ceba719cb..14f4b8f2df4 100644
--- a/core/modules/jsonapi/tests/src/Kernel/Controller/FileUploadTest.php
+++ b/core/modules/jsonapi/tests/src/Kernel/Controller/FileUploadTest.php
@@ -89,7 +89,7 @@ class FileUploadTest extends JsonapiKernelTestBase {
/**
* @covers ::checkFileUploadAccess
*/
- public function testCheckFileUploadAccessWithBaseField() {
+ public function testCheckFileUploadAccessWithBaseField(): void {
// Create a set of users for access testing.
$article_editor = User::create([
'name' => 'article editor',
diff --git a/core/modules/jsonapi/tests/src/Kernel/EventSubscriber/ResourceObjectNormalizerCacherTest.php b/core/modules/jsonapi/tests/src/Kernel/EventSubscriber/ResourceObjectNormalizerCacherTest.php
index d3ad196bbb1..93ed8c7ddba 100644
--- a/core/modules/jsonapi/tests/src/Kernel/EventSubscriber/ResourceObjectNormalizerCacherTest.php
+++ b/core/modules/jsonapi/tests/src/Kernel/EventSubscriber/ResourceObjectNormalizerCacherTest.php
@@ -75,7 +75,7 @@ class ResourceObjectNormalizerCacherTest extends KernelTestBase {
*
* @see https://www.drupal.org/project/drupal/issues/3077287
*/
- public function testLinkNormalizationCacheability() {
+ public function testLinkNormalizationCacheability(): void {
$user = User::create([
'name' => $this->randomMachineName(),
'pass' => $this->randomString(),
diff --git a/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php b/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
index 9c6e07cb98a..20a8ac792d7 100644
--- a/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
+++ b/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
@@ -261,7 +261,7 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase {
/**
* @covers ::normalize
*/
- public function testNormalize() {
+ public function testNormalize(): void {
$resource_type = $this->container->get('jsonapi.resource_type.repository')->get('node', 'article');
$resource_object = ResourceObject::createFromEntity($resource_type, $this->node);
@@ -362,7 +362,7 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase {
/**
* @covers ::normalize
*/
- public function testNormalizeUuid() {
+ public function testNormalizeUuid(): void {
$resource_type = $this->container->get('jsonapi.resource_type.repository')->get('node', 'article');
$resource_object = ResourceObject::createFromEntity($resource_type, $this->node);
$include_param = 'uid,field_tags';
@@ -403,7 +403,7 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase {
/**
* @covers ::normalize
*/
- public function testNormalizeException() {
+ public function testNormalizeException(): void {
$normalized = $this
->container
->get('jsonapi.serializer')
@@ -427,7 +427,7 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase {
/**
* Tests the message and exceptions when requesting a Label only resource.
*/
- public function testAliasFieldRouteException() {
+ public function testAliasFieldRouteException(): void {
$this->assertSame('uid', $this->resourceTypeRepository->getByTypeName('node--article')->getPublicName('uid'));
$this->assertSame('roles', $this->resourceTypeRepository->getByTypeName('user--user')->getPublicName('roles'));
$resource_type_field_aliases = [
@@ -491,7 +491,7 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase {
/**
* @covers ::normalize
*/
- public function testNormalizeConfig() {
+ public function testNormalizeConfig(): void {
$resource_type = $this->container->get('jsonapi.resource_type.repository')->get('node_type', 'node_type');
$resource_object = ResourceObject::createFromEntity($resource_type, $this->nodeType);
$document_wrapper = new JsonApiDocumentTopLevel(new ResourceObjectData([$resource_object], 1), new NullIncludedData(), new LinkCollection([]));
@@ -522,7 +522,7 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase {
*
* @covers ::denormalize
*/
- public function testDenormalize() {
+ public function testDenormalize(): void {
$payload = '{"data":{"type":"article","attributes":{"title":"Testing article"}}}';
$resource_type = $this->container->get('jsonapi.resource_type.repository')->get('node', 'article');
@@ -540,7 +540,7 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase {
*
* @covers ::denormalize
*/
- public function testDenormalizeUuid() {
+ public function testDenormalizeUuid(): void {
$configurations = [
// Good data.
[
@@ -634,7 +634,7 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase {
/**
* Tests denormalization for related resources with missing or invalid types.
*/
- public function testDenormalizeInvalidTypeAndNoType() {
+ public function testDenormalizeInvalidTypeAndNoType(): void {
$payload_data = [
'data' => [
'type' => 'node--article',
@@ -758,7 +758,7 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase {
*
* @dataProvider testCacheableMetadataProvider
*/
- public function testCacheableMetadata(CacheableMetadata $expected_metadata) {
+ public function testCacheableMetadata(CacheableMetadata $expected_metadata): void {
$resource_type = $this->container->get('jsonapi.resource_type.repository')->get('node', 'article');
$resource_object = ResourceObject::createFromEntity($resource_type, $this->node);
$context = [
diff --git a/core/modules/jsonapi/tests/src/Kernel/Normalizer/LinkCollectionNormalizerTest.php b/core/modules/jsonapi/tests/src/Kernel/Normalizer/LinkCollectionNormalizerTest.php
index 5f3dbb78b4b..a4cdb4f5444 100644
--- a/core/modules/jsonapi/tests/src/Kernel/Normalizer/LinkCollectionNormalizerTest.php
+++ b/core/modules/jsonapi/tests/src/Kernel/Normalizer/LinkCollectionNormalizerTest.php
@@ -77,7 +77,7 @@ class LinkCollectionNormalizerTest extends KernelTestBase {
/**
* Tests the link collection normalizer.
*/
- public function testNormalize() {
+ public function testNormalize(): void {
$link_context = new ResourceObject(new CacheableMetadata(), new ResourceType('n/a', 'n/a', 'n/a'), 'n/a', NULL, [], new LinkCollection([]));
$link_collection = (new LinkCollection([]))
->withLink('related', new Link(new CacheableMetadata(), Url::fromUri('http://example.com/post/42'), 'related', ['title' => 'Most viewed']))
@@ -110,7 +110,7 @@ class LinkCollectionNormalizerTest extends KernelTestBase {
*
* @dataProvider linkAccessTestData
*/
- public function testLinkAccess($current_user_id, $edit_form_uid, $expected_link_keys, $expected_cache_contexts) {
+ public function testLinkAccess($current_user_id, $edit_form_uid, $expected_link_keys, $expected_cache_contexts): void {
// Get the current user and an edit-form URL.
foreach ($this->testUsers as $user) {
$uid = (int) $user->id();
diff --git a/core/modules/jsonapi/tests/src/Kernel/Normalizer/RelationshipNormalizerTest.php b/core/modules/jsonapi/tests/src/Kernel/Normalizer/RelationshipNormalizerTest.php
index 54dd005f68a..86ca587adc1 100644
--- a/core/modules/jsonapi/tests/src/Kernel/Normalizer/RelationshipNormalizerTest.php
+++ b/core/modules/jsonapi/tests/src/Kernel/Normalizer/RelationshipNormalizerTest.php
@@ -224,7 +224,7 @@ class RelationshipNormalizerTest extends JsonapiKernelTestBase {
* @covers ::normalize
* @dataProvider normalizeProvider
*/
- public function testNormalize($entity_property_names, $field_name, $expected) {
+ public function testNormalize($entity_property_names, $field_name, $expected): void {
// Links cannot be generated in the test provider because the container
// has not yet been set.
$expected['links'] = [
diff --git a/core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php b/core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php
index 5de336554e0..099b30ccc03 100644
--- a/core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php
+++ b/core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php
@@ -89,7 +89,7 @@ class FilterTest extends JsonapiKernelTestBase {
/**
* @covers ::queryCondition
*/
- public function testInvalidFilterPathDueToMissingPropertyName() {
+ public function testInvalidFilterPathDueToMissingPropertyName(): void {
$this->expectException(CacheableBadRequestHttpException::class);
$this->expectExceptionMessage('Invalid nested filtering. The field `colors`, given in the path `colors` is incomplete, it must end with one of the following specifiers: `value`, `format`, `processed`.');
$resource_type = $this->resourceTypeRepository->get('node', 'painting');
@@ -99,7 +99,7 @@ class FilterTest extends JsonapiKernelTestBase {
/**
* @covers ::queryCondition
*/
- public function testInvalidFilterPathDueToMissingPropertyNameReferenceFieldWithMetaProperties() {
+ public function testInvalidFilterPathDueToMissingPropertyNameReferenceFieldWithMetaProperties(): void {
$this->expectException(CacheableBadRequestHttpException::class);
$this->expectExceptionMessage('Invalid nested filtering. The field `photo`, given in the path `photo` is incomplete, it must end with one of the following specifiers: `id`, `meta.drupal_internal__target_id`, `meta.alt`, `meta.title`, `meta.width`, `meta.height`.');
$resource_type = $this->resourceTypeRepository->get('node', 'painting');
@@ -109,7 +109,7 @@ class FilterTest extends JsonapiKernelTestBase {
/**
* @covers ::queryCondition
*/
- public function testInvalidFilterPathDueMissingMetaPrefixReferenceFieldWithMetaProperties() {
+ public function testInvalidFilterPathDueMissingMetaPrefixReferenceFieldWithMetaProperties(): void {
$this->expectException(CacheableBadRequestHttpException::class);
$this->expectExceptionMessage('Invalid nested filtering. The property `alt`, given in the path `photo.alt` belongs to the meta object of a relationship and must be preceded by `meta`.');
$resource_type = $this->resourceTypeRepository->get('node', 'painting');
@@ -119,7 +119,7 @@ class FilterTest extends JsonapiKernelTestBase {
/**
* @covers ::queryCondition
*/
- public function testInvalidFilterPathDueToMissingPropertyNameReferenceFieldWithoutMetaProperties() {
+ public function testInvalidFilterPathDueToMissingPropertyNameReferenceFieldWithoutMetaProperties(): void {
$this->expectException(CacheableBadRequestHttpException::class);
$this->expectExceptionMessage('Invalid nested filtering. The field `uid`, given in the path `uid` is incomplete, it must end with one of the following specifiers: `id`, `meta.drupal_internal__target_id`.');
$resource_type = $this->resourceTypeRepository->get('node', 'painting');
@@ -129,7 +129,7 @@ class FilterTest extends JsonapiKernelTestBase {
/**
* @covers ::queryCondition
*/
- public function testInvalidFilterPathDueToNonexistentProperty() {
+ public function testInvalidFilterPathDueToNonexistentProperty(): void {
$this->expectException(CacheableBadRequestHttpException::class);
$this->expectExceptionMessage('Invalid nested filtering. The property `foobar`, given in the path `colors.foobar`, does not exist. Must be one of the following property names: `value`, `format`, `processed`.');
$resource_type = $this->resourceTypeRepository->get('node', 'painting');
@@ -139,7 +139,7 @@ class FilterTest extends JsonapiKernelTestBase {
/**
* @covers ::queryCondition
*/
- public function testInvalidFilterPathDueToElidedSoleProperty() {
+ public function testInvalidFilterPathDueToElidedSoleProperty(): void {
$this->expectException(CacheableBadRequestHttpException::class);
$this->expectExceptionMessage('Invalid nested filtering. The property `value`, given in the path `promote.value`, does not exist. Filter by `promote`, not `promote.value` (the JSON:API module elides property names from single-property fields).');
$resource_type = $this->resourceTypeRepository->get('node', 'painting');
@@ -149,7 +149,7 @@ class FilterTest extends JsonapiKernelTestBase {
/**
* @covers ::queryCondition
*/
- public function testQueryCondition() {
+ public function testQueryCondition(): void {
// Can't use a data provider because we need access to the container.
$data = $this->queryConditionData();
@@ -315,7 +315,7 @@ class FilterTest extends JsonapiKernelTestBase {
* @covers ::createFromQueryParameter
* @dataProvider parameterProvider
*/
- public function testCreateFromQueryParameter($case, $expected) {
+ public function testCreateFromQueryParameter($case, $expected): void {
$resource_type = new ResourceType('foo', 'bar', NULL);
$actual = Filter::createFromQueryParameter($case, $resource_type, $this->getFieldResolverMock($resource_type));
$conditions = $actual->root()->members();
@@ -345,7 +345,7 @@ class FilterTest extends JsonapiKernelTestBase {
/**
* @covers ::createFromQueryParameter
*/
- public function testCreateFromQueryParameterNested() {
+ public function testCreateFromQueryParameterNested(): void {
$parameter = [
'or-group' => ['group' => ['conjunction' => 'OR']],
'nested-or-group' => [
diff --git a/core/modules/jsonapi/tests/src/Kernel/ResourceType/RelatedResourceTypesTest.php b/core/modules/jsonapi/tests/src/Kernel/ResourceType/RelatedResourceTypesTest.php
index 2d427742688..5341b489cdd 100644
--- a/core/modules/jsonapi/tests/src/Kernel/ResourceType/RelatedResourceTypesTest.php
+++ b/core/modules/jsonapi/tests/src/Kernel/ResourceType/RelatedResourceTypesTest.php
@@ -115,7 +115,7 @@ class RelatedResourceTypesTest extends JsonapiKernelTestBase {
* @covers ::getRelatableResourceTypes
* @dataProvider getRelatableResourceTypesProvider
*/
- public function testGetRelatableResourceTypes($resource_type_name, $relatable_type_names) {
+ public function testGetRelatableResourceTypes($resource_type_name, $relatable_type_names): void {
// We're only testing the fields that we set up.
$test_fields = [
'field_ref_foo',
@@ -166,7 +166,7 @@ class RelatedResourceTypesTest extends JsonapiKernelTestBase {
* @covers ::getRelatableResourceTypesByField
* @dataProvider getRelatableResourceTypesByFieldProvider
*/
- public function testGetRelatableResourceTypesByField($entity_type_id, $bundle, $field) {
+ public function testGetRelatableResourceTypesByField($entity_type_id, $bundle, $field): void {
$resource_type = $this->resourceTypeRepository->get($entity_type_id, $bundle);
$relatable_types = $resource_type->getRelatableResourceTypes();
$this->assertSame(
@@ -195,7 +195,7 @@ class RelatedResourceTypesTest extends JsonapiKernelTestBase {
*
* @link https://www.drupal.org/project/drupal/issues/2996114
*/
- public function testGetRelatableResourceTypesFromFieldDefinition() {
+ public function testGetRelatableResourceTypesFromFieldDefinition(): void {
$field_config_storage = $this->container->get('entity_type.manager')->getStorage('field_config');
static::assertCount(0, $this->resourceTypeRepository->get('node', 'foo')->getRelatableResourceTypesByField('field_relationship'));
diff --git a/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php b/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php
index 969ac85e9c6..de52302e039 100644
--- a/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php
+++ b/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php
@@ -68,7 +68,7 @@ class ResourceTypeRepositoryTest extends JsonapiKernelTestBase {
/**
* @covers ::all
*/
- public function testAll() {
+ public function testAll(): void {
// Make sure that there are resources being created.
$all = $this->resourceTypeRepository->all();
$this->assertNotEmpty($all);
@@ -83,7 +83,7 @@ class ResourceTypeRepositoryTest extends JsonapiKernelTestBase {
* @covers ::get
* @dataProvider getProvider
*/
- public function testGet($entity_type_id, $bundle, $entity_class) {
+ public function testGet($entity_type_id, $bundle, $entity_class): void {
// Make sure that there are resources being created.
$resource_type = $this->resourceTypeRepository->get($entity_type_id, $bundle);
$this->assertInstanceOf(ResourceType::class, $resource_type);
@@ -111,7 +111,7 @@ class ResourceTypeRepositoryTest extends JsonapiKernelTestBase {
/**
* Ensures that the ResourceTypeRepository's cache does not become stale.
*/
- public function testCaching() {
+ public function testCaching(): void {
$this->assertEmpty($this->resourceTypeRepository->get('node', 'article')->getRelatableResourceTypesByField('field_relationship'));
$this->createEntityReferenceField('node', 'article', 'field_relationship', 'Related entity', 'node');
$this->assertCount(3, $this->resourceTypeRepository->get('node', 'article')->getRelatableResourceTypesByField('field_relationship'));
@@ -128,7 +128,7 @@ class ResourceTypeRepositoryTest extends JsonapiKernelTestBase {
* @covers ::getFields
* @dataProvider getFieldsProvider
*/
- public function testMappingNameConflictCheck($field_name_list) {
+ public function testMappingNameConflictCheck($field_name_list): void {
$entity_type = \Drupal::entityTypeManager()->getDefinition('node');
$bundle = 'article';
$reflection_class = new \ReflectionClass($this->resourceTypeRepository);
@@ -159,7 +159,7 @@ class ResourceTypeRepositoryTest extends JsonapiKernelTestBase {
/**
* Tests that resource types can be disabled by a build subscriber.
*/
- public function testResourceTypeDisabling() {
+ public function testResourceTypeDisabling(): void {
$this->assertFalse($this->resourceTypeRepository->getByTypeName('node--article')->isInternal());
$this->assertFalse($this->resourceTypeRepository->getByTypeName('node--page')->isInternal());
$this->assertFalse($this->resourceTypeRepository->getByTypeName('user--user')->isInternal());
@@ -177,7 +177,7 @@ class ResourceTypeRepositoryTest extends JsonapiKernelTestBase {
/**
* Tests that resource type fields can be aliased per resource type.
*/
- public function testResourceTypeFieldAliasing() {
+ public function testResourceTypeFieldAliasing(): void {
$this->assertSame($this->resourceTypeRepository->getByTypeName('node--article')->getPublicName('uid'), 'uid');
$this->assertSame($this->resourceTypeRepository->getByTypeName('node--page')->getPublicName('uid'), 'uid');
$resource_type_field_aliases = [
@@ -197,7 +197,7 @@ class ResourceTypeRepositoryTest extends JsonapiKernelTestBase {
/**
* Tests that resource type fields can be disabled per resource type.
*/
- public function testResourceTypeFieldDisabling() {
+ public function testResourceTypeFieldDisabling(): void {
$this->assertTrue($this->resourceTypeRepository->getByTypeName('node--article')->isFieldEnabled('uid'));
$this->assertTrue($this->resourceTypeRepository->getByTypeName('node--page')->isFieldEnabled('uid'));
$disabled_resource_type_fields = [
@@ -217,7 +217,7 @@ class ResourceTypeRepositoryTest extends JsonapiKernelTestBase {
/**
* Tests that resource types can be renamed.
*/
- public function testResourceTypeRenaming() {
+ public function testResourceTypeRenaming(): void {
\Drupal::state()->set('jsonapi_test_resource_type_builder.renamed_resource_types', [
'node--article' => 'articles',
'node--page' => 'pages',
diff --git a/core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php b/core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php
index fd3370ad2ac..11a2a1e00f2 100644
--- a/core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php
+++ b/core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php
@@ -128,7 +128,7 @@ class VersionNegotiatorTest extends JsonapiKernelTestBase {
/**
* @covers \Drupal\jsonapi\Revisions\VersionById::getRevision
*/
- public function testOldRevision() {
+ public function testOldRevision(): void {
$revision = $this->versionNegotiator->getRevision($this->node, 'id:' . $this->nodePreviousRevisionId);
$this->assertEquals($this->node->id(), $revision->id());
$this->assertEquals($this->nodePreviousRevisionId, $revision->getRevisionId());
@@ -137,7 +137,7 @@ class VersionNegotiatorTest extends JsonapiKernelTestBase {
/**
* @covers \Drupal\jsonapi\Revisions\VersionById::getRevision
*/
- public function testInvalidRevisionId() {
+ public function testInvalidRevisionId(): void {
$this->expectException(CacheableNotFoundHttpException::class);
$this->expectExceptionMessage(sprintf('The requested version, identified by `id:%s`, could not be found.', $this->node2->getRevisionId()));
$this->versionNegotiator->getRevision($this->node, 'id:' . $this->node2->getRevisionId());
@@ -146,7 +146,7 @@ class VersionNegotiatorTest extends JsonapiKernelTestBase {
/**
* @covers \Drupal\jsonapi\Revisions\VersionByRel::getRevision
*/
- public function testLatestVersion() {
+ public function testLatestVersion(): void {
$revision = $this->versionNegotiator->getRevision($this->node, 'rel:' . VersionByRel::LATEST_VERSION);
$this->assertEquals($this->node->id(), $revision->id());
$this->assertEquals($this->node->getRevisionId(), $revision->getRevisionId());
@@ -155,7 +155,7 @@ class VersionNegotiatorTest extends JsonapiKernelTestBase {
/**
* @covers \Drupal\jsonapi\Revisions\VersionByRel::getRevision
*/
- public function testCurrentVersion() {
+ public function testCurrentVersion(): void {
$revision = $this->versionNegotiator->getRevision($this->node, 'rel:' . VersionByRel::WORKING_COPY);
$this->assertEquals($this->node->id(), $revision->id());
$this->assertEquals($this->node->id(), $revision->id());
@@ -165,7 +165,7 @@ class VersionNegotiatorTest extends JsonapiKernelTestBase {
/**
* @covers \Drupal\jsonapi\Revisions\VersionByRel::getRevision
*/
- public function testInvalidRevisionRel() {
+ public function testInvalidRevisionRel(): void {
$this->expectException(CacheableBadRequestHttpException::class);
$this->expectExceptionMessage('An invalid resource version identifier, `rel:erroneous-revision-name`, was provided.');
$this->versionNegotiator->getRevision($this->node, 'rel:erroneous-revision-name');
diff --git a/core/modules/jsonapi/tests/src/Kernel/Serializer/SerializerTest.php b/core/modules/jsonapi/tests/src/Kernel/Serializer/SerializerTest.php
index 61fb19e204e..cba34611456 100644
--- a/core/modules/jsonapi/tests/src/Kernel/Serializer/SerializerTest.php
+++ b/core/modules/jsonapi/tests/src/Kernel/Serializer/SerializerTest.php
@@ -105,7 +105,7 @@ class SerializerTest extends JsonapiKernelTestBase {
/**
* @covers \Drupal\jsonapi\Serializer\Serializer::normalize
*/
- public function testFallbackNormalizer() {
+ public function testFallbackNormalizer(): void {
$context = [
'account' => $this->user,
'resource_object' => ResourceObject::createFromEntity($this->resourceType, $this->node),
diff --git a/core/modules/jsonapi/tests/src/Kernel/TestCoverageTest.php b/core/modules/jsonapi/tests/src/Kernel/TestCoverageTest.php
index b3c47abf213..7fbfd6b3245 100644
--- a/core/modules/jsonapi/tests/src/Kernel/TestCoverageTest.php
+++ b/core/modules/jsonapi/tests/src/Kernel/TestCoverageTest.php
@@ -62,7 +62,7 @@ class TestCoverageTest extends KernelTestBase {
/**
* Tests that all core entity types have JSON:API test coverage.
*/
- public function testEntityTypeRestTestCoverage() {
+ public function testEntityTypeRestTestCoverage(): void {
$problems = [];
foreach ($this->definitions as $entity_type_id => $info) {
$class_name_full = $info->getClass();
diff --git a/core/modules/jsonapi/tests/src/Unit/EventSubscriber/ResourceResponseValidatorTest.php b/core/modules/jsonapi/tests/src/Unit/EventSubscriber/ResourceResponseValidatorTest.php
index 7ca219a3e41..5caf741ac01 100644
--- a/core/modules/jsonapi/tests/src/Unit/EventSubscriber/ResourceResponseValidatorTest.php
+++ b/core/modules/jsonapi/tests/src/Unit/EventSubscriber/ResourceResponseValidatorTest.php
@@ -58,7 +58,7 @@ class ResourceResponseValidatorTest extends UnitTestCase {
* @covers ::validateResponse
* @dataProvider validateResponseProvider
*/
- public function testValidateResponse($request, $response, $expected, $description) {
+ public function testValidateResponse($request, $response, $expected, $description): void {
// Expose protected ResourceResponseSubscriber::validateResponse() method.
$object = new \ReflectionObject($this->subscriber);
$method = $object->getMethod('validateResponse');
diff --git a/core/modules/jsonapi/tests/src/Unit/JsonApiResource/LinkTest.php b/core/modules/jsonapi/tests/src/Unit/JsonApiResource/LinkTest.php
index 6c5916bb4d2..16154b64c63 100644
--- a/core/modules/jsonapi/tests/src/Unit/JsonApiResource/LinkTest.php
+++ b/core/modules/jsonapi/tests/src/Unit/JsonApiResource/LinkTest.php
@@ -122,7 +122,7 @@ class LinkTest extends UnitTestCase {
/**
* @covers ::getLinkRelationType
*/
- public function testGetLinkRelationType() {
+ public function testGetLinkRelationType(): void {
$this->mockUrlAssembler();
$link = new Link((new CacheableMetadata())->addCacheTags(['foo']), Url::fromUri('https://jsonapi.org/foo'), 'self');
$this->assertSame('self', $link->getLinkRelationType());
diff --git a/core/modules/jsonapi/tests/src/Unit/JsonApiSpecTest.php b/core/modules/jsonapi/tests/src/Unit/JsonApiSpecTest.php
index a761b5fb989..f7dc9f64517 100644
--- a/core/modules/jsonapi/tests/src/Unit/JsonApiSpecTest.php
+++ b/core/modules/jsonapi/tests/src/Unit/JsonApiSpecTest.php
@@ -23,7 +23,7 @@ class JsonApiSpecTest extends UnitTestCase {
* @dataProvider providerTestIsValidMemberName
* @covers ::isValidMemberName
*/
- public function testIsValidMemberName($member_name, $expected) {
+ public function testIsValidMemberName($member_name, $expected): void {
$this->assertSame($expected, JsonApiSpec::isValidMemberName($member_name));
}
@@ -104,7 +104,7 @@ class JsonApiSpecTest extends UnitTestCase {
* @covers ::isValidCustomQueryParameter
* @covers ::isValidMemberName
*/
- public function testIsValidCustomQueryParameter($custom_query_parameter, $expected) {
+ public function testIsValidCustomQueryParameter($custom_query_parameter, $expected): void {
$this->assertSame($expected, JsonApiSpec::isValidCustomQueryParameter($custom_query_parameter));
}
diff --git a/core/modules/jsonapi/tests/src/Unit/Normalizer/HttpExceptionNormalizerTest.php b/core/modules/jsonapi/tests/src/Unit/Normalizer/HttpExceptionNormalizerTest.php
index 30eddf58a10..be112fb9e0e 100644
--- a/core/modules/jsonapi/tests/src/Unit/Normalizer/HttpExceptionNormalizerTest.php
+++ b/core/modules/jsonapi/tests/src/Unit/Normalizer/HttpExceptionNormalizerTest.php
@@ -25,7 +25,7 @@ class HttpExceptionNormalizerTest extends UnitTestCase {
/**
* @covers ::normalize
*/
- public function testNormalize() {
+ public function testNormalize(): void {
$request_stack = $this->prophesize(RequestStack::class);
$request_stack->getCurrentRequest()->willReturn(Request::create('http://localhost/'));
$container = $this->prophesize(ContainerInterface::class);
diff --git a/core/modules/jsonapi/tests/src/Unit/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php b/core/modules/jsonapi/tests/src/Unit/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
index da5d2aeb44d..55c6a1ef0b9 100644
--- a/core/modules/jsonapi/tests/src/Unit/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
+++ b/core/modules/jsonapi/tests/src/Unit/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
@@ -89,7 +89,7 @@ class JsonApiDocumentTopLevelNormalizerTest extends UnitTestCase {
* @covers ::denormalize
* @dataProvider denormalizeProvider
*/
- public function testDenormalize($input, $expected) {
+ public function testDenormalize($input, $expected): void {
$resource_type = new ResourceType('node', 'article', FieldableEntityInterface::class);
$resource_type->setRelatableResourceTypes([]);
$context = ['resource_type' => $resource_type];
@@ -211,7 +211,7 @@ class JsonApiDocumentTopLevelNormalizerTest extends UnitTestCase {
* @covers ::denormalize
* @dataProvider denormalizeUuidProvider
*/
- public function testDenormalizeUuid($id, $expect_exception) {
+ public function testDenormalizeUuid($id, $expect_exception): void {
$data['data'] = (isset($id)) ?
['type' => 'node--article', 'id' => $id] :
['type' => 'node--article'];
diff --git a/core/modules/jsonapi/tests/src/Unit/Normalizer/ResourceIdentifierNormalizerTest.php b/core/modules/jsonapi/tests/src/Unit/Normalizer/ResourceIdentifierNormalizerTest.php
index fc78271bf3b..63d005be306 100644
--- a/core/modules/jsonapi/tests/src/Unit/Normalizer/ResourceIdentifierNormalizerTest.php
+++ b/core/modules/jsonapi/tests/src/Unit/Normalizer/ResourceIdentifierNormalizerTest.php
@@ -111,7 +111,7 @@ class ResourceIdentifierNormalizerTest extends UnitTestCase {
* @covers ::denormalize
* @dataProvider denormalizeProvider
*/
- public function testDenormalize($input, $field_name, $expected) {
+ public function testDenormalize($input, $field_name, $expected): void {
$entity = $this->prophesize(FieldableEntityInterface::class);
$context = [
'resource_type' => $this->resourceType,
@@ -152,7 +152,7 @@ class ResourceIdentifierNormalizerTest extends UnitTestCase {
* @covers ::denormalize
* @dataProvider denormalizeInvalidResourceProvider
*/
- public function testDenormalizeInvalidResource($data, $field_name) {
+ public function testDenormalizeInvalidResource($data, $field_name): void {
$context = [
'resource_type' => $this->resourceType,
'related' => $field_name,
diff --git a/core/modules/jsonapi/tests/src/Unit/Query/EntityConditionGroupTest.php b/core/modules/jsonapi/tests/src/Unit/Query/EntityConditionGroupTest.php
index 5544e70012e..8f3a4e5670e 100644
--- a/core/modules/jsonapi/tests/src/Unit/Query/EntityConditionGroupTest.php
+++ b/core/modules/jsonapi/tests/src/Unit/Query/EntityConditionGroupTest.php
@@ -19,7 +19,7 @@ class EntityConditionGroupTest extends UnitTestCase {
* @covers ::__construct
* @dataProvider constructProvider
*/
- public function testConstruct($case) {
+ public function testConstruct($case): void {
$group = new EntityConditionGroup($case['conjunction'], $case['members']);
$this->assertEquals($case['conjunction'], $group->conjunction());
@@ -33,7 +33,7 @@ class EntityConditionGroupTest extends UnitTestCase {
/**
* @covers ::__construct
*/
- public function testConstructException() {
+ public function testConstructException(): void {
$this->expectException(\InvalidArgumentException::class);
new EntityConditionGroup('NOT_ALLOWED', []);
}
diff --git a/core/modules/jsonapi/tests/src/Unit/Query/EntityConditionTest.php b/core/modules/jsonapi/tests/src/Unit/Query/EntityConditionTest.php
index adea6af9f0d..78aa37d8d13 100644
--- a/core/modules/jsonapi/tests/src/Unit/Query/EntityConditionTest.php
+++ b/core/modules/jsonapi/tests/src/Unit/Query/EntityConditionTest.php
@@ -37,7 +37,7 @@ class EntityConditionTest extends UnitTestCase {
* @covers ::createFromQueryParameter
* @dataProvider queryParameterProvider
*/
- public function testCreateFromQueryParameter($case) {
+ public function testCreateFromQueryParameter($case): void {
$condition = EntityCondition::createFromQueryParameter($case);
$this->assertEquals($case['path'], $condition->field());
$this->assertEquals($case['value'], $condition->value());
@@ -75,7 +75,7 @@ class EntityConditionTest extends UnitTestCase {
* @covers ::validate
* @dataProvider validationProvider
*/
- public function testValidation($input, $exception) {
+ public function testValidation($input, $exception): void {
if ($exception) {
$this->expectException(get_class($exception));
$this->expectExceptionMessage($exception->getMessage());
diff --git a/core/modules/jsonapi/tests/src/Unit/Query/OffsetPageTest.php b/core/modules/jsonapi/tests/src/Unit/Query/OffsetPageTest.php
index 264d3bd7f61..e360fb65fe0 100644
--- a/core/modules/jsonapi/tests/src/Unit/Query/OffsetPageTest.php
+++ b/core/modules/jsonapi/tests/src/Unit/Query/OffsetPageTest.php
@@ -37,7 +37,7 @@ class OffsetPageTest extends UnitTestCase {
* @covers ::createFromQueryParameter
* @dataProvider parameterProvider
*/
- public function testCreateFromQueryParameter($original, $expected) {
+ public function testCreateFromQueryParameter($original, $expected): void {
$actual = OffsetPage::createFromQueryParameter($original);
$this->assertEquals($expected['offset'], $actual->getOffset());
$this->assertEquals($expected['limit'], $actual->getSize());
@@ -59,7 +59,7 @@ class OffsetPageTest extends UnitTestCase {
/**
* @covers ::createFromQueryParameter
*/
- public function testCreateFromQueryParameterFail() {
+ public function testCreateFromQueryParameterFail(): void {
$this->expectException(BadRequestHttpException::class);
OffsetPage::createFromQueryParameter('lorem');
}
diff --git a/core/modules/jsonapi/tests/src/Unit/Query/SortTest.php b/core/modules/jsonapi/tests/src/Unit/Query/SortTest.php
index 14b3faa9f52..352ba46d619 100644
--- a/core/modules/jsonapi/tests/src/Unit/Query/SortTest.php
+++ b/core/modules/jsonapi/tests/src/Unit/Query/SortTest.php
@@ -37,7 +37,7 @@ class SortTest extends UnitTestCase {
* @covers ::createFromQueryParameter
* @dataProvider parameterProvider
*/
- public function testCreateFromQueryParameter($input, $expected) {
+ public function testCreateFromQueryParameter($input, $expected): void {
$sort = Sort::createFromQueryParameter($input);
foreach ($sort->fields() as $index => $sort_field) {
$this->assertEquals($expected[$index]['path'], $sort_field['path']);
@@ -85,7 +85,7 @@ class SortTest extends UnitTestCase {
* @covers ::createFromQueryParameter
* @dataProvider badParameterProvider
*/
- public function testCreateFromQueryParameterFail($input) {
+ public function testCreateFromQueryParameterFail($input): void {
$this->expectException(BadRequestHttpException::class);
Sort::createFromQueryParameter($input);
}
diff --git a/core/modules/jsonapi/tests/src/Unit/Routing/RoutesTest.php b/core/modules/jsonapi/tests/src/Unit/Routing/RoutesTest.php
index 59000936c3e..80f38d545c7 100644
--- a/core/modules/jsonapi/tests/src/Unit/Routing/RoutesTest.php
+++ b/core/modules/jsonapi/tests/src/Unit/Routing/RoutesTest.php
@@ -68,7 +68,7 @@ class RoutesTest extends UnitTestCase {
/**
* @covers ::routes
*/
- public function testRoutesCollection() {
+ public function testRoutesCollection(): void {
// Get the route collection and start making assertions.
$routes = $this->routes['ok']->routes();
@@ -104,7 +104,7 @@ class RoutesTest extends UnitTestCase {
/**
* @covers ::routes
*/
- public function testRoutesIndividual() {
+ public function testRoutesIndividual(): void {
// Get the route collection and start making assertions.
$iterator = $this->routes['ok']->routes()->getIterator();
@@ -147,7 +147,7 @@ class RoutesTest extends UnitTestCase {
/**
* @covers ::routes
*/
- public function testRoutesRelated() {
+ public function testRoutesRelated(): void {
// Get the route collection and start making assertions.
$iterator = $this->routes['ok']->routes()->getIterator();
@@ -168,7 +168,7 @@ class RoutesTest extends UnitTestCase {
/**
* @covers ::routes
*/
- public function testRoutesRelationships() {
+ public function testRoutesRelationships(): void {
// Get the route collection and start making assertions.
$iterator = $this->routes['ok']->routes()->getIterator();
@@ -191,7 +191,7 @@ class RoutesTest extends UnitTestCase {
*
* @dataProvider expectedRoutes
*/
- public function testRoutes($route) {
+ public function testRoutes($route): void {
$this->assertArrayHasKey($route, $this->routes['ok']->routes()->all());
}
@@ -225,7 +225,7 @@ class RoutesTest extends UnitTestCase {
*
* @dataProvider notExpectedRoutes
*/
- public function testInternalRoutes($route) {
+ public function testInternalRoutes($route): void {
$this->assertArrayNotHasKey($route, $this->routes['ok']->routes()->all());
}
diff --git a/core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php b/core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php
index f188628d044..1096c75419f 100644
--- a/core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php
+++ b/core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php
@@ -37,7 +37,7 @@ class AdminPathEntityConverterLanguageTest extends BrowserTestBase {
/**
* Tests the translated and untranslated config entities are loaded properly.
*/
- public function testConfigUsingCurrentLanguage() {
+ public function testConfigUsingCurrentLanguage(): void {
\Drupal::languageManager()
->getLanguageConfigOverride('es', 'language.entity.es')
->set('label', 'Español')
diff --git a/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php b/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php
index 487fbdb8780..c480e0d8389 100644
--- a/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php
+++ b/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php
@@ -120,7 +120,7 @@ class ConfigurableLanguageManagerTest extends BrowserTestBase {
* The interface language uses the preferred language for admin pages of the
* user and after that the URL. The Content uses just the URL.
*/
- public function testUrlContentTranslationWithPreferredAdminLanguage() {
+ public function testUrlContentTranslationWithPreferredAdminLanguage(): void {
$assert_session = $this->assertSession();
// Set the interface language to use the preferred administration language
// and then the URL.
@@ -161,7 +161,7 @@ class ConfigurableLanguageManagerTest extends BrowserTestBase {
/**
* Tests translation with URL and Session Language Negotiators.
*/
- public function testUrlContentTranslationWithSessionLanguage() {
+ public function testUrlContentTranslationWithSessionLanguage(): void {
$assert_session = $this->assertSession();
/** @var \Drupal\language\LanguageNegotiatorInterface $language_negotiator */
$language_negotiator = \Drupal::getContainer()->get('language_negotiator');
@@ -213,7 +213,7 @@ class ConfigurableLanguageManagerTest extends BrowserTestBase {
* admin language negotiator because of the recursive way that the negotiator
* is called.
*/
- public function testUserProfileTranslationWithPreferredAdminLanguage() {
+ public function testUserProfileTranslationWithPreferredAdminLanguage(): void {
$assert_session = $this->assertSession();
// Set the interface language to use the preferred administration language.
/** @var \Drupal\language\LanguageNegotiatorInterface $language_negotiator */
diff --git a/core/modules/language/tests/src/Functional/EntityTypeWithoutLanguageFormTest.php b/core/modules/language/tests/src/Functional/EntityTypeWithoutLanguageFormTest.php
index b02fe739da2..c12871e7ae2 100644
--- a/core/modules/language/tests/src/Functional/EntityTypeWithoutLanguageFormTest.php
+++ b/core/modules/language/tests/src/Functional/EntityTypeWithoutLanguageFormTest.php
@@ -48,7 +48,7 @@ class EntityTypeWithoutLanguageFormTest extends BrowserTestBase {
/**
* Tests configuration options with an entity without language definition.
*/
- public function testEmptyLangcode() {
+ public function testEmptyLangcode(): void {
// Assert that we can not enable language select from
// content language settings page.
$this->drupalGet('admin/config/regional/content-language');
diff --git a/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php b/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php
index 4617e684e66..ffaf49d6829 100644
--- a/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php
@@ -20,7 +20,7 @@ class LanguageBlockSettingsVisibilityTest extends BrowserTestBase {
*/
protected $defaultTheme = 'stark';
- public function testUnnecessaryLanguageSettingsVisibility() {
+ public function testUnnecessaryLanguageSettingsVisibility(): void {
$admin_user = $this->drupalCreateUser([
'administer languages',
'access administration pages',
diff --git a/core/modules/language/tests/src/Functional/LanguageBreadcrumbTest.php b/core/modules/language/tests/src/Functional/LanguageBreadcrumbTest.php
index 4723c99d3b8..da89dfd29d1 100644
--- a/core/modules/language/tests/src/Functional/LanguageBreadcrumbTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageBreadcrumbTest.php
@@ -42,7 +42,7 @@ class LanguageBreadcrumbTest extends BrowserTestBase {
/**
* Tests breadcrumbs with URL prefixes.
*/
- public function testBreadCrumbs() {
+ public function testBreadCrumbs(): void {
// /user/login is the default frontpage which only works for an anonymous
// user. Access the frontpage in different languages, ensure that no
// breadcrumb is displayed.
diff --git a/core/modules/language/tests/src/Functional/LanguageBrowserDetectionAcceptLanguageTest.php b/core/modules/language/tests/src/Functional/LanguageBrowserDetectionAcceptLanguageTest.php
index 31ec8ac47fd..25ea1a10542 100644
--- a/core/modules/language/tests/src/Functional/LanguageBrowserDetectionAcceptLanguageTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageBrowserDetectionAcceptLanguageTest.php
@@ -76,7 +76,7 @@ class LanguageBrowserDetectionAcceptLanguageTest extends BrowserTestBase {
/**
* Tests with browsers with and without Accept-Language header.
*/
- public function testAcceptLanguageEmptyDefault() {
+ public function testAcceptLanguageEmptyDefault(): void {
// Check correct headers.
$this->drupalGet('/en/system-test/echo/language test', [], ['Accept-Language' => 'en']);
diff --git a/core/modules/language/tests/src/Functional/LanguageBrowserDetectionTest.php b/core/modules/language/tests/src/Functional/LanguageBrowserDetectionTest.php
index ec0331471b9..92e843e0e5a 100644
--- a/core/modules/language/tests/src/Functional/LanguageBrowserDetectionTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageBrowserDetectionTest.php
@@ -24,7 +24,7 @@ class LanguageBrowserDetectionTest extends BrowserTestBase {
/**
* Tests mappings between browser language codes and Drupal language codes.
*/
- public function testUIBrowserLanguageMappings() {
+ public function testUIBrowserLanguageMappings(): void {
// User to manage languages.
$admin_user = $this->drupalCreateUser([
'administer languages',
diff --git a/core/modules/language/tests/src/Functional/LanguageConfigInstallOverrideExistingTest.php b/core/modules/language/tests/src/Functional/LanguageConfigInstallOverrideExistingTest.php
index dda12c90f29..5dfd86ebd7f 100644
--- a/core/modules/language/tests/src/Functional/LanguageConfigInstallOverrideExistingTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageConfigInstallOverrideExistingTest.php
@@ -26,7 +26,7 @@ class LanguageConfigInstallOverrideExistingTest extends BrowserTestBase {
/**
* Tests when language config is installed existing config is not overridden.
*/
- public function testLanguageConfigInstallOverrideExisting() {
+ public function testLanguageConfigInstallOverrideExisting(): void {
/** @var \Drupal\Core\Config\StorageInterface $storage */
$storage = $this->container->get('config.storage');
$config = $this->config('language.types');
diff --git a/core/modules/language/tests/src/Functional/LanguageConfigOverrideImportTest.php b/core/modules/language/tests/src/Functional/LanguageConfigOverrideImportTest.php
index 629f7d7acdf..b2184159a7e 100644
--- a/core/modules/language/tests/src/Functional/LanguageConfigOverrideImportTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageConfigOverrideImportTest.php
@@ -35,7 +35,7 @@ class LanguageConfigOverrideImportTest extends BrowserTestBase {
/**
* Tests that language can be enabled and overrides are created during a sync.
*/
- public function testConfigOverrideImport() {
+ public function testConfigOverrideImport(): void {
ConfigurableLanguage::createFromLangcode('fr')->save();
/** @var \Drupal\Core\Config\StorageInterface $sync */
$sync = \Drupal::service('config.storage.sync');
@@ -72,7 +72,7 @@ class LanguageConfigOverrideImportTest extends BrowserTestBase {
/**
* Tests that configuration events are not fired during a sync of overrides.
*/
- public function testConfigOverrideImportEvents() {
+ public function testConfigOverrideImportEvents(): void {
// Enable the config_events_test module so we can record events occurring.
\Drupal::service('module_installer')->install(['config_events_test']);
$this->rebuildContainer();
diff --git a/core/modules/language/tests/src/Functional/LanguageConfigSchemaTest.php b/core/modules/language/tests/src/Functional/LanguageConfigSchemaTest.php
index fa09ec5592e..0d7ba23733a 100644
--- a/core/modules/language/tests/src/Functional/LanguageConfigSchemaTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageConfigSchemaTest.php
@@ -49,7 +49,7 @@ class LanguageConfigSchemaTest extends BrowserTestBase {
/**
* Tests whether the language config schema is valid.
*/
- public function testValidLanguageConfigSchema() {
+ public function testValidLanguageConfigSchema(): void {
// Make sure no language configuration available by default.
$config_data = $this->config('language.settings')->get();
$this->assertEmpty($config_data);
diff --git a/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php b/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php
index 78d7d921387..92ed2b53350 100644
--- a/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php
@@ -51,7 +51,7 @@ class LanguageConfigurationElementTest extends BrowserTestBase {
/**
* Tests the language settings have been saved.
*/
- public function testLanguageConfigurationElement() {
+ public function testLanguageConfigurationElement(): void {
$this->drupalGet('language-tests/language_configuration_element');
$edit['lang_configuration[langcode]'] = 'current_interface';
$edit['lang_configuration[language_alterable]'] = FALSE;
@@ -99,7 +99,7 @@ class LanguageConfigurationElementTest extends BrowserTestBase {
/**
* Tests that the language_get_default_langcode() returns the correct values.
*/
- public function testDefaultLangcode() {
+ public function testDefaultLangcode(): void {
// Add some custom languages.
foreach (['aa', 'bb', 'cc'] as $language_code) {
ConfigurableLanguage::create([
@@ -175,7 +175,7 @@ class LanguageConfigurationElementTest extends BrowserTestBase {
/**
* Tests that the configuration is retained when the node type is updated.
*/
- public function testNodeTypeUpdate() {
+ public function testNodeTypeUpdate(): void {
// Create the article content type first if the profile used is not the
// standard one.
if ($this->profile != 'standard') {
@@ -210,7 +210,7 @@ class LanguageConfigurationElementTest extends BrowserTestBase {
/**
* Tests the language settings are deleted on bundle delete.
*/
- public function testNodeTypeDelete() {
+ public function testNodeTypeDelete(): void {
// Create the article content type first if the profile used is not the
// standard one.
if ($this->profile != 'standard') {
@@ -247,7 +247,7 @@ class LanguageConfigurationElementTest extends BrowserTestBase {
/**
* Tests that the configuration is retained when a vocabulary is updated.
*/
- public function testTaxonomyVocabularyUpdate() {
+ public function testTaxonomyVocabularyUpdate(): void {
$vocabulary = Vocabulary::create([
'name' => 'Country',
'vid' => 'country',
diff --git a/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php b/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
index c7d1cf7232c..7cc01976c13 100644
--- a/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
@@ -31,7 +31,7 @@ class LanguageConfigurationTest extends BrowserTestBase {
/**
* Functional tests for adding, editing and deleting languages.
*/
- public function testLanguageConfiguration() {
+ public function testLanguageConfiguration(): void {
// Ensure the after installing the language module the weight of the English
// language is still 0.
$this->assertEquals(0, ConfigurableLanguage::load('en')->getWeight(), 'The English language has a weight of 0.');
@@ -162,7 +162,7 @@ class LanguageConfigurationTest extends BrowserTestBase {
/**
* Functional tests for setting system language weight on adding, editing and deleting languages.
*/
- public function testLanguageConfigurationWeight() {
+ public function testLanguageConfigurationWeight(): void {
// User to add and remove language.
$admin_user = $this->drupalCreateUser([
'administer languages',
diff --git a/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php b/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php
index ad051dcf2cc..4bdc7692a50 100644
--- a/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php
@@ -31,7 +31,7 @@ class LanguageCustomLanguageConfigurationTest extends BrowserTestBase {
/**
* Functional tests for adding, editing and deleting languages.
*/
- public function testLanguageConfiguration() {
+ public function testLanguageConfiguration(): void {
// Create user with permissions to add and remove languages.
$admin_user = $this->drupalCreateUser([
diff --git a/core/modules/language/tests/src/Functional/LanguageEntityFieldAccessHookTest.php b/core/modules/language/tests/src/Functional/LanguageEntityFieldAccessHookTest.php
index 63d026ef610..264bd79b6ea 100644
--- a/core/modules/language/tests/src/Functional/LanguageEntityFieldAccessHookTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageEntityFieldAccessHookTest.php
@@ -35,7 +35,7 @@ class LanguageEntityFieldAccessHookTest extends BrowserTestBase {
/**
* Tests compatibility with hook_entity_field_access().
*/
- public function testHookEntityFieldAccess() {
+ public function testHookEntityFieldAccess(): void {
// Create an admin user and do the login.
$user = $this->drupalCreateUser([], NULL, TRUE);
$this->drupalLogin($user);
diff --git a/core/modules/language/tests/src/Functional/LanguageListModuleInstallTest.php b/core/modules/language/tests/src/Functional/LanguageListModuleInstallTest.php
index c66e11715b5..fdce3d13051 100644
--- a/core/modules/language/tests/src/Functional/LanguageListModuleInstallTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageListModuleInstallTest.php
@@ -28,7 +28,7 @@ class LanguageListModuleInstallTest extends BrowserTestBase {
/**
* Tests enabling Language.
*/
- public function testModuleInstallLanguageList() {
+ public function testModuleInstallLanguageList(): void {
// Since LanguageManager::getLanguages() uses static caches we need to do
// this by enabling the module using the UI.
$admin_user = $this->drupalCreateUser([
diff --git a/core/modules/language/tests/src/Functional/LanguageListTest.php b/core/modules/language/tests/src/Functional/LanguageListTest.php
index 7e1f6b38d78..f8602173c8c 100644
--- a/core/modules/language/tests/src/Functional/LanguageListTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageListTest.php
@@ -32,7 +32,7 @@ class LanguageListTest extends BrowserTestBase {
/**
* Functional tests for adding, editing and deleting languages.
*/
- public function testLanguageList() {
+ public function testLanguageList(): void {
// User to add and remove language.
$admin_user = $this->drupalCreateUser([
@@ -211,7 +211,7 @@ class LanguageListTest extends BrowserTestBase {
/**
* Functional tests for the language states (locked or configurable).
*/
- public function testLanguageStates() {
+ public function testLanguageStates(): void {
// Add some languages, and also lock some of them.
ConfigurableLanguage::create(['label' => $this->randomMachineName(), 'id' => 'l1'])->save();
ConfigurableLanguage::create(['label' => $this->randomMachineName(), 'id' => 'l2', 'locked' => TRUE])->save();
diff --git a/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php b/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php
index 7da3df26067..a1a7db8141f 100644
--- a/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php
@@ -46,7 +46,7 @@ class LanguageLocaleListTest extends BrowserTestBase {
/**
* Tests adding, editing, and deleting languages.
*/
- public function testLanguageLocaleList() {
+ public function testLanguageLocaleList(): void {
// User to add and remove language.
$admin_user = $this->drupalCreateUser([
'administer languages',
diff --git a/core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php b/core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php
index 65aeb557c59..02e0539a33a 100644
--- a/core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php
@@ -69,7 +69,7 @@ class LanguageNegotiationContentEntityTest extends BrowserTestBase {
/**
* Tests default with content language remaining same as interface language.
*/
- public function testDefaultConfiguration() {
+ public function testDefaultConfiguration(): void {
$translation = $this->entity;
$this->drupalGet($translation->toUrl());
$last = \Drupal::keyValue('language_test')->get('language_negotiation_last');
@@ -98,7 +98,7 @@ class LanguageNegotiationContentEntityTest extends BrowserTestBase {
/**
* Tests enabling the language negotiator language_content_entity.
*/
- public function testEnabledLanguageContentNegotiator() {
+ public function testEnabledLanguageContentNegotiator(): void {
// Define the method language-url with a higher priority than
// language-content-entity. This configuration should match the default one,
// where the language-content-entity is turned off.
diff --git a/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php b/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php
index 2cde3eafb25..e2640da9926 100644
--- a/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php
@@ -74,7 +74,7 @@ class LanguageNegotiationInfoTest extends BrowserTestBase {
/**
* Tests alterations to language types/negotiation info.
*/
- public function testInfoAlterations() {
+ public function testInfoAlterations(): void {
$this->stateSet([
// Enable language_test type info.
'language_test.language_types' => TRUE,
@@ -184,7 +184,7 @@ class LanguageNegotiationInfoTest extends BrowserTestBase {
/**
* Tests altering config of configurable language types.
*/
- public function testConfigLangTypeAlterations() {
+ public function testConfigLangTypeAlterations(): void {
// Default of config.
$test_type = LanguageInterface::TYPE_CONTENT;
$this->assertFalse($this->isLanguageTypeConfigurable($test_type), 'Language type is not configurable.');
diff --git a/core/modules/language/tests/src/Functional/LanguageNegotiationSessionTest.php b/core/modules/language/tests/src/Functional/LanguageNegotiationSessionTest.php
index 2ead53a516e..46514b95ae1 100644
--- a/core/modules/language/tests/src/Functional/LanguageNegotiationSessionTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageNegotiationSessionTest.php
@@ -47,7 +47,7 @@ class LanguageNegotiationSessionTest extends BrowserTestBase {
/**
* Tests language negotiation via query/session parameters.
*/
- public function testSessionLanguageNegotiationMethod() {
+ public function testSessionLanguageNegotiationMethod(): void {
// Enable Session and Selected language for interface language detection.
$this->drupalGet('admin/config/regional/language/detection');
$edit = [
diff --git a/core/modules/language/tests/src/Functional/LanguageNegotiationUrlTest.php b/core/modules/language/tests/src/Functional/LanguageNegotiationUrlTest.php
index 163e7125bdb..49101adbdc4 100644
--- a/core/modules/language/tests/src/Functional/LanguageNegotiationUrlTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageNegotiationUrlTest.php
@@ -59,7 +59,7 @@ class LanguageNegotiationUrlTest extends BrowserTestBase {
/**
* @covers ::processInbound
*/
- public function testDomain() {
+ public function testDomain(): void {
// Check if paths that contain language prefixes can be reached when
// language is taken from the domain.
$edit = [
diff --git a/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php b/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php
index aab8dbf7f00..9bae27b53b5 100644
--- a/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php
+++ b/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php
@@ -75,7 +75,7 @@ class LanguagePathMonolingualTest extends BrowserTestBase {
/**
* Verifies that links do not have language prefixes in them.
*/
- public function testPageLinks() {
+ public function testPageLinks(): void {
// Navigate to 'admin/config' path.
$this->drupalGet('admin/config');
diff --git a/core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php b/core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php
index 792052ff38b..73dfb120124 100644
--- a/core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php
@@ -73,7 +73,7 @@ class LanguageSelectorTranslatableTest extends BrowserTestBase {
/**
* Tests content translation language selectors are correctly translated.
*/
- public function testLanguageStringSelector() {
+ public function testLanguageStringSelector(): void {
// Add another language.
static::createLanguageFromLangcode('es');
@@ -98,7 +98,7 @@ class LanguageSelectorTranslatableTest extends BrowserTestBase {
/**
* Tests that correct title is displayed for content translation page.
*/
- public function testContentTranslationPageTitle() {
+ public function testContentTranslationPageTitle(): void {
$this->drupalGet('admin/config/regional/content-language');
$this->assertSession()->pageTextContains('Content language and translation');
$this->assertSession()->pageTextNotMatches('#Content language$#');
diff --git a/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php b/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php
index b0fb5d0ef4b..5dfb11be2b5 100644
--- a/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php
@@ -62,7 +62,7 @@ class LanguageSwitchingTest extends BrowserTestBase {
/**
* Functional tests for the language switcher block.
*/
- public function testLanguageBlock() {
+ public function testLanguageBlock(): void {
// Add language.
$edit = [
'predefined_langcode' => 'fr',
@@ -313,7 +313,7 @@ class LanguageSwitchingTest extends BrowserTestBase {
/**
* Tests language switcher links for domain based negotiation.
*/
- public function testLanguageBlockWithDomain() {
+ public function testLanguageBlockWithDomain(): void {
// Add the Italian language.
ConfigurableLanguage::createFromLangcode('it')->save();
@@ -370,7 +370,7 @@ class LanguageSwitchingTest extends BrowserTestBase {
/**
* Tests active class on links when switching languages.
*/
- public function testLanguageLinkActiveClass() {
+ public function testLanguageLinkActiveClass(): void {
// Add language.
$edit = [
'predefined_langcode' => 'fr',
@@ -390,7 +390,7 @@ class LanguageSwitchingTest extends BrowserTestBase {
/**
* Check the path-admin class, as same as on default language.
*/
- public function testLanguageBodyClass() {
+ public function testLanguageBodyClass(): void {
// Add language.
$edit = [
'predefined_langcode' => 'fr',
@@ -517,7 +517,7 @@ class LanguageSwitchingTest extends BrowserTestBase {
/**
* Tests language switcher links for session based negotiation.
*/
- public function testLanguageSessionSwitchLinks() {
+ public function testLanguageSessionSwitchLinks(): void {
// Add language.
$edit = [
'predefined_langcode' => 'fr',
diff --git a/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php b/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php
index c1885b47d0d..47c61d06f24 100644
--- a/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php
@@ -101,7 +101,7 @@ class LanguageUILanguageNegotiationTest extends BrowserTestBase {
/**
* Tests for language switching by URL path.
*/
- public function testUILanguageNegotiation() {
+ public function testUILanguageNegotiation(): void {
// A few languages to switch to.
// This one is unknown, should get the default lang version.
$langcode_unknown = 'blah-blah';
@@ -444,7 +444,7 @@ class LanguageUILanguageNegotiationTest extends BrowserTestBase {
/**
* Tests URL language detection when the requested URL has no language.
*/
- public function testUrlLanguageFallback() {
+ public function testUrlLanguageFallback(): void {
// Add the Italian language.
$langcode_browser_fallback = 'it';
ConfigurableLanguage::createFromLangcode($langcode_browser_fallback)->save();
@@ -499,7 +499,7 @@ class LanguageUILanguageNegotiationTest extends BrowserTestBase {
/**
* Tests URL handling when separate domains are used for multiple languages.
*/
- public function testLanguageDomain() {
+ public function testLanguageDomain(): void {
global $base_url;
// Get the current host URI we're running on.
@@ -577,7 +577,7 @@ class LanguageUILanguageNegotiationTest extends BrowserTestBase {
/**
* Tests persistence of negotiation settings for the content language type.
*/
- public function testContentCustomization() {
+ public function testContentCustomization(): void {
// Customize content language settings from their defaults.
$edit = [
'language_content[configurable]' => TRUE,
@@ -600,7 +600,7 @@ class LanguageUILanguageNegotiationTest extends BrowserTestBase {
/**
* Tests if the language switcher block gets deleted when a language type has been made not configurable.
*/
- public function testDisableLanguageSwitcher() {
+ public function testDisableLanguageSwitcher(): void {
$block_id = 'test_language_block';
// Enable the language switcher block.
diff --git a/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php b/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php
index 444aa27abdd..a3279c40307 100644
--- a/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php
@@ -69,7 +69,7 @@ class LanguageUrlRewritingTest extends BrowserTestBase {
/**
* Check that non-installed languages are not considered.
*/
- public function testUrlRewritingEdgeCases() {
+ public function testUrlRewritingEdgeCases(): void {
// Check URL rewriting with a non-installed language.
$non_existing = new Language(['id' => $this->randomMachineName()]);
$this->checkUrl($non_existing, 'Path language is ignored if language is not installed.');
@@ -113,7 +113,7 @@ class LanguageUrlRewritingTest extends BrowserTestBase {
/**
* Check URL rewriting when using a domain name and a non-standard port.
*/
- public function testDomainNameNegotiationPort() {
+ public function testDomainNameNegotiationPort(): void {
global $base_url;
$language_domain = 'example.fr';
// Get the current host URI we're running on.
diff --git a/core/modules/language/tests/src/Functional/Rest/ConfigurableLanguageResourceTestBase.php b/core/modules/language/tests/src/Functional/Rest/ConfigurableLanguageResourceTestBase.php
index ff4f5feef79..b26cf43b90a 100644
--- a/core/modules/language/tests/src/Functional/Rest/ConfigurableLanguageResourceTestBase.php
+++ b/core/modules/language/tests/src/Functional/Rest/ConfigurableLanguageResourceTestBase.php
@@ -83,7 +83,7 @@ abstract class ConfigurableLanguageResourceTestBase extends ConfigEntityResource
*
* @see https://www.drupal.org/node/2915414
*/
- public function testGetDefaultConfig() {
+ public function testGetDefaultConfig(): void {
$this->initAuthentication();
$url = Url::fromUri('base:/entity/configurable_language/en')->setOption('query', ['_format' => static::$format]);
$request_options = $this->getAuthenticationRequestOptions('GET');
diff --git a/core/modules/language/tests/src/Kernel/Condition/LanguageConditionTest.php b/core/modules/language/tests/src/Kernel/Condition/LanguageConditionTest.php
index ef067f0ac06..742c18312a4 100644
--- a/core/modules/language/tests/src/Kernel/Condition/LanguageConditionTest.php
+++ b/core/modules/language/tests/src/Kernel/Condition/LanguageConditionTest.php
@@ -51,7 +51,7 @@ class LanguageConditionTest extends KernelTestBase {
/**
* Tests the language condition.
*/
- public function testConditions() {
+ public function testConditions(): void {
// Grab the language condition and configure it to check the content
// language.
$language = \Drupal::languageManager()->getLanguage('en');
diff --git a/core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php b/core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php
index 231eeed233d..4fd94ce3d92 100644
--- a/core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php
+++ b/core/modules/language/tests/src/Kernel/ConfigurableLanguageManagerTest.php
@@ -49,7 +49,7 @@ class ConfigurableLanguageManagerTest extends LanguageTestBase {
/**
* @covers ::getLanguageSwitchLinks
*/
- public function testLanguageSwitchLinks() {
+ public function testLanguageSwitchLinks(): void {
$this->languageNegotiator->setCurrentUser($this->prophesize('Drupal\Core\Session\AccountInterface')->reveal());
$this->languageManager->getLanguageSwitchLinks(LanguageInterface::TYPE_INTERFACE, new Url('<current>'));
}
diff --git a/core/modules/language/tests/src/Kernel/ConfigurableLanguageTest.php b/core/modules/language/tests/src/Kernel/ConfigurableLanguageTest.php
index 80c73f2a7ba..0225d023160 100644
--- a/core/modules/language/tests/src/Kernel/ConfigurableLanguageTest.php
+++ b/core/modules/language/tests/src/Kernel/ConfigurableLanguageTest.php
@@ -25,7 +25,7 @@ class ConfigurableLanguageTest extends KernelTestBase {
/**
* Tests configurable language name methods.
*/
- public function testName() {
+ public function testName(): void {
$name = $this->randomMachineName();
$language_code = $this->randomMachineName(2);
$configurableLanguage = new ConfigurableLanguage(['label' => $name, 'id' => $language_code], 'configurable_language');
diff --git a/core/modules/language/tests/src/Kernel/EntityDefaultLanguageTest.php b/core/modules/language/tests/src/Kernel/EntityDefaultLanguageTest.php
index 11ca0ca8fc9..fb38f751732 100644
--- a/core/modules/language/tests/src/Kernel/EntityDefaultLanguageTest.php
+++ b/core/modules/language/tests/src/Kernel/EntityDefaultLanguageTest.php
@@ -53,7 +53,7 @@ class EntityDefaultLanguageTest extends KernelTestBase {
/**
* Tests that default language code is properly set for new nodes.
*/
- public function testEntityTranslationDefaultLanguageViaCode() {
+ public function testEntityTranslationDefaultLanguageViaCode(): void {
// With language module activated, and a content type that is configured to
// have no language by default, a new node of this content type will have
// "und" language code when language is not specified.
diff --git a/core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php b/core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php
index d7984991067..1c261916a9b 100644
--- a/core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php
+++ b/core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php
@@ -61,7 +61,7 @@ class EntityUrlLanguageTest extends LanguageTestBase {
/**
* Ensures that entity URLs in a language have the right language prefix.
*/
- public function testEntityUrlLanguage() {
+ public function testEntityUrlLanguage(): void {
$this->assertStringContainsString('/en/entity_test/' . $this->entity->id(), $this->entity->toUrl()->toString());
$this->assertStringContainsString('/es/entity_test/' . $this->entity->id(), $this->entity->getTranslation('es')->toUrl()->toString());
$this->assertStringContainsString('/fr/entity_test/' . $this->entity->id(), $this->entity->getTranslation('fr')->toUrl()->toString());
@@ -73,7 +73,7 @@ class EntityUrlLanguageTest extends LanguageTestBase {
* Test case with the method language-content-entity enabled and configured
* with higher and also with lower priority than the method language-url.
*/
- public function testEntityUrlLanguageWithLanguageContentEnabled() {
+ public function testEntityUrlLanguageWithLanguageContentEnabled(): void {
// Define the method language-content-entity with a higher priority than
// language-url.
$config = $this->config('language.types');
diff --git a/core/modules/language/tests/src/Kernel/LanguageConfigFactoryOverrideTest.php b/core/modules/language/tests/src/Kernel/LanguageConfigFactoryOverrideTest.php
index cc34d090c89..48def5629df 100644
--- a/core/modules/language/tests/src/Kernel/LanguageConfigFactoryOverrideTest.php
+++ b/core/modules/language/tests/src/Kernel/LanguageConfigFactoryOverrideTest.php
@@ -24,7 +24,7 @@ class LanguageConfigFactoryOverrideTest extends KernelTestBase {
/**
* Tests language.config_factory_override service has the default language.
*/
- public function testLanguageConfigFactoryOverride() {
+ public function testLanguageConfigFactoryOverride(): void {
$this->installConfig('system');
$this->installConfig('language');
diff --git a/core/modules/language/tests/src/Kernel/LanguageConfigOverrideInstallTest.php b/core/modules/language/tests/src/Kernel/LanguageConfigOverrideInstallTest.php
index aa4499f4b8e..0b4ccda1d6c 100644
--- a/core/modules/language/tests/src/Kernel/LanguageConfigOverrideInstallTest.php
+++ b/core/modules/language/tests/src/Kernel/LanguageConfigOverrideInstallTest.php
@@ -28,7 +28,7 @@ class LanguageConfigOverrideInstallTest extends KernelTestBase {
/**
* Tests the configuration events are not fired during install of overrides.
*/
- public function testLanguageConfigOverrideInstall() {
+ public function testLanguageConfigOverrideInstall(): void {
$this->installConfig(['language']);
ConfigurableLanguage::createFromLangcode('de')->save();
// Need to enable test module after creating the language otherwise saving
diff --git a/core/modules/language/tests/src/Kernel/LanguageDependencyInjectionTest.php b/core/modules/language/tests/src/Kernel/LanguageDependencyInjectionTest.php
index dc0388394b5..155075ce509 100644
--- a/core/modules/language/tests/src/Kernel/LanguageDependencyInjectionTest.php
+++ b/core/modules/language/tests/src/Kernel/LanguageDependencyInjectionTest.php
@@ -19,7 +19,7 @@ class LanguageDependencyInjectionTest extends LanguageTestBase {
*
* @see \Drupal\Core\Language\LanguageInterface
*/
- public function testDependencyInjectedNewLanguage() {
+ public function testDependencyInjectedNewLanguage(): void {
$expected = $this->languageManager->getDefaultLanguage();
$result = $this->languageManager->getCurrentLanguage();
$this->assertSame($expected, $result);
@@ -30,7 +30,7 @@ class LanguageDependencyInjectionTest extends LanguageTestBase {
*
* @see \Drupal\Core\Language\Language
*/
- public function testDependencyInjectedNewDefaultLanguage() {
+ public function testDependencyInjectedNewDefaultLanguage(): void {
$default_language = ConfigurableLanguage::load(\Drupal::languageManager()->getDefaultLanguage()->getId());
// Change the language default object to different values.
$fr = ConfigurableLanguage::createFromLangcode('fr');
diff --git a/core/modules/language/tests/src/Kernel/LanguageFallbackTest.php b/core/modules/language/tests/src/Kernel/LanguageFallbackTest.php
index f635389eeb6..b272ed35d4e 100644
--- a/core/modules/language/tests/src/Kernel/LanguageFallbackTest.php
+++ b/core/modules/language/tests/src/Kernel/LanguageFallbackTest.php
@@ -31,7 +31,7 @@ class LanguageFallbackTest extends LanguageTestBase {
/**
* Tests language fallback candidates.
*/
- public function testCandidates() {
+ public function testCandidates(): void {
$language_list = $this->languageManager->getLanguages();
$expected = array_keys($language_list + [LanguageInterface::LANGCODE_NOT_SPECIFIED => NULL]);
diff --git a/core/modules/language/tests/src/Kernel/LanguageNegotiatorPluginTest.php b/core/modules/language/tests/src/Kernel/LanguageNegotiatorPluginTest.php
index e1bc47fee62..9673ec3ab92 100644
--- a/core/modules/language/tests/src/Kernel/LanguageNegotiatorPluginTest.php
+++ b/core/modules/language/tests/src/Kernel/LanguageNegotiatorPluginTest.php
@@ -25,7 +25,7 @@ class LanguageNegotiatorPluginTest extends KernelTestBase {
/**
* Tests for PluginNotFoundException.
*/
- public function testLanguageNegotiatorNoPlugin() {
+ public function testLanguageNegotiatorNoPlugin(): void {
$logger = new BufferingLogger();
$logger_factory = $this->createMock(LoggerChannelFactory::class);
$logger_factory->expects($this->once())
diff --git a/core/modules/language/tests/src/Kernel/LanguageSelectWidgetTest.php b/core/modules/language/tests/src/Kernel/LanguageSelectWidgetTest.php
index a34d37c81ce..0f76bfe6999 100644
--- a/core/modules/language/tests/src/Kernel/LanguageSelectWidgetTest.php
+++ b/core/modules/language/tests/src/Kernel/LanguageSelectWidgetTest.php
@@ -52,7 +52,7 @@ class LanguageSelectWidgetTest extends KernelTestBase {
/**
* Tests the widget with the locked languages.
*/
- public function testWithIncludedLockedLanguage() {
+ public function testWithIncludedLockedLanguage(): void {
$this->entityFormDisplay->setComponent('langcode', [
'type' => 'language_select',
])->save();
@@ -65,7 +65,7 @@ class LanguageSelectWidgetTest extends KernelTestBase {
/**
* Tests the widget without the locked languages.
*/
- public function testWithoutIncludedLockedLanguage() {
+ public function testWithoutIncludedLockedLanguage(): void {
$this->entityFormDisplay->setComponent('langcode', [
'type' => 'language_select',
'settings' => ['include_locked' => FALSE],
diff --git a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateDefaultLanguageTest.php b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateDefaultLanguageTest.php
index 63bdd6c30c6..ce5167947ff 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateDefaultLanguageTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateDefaultLanguageTest.php
@@ -23,7 +23,7 @@ class MigrateDefaultLanguageTest extends MigrateDrupal6TestBase {
/**
* Tests language_default migration with an existing language.
*/
- public function testMigrationWithExistingLanguage() {
+ public function testMigrationWithExistingLanguage(): void {
$this->setDefaultLanguage('fr');
$this->startCollectingMessages();
$this->executeMigrations(['language', 'default_language']);
@@ -37,7 +37,7 @@ class MigrateDefaultLanguageTest extends MigrateDrupal6TestBase {
/**
* Tests language_default migration with a non-existing language.
*/
- public function testMigrationWithNonExistentLanguage() {
+ public function testMigrationWithNonExistentLanguage(): void {
$this->setDefaultLanguage('tv');
$this->startCollectingMessages();
$this->executeMigrations(['language', 'default_language']);
@@ -56,7 +56,7 @@ class MigrateDefaultLanguageTest extends MigrateDrupal6TestBase {
/**
* Tests language_default migration with unset default language variable.
*/
- public function testMigrationWithUnsetVariable() {
+ public function testMigrationWithUnsetVariable(): void {
// Delete the language_default variable.
$this->sourceDatabase->delete('variable')
->condition('name', 'language_default')
diff --git a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentCommentSettingsTest.php b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentCommentSettingsTest.php
index 96a83fa2db8..853bc3c7c56 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentCommentSettingsTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentCommentSettingsTest.php
@@ -39,7 +39,7 @@ class MigrateLanguageContentCommentSettingsTest extends MigrateDrupal6TestBase {
/**
* Tests migration of comment content language settings.
*/
- public function testLanguageCommentSettings() {
+ public function testLanguageCommentSettings(): void {
// Article and Employee content type have multilingual settings of 'Enabled,
// with Translation'. Assert that comments are not translatable and the
// default language is 'current_interface'.
diff --git a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentMenuSettingsTest.php b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentMenuSettingsTest.php
index af0cb726c3c..edcb5b9a496 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentMenuSettingsTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentMenuSettingsTest.php
@@ -42,7 +42,7 @@ class MigrateLanguageContentMenuSettingsTest extends MigrateDrupal6TestBase {
/**
* Tests migration of menu translation ability.
*/
- public function testLanguageMenuContent() {
+ public function testLanguageMenuContent(): void {
$config = ContentLanguageSettings::load('menu_link_content.menu_link_content');
$this->assertInstanceOf(ContentLanguageSettings::class, $config);
$this->assertSame('menu_link_content', $config->getTargetEntityTypeId());
diff --git a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentSettingsTest.php b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentSettingsTest.php
index 7cf9ab3f0aa..971d89f5275 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentSettingsTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentSettingsTest.php
@@ -46,7 +46,7 @@ class MigrateLanguageContentSettingsTest extends MigrateDrupal6TestBase {
/**
* Tests migration of content language settings.
*/
- public function testLanguageContent() {
+ public function testLanguageContent(): void {
// Assert that a translatable content is still translatable.
$config = $this->config('language.content_settings.node.article');
$this->assertSame($config->get('target_entity_type_id'), 'node');
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 918922d1b3b..6aeeb1a91e7 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentTaxonomyVocabularySettingsTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentTaxonomyVocabularySettingsTest.php
@@ -40,7 +40,7 @@ class MigrateLanguageContentTaxonomyVocabularySettingsTest extends MigrateDrupal
/**
* Tests migration of 18ntaxonomy vocabulary settings.
*/
- public function testLanguageContentTaxonomy() {
+ public function testLanguageContentTaxonomy(): void {
$target_entity = 'taxonomy_term';
// Per Language.
$this->assertLanguageContentSettings($target_entity, 'vocabulary_1_i_0_', LanguageInterface::LANGCODE_SITE_DEFAULT, TRUE, ['enabled' => FALSE]);
diff --git a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageNegotiationSettingsTest.php b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageNegotiationSettingsTest.php
index 8d1dc93f506..aa7ea398fa5 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageNegotiationSettingsTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageNegotiationSettingsTest.php
@@ -22,7 +22,7 @@ class MigrateLanguageNegotiationSettingsTest extends MigrateDrupal6TestBase {
/**
* Tests the migration with LANGUAGE_NEGOTIATION_PATH_DEFAULT.
*/
- public function testLanguageNegotiationWithDefaultPathPrefix() {
+ public function testLanguageNegotiationWithDefaultPathPrefix(): void {
$this->executeMigrations([
'language',
'd6_language_negotiation_settings',
@@ -56,7 +56,7 @@ class MigrateLanguageNegotiationSettingsTest extends MigrateDrupal6TestBase {
/**
* Tests the migration with LANGUAGE_NEGOTIATION_NONE.
*/
- public function testLanguageNegotiationWithNoNegotiation() {
+ public function testLanguageNegotiationWithNoNegotiation(): void {
$this->sourceDatabase->update('variable')
->fields(['value' => serialize(0)])
->condition('name', 'language_negotiation')
@@ -88,7 +88,7 @@ class MigrateLanguageNegotiationSettingsTest extends MigrateDrupal6TestBase {
/**
* Tests the migration with LANGUAGE_NEGOTIATION_PATH.
*/
- public function testLanguageNegotiationWithPathPrefix() {
+ public function testLanguageNegotiationWithPathPrefix(): void {
$this->sourceDatabase->update('variable')
->fields(['value' => serialize(2)])
->condition('name', 'language_negotiation')
@@ -129,7 +129,7 @@ class MigrateLanguageNegotiationSettingsTest extends MigrateDrupal6TestBase {
/**
* Tests the migration with LANGUAGE_NEGOTIATION_DOMAIN.
*/
- public function testLanguageNegotiationWithDomain() {
+ public function testLanguageNegotiationWithDomain(): void {
$this->sourceDatabase->update('variable')
->fields(['value' => serialize(3)])
->condition('name', 'language_negotiation')
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 0ed0caf78b7..21afd6464d8 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageTest.php
@@ -46,7 +46,7 @@ class MigrateLanguageTest extends MigrateDrupal6TestBase {
/**
* Tests migration of Drupal 6 languages to configurable language entities.
*/
- public function testLanguageMigration() {
+ public function testLanguageMigration(): void {
$this->executeMigration('language');
$this->assertLanguage('en', 'English');
$this->assertLanguage('fr', 'French');
diff --git a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateDefaultLanguageTest.php b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateDefaultLanguageTest.php
index 08cc3ebc37b..cbcb91b390b 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateDefaultLanguageTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateDefaultLanguageTest.php
@@ -23,7 +23,7 @@ class MigrateDefaultLanguageTest extends MigrateDrupal7TestBase {
/**
* Tests language_default migration with a non-existing language.
*/
- public function testMigrationWithExistingLanguage() {
+ public function testMigrationWithExistingLanguage(): void {
$this->setDefaultLanguage('is');
$this->startCollectingMessages();
$this->executeMigrations(['language', 'default_language']);
@@ -37,7 +37,7 @@ class MigrateDefaultLanguageTest extends MigrateDrupal7TestBase {
/**
* Tests language_default migration with a non-existing language.
*/
- public function testMigrationWithNonExistentLanguage() {
+ public function testMigrationWithNonExistentLanguage(): void {
$this->setDefaultLanguage('tv');
$this->startCollectingMessages();
$this->executeMigrations(['language', 'default_language']);
@@ -56,7 +56,7 @@ class MigrateDefaultLanguageTest extends MigrateDrupal7TestBase {
/**
* Tests language_default migration with unset default language variable.
*/
- public function testMigrationWithUnsetVariable() {
+ public function testMigrationWithUnsetVariable(): void {
// Delete the language_default variable.
$this->sourceDatabase->delete('variable')
->condition('name', 'language_default')
diff --git a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentCommentSettingsNoEntityTranslationTest.php b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentCommentSettingsNoEntityTranslationTest.php
index 0c4872a8d2f..9cf007a8593 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentCommentSettingsNoEntityTranslationTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentCommentSettingsNoEntityTranslationTest.php
@@ -59,7 +59,7 @@ class MigrateLanguageContentCommentSettingsNoEntityTranslationTest extends Migra
/**
* Tests migration of content language settings.
*/
- public function testLanguageCommentSettings() {
+ public function testLanguageCommentSettings(): void {
// Confirm there is no message about a missing bundle.
$this->assertEmpty($this->migrateMessages, $this->migrateMessages['error'][0] ?? '');
diff --git a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentCommentSettingsTest.php b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentCommentSettingsTest.php
index 9ea1c17624b..16923949a2e 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentCommentSettingsTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentCommentSettingsTest.php
@@ -41,7 +41,7 @@ class MigrateLanguageContentCommentSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests migration of content language settings.
*/
- public function testLanguageCommentSettings() {
+ public function testLanguageCommentSettings(): void {
// Confirm there is no message about a missing bundle.
$this->assertEmpty($this->migrateMessages, $this->migrateMessages['error'][0] ?? '');
diff --git a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentMenuSettingsTest.php b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentMenuSettingsTest.php
index 9899525eac6..1a98209ed50 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentMenuSettingsTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentMenuSettingsTest.php
@@ -41,7 +41,7 @@ class MigrateLanguageContentMenuSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests migration of menu translation ability.
*/
- public function testLanguageContentMenu() {
+ public function testLanguageContentMenu(): void {
$config = ContentLanguageSettings::load('menu_link_content.menu_link_content');
$this->assertInstanceOf(ContentLanguageSettings::class, $config);
$this->assertSame('menu_link_content', $config->getTargetEntityTypeId());
diff --git a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentSettingsTest.php b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentSettingsTest.php
index 10366453d8c..28da2b80249 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentSettingsTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentSettingsTest.php
@@ -44,7 +44,7 @@ class MigrateLanguageContentSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests migration of content language settings.
*/
- public function testLanguageContent() {
+ public function testLanguageContent(): void {
// Assert that a translatable content is still translatable.
$config = $this->config('language.content_settings.node.blog');
$this->assertSame($config->get('target_entity_type_id'), 'node');
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 91146631bd1..801d68b44f8 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentTaxonomyVocabularySettingsTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentTaxonomyVocabularySettingsTest.php
@@ -41,7 +41,7 @@ class MigrateLanguageContentTaxonomyVocabularySettingsTest extends MigrateDrupal
/**
* Tests migration of 18ntaxonomy vocabulary settings.
*/
- public function testLanguageContentTaxonomy() {
+ public function testLanguageContentTaxonomy(): void {
$target_entity = 'taxonomy_term';
// No multilingual options for terms, i18n_mode = 0.
$this->assertLanguageContentSettings($target_entity, 'tags', LanguageInterface::LANGCODE_NOT_SPECIFIED, FALSE, ['enabled' => FALSE]);
diff --git a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php
index b42a3728d90..54fdf4b0d21 100644
--- a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php
+++ b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php
@@ -22,7 +22,7 @@ class MigrateLanguageNegotiationSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests migration of language types variables to language.types.yml.
*/
- public function testLanguageTypes() {
+ public function testLanguageTypes(): void {
$this->executeMigrations([
'language',
'd7_language_negotiation_settings',
@@ -54,7 +54,7 @@ class MigrateLanguageNegotiationSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests the migration with prefix negotiation.
*/
- public function testLanguageNegotiationWithPrefix() {
+ public function testLanguageNegotiationWithPrefix(): void {
$this->sourceDatabase->update('languages')
->fields(['domain' => ''])
->execute();
@@ -90,7 +90,7 @@ class MigrateLanguageNegotiationSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests the migration with domain negotiation.
*/
- public function testLanguageNegotiationWithDomain() {
+ public function testLanguageNegotiationWithDomain(): void {
$this->sourceDatabase->update('variable')
->fields(['value' => serialize(1)])
->condition('name', 'locale_language_negotiation_url_part')
@@ -118,7 +118,7 @@ class MigrateLanguageNegotiationSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests the migration with non-existent variables.
*/
- public function testLanguageNegotiationWithNonExistentVariables() {
+ public function testLanguageNegotiationWithNonExistentVariables(): void {
$this->sourceDatabase->delete('variable')
->condition('name', ['local_language_negotiation_url_part', 'local_language_negotiation_session_param'], 'IN')
->execute();
diff --git a/core/modules/language/tests/src/Kernel/OverriddenConfigImportTest.php b/core/modules/language/tests/src/Kernel/OverriddenConfigImportTest.php
index 051cbaf106e..90a8f982155 100644
--- a/core/modules/language/tests/src/Kernel/OverriddenConfigImportTest.php
+++ b/core/modules/language/tests/src/Kernel/OverriddenConfigImportTest.php
@@ -59,7 +59,7 @@ class OverriddenConfigImportTest extends KernelTestBase {
/**
* Tests importing overridden config alongside config in the default language.
*/
- public function testConfigImportUpdates() {
+ public function testConfigImportUpdates(): void {
$storage = $this->container->get('config.storage');
$sync = $this->container->get('config.storage.sync');
/** @var \Drupal\language\ConfigurableLanguageManagerInterface $language_manager */
diff --git a/core/modules/language/tests/src/Kernel/Views/ArgumentLanguageTest.php b/core/modules/language/tests/src/Kernel/Views/ArgumentLanguageTest.php
index 8653988b470..282a3e5b442 100644
--- a/core/modules/language/tests/src/Kernel/Views/ArgumentLanguageTest.php
+++ b/core/modules/language/tests/src/Kernel/Views/ArgumentLanguageTest.php
@@ -24,7 +24,7 @@ class ArgumentLanguageTest extends LanguageTestBase {
/**
* Tests the language argument.
*/
- public function testArgument() {
+ public function testArgument(): void {
$view = Views::getView('test_view');
foreach (['en' => 'John', 'xx-lolspeak' => 'George'] as $langcode => $name) {
$view->setDisplay();
diff --git a/core/modules/language/tests/src/Kernel/Views/FieldLanguageTest.php b/core/modules/language/tests/src/Kernel/Views/FieldLanguageTest.php
index ae4247cb5aa..d3d0a375297 100644
--- a/core/modules/language/tests/src/Kernel/Views/FieldLanguageTest.php
+++ b/core/modules/language/tests/src/Kernel/Views/FieldLanguageTest.php
@@ -24,7 +24,7 @@ class FieldLanguageTest extends LanguageTestBase {
/**
* Tests the language field.
*/
- public function testField() {
+ public function testField(): void {
$view = Views::getView('test_view');
$view->setDisplay();
$view->displayHandlers->get('default')->overrideOption('fields', [
diff --git a/core/modules/language/tests/src/Kernel/Views/FilterLanguageTest.php b/core/modules/language/tests/src/Kernel/Views/FilterLanguageTest.php
index b5e2bfaf229..ccfad272df1 100644
--- a/core/modules/language/tests/src/Kernel/Views/FilterLanguageTest.php
+++ b/core/modules/language/tests/src/Kernel/Views/FilterLanguageTest.php
@@ -24,7 +24,7 @@ class FilterLanguageTest extends LanguageTestBase {
/**
* Tests the language filter.
*/
- public function testFilter() {
+ public function testFilter(): void {
$view = Views::getView('test_view');
foreach (['en' => 'John', 'xx-lolspeak' => 'George'] as $langcode => $name) {
$view->setDisplay();
diff --git a/core/modules/language/tests/src/Unit/Config/LanguageConfigOverrideTest.php b/core/modules/language/tests/src/Unit/Config/LanguageConfigOverrideTest.php
index 8f8725b8d73..e898a80bf73 100644
--- a/core/modules/language/tests/src/Unit/Config/LanguageConfigOverrideTest.php
+++ b/core/modules/language/tests/src/Unit/Config/LanguageConfigOverrideTest.php
@@ -70,7 +70,7 @@ class LanguageConfigOverrideTest extends UnitTestCase {
/**
* @covers ::save
*/
- public function testSaveNew() {
+ public function testSaveNew(): void {
$this->cacheTagsInvalidator->expects($this->once())
->method('invalidateTags')
->with(['config:config.test']);
@@ -81,7 +81,7 @@ class LanguageConfigOverrideTest extends UnitTestCase {
/**
* @covers ::save
*/
- public function testSaveExisting() {
+ public function testSaveExisting(): void {
$this->cacheTagsInvalidator->expects($this->once())
->method('invalidateTags')
->with(['config:config.test']);
@@ -92,7 +92,7 @@ class LanguageConfigOverrideTest extends UnitTestCase {
/**
* @covers ::delete
*/
- public function testDelete() {
+ public function testDelete(): void {
$this->cacheTagsInvalidator->expects($this->once())
->method('invalidateTags')
->with(['config:config.test']);
diff --git a/core/modules/language/tests/src/Unit/ConfigurableLanguageUnitTest.php b/core/modules/language/tests/src/Unit/ConfigurableLanguageUnitTest.php
index 02c35d10bb7..2c4156cf904 100644
--- a/core/modules/language/tests/src/Unit/ConfigurableLanguageUnitTest.php
+++ b/core/modules/language/tests/src/Unit/ConfigurableLanguageUnitTest.php
@@ -19,7 +19,7 @@ class ConfigurableLanguageUnitTest extends UnitTestCase {
/**
* @covers ::getDirection
*/
- public function testDirection() {
+ public function testDirection(): void {
// Direction of language writing, an integer. Usually either
// ConfigurableLanguage::DIRECTION_LTR or
// ConfigurableLanguage::DIRECTION_RTL.
@@ -35,7 +35,7 @@ class ConfigurableLanguageUnitTest extends UnitTestCase {
* @covers ::getWeight
* @covers ::setWeight
*/
- public function testWeight() {
+ public function testWeight(): void {
// The weight, an integer. Used to order languages with larger positive
// weights sinking items toward the bottom of lists.
$configurableLanguage = new ConfigurableLanguage(['weight' => -5], 'configurable_language');
diff --git a/core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php b/core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php
index 471648cb92b..cf7388e7dcc 100644
--- a/core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php
+++ b/core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php
@@ -88,7 +88,7 @@ class ContentLanguageSettingsUnitTest extends UnitTestCase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependencies() {
+ public function testCalculateDependencies(): void {
// Mock the interfaces necessary to create a dependency on a bundle entity.
$target_entity_type = $this->createMock('\Drupal\Core\Entity\EntityTypeInterface');
$target_entity_type->expects($this->any())
@@ -111,7 +111,7 @@ class ContentLanguageSettingsUnitTest extends UnitTestCase {
/**
* @covers ::id
*/
- public function testId() {
+ public function testId(): void {
$config = new ContentLanguageSettings([
'target_entity_type_id' => 'test_entity_type',
'target_bundle' => 'test_bundle',
@@ -122,7 +122,7 @@ class ContentLanguageSettingsUnitTest extends UnitTestCase {
/**
* @covers ::getTargetEntityTypeId
*/
- public function testTargetEntityTypeId() {
+ public function testTargetEntityTypeId(): void {
$config = new ContentLanguageSettings([
'target_entity_type_id' => 'test_entity_type',
'target_bundle' => 'test_bundle',
@@ -133,7 +133,7 @@ class ContentLanguageSettingsUnitTest extends UnitTestCase {
/**
* @covers ::getTargetBundle
*/
- public function testTargetBundle() {
+ public function testTargetBundle(): void {
$config = new ContentLanguageSettings([
'target_entity_type_id' => 'test_entity_type',
'target_bundle' => 'test_bundle',
@@ -147,7 +147,7 @@ class ContentLanguageSettingsUnitTest extends UnitTestCase {
*
* @dataProvider providerDefaultLangcode
*/
- public function testDefaultLangcode(ContentLanguageSettings $config, $expected) {
+ public function testDefaultLangcode(ContentLanguageSettings $config, $expected): void {
$this->assertSame($expected, $config->getDefaultLangcode());
}
@@ -176,7 +176,7 @@ class ContentLanguageSettingsUnitTest extends UnitTestCase {
*
* @dataProvider providerLanguageAlterable
*/
- public function testLanguageAlterable(ContentLanguageSettings $config, $expected) {
+ public function testLanguageAlterable(ContentLanguageSettings $config, $expected): void {
$this->assertSame($expected, $config->isLanguageAlterable());
}
@@ -210,7 +210,7 @@ class ContentLanguageSettingsUnitTest extends UnitTestCase {
*
* @dataProvider providerIsDefaultConfiguration
*/
- public function testIsDefaultConfiguration(ContentLanguageSettings $config, $expected) {
+ public function testIsDefaultConfiguration(ContentLanguageSettings $config, $expected): void {
$this->assertSame($expected, $config->isDefaultConfiguration());
}
@@ -244,7 +244,7 @@ class ContentLanguageSettingsUnitTest extends UnitTestCase {
*
* @dataProvider providerLoadByEntityTypeBundle
*/
- public function testLoadByEntityTypeBundle($config_id, ?ContentLanguageSettings $existing_config, $expected_langcode, $expected_language_alterable) {
+ public function testLoadByEntityTypeBundle($config_id, ?ContentLanguageSettings $existing_config, $expected_langcode, $expected_language_alterable): void {
[$type, $bundle] = explode('.', $config_id);
$nullConfig = new ContentLanguageSettings([
diff --git a/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php b/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php
index 5cea18f24ed..c08b0b97057 100644
--- a/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php
+++ b/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php
@@ -69,7 +69,7 @@ class LanguageNegotiationUrlTest extends UnitTestCase {
*
* @dataProvider providerTestPathPrefix
*/
- public function testPathPrefix($prefix, $prefixes, $expected_langcode) {
+ public function testPathPrefix($prefix, $prefixes, $expected_langcode): void {
$this->languageManager->expects($this->any())
->method('getCurrentLanguage')
->willReturn($this->languages[(in_array($expected_langcode, [
@@ -161,7 +161,7 @@ class LanguageNegotiationUrlTest extends UnitTestCase {
*
* @dataProvider providerNeutralLanguages
*/
- public function testNeutralLanguages($langcode, $expected_langcode) {
+ public function testNeutralLanguages($langcode, $expected_langcode): void {
if ($expected_langcode) {
$this->languageManager->expects($this->once())
->method('getCurrentLanguage')
@@ -226,7 +226,7 @@ class LanguageNegotiationUrlTest extends UnitTestCase {
*
* @dataProvider providerTestDomain
*/
- public function testDomain($http_host, $domains, $expected_langcode) {
+ public function testDomain($http_host, $domains, $expected_langcode): void {
$this->languageManager->expects($this->any())
->method('getCurrentLanguage')
->willReturn($this->languages['en']);
diff --git a/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php b/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php
index f69026f7f98..2f242e198cb 100644
--- a/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php
+++ b/core/modules/language/tests/src/Unit/Menu/LanguageLocalTasksTest.php
@@ -28,7 +28,7 @@ class LanguageLocalTasksTest extends LocalTaskIntegrationTestBase {
*
* @dataProvider getLanguageAdminOverviewRoutes
*/
- public function testLanguageAdminLocalTasks($route, $expected) {
+ public function testLanguageAdminLocalTasks($route, $expected): void {
$this->assertLocalTasks($route, $expected);
}
@@ -45,7 +45,7 @@ class LanguageLocalTasksTest extends LocalTaskIntegrationTestBase {
/**
* Tests language edit local tasks existence.
*/
- public function testLanguageEditLocalTasks() {
+ public function testLanguageEditLocalTasks(): void {
$this->assertLocalTasks('entity.configurable_language.edit_form', [
0 => ['entity.configurable_language.edit_form'],
]);
diff --git a/core/modules/language/tests/src/Unit/Plugin/LanguageNegotiation/LanguageNegotiationContentEntityTest.php b/core/modules/language/tests/src/Unit/Plugin/LanguageNegotiation/LanguageNegotiationContentEntityTest.php
index e6232116946..4ae5949a71a 100644
--- a/core/modules/language/tests/src/Unit/Plugin/LanguageNegotiation/LanguageNegotiationContentEntityTest.php
+++ b/core/modules/language/tests/src/Unit/Plugin/LanguageNegotiation/LanguageNegotiationContentEntityTest.php
@@ -97,7 +97,7 @@ class LanguageNegotiationContentEntityTest extends LanguageNegotiationTestBase {
/**
* @covers ::getLangcode
*/
- public function testGetLangcode() {
+ public function testGetLangcode(): void {
$languageNegotiationContentEntity = $this->createLanguageNegotiationPlugin();
// Case 1: Empty request.
@@ -131,7 +131,7 @@ class LanguageNegotiationContentEntityTest extends LanguageNegotiationTestBase {
/**
* @covers ::processOutbound
*/
- public function testProcessOutbound() {
+ public function testProcessOutbound(): void {
// Case 1: Not all processing conditions are met.
$languageNegotiationContentEntityMock = $this->createPartialMock($this->getPluginClass(),
@@ -208,7 +208,7 @@ class LanguageNegotiationContentEntityTest extends LanguageNegotiationTestBase {
/**
* @covers ::getLanguageSwitchLinks
*/
- public function testGetLanguageSwitchLinks() {
+ public function testGetLanguageSwitchLinks(): void {
$languageNegotiationContentEntity = $this->createLanguageNegotiationPlugin();
$languageNegotiationContentEntity->setLanguageManager($this->languageManager);
diff --git a/core/modules/language/tests/src/Unit/process/LanguageDomainsTest.php b/core/modules/language/tests/src/Unit/process/LanguageDomainsTest.php
index 87f69db6235..29f803d34db 100644
--- a/core/modules/language/tests/src/Unit/process/LanguageDomainsTest.php
+++ b/core/modules/language/tests/src/Unit/process/LanguageDomainsTest.php
@@ -39,7 +39,7 @@ class LanguageDomainsTest extends MigrateProcessTestCase {
/**
* @covers ::transform
*/
- public function testTransform() {
+ public function testTransform(): void {
$source = [
['language' => 'en', 'domain' => ''],
['language' => 'fr', 'domain' => 'fr.example.com'],
diff --git a/core/modules/language/tests/src/Unit/process/LanguageNegotiationTest.php b/core/modules/language/tests/src/Unit/process/LanguageNegotiationTest.php
index ef5d2921bea..3b96ea68aa0 100644
--- a/core/modules/language/tests/src/Unit/process/LanguageNegotiationTest.php
+++ b/core/modules/language/tests/src/Unit/process/LanguageNegotiationTest.php
@@ -25,7 +25,7 @@ class LanguageNegotiationTest extends MigrateProcessTestCase {
/**
* Tests successful transformation without weights.
*/
- public function testTransformWithWeights() {
+ public function testTransformWithWeights(): void {
$source = [
[
'locale-url' => [],
@@ -59,7 +59,7 @@ class LanguageNegotiationTest extends MigrateProcessTestCase {
/**
* Tests successful transformation without weights.
*/
- public function testTransformWithoutWeights() {
+ public function testTransformWithoutWeights(): void {
$source = [
[
'locale-url' => [],
@@ -79,7 +79,7 @@ class LanguageNegotiationTest extends MigrateProcessTestCase {
/**
* Tests string input.
*/
- public function testStringInput() {
+ public function testStringInput(): void {
$this->plugin = new LanguageNegotiation([], 'map', []);
$this->expectException(MigrateException::class);
$this->expectExceptionMessage('The input should be an array');
diff --git a/core/modules/language/tests/src/Unit/process/LanguageTypesTest.php b/core/modules/language/tests/src/Unit/process/LanguageTypesTest.php
index 5be238b3529..21b9cdd1a97 100644
--- a/core/modules/language/tests/src/Unit/process/LanguageTypesTest.php
+++ b/core/modules/language/tests/src/Unit/process/LanguageTypesTest.php
@@ -17,7 +17,7 @@ class LanguageTypesTest extends MigrateProcessTestCase {
/**
* Tests successful transformation of all language types.
*/
- public function testTransformAll() {
+ public function testTransformAll(): void {
$this->plugin = new LanguageTypes([], 'map', []);
$source = [
'language' => TRUE,
@@ -36,7 +36,7 @@ class LanguageTypesTest extends MigrateProcessTestCase {
/**
* Tests successful transformation of configurable language types.
*/
- public function testTransformConfigurable() {
+ public function testTransformConfigurable(): void {
$this->plugin = new LanguageTypes(['filter_configurable' => TRUE], 'map', []);
$source = [
'language' => TRUE,
@@ -53,7 +53,7 @@ class LanguageTypesTest extends MigrateProcessTestCase {
/**
* Tests string input.
*/
- public function testStringInput() {
+ public function testStringInput(): void {
$this->plugin = new LanguageTypes([], 'map', []);
$this->expectException(MigrateException::class);
$this->expectExceptionMessage('The input should be an array');
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php
index 6acfda1cb8b..ba088036bfd 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php
@@ -72,7 +72,7 @@ class LayoutBuilderAccessTest extends BrowserTestBase {
* @param array $permission_dependencies
* An array of expected permission dependencies.
*/
- public function testAccessWithBundles(array $permissions, $default_access, $non_editable_access, $editable_access, array $permission_dependencies) {
+ public function testAccessWithBundles(array $permissions, $default_access, $non_editable_access, $editable_access, array $permission_dependencies): void {
$permissions[] = 'edit own bundle_with_section_field content';
$permissions[] = 'access content';
$user = $this->drupalCreateUser($permissions);
@@ -187,7 +187,7 @@ class LayoutBuilderAccessTest extends BrowserTestBase {
*
* @dataProvider providerTestAccessWithoutBundles
*/
- public function testAccessWithoutBundles(array $permissions, $default_access, $non_editable_access, $editable_access, array $permission_dependencies) {
+ public function testAccessWithoutBundles(array $permissions, $default_access, $non_editable_access, $editable_access, array $permission_dependencies): void {
$permissions[] = 'access user profiles';
$user = $this->drupalCreateUser($permissions);
$this->drupalLogin($user);
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderBlocksTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderBlocksTest.php
index 1c150d3ea99..89395413a82 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderBlocksTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderBlocksTest.php
@@ -18,7 +18,7 @@ class LayoutBuilderBlocksTest extends LayoutBuilderTestBase {
/**
* Tests that block plugins can define custom attributes and contextual links.
*/
- public function testPluginsProvidingCustomAttributesAndContextualLinks() {
+ public function testPluginsProvidingCustomAttributesAndContextualLinks(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -49,7 +49,7 @@ class LayoutBuilderBlocksTest extends LayoutBuilderTestBase {
/**
* Tests preview-aware layout & block plugins.
*/
- public function testPreviewAwarePlugins() {
+ public function testPreviewAwarePlugins(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -83,7 +83,7 @@ class LayoutBuilderBlocksTest extends LayoutBuilderTestBase {
/**
* {@inheritdoc}
*/
- public function testLayoutBuilderChooseBlocksAlter() {
+ public function testLayoutBuilderChooseBlocksAlter(): void {
// See layout_builder_test_plugin_filter_block__layout_builder_alter().
$assert_session = $this->assertSession();
@@ -139,7 +139,7 @@ class LayoutBuilderBlocksTest extends LayoutBuilderTestBase {
/**
* Tests that deleting a View block used in Layout Builder works.
*/
- public function testDeletedView() {
+ public function testDeletedView(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -181,7 +181,7 @@ class LayoutBuilderBlocksTest extends LayoutBuilderTestBase {
* @see \Drupal\Core\Render\PreviewFallbackInterface::getPreviewFallbackString()
* @see \Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray::onBuildRender()
*/
- public function testBlockPlaceholder() {
+ public function testBlockPlaceholder(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -222,7 +222,7 @@ class LayoutBuilderBlocksTest extends LayoutBuilderTestBase {
/**
* Tests the ability to use a specified block label for field blocks.
*/
- public function testFieldBlockLabel() {
+ public function testFieldBlockLabel(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -262,7 +262,7 @@ class LayoutBuilderBlocksTest extends LayoutBuilderTestBase {
/**
* Tests the Block UI when Layout Builder is installed.
*/
- public function testBlockUiListing() {
+ public function testBlockUiListing(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderDefaultValuesTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderDefaultValuesTest.php
index fe7210c6081..9d099dfe9c3 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderDefaultValuesTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderDefaultValuesTest.php
@@ -99,7 +99,7 @@ class LayoutBuilderDefaultValuesTest extends BrowserTestBase {
/**
* Tests display of default field values.
*/
- public function testDefaultValues() {
+ public function testDefaultValues(): void {
// Begin by viewing nodes with Layout Builder disabled.
$this->assertNodeWithValues();
$this->assertNodeWithDefaultValues();
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderFieldBlockEntityReferenceCacheTagsTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderFieldBlockEntityReferenceCacheTagsTest.php
index 1bb93b2793a..0599f0f1d55 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderFieldBlockEntityReferenceCacheTagsTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderFieldBlockEntityReferenceCacheTagsTest.php
@@ -72,7 +72,7 @@ class LayoutBuilderFieldBlockEntityReferenceCacheTagsTest extends BrowserTestBas
/**
* Tests cache tags on field block for entity reference field.
*/
- public function testEntityReferenceFieldBlockCaching() {
+ public function testEntityReferenceFieldBlockCaching(): void {
$assert_session = $this->assertSession();
// Create two nodes, one of the referenced content type and one of the
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderFormModeTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderFormModeTest.php
index 246b7c5b65b..4226d275e96 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderFormModeTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderFormModeTest.php
@@ -95,7 +95,7 @@ class LayoutBuilderFormModeTest extends BrowserTestBase {
/**
* Tests that the 'Discard changes' button skips validation and ignores input.
*/
- public function testDiscardValidation() {
+ public function testDiscardValidation(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderLocalTaskTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderLocalTaskTest.php
index 546c602ac99..fe5bcbaaba1 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderLocalTaskTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderLocalTaskTest.php
@@ -40,7 +40,7 @@ class LayoutBuilderLocalTaskTest extends BrowserTestBase {
/**
* Tests the cacheability of local tasks with Layout Builder module installed.
*/
- public function testLocalTaskLayoutBuilderInstalledCacheability() {
+ public function testLocalTaskLayoutBuilderInstalledCacheability(): void {
// Create only one bundle and do not enable layout builder on its display.
$this->drupalCreateContentType([
'type' => 'bundle_no_lb_display',
@@ -68,7 +68,7 @@ class LayoutBuilderLocalTaskTest extends BrowserTestBase {
/**
* Tests the cacheability of local tasks with multiple content types.
*/
- public function testLocalTaskMultipleContentTypesCacheability() {
+ public function testLocalTaskMultipleContentTypesCacheability(): void {
// Test when there are two content types, one with a display having Layout
// Builder enabled with overrides, and another with display not having
// Layout Builder enabled.
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderOverridesTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderOverridesTest.php
index 13966bc3a80..31bd551edf3 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderOverridesTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderOverridesTest.php
@@ -18,7 +18,7 @@ class LayoutBuilderOverridesTest extends LayoutBuilderTestBase {
/**
* Tests deleting a field in-use by an overridden layout.
*/
- public function testDeleteField() {
+ public function testDeleteField(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -51,7 +51,7 @@ class LayoutBuilderOverridesTest extends LayoutBuilderTestBase {
/**
* Tests Layout Builder overrides without access to edit the default layout.
*/
- public function testOverridesWithoutDefaultsAccess() {
+ public function testOverridesWithoutDefaultsAccess(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -71,7 +71,7 @@ class LayoutBuilderOverridesTest extends LayoutBuilderTestBase {
/**
* Tests Layout Builder overrides without Field UI installed.
*/
- public function testOverridesWithoutFieldUi() {
+ public function testOverridesWithoutFieldUi(): void {
$this->container->get('module_installer')->uninstall(['field_ui']);
$assert_session = $this->assertSession();
@@ -95,7 +95,7 @@ class LayoutBuilderOverridesTest extends LayoutBuilderTestBase {
/**
* Tests functionality of Layout Builder for overrides.
*/
- public function testOverrides() {
+ public function testOverrides(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -142,7 +142,7 @@ class LayoutBuilderOverridesTest extends LayoutBuilderTestBase {
/**
* Tests a custom alter of the overrides form.
*/
- public function testOverridesFormAlter() {
+ public function testOverridesFormAlter(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -177,7 +177,7 @@ class LayoutBuilderOverridesTest extends LayoutBuilderTestBase {
/**
* Tests removing all sections from overrides and defaults.
*/
- public function testRemovingAllSections() {
+ public function testRemovingAllSections(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderPrepareLayoutTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderPrepareLayoutTest.php
index 2974304ae9e..bd47f0218fc 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderPrepareLayoutTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderPrepareLayoutTest.php
@@ -75,7 +75,7 @@ class LayoutBuilderPrepareLayoutTest extends BrowserTestBase {
*
* @see \Drupal\layout_builder_element_test\EventSubscriber\TestPrepareLayout;
*/
- public function testAlterPrepareLayout() {
+ public function testAlterPrepareLayout(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderSectionStorageTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderSectionStorageTest.php
index e65a14fab70..4f8dda899ca 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderSectionStorageTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderSectionStorageTest.php
@@ -51,7 +51,7 @@ class LayoutBuilderSectionStorageTest extends BrowserTestBase {
*
* @see \Drupal\layout_builder_test\Plugin\SectionStorage\TestStateBasedSectionStorage
*/
- public function testRenderByContextAwarePluginDelegate() {
+ public function testRenderByContextAwarePluginDelegate(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php
index e9608bff6c5..1f62f0a38bb 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php
@@ -22,7 +22,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* Tests the Layout Builder UI for an entity type without a bundle.
*/
- public function testNonBundleEntityType() {
+ public function testNonBundleEntityType(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -56,7 +56,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* Tests that the Layout Builder preserves entity values.
*/
- public function testPreserverEntityValues() {
+ public function testPreserverEntityValues(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -103,7 +103,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* {@inheritdoc}
*/
- public function testLayoutBuilderUi() {
+ public function testLayoutBuilderUi(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -302,7 +302,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* Test decorating controller.entity_form while layout_builder is installed.
*/
- public function testHtmlEntityFormControllerDecoration() {
+ public function testHtmlEntityFormControllerDecoration(): void {
$assert_session = $this->assertSession();
$this->drupalLogin($this->drupalCreateUser([
@@ -319,7 +319,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* Tests that layout builder checks entity view access.
*/
- public function testAccess() {
+ public function testAccess(): void {
$assert_session = $this->assertSession();
$this->drupalLogin($this->drupalCreateUser([
@@ -353,7 +353,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* Tests that component's dependencies are respected during removal.
*/
- public function testPluginDependencies() {
+ public function testPluginDependencies(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -431,7 +431,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* Tests preview-aware templates.
*/
- public function testPreviewAwareTemplates() {
+ public function testPreviewAwareTemplates(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -461,7 +461,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* Tests that extra fields work before and after enabling Layout Builder.
*/
- public function testExtraFields() {
+ public function testExtraFields(): void {
$assert_session = $this->assertSession();
$this->drupalLogin($this->drupalCreateUser([
@@ -505,7 +505,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* Tests loading a pending revision in the Layout Builder UI.
*/
- public function testPendingRevision() {
+ public function testPendingRevision(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -540,7 +540,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* Tests that hook_form_alter() has access to the Layout Builder info.
*/
- public function testFormAlter() {
+ public function testFormAlter(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -574,7 +574,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* Tests the functionality of custom section labels.
*/
- public function testSectionLabels() {
+ public function testSectionLabels(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -599,7 +599,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* Tests that layouts can be context-aware.
*/
- public function testContextAwareLayouts() {
+ public function testContextAwareLayouts(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -633,7 +633,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* Tests that sections can provide custom attributes.
*/
- public function testCustomSectionAttributes() {
+ public function testCustomSectionAttributes(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -655,7 +655,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* Tests the expected breadcrumbs of the Layout Builder UI.
*/
- public function testBreadcrumb() {
+ public function testBreadcrumb(): void {
$page = $this->getSession()->getPage();
$this->drupalPlaceBlock('system_breadcrumb_block');
@@ -695,7 +695,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
*
* @see \Drupal\layout_builder_test\Plugin\SectionStorage\SimpleConfigSectionStorage
*/
- public function testSimpleConfigBasedLayout() {
+ public function testSimpleConfigBasedLayout(): void {
$assert_session = $this->assertSession();
$this->drupalLogin($this->createUser(['configure any layout']));
@@ -722,7 +722,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* Tests removing section without layout label configuration.
*/
- public function testRemovingSectionWithoutLayoutLabel() {
+ public function testRemovingSectionWithoutLayoutLabel(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -786,7 +786,7 @@ class LayoutBuilderTest extends LayoutBuilderTestBase {
/**
* Tests the Layout Builder UI with a context defined at runtime.
*/
- public function testLayoutBuilderContexts() {
+ public function testLayoutBuilderContexts(): void {
$node_url = 'node/1';
$assert_session = $this->assertSession();
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderThemeSuggestionsTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderThemeSuggestionsTest.php
index 3662f6dbdfe..b107ec4f9b4 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderThemeSuggestionsTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderThemeSuggestionsTest.php
@@ -60,7 +60,7 @@ class LayoutBuilderThemeSuggestionsTest extends BrowserTestBase {
/**
* Tests alterations of the layout list via preprocess functions.
*/
- public function testLayoutListSuggestion() {
+ public function testLayoutListSuggestion(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -72,7 +72,7 @@ class LayoutBuilderThemeSuggestionsTest extends BrowserTestBase {
/**
* Tests that of view mode specific field templates are suggested.
*/
- public function testFieldBlockViewModeTemplates() {
+ public function testFieldBlockViewModeTemplates(): void {
$assert_session = $this->assertSession();
$this->drupalGet('node/1');
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php
index 2b93ef08df6..a64dd16ac5b 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php
@@ -51,7 +51,7 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
/**
* Tests that layout overrides work when created after a translation.
*/
- public function testTranslationBeforeLayoutOverride() {
+ public function testTranslationBeforeLayoutOverride(): void {
$assert_session = $this->assertSession();
$this->addEntityTranslation();
@@ -91,7 +91,7 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
/**
* Tests that layout overrides work when created before a translation.
*/
- public function testLayoutOverrideBeforeTranslation() {
+ public function testLayoutOverrideBeforeTranslation(): void {
$assert_session = $this->assertSession();
$entity_url = $this->entity->toUrl()->toString();
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderViewModeTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderViewModeTest.php
index 95ac92066e7..68f7d83f622 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderViewModeTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderViewModeTest.php
@@ -20,7 +20,7 @@ class LayoutBuilderViewModeTest extends LayoutBuilderTestBase {
/**
* Tests that a non-default view mode works as expected.
*/
- public function testNonDefaultViewMode() {
+ public function testNonDefaultViewMode(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -77,7 +77,7 @@ class LayoutBuilderViewModeTest extends LayoutBuilderTestBase {
*
* @see \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage::getDefaultSectionStorage()
*/
- public function testLayoutBuilderUiFullViewMode() {
+ public function testLayoutBuilderUiFullViewMode(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -253,7 +253,7 @@ class LayoutBuilderViewModeTest extends LayoutBuilderTestBase {
/**
* Ensures that one bundle doesn't interfere with another bundle.
*/
- public function testFullViewModeMultipleBundles() {
+ public function testFullViewModeMultipleBundles(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutDisplayTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutDisplayTest.php
index 1a2291821b7..085f08af4bc 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutDisplayTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutDisplayTest.php
@@ -48,7 +48,7 @@ class LayoutDisplayTest extends BrowserTestBase {
/**
* Tests the interaction between multiple view modes.
*/
- public function testMultipleViewModes() {
+ public function testMultipleViewModes(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
$field_ui_prefix = 'admin/structure/types/manage/bundle_with_section_field/display';
diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php
index bb32a834388..3988454611c 100644
--- a/core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php
@@ -171,7 +171,7 @@ class LayoutSectionTest extends BrowserTestBase {
*
* @dataProvider providerTestLayoutSectionFormatter
*/
- public function testLayoutSectionFormatter($layout_data, $expected_selector, $expected_content, $expected_cache_contexts, $expected_cache_tags, $expected_dynamic_cache) {
+ public function testLayoutSectionFormatter($layout_data, $expected_selector, $expected_content, $expected_cache_contexts, $expected_cache_tags, $expected_dynamic_cache): void {
$node = $this->createSectionNode($layout_data);
$canonical_url = $node->toUrl('canonical');
@@ -185,7 +185,7 @@ class LayoutSectionTest extends BrowserTestBase {
/**
* Tests the access checking of the section formatter.
*/
- public function testLayoutSectionFormatterAccess() {
+ public function testLayoutSectionFormatterAccess(): void {
$node = $this->createSectionNode([
[
'section' => new Section('layout_onecol', [], [
@@ -213,7 +213,7 @@ class LayoutSectionTest extends BrowserTestBase {
/**
* Ensures that the entity title is displayed.
*/
- public function testLayoutPageTitle() {
+ public function testLayoutPageTitle(): void {
$this->drupalPlaceBlock('page_title_block');
$node = $this->createSectionNode([]);
@@ -225,7 +225,7 @@ class LayoutSectionTest extends BrowserTestBase {
/**
* Tests that no Layout link shows without a section field.
*/
- public function testLayoutUrlNoSectionField() {
+ public function testLayoutUrlNoSectionField(): void {
$node = $this->createNode([
'type' => 'bundle_without_section_field',
'title' => 'The node title',
@@ -244,7 +244,7 @@ class LayoutSectionTest extends BrowserTestBase {
/**
* Tests that deleting a field removes it from the layout.
*/
- public function testLayoutDeletingField() {
+ public function testLayoutDeletingField(): void {
$assert_session = $this->assertSession();
$this->drupalGet('/admin/structure/types/manage/bundle_with_section_field/display/default/layout');
@@ -268,7 +268,7 @@ class LayoutSectionTest extends BrowserTestBase {
/**
* Tests that deleting a bundle removes the layout.
*/
- public function testLayoutDeletingBundle() {
+ public function testLayoutDeletingBundle(): void {
$assert_session = $this->assertSession();
$display = LayoutBuilderEntityViewDisplay::load('node.bundle_with_section_field.default');
diff --git a/core/modules/layout_builder/tests/src/Functional/Rest/OverrideSectionsTest.php b/core/modules/layout_builder/tests/src/Functional/Rest/OverrideSectionsTest.php
index 79df58753b8..de7257379b2 100644
--- a/core/modules/layout_builder/tests/src/Functional/Rest/OverrideSectionsTest.php
+++ b/core/modules/layout_builder/tests/src/Functional/Rest/OverrideSectionsTest.php
@@ -40,7 +40,7 @@ class OverrideSectionsTest extends LayoutRestTestBase {
/**
* Tests that the layout override field is not normalized.
*/
- public function testOverrideField() {
+ public function testOverrideField(): void {
$this->assertCount(1, $this->node->get(OverridesSectionStorage::FIELD_NAME));
// Make a GET request and ensure override field is not included.
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/AjaxBlockTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/AjaxBlockTest.php
index 199ee239dfe..6e72c8b572c 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/AjaxBlockTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/AjaxBlockTest.php
@@ -58,7 +58,7 @@ class AjaxBlockTest extends WebDriverTestBase {
/**
* Tests configuring a field block for a user field.
*/
- public function testAddAjaxBlock() {
+ public function testAddAjaxBlock(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFilterTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFilterTest.php
index 0921ce8384b..c80d3422610 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFilterTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFilterTest.php
@@ -53,7 +53,7 @@ class BlockFilterTest extends WebDriverTestBase {
/**
* Tests block filter.
*/
- public function testBlockFilter() {
+ public function testBlockFilter(): void {
$assert_session = $this->assertSession();
$session = $this->getSession();
$page = $session->getPage();
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php
index 1fd7fe80e79..c07b69de1ef 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php
@@ -48,7 +48,7 @@ class BlockFormMessagesTest extends WebDriverTestBase {
/**
* Tests that validation messages are shown on the block form.
*/
- public function testValidationMessage() {
+ public function testValidationMessage(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/ContentPreviewToggleTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/ContentPreviewToggleTest.php
index 6e9cc44793f..b1bb5c8706e 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/ContentPreviewToggleTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/ContentPreviewToggleTest.php
@@ -56,7 +56,7 @@ class ContentPreviewToggleTest extends WebDriverTestBase {
/**
* Tests the content preview toggle.
*/
- public function testContentPreviewToggle() {
+ public function testContentPreviewToggle(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
$links_field_placeholder_label = '"Links" field';
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php
index 335af57ede2..3c6619b7480 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php
@@ -71,7 +71,7 @@ class ContextualLinksTest extends WebDriverTestBase {
/**
* Tests that the contextual links inside Layout Builder are removed.
*/
- public function testContextualLinks() {
+ public function testContextualLinks(): void {
$page = $this->getSession()->getPage();
$this->drupalGet('node/1/layout');
@@ -99,7 +99,7 @@ class ContextualLinksTest extends WebDriverTestBase {
/**
* Tests that contextual links outside the layout are removed.
*/
- public function testContextualLinksOutsideLayout() {
+ public function testContextualLinksOutsideLayout(): void {
$assert_session = $this->assertSession();
$this->drupalPlaceBlock('system_powered_by_block', ['id' => 'global_block']);
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/FieldBlockTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/FieldBlockTest.php
index d4a574d4b33..888c97274b6 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/FieldBlockTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/FieldBlockTest.php
@@ -67,7 +67,7 @@ class FieldBlockTest extends WebDriverTestBase {
/**
* Tests configuring a field block for a user field.
*/
- public function testUserFieldBlock() {
+ public function testUserFieldBlock(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -143,7 +143,7 @@ class FieldBlockTest extends WebDriverTestBase {
/**
* Tests configuring a field block that uses #states.
*/
- public function testStatesFieldBlock() {
+ public function testStatesFieldBlock(): void {
$page = $this->getSession()->getPage();
$timestamp_field_storage = FieldStorageConfig::create([
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php
index f0d64fbf3b2..a006aa29d6a 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php
@@ -63,7 +63,7 @@ class InlineBlockPrivateFilesTest extends InlineBlockTestBase {
/**
* Tests access to private files added to inline blocks in the layout builder.
*/
- public function testPrivateFiles() {
+ public function testPrivateFiles(): void {
$assert_session = $this->assertSession();
LayoutBuilderEntityViewDisplay::load('node.bundle_with_section_field.default')
->enableLayoutBuilder()
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
index 60310e0a959..c146e6bc955 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
@@ -30,7 +30,7 @@ class InlineBlockTest extends InlineBlockTestBase {
/**
* Tests adding and editing of inline blocks.
*/
- public function testInlineBlocks() {
+ public function testInlineBlocks(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -115,7 +115,7 @@ class InlineBlockTest extends InlineBlockTestBase {
*
* @dataProvider layoutNoSaveProvider
*/
- public function testNoLayoutSave($operation, $no_save_button_text, $confirm_button_text) {
+ public function testNoLayoutSave($operation, $no_save_button_text, $confirm_button_text): void {
$this->drupalLogin($this->drupalCreateUser([
'access contextual links',
'configure any layout',
@@ -204,7 +204,7 @@ class InlineBlockTest extends InlineBlockTestBase {
/**
* Tests entity blocks revisioning.
*/
- public function testInlineBlocksRevisioning() {
+ public function testInlineBlocksRevisioning(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -271,7 +271,7 @@ class InlineBlockTest extends InlineBlockTestBase {
/**
* Tests entity blocks revisioning.
*/
- public function testInlineBlocksRevisioningIntegrity() {
+ public function testInlineBlocksRevisioningIntegrity(): void {
$this->drupalLogin($this->drupalCreateUser([
'access contextual links',
'configure any layout',
@@ -359,7 +359,7 @@ class InlineBlockTest extends InlineBlockTestBase {
/**
* Tests that entity blocks deleted correctly.
*/
- public function testDeletion() {
+ public function testDeletion(): void {
/** @var \Drupal\Core\Cron $cron */
$cron = \Drupal::service('cron');
/** @var \Drupal\layout_builder\InlineBlockUsageInterface $usage */
@@ -488,7 +488,7 @@ class InlineBlockTest extends InlineBlockTestBase {
*
* @see layout_builder_block_content_access()
*/
- public function testAccess() {
+ public function testAccess(): void {
$this->drupalLogin($this->drupalCreateUser([
'access contextual links',
'configure any layout',
@@ -532,7 +532,7 @@ class InlineBlockTest extends InlineBlockTestBase {
* @throws \Behat\Mink\Exception\ElementNotFoundException
* @throws \Behat\Mink\Exception\ExpectationException
*/
- public function testAddWorkFlow() {
+ public function testAddWorkFlow(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
$type_storage = $this->container->get('entity_type.manager')->getStorage('block_content_type');
@@ -597,7 +597,7 @@ class InlineBlockTest extends InlineBlockTestBase {
/**
* Tests the 'create and edit content blocks' permission to add a new block.
*/
- public function testAddInlineBlocksPermission() {
+ public function testAddInlineBlocksPermission(): void {
LayoutBuilderEntityViewDisplay::load('node.bundle_with_section_field.default')
->enableLayoutBuilder()
->setOverridable()
@@ -631,7 +631,7 @@ class InlineBlockTest extends InlineBlockTestBase {
/**
* Tests 'create and edit custom blocks' permission to edit an existing block.
*/
- public function testEditInlineBlocksPermission() {
+ public function testEditInlineBlocksPermission(): void {
LayoutBuilderEntityViewDisplay::load('node.bundle_with_section_field.default')
->enableLayoutBuilder()
@@ -675,7 +675,7 @@ class InlineBlockTest extends InlineBlockTestBase {
/**
* Test editing inline blocks when the parent has been reverted.
*/
- public function testInlineBlockParentRevert() {
+ public function testInlineBlockParentRevert(): void {
$this->drupalLogin($this->drupalCreateUser([
'access contextual links',
'configure any layout',
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/ItemLayoutFieldBlockTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/ItemLayoutFieldBlockTest.php
index 31b719df935..4bb6313816f 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/ItemLayoutFieldBlockTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/ItemLayoutFieldBlockTest.php
@@ -49,7 +49,7 @@ class ItemLayoutFieldBlockTest extends WebDriverTestBase {
/**
* Tests configuring a field block for a user field.
*/
- public function testAddAjaxBlock() {
+ public function testAddAjaxBlock(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php
index 82447cc665d..2ed6f0f2a1f 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php
@@ -93,7 +93,7 @@ class LayoutBuilderDisableInteractionsTest extends WebDriverTestBase {
/**
* Tests that forms and links are disabled in the Layout Builder preview.
*/
- public function testFormsLinksDisabled() {
+ public function testFormsLinksDisabled(): void {
// Resize window due to bug in Chromedriver when clicking on overlays over
// iFrames.
// @see https://bugs.chromium.org/p/chromedriver/issues/detail?id=2758
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderNestedFormUiTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderNestedFormUiTest.php
index 742548d5fcd..4c402fa013a 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderNestedFormUiTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderNestedFormUiTest.php
@@ -67,7 +67,7 @@ class LayoutBuilderNestedFormUiTest extends WebDriverTestBase {
/**
* Tests blocks containing forms can be successfully saved editing defaults.
*/
- public function testAddingFormBlocksToDefaults() {
+ public function testAddingFormBlocksToDefaults(): void {
$this->drupalLogin($this->drupalCreateUser([
'configure any layout',
'administer node display',
@@ -101,7 +101,7 @@ class LayoutBuilderNestedFormUiTest extends WebDriverTestBase {
/**
* Tests blocks containing forms can be successfully saved editing overrides.
*/
- public function testAddingFormBlocksToOverrides() {
+ public function testAddingFormBlocksToOverrides(): void {
$this->drupalLogin($this->drupalCreateUser([
'configure any layout',
'administer node display',
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderOptInTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderOptInTest.php
index d8a30accc29..e0664917c55 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderOptInTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderOptInTest.php
@@ -51,7 +51,7 @@ class LayoutBuilderOptInTest extends WebDriverTestBase {
/**
* Tests the interaction between the two layout checkboxes.
*/
- public function testCheckboxLogic() {
+ public function testCheckboxLogic(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -92,7 +92,7 @@ class LayoutBuilderOptInTest extends WebDriverTestBase {
/**
* Tests the expected default values for enabling Layout Builder.
*/
- public function testDefaultValues() {
+ public function testDefaultValues(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php
index 2c1f033522c..e5b81f7ddbd 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php
@@ -101,7 +101,7 @@ class LayoutBuilderTest extends WebDriverTestBase {
/**
* Tests the Layout Builder UI.
*/
- public function testLayoutBuilderUi() {
+ public function testLayoutBuilderUi(): void {
$layout_url = 'node/1/layout';
$node_url = 'node/1';
@@ -265,7 +265,7 @@ class LayoutBuilderTest extends WebDriverTestBase {
/**
* Tests configurable layouts.
*/
- public function testConfigurableLayoutSections() {
+ public function testConfigurableLayoutSections(): void {
$layout_url = 'node/1/layout';
\Drupal::entityTypeManager()
@@ -344,7 +344,7 @@ class LayoutBuilderTest extends WebDriverTestBase {
/**
* Tests bypassing the off-canvas dialog.
*/
- public function testLayoutNoDialog() {
+ public function testLayoutNoDialog(): void {
$layout_url = 'node/1/layout';
\Drupal::entityTypeManager()
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderToolbarTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderToolbarTest.php
index c55485cba79..5e0155ae06d 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderToolbarTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderToolbarTest.php
@@ -59,7 +59,7 @@ class LayoutBuilderToolbarTest extends WebDriverTestBase {
/**
* Tests the 'Back to site' link behaves with manage layout as admin page.
*/
- public function testBackToSiteLink() {
+ public function testBackToSiteLink(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php
index 7b6e8cb1e4f..5a11de6bdbd 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php
@@ -66,7 +66,7 @@ class LayoutBuilderUiTest extends WebDriverTestBase {
/**
* Tests that after removing sections reloading the page does not re-add them.
*/
- public function testReloadWithNoSections() {
+ public function testReloadWithNoSections(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -90,7 +90,7 @@ class LayoutBuilderUiTest extends WebDriverTestBase {
/**
* Tests the message indicating unsaved changes.
*/
- public function testUnsavedChangesMessage() {
+ public function testUnsavedChangesMessage(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -143,7 +143,7 @@ class LayoutBuilderUiTest extends WebDriverTestBase {
/**
* Tests that elements that open the dialog are properly highlighted.
*/
- public function testAddHighlights() {
+ public function testAddHighlights(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -255,7 +255,7 @@ class LayoutBuilderUiTest extends WebDriverTestBase {
/**
* Tests removing newly added extra field.
*/
- public function testNewExtraField() {
+ public function testNewExtraField(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php
index 88288c90fa5..716ac3fa066 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php
@@ -96,7 +96,7 @@ class MoveBlockFormTest extends WebDriverTestBase {
/**
* Tests moving a block.
*/
- public function testMoveBlock() {
+ public function testMoveBlock(): 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 d6570a9eae1..c7037f99391 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/TestMultiWidthLayoutsTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/TestMultiWidthLayoutsTest.php
@@ -51,7 +51,7 @@ class TestMultiWidthLayoutsTest extends WebDriverTestBase {
/**
* Tests changing the columns widths of a multi-width section.
*/
- public function testWidthChange() {
+ public function testWidthChange(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/layout_builder/tests/src/Kernel/DefaultsSectionStorageTest.php b/core/modules/layout_builder/tests/src/Kernel/DefaultsSectionStorageTest.php
index cf90f89f000..00055e4080b 100644
--- a/core/modules/layout_builder/tests/src/Kernel/DefaultsSectionStorageTest.php
+++ b/core/modules/layout_builder/tests/src/Kernel/DefaultsSectionStorageTest.php
@@ -64,7 +64,7 @@ class DefaultsSectionStorageTest extends KernelTestBase {
/**
* Tests installing defaults via config install.
*/
- public function testConfigInstall() {
+ public function testConfigInstall(): void {
/** @var \Drupal\layout_builder\Entity\LayoutEntityDisplayInterface $display */
$display = LayoutBuilderEntityViewDisplay::load('entity_test.bundle_with_extra_fields.default');
$section = $display->getSection(0);
@@ -89,7 +89,7 @@ class DefaultsSectionStorageTest extends KernelTestBase {
* @param array $section_data
* Data to store as the sections value for Layout Builder.
*/
- public function testAccess($expected, $operation, $is_enabled, array $section_data) {
+ public function testAccess($expected, $operation, $is_enabled, array $section_data): void {
$display = LayoutBuilderEntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
@@ -139,7 +139,7 @@ class DefaultsSectionStorageTest extends KernelTestBase {
/**
* @covers ::getContexts
*/
- public function testGetContexts() {
+ public function testGetContexts(): void {
$display = LayoutBuilderEntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
@@ -159,7 +159,7 @@ class DefaultsSectionStorageTest extends KernelTestBase {
/**
* @covers ::getContextsDuringPreview
*/
- public function testGetContextsDuringPreview() {
+ public function testGetContextsDuringPreview(): void {
$display = LayoutBuilderEntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
@@ -189,7 +189,7 @@ class DefaultsSectionStorageTest extends KernelTestBase {
/**
* @covers ::getTempstoreKey
*/
- public function testGetTempstoreKey() {
+ public function testGetTempstoreKey(): void {
$display = LayoutBuilderEntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
@@ -208,7 +208,7 @@ class DefaultsSectionStorageTest extends KernelTestBase {
/**
* Tests loading given a display.
*/
- public function testLoadFromDisplay() {
+ public function testLoadFromDisplay(): void {
$display = LayoutBuilderEntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
diff --git a/core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php b/core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php
index 22b1ffa203e..77c772f2014 100644
--- a/core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php
+++ b/core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php
@@ -62,7 +62,7 @@ class FieldBlockTest extends EntityKernelTestBase {
* @covers ::blockAccess
* @dataProvider providerTestBlockAccessNotAllowed
*/
- public function testBlockAccessEntityNotAllowed($expected, $entity_access) {
+ public function testBlockAccessEntityNotAllowed($expected, $entity_access): void {
$entity = $this->prophesize(FieldableEntityInterface::class);
$block = $this->getTestBlock($entity);
@@ -95,7 +95,7 @@ class FieldBlockTest extends EntityKernelTestBase {
*
* @covers ::blockAccess
*/
- public function testBlockAccessEntityAllowedNotFieldable() {
+ public function testBlockAccessEntityAllowedNotFieldable(): void {
$entity = $this->prophesize(EntityInterface::class);
$block = $this->getTestBlock($entity);
@@ -111,7 +111,7 @@ class FieldBlockTest extends EntityKernelTestBase {
*
* @covers ::blockAccess
*/
- public function testBlockAccessEntityAllowedNoField() {
+ public function testBlockAccessEntityAllowedNoField(): void {
$entity = $this->prophesize(FieldableEntityInterface::class);
$block = $this->getTestBlock($entity);
@@ -130,7 +130,7 @@ class FieldBlockTest extends EntityKernelTestBase {
* @covers ::blockAccess
* @dataProvider providerTestBlockAccessNotAllowed
*/
- public function testBlockAccessEntityAllowedFieldNotAllowed($expected, $field_access) {
+ public function testBlockAccessEntityAllowedFieldNotAllowed($expected, $field_access): void {
$entity = $this->prophesize(FieldableEntityInterface::class);
$block = $this->getTestBlock($entity);
@@ -154,7 +154,7 @@ class FieldBlockTest extends EntityKernelTestBase {
* @covers ::build
* @dataProvider providerTestBlockAccessEntityAllowedFieldHasValue
*/
- public function testBlockAccessEntityAllowedFieldHasValue($expected, $is_empty, $default_value) {
+ public function testBlockAccessEntityAllowedFieldHasValue($expected, $is_empty, $default_value): void {
$entity = $this->prophesize(FieldableEntityInterface::class);
$block = $this->getTestBlock($entity);
@@ -248,7 +248,7 @@ class FieldBlockTest extends EntityKernelTestBase {
* @covers ::build
* @dataProvider providerTestBuild
*/
- public function testBuild(PromiseInterface $promise, $expected_markup, $log_message = '', $log_arguments = []) {
+ public function testBuild(PromiseInterface $promise, $expected_markup, $log_message = '', $log_arguments = []): void {
$entity = $this->prophesize(FieldableEntityInterface::class);
$field = $this->prophesize(FieldItemListInterface::class);
$entity->get('the_field_name')->willReturn($field->reveal());
@@ -300,7 +300,7 @@ class FieldBlockTest extends EntityKernelTestBase {
/**
* @covers ::build
*/
- public function testBuildException() {
+ public function testBuildException(): void {
// In PHP 7.4 ReflectionClass cannot be serialized so this cannot be part of
// providerTestBuild().
$promise = new ThrowPromise(new \Exception('The exception message'));
@@ -317,7 +317,7 @@ class FieldBlockTest extends EntityKernelTestBase {
*
* @todo Remove in https://www.drupal.org/project/drupal/issues/2367555.
*/
- public function testBuildWithFormException() {
+ public function testBuildWithFormException(): void {
$field = $this->prophesize(FieldItemListInterface::class);
$field->view(Argument::type('array'))->willThrow(new EnforcedResponseException(new Response()));
diff --git a/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderBreadcrumbAlterTest.php b/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderBreadcrumbAlterTest.php
index e9f00be59e8..8fc56da0322 100644
--- a/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderBreadcrumbAlterTest.php
+++ b/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderBreadcrumbAlterTest.php
@@ -26,7 +26,7 @@ class LayoutBuilderBreadcrumbAlterTest extends EntityKernelTestBase {
/**
* Check that there are no errors when alter called with null route match.
*/
- public function testBreadcrumbAlterNullRouteMatch() {
+ public function testBreadcrumbAlterNullRouteMatch(): void {
$breadcrumb = new Breadcrumb();
$route_match = new NullRouteMatch();
layout_builder_system_breadcrumb_alter($breadcrumb, $route_match, []);
diff --git a/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php b/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php
index 49bf7e860a5..8e421a35ed3 100644
--- a/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php
+++ b/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php
@@ -38,7 +38,7 @@ class LayoutBuilderEntityViewDisplayTest extends SectionListTestBase {
/**
* Tests that configuration schema enforces valid values.
*/
- public function testInvalidConfiguration() {
+ public function testInvalidConfiguration(): void {
$this->expectException(SchemaIncompleteException::class);
$this->sectionList->getSection(0)->getComponent('10000000-0000-1000-a000-000000000000')->setConfiguration(['id' => 'foo', 'bar' => 'baz']);
$this->sectionList->save();
@@ -47,7 +47,7 @@ class LayoutBuilderEntityViewDisplayTest extends SectionListTestBase {
/**
* @dataProvider providerTestIsLayoutBuilderEnabled
*/
- public function testIsLayoutBuilderEnabled($expected, $view_mode, $enabled) {
+ public function testIsLayoutBuilderEnabled($expected, $view_mode, $enabled): void {
$display = LayoutBuilderEntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
@@ -80,7 +80,7 @@ class LayoutBuilderEntityViewDisplayTest extends SectionListTestBase {
/**
* Tests that setting overridable enables Layout Builder only when TRUE.
*/
- public function testSetOverridable() {
+ public function testSetOverridable(): void {
// Disable Layout Builder.
$this->sectionList->disableLayoutBuilder();
diff --git a/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderFieldLayoutCompatibilityTest.php b/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderFieldLayoutCompatibilityTest.php
index 60be029b204..613d76acbd4 100644
--- a/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderFieldLayoutCompatibilityTest.php
+++ b/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderFieldLayoutCompatibilityTest.php
@@ -35,7 +35,7 @@ class LayoutBuilderFieldLayoutCompatibilityTest extends LayoutBuilderCompatibili
/**
* Tests the compatibility of Layout Builder and Field Layout.
*/
- public function testCompatibility() {
+ public function testCompatibility(): void {
// Ensure that the configurable field is shown in the correct region and
// that the non-configurable field is shown outside the layout.
$expected_fields = [
diff --git a/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderInstallTest.php b/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderInstallTest.php
index d44056f28ba..6baa0f769d6 100644
--- a/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderInstallTest.php
+++ b/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderInstallTest.php
@@ -19,7 +19,7 @@ class LayoutBuilderInstallTest extends LayoutBuilderCompatibilityTestBase {
/**
* Tests the compatibility of Layout Builder with existing entity displays.
*/
- public function testCompatibility() {
+ public function testCompatibility(): void {
// Ensure that the fields are shown.
$expected_fields = [
'field field--name-name field--type-string field--label-hidden field__item',
diff --git a/core/modules/layout_builder/tests/src/Kernel/LayoutEntityHelperTraitTest.php b/core/modules/layout_builder/tests/src/Kernel/LayoutEntityHelperTraitTest.php
index d6da92d8e28..0c15a8c9a9f 100644
--- a/core/modules/layout_builder/tests/src/Kernel/LayoutEntityHelperTraitTest.php
+++ b/core/modules/layout_builder/tests/src/Kernel/LayoutEntityHelperTraitTest.php
@@ -81,7 +81,7 @@ class LayoutEntityHelperTraitTest extends KernelTestBase {
*
* @dataProvider providerTestGetSectionStorageForEntity
*/
- public function testGetSectionStorageForEntity($entity_type_id, $values, $expected_context_keys) {
+ public function testGetSectionStorageForEntity($entity_type_id, $values, $expected_context_keys): void {
$section_storage_manager = $this->prophesize(SectionStorageManagerInterface::class);
$section_storage_manager->load('')->willReturn(NULL);
$section_storage_manager->findByContext(Argument::cetera())->will(function ($arguments) {
@@ -185,7 +185,7 @@ class LayoutEntityHelperTraitTest extends KernelTestBase {
*
* @dataProvider providerTestOriginalEntityUsesDefaultStorage
*/
- public function testOriginalEntityUsesDefaultStorage($entity_storages, $is_new, $has_original, $expected) {
+ public function testOriginalEntityUsesDefaultStorage($entity_storages, $is_new, $has_original, $expected): void {
$this->assertFalse($is_new && $has_original);
$entity = EntityTest::create(['name' => 'updated']);
if (!$is_new) {
@@ -221,7 +221,7 @@ class LayoutEntityHelperTraitTest extends KernelTestBase {
/**
* @covers ::getEntitySections
*/
- public function testGetEntitySections() {
+ public function testGetEntitySections(): void {
$entity = EntityTest::create(['name' => 'updated']);
$section_storage_manager = $this->prophesize(SectionStorageManagerInterface::class);
$section_storage_manager->load('')->willReturn(NULL);
diff --git a/core/modules/layout_builder/tests/src/Kernel/LayoutSectionItemListTest.php b/core/modules/layout_builder/tests/src/Kernel/LayoutSectionItemListTest.php
index 6f0ea17f9dd..cc25a327cd7 100644
--- a/core/modules/layout_builder/tests/src/Kernel/LayoutSectionItemListTest.php
+++ b/core/modules/layout_builder/tests/src/Kernel/LayoutSectionItemListTest.php
@@ -56,7 +56,7 @@ class LayoutSectionItemListTest extends SectionListTestBase {
/**
* @covers ::equals
*/
- public function testEquals() {
+ public function testEquals(): void {
$this->sectionList->getSection(0)->setLayoutSettings(['foo' => 1]);
$second_section_storage = clone $this->sectionList;
@@ -69,7 +69,7 @@ class LayoutSectionItemListTest extends SectionListTestBase {
/**
* @covers ::equals
*/
- public function testEqualsNonSection() {
+ public function testEqualsNonSection(): void {
$list = $this->prophesize(FieldItemListInterface::class);
$this->assertFalse($this->sectionList->equals($list->reveal()));
}
diff --git a/core/modules/layout_builder/tests/src/Kernel/OverridesSectionStorageTest.php b/core/modules/layout_builder/tests/src/Kernel/OverridesSectionStorageTest.php
index 660137e60c4..d8d773134dc 100644
--- a/core/modules/layout_builder/tests/src/Kernel/OverridesSectionStorageTest.php
+++ b/core/modules/layout_builder/tests/src/Kernel/OverridesSectionStorageTest.php
@@ -73,7 +73,7 @@ class OverridesSectionStorageTest extends KernelTestBase {
* @param string[] $permissions
* An array of permissions to grant to the user.
*/
- public function testAccess($expected, $is_enabled, array $section_data, array $permissions) {
+ public function testAccess($expected, $is_enabled, array $section_data, array $permissions): void {
$display = LayoutBuilderEntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
@@ -174,7 +174,7 @@ class OverridesSectionStorageTest extends KernelTestBase {
/**
* @covers ::getContexts
*/
- public function testGetContexts() {
+ public function testGetContexts(): void {
$entity = EntityTest::create();
$entity->save();
@@ -193,7 +193,7 @@ class OverridesSectionStorageTest extends KernelTestBase {
/**
* @covers ::getContextsDuringPreview
*/
- public function testGetContextsDuringPreview() {
+ public function testGetContextsDuringPreview(): void {
$entity = EntityTest::create();
$entity->save();
@@ -212,7 +212,7 @@ class OverridesSectionStorageTest extends KernelTestBase {
/**
* @covers ::getDefaultSectionStorage
*/
- public function testGetDefaultSectionStorage() {
+ public function testGetDefaultSectionStorage(): void {
$entity = EntityTest::create();
$entity->save();
$this->plugin->setContext('entity', EntityContext::fromEntity($entity));
@@ -223,7 +223,7 @@ class OverridesSectionStorageTest extends KernelTestBase {
/**
* @covers ::getTempstoreKey
*/
- public function testGetTempstoreKey() {
+ public function testGetTempstoreKey(): void {
$entity = EntityTest::create();
$entity->save();
$this->plugin->setContext('entity', EntityContext::fromEntity($entity));
@@ -236,7 +236,7 @@ class OverridesSectionStorageTest extends KernelTestBase {
/**
* @covers ::deriveContextsFromRoute
*/
- public function testDeriveContextsFromRoute() {
+ public function testDeriveContextsFromRoute(): void {
$display = LayoutBuilderEntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
@@ -261,7 +261,7 @@ class OverridesSectionStorageTest extends KernelTestBase {
/**
* @covers ::isOverridden
*/
- public function testIsOverridden() {
+ public function testIsOverridden(): void {
$display = LayoutBuilderEntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
diff --git a/core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php b/core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php
index 5c13d9b59f5..f94e27d784f 100644
--- a/core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php
+++ b/core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php
@@ -62,7 +62,7 @@ abstract class SectionListTestBase extends EntityKernelTestBase {
/**
* Tests ::getSections().
*/
- public function testGetSections() {
+ public function testGetSections(): void {
$expected = [
new Section('layout_test_plugin', ['setting_1' => 'Default'], [
'10000000-0000-1000-a000-000000000000' => new SectionComponent('10000000-0000-1000-a000-000000000000', 'content', ['id' => 'foo']),
@@ -77,14 +77,14 @@ abstract class SectionListTestBase extends EntityKernelTestBase {
/**
* @covers ::getSection
*/
- public function testGetSection() {
+ public function testGetSection(): void {
$this->assertInstanceOf(Section::class, $this->sectionList->getSection(0));
}
/**
* @covers ::getSection
*/
- public function testGetSectionInvalidDelta() {
+ public function testGetSectionInvalidDelta(): void {
$this->expectException(\OutOfBoundsException::class);
$this->expectExceptionMessage('Invalid delta "2"');
$this->sectionList->getSection(2);
@@ -93,7 +93,7 @@ abstract class SectionListTestBase extends EntityKernelTestBase {
/**
* @covers ::insertSection
*/
- public function testInsertSection() {
+ public function testInsertSection(): void {
$expected = [
new Section('layout_test_plugin', ['setting_1' => 'Default'], [
'10000000-0000-1000-a000-000000000000' => new SectionComponent('10000000-0000-1000-a000-000000000000', 'content', ['id' => 'foo']),
@@ -111,7 +111,7 @@ abstract class SectionListTestBase extends EntityKernelTestBase {
/**
* @covers ::appendSection
*/
- public function testAppendSection() {
+ public function testAppendSection(): void {
$expected = [
new Section('layout_test_plugin', ['setting_1' => 'Default'], [
'10000000-0000-1000-a000-000000000000' => new SectionComponent('10000000-0000-1000-a000-000000000000', 'content', ['id' => 'foo']),
@@ -131,7 +131,7 @@ abstract class SectionListTestBase extends EntityKernelTestBase {
*
* @dataProvider providerTestRemoveAllSections
*/
- public function testRemoveAllSections($set_blank, $expected) {
+ public function testRemoveAllSections($set_blank, $expected): void {
if ($set_blank === NULL) {
$this->sectionList->removeAllSections();
}
@@ -155,7 +155,7 @@ abstract class SectionListTestBase extends EntityKernelTestBase {
/**
* @covers ::removeSection
*/
- public function testRemoveSection() {
+ public function testRemoveSection(): void {
$expected = [
new Section('layout_test_plugin', ['setting_1' => 'bar'], [
'20000000-0000-1000-a000-000000000000' => new SectionComponent('20000000-0000-1000-a000-000000000000', 'content', ['id' => 'foo']),
@@ -169,7 +169,7 @@ abstract class SectionListTestBase extends EntityKernelTestBase {
/**
* @covers ::removeSection
*/
- public function testRemoveMultipleSections() {
+ public function testRemoveMultipleSections(): void {
$expected = [
new Section('layout_builder_blank'),
];
@@ -182,7 +182,7 @@ abstract class SectionListTestBase extends EntityKernelTestBase {
/**
* Tests __clone().
*/
- public function testClone() {
+ public function testClone(): void {
$this->assertSame(['setting_1' => 'Default'], $this->sectionList->getSection(0)->getLayoutSettings());
$new_section_storage = clone $this->sectionList;
diff --git a/core/modules/layout_builder/tests/src/Kernel/SectionListTraitTest.php b/core/modules/layout_builder/tests/src/Kernel/SectionListTraitTest.php
index fc472b510d7..fcaa4c68870 100644
--- a/core/modules/layout_builder/tests/src/Kernel/SectionListTraitTest.php
+++ b/core/modules/layout_builder/tests/src/Kernel/SectionListTraitTest.php
@@ -26,7 +26,7 @@ class SectionListTraitTest extends SectionListTestBase {
/**
* @covers ::addBlankSection
*/
- public function testAddBlankSection() {
+ public function testAddBlankSection(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('A blank section must only be added to an empty list');
$this->sectionList->addBlankSection();
diff --git a/core/modules/layout_builder/tests/src/Kernel/TranslatableFieldTest.php b/core/modules/layout_builder/tests/src/Kernel/TranslatableFieldTest.php
index b372447cbbd..87d3ee0a2d1 100644
--- a/core/modules/layout_builder/tests/src/Kernel/TranslatableFieldTest.php
+++ b/core/modules/layout_builder/tests/src/Kernel/TranslatableFieldTest.php
@@ -66,7 +66,7 @@ class TranslatableFieldTest extends KernelTestBase {
/**
* Tests that sections on cleared when creating a new translation.
*/
- public function testSectionsClearedOnCreateTranslation() {
+ public function testSectionsClearedOnCreateTranslation(): void {
$section_data = [
new Section('layout_onecol', [], [
'10000000-0000-1000-a000-000000000000' => new SectionComponent('10000000-0000-1000-a000-000000000000', 'content', ['id' => 'foo']),
diff --git a/core/modules/layout_builder/tests/src/Unit/BlockComponentRenderArrayTest.php b/core/modules/layout_builder/tests/src/Unit/BlockComponentRenderArrayTest.php
index 10787a76cb5..464880254b1 100644
--- a/core/modules/layout_builder/tests/src/Unit/BlockComponentRenderArrayTest.php
+++ b/core/modules/layout_builder/tests/src/Unit/BlockComponentRenderArrayTest.php
@@ -74,7 +74,7 @@ class BlockComponentRenderArrayTest extends UnitTestCase {
*
* @dataProvider providerBlockTypes
*/
- public function testOnBuildRender($refinable_dependent_access) {
+ public function testOnBuildRender($refinable_dependent_access): void {
$contexts = [];
if ($refinable_dependent_access) {
$block = $this->prophesize(TestBlockPluginWithRefinableDependentAccessInterface::class)->willImplement(PreviewFallbackInterface::class);
@@ -148,7 +148,7 @@ class BlockComponentRenderArrayTest extends UnitTestCase {
*
* @dataProvider providerBlockTypes
*/
- public function testOnBuildRenderWithoutPreviewFallbackString($refinable_dependent_access) {
+ public function testOnBuildRenderWithoutPreviewFallbackString($refinable_dependent_access): void {
$contexts = [];
if ($refinable_dependent_access) {
$block = $this->prophesize(TestBlockPluginWithRefinableDependentAccessInterface::class);
@@ -221,7 +221,7 @@ class BlockComponentRenderArrayTest extends UnitTestCase {
*
* @dataProvider providerBlockTypes
*/
- public function testOnBuildRenderDenied($refinable_dependent_access) {
+ public function testOnBuildRenderDenied($refinable_dependent_access): void {
$contexts = [];
if ($refinable_dependent_access) {
$block = $this->prophesize(TestBlockPluginWithRefinableDependentAccessInterface::class);
@@ -279,7 +279,7 @@ class BlockComponentRenderArrayTest extends UnitTestCase {
*
* @dataProvider providerBlockTypes
*/
- public function testOnBuildRenderInPreview($refinable_dependent_access) {
+ public function testOnBuildRenderInPreview($refinable_dependent_access): void {
$contexts = [];
if ($refinable_dependent_access) {
$block = $this->prophesize(TestBlockPluginWithRefinableDependentAccessInterface::class)->willImplement(PreviewFallbackInterface::class);
@@ -350,7 +350,7 @@ class BlockComponentRenderArrayTest extends UnitTestCase {
/**
* @covers ::onBuildRender
*/
- public function testOnBuildRenderInPreviewEmptyBuild() {
+ public function testOnBuildRenderInPreviewEmptyBuild(): void {
$block = $this->prophesize(BlockPluginInterface::class)->willImplement(PreviewFallbackInterface::class);
$block->access($this->account->reveal(), TRUE)->shouldNotBeCalled();
@@ -412,7 +412,7 @@ class BlockComponentRenderArrayTest extends UnitTestCase {
/**
* @covers ::onBuildRender
*/
- public function testOnBuildRenderEmptyBuild() {
+ public function testOnBuildRenderEmptyBuild(): void {
$block = $this->prophesize(BlockPluginInterface::class);
$access_result = AccessResult::allowed();
$block->access($this->account->reveal(), TRUE)->willReturn($access_result)->shouldBeCalled();
@@ -457,7 +457,7 @@ class BlockComponentRenderArrayTest extends UnitTestCase {
/**
* @covers ::onBuildRender
*/
- public function testOnBuildRenderEmptyBuildWithCacheTags() {
+ public function testOnBuildRenderEmptyBuildWithCacheTags(): void {
$block = $this->prophesize(BlockPluginInterface::class);
$access_result = AccessResult::allowed();
$block->access($this->account->reveal(), TRUE)->willReturn($access_result)->shouldBeCalled();
@@ -502,7 +502,7 @@ class BlockComponentRenderArrayTest extends UnitTestCase {
/**
* @covers ::onBuildRender
*/
- public function testOnBuildRenderNoBlock() {
+ public function testOnBuildRenderNoBlock(): void {
$this->blockManager->createInstance('some_block_id', ['id' => 'some_block_id'])->willReturn(NULL);
$component = new SectionComponent('some-uuid', 'some-region', ['id' => 'some_block_id']);
diff --git a/core/modules/layout_builder/tests/src/Unit/DefaultsSectionStorageTest.php b/core/modules/layout_builder/tests/src/Unit/DefaultsSectionStorageTest.php
index 190110cda71..46b8de007a4 100644
--- a/core/modules/layout_builder/tests/src/Unit/DefaultsSectionStorageTest.php
+++ b/core/modules/layout_builder/tests/src/Unit/DefaultsSectionStorageTest.php
@@ -73,7 +73,7 @@ class DefaultsSectionStorageTest extends UnitTestCase {
* @covers ::getThirdPartySetting
* @covers ::setThirdPartySetting
*/
- public function testThirdPartySettings() {
+ public function testThirdPartySettings(): void {
$this->entityTypeManager->getDefinition('entity_view_display')->willReturn(new EntityType(['id' => 'entity_view_display']));
$container = new ContainerBuilder();
@@ -122,7 +122,7 @@ class DefaultsSectionStorageTest extends UnitTestCase {
* @param array $defaults
* The defaults to pass to ::extractEntityFromRoute().
*/
- public function testExtractEntityFromRoute($success, $expected_entity_id, $value, array $defaults) {
+ public function testExtractEntityFromRoute($success, $expected_entity_id, $value, array $defaults): void {
if ($expected_entity_id) {
$entity_storage = $this->prophesize(EntityStorageInterface::class);
$entity_storage->load($expected_entity_id)->willReturn('the_return_value');
@@ -194,7 +194,7 @@ class DefaultsSectionStorageTest extends UnitTestCase {
/**
* @covers ::extractEntityFromRoute
*/
- public function testExtractEntityFromRouteCreate() {
+ public function testExtractEntityFromRouteCreate(): void {
$expected = 'the_return_value';
$value = 'foo.bar.baz';
$expected_create_values = [
@@ -220,7 +220,7 @@ class DefaultsSectionStorageTest extends UnitTestCase {
* @covers ::getEntityTypes
* @covers \Drupal\layout_builder\Routing\LayoutBuilderRoutesTrait::buildLayoutRoutes
*/
- public function testBuildRoutes() {
+ public function testBuildRoutes(): void {
$module_handler = $this->prophesize(ModuleHandlerInterface::class);
$module_handler->moduleExists('field_ui')->willReturn(TRUE);
$container = new ContainerBuilder();
@@ -415,7 +415,7 @@ class DefaultsSectionStorageTest extends UnitTestCase {
/**
* @covers ::buildRoutes
*/
- public function testBuildRoutesNoFieldUi() {
+ public function testBuildRoutesNoFieldUi(): void {
$module_handler = $this->prophesize(ModuleHandlerInterface::class);
$module_handler->moduleExists('field_ui')->willReturn(FALSE);
$container = new ContainerBuilder();
diff --git a/core/modules/layout_builder/tests/src/Unit/InlineBlockUsageTest.php b/core/modules/layout_builder/tests/src/Unit/InlineBlockUsageTest.php
index 1806219066b..77ebe9c1017 100644
--- a/core/modules/layout_builder/tests/src/Unit/InlineBlockUsageTest.php
+++ b/core/modules/layout_builder/tests/src/Unit/InlineBlockUsageTest.php
@@ -20,7 +20,7 @@ class InlineBlockUsageTest extends UnitTestCase {
*
* @covers ::deleteUsage
*/
- public function testEmptyDeleteUsageCall() {
+ public function testEmptyDeleteUsageCall(): void {
$connection = $this->prophesize(Connection::class);
$connection->delete('inline_block_usage')->shouldNotBeCalled();
diff --git a/core/modules/layout_builder/tests/src/Unit/LayoutBuilderIsActiveCacheContextTest.php b/core/modules/layout_builder/tests/src/Unit/LayoutBuilderIsActiveCacheContextTest.php
index b81f9b2ff61..74d6f7ca902 100644
--- a/core/modules/layout_builder/tests/src/Unit/LayoutBuilderIsActiveCacheContextTest.php
+++ b/core/modules/layout_builder/tests/src/Unit/LayoutBuilderIsActiveCacheContextTest.php
@@ -26,7 +26,7 @@ class LayoutBuilderIsActiveCacheContextTest extends UnitTestCase {
/**
* @covers ::getContext
*/
- public function testGetContextMissingEntityTypeId() {
+ public function testGetContextMissingEntityTypeId(): void {
$route_match = $this->prophesize(RouteMatchInterface::class);
$cache_context = new LayoutBuilderIsActiveCacheContext($route_match->reveal());
$this->expectException(\LogicException::class);
@@ -38,7 +38,7 @@ class LayoutBuilderIsActiveCacheContextTest extends UnitTestCase {
* @covers ::getContext
* @covers ::getDisplay
*/
- public function testGetContextNonFieldableEntity() {
+ public function testGetContextNonFieldableEntity(): void {
$route_match = $this->prophesize(RouteMatchInterface::class);
$route_match->getParameter('not_a_fieldable_entity')->willReturn('something that is not a fieldable entity');
@@ -54,7 +54,7 @@ class LayoutBuilderIsActiveCacheContextTest extends UnitTestCase {
*
* @dataProvider providerTestGetContext
*/
- public function testGetContext($is_overridden, $expected) {
+ public function testGetContext($is_overridden, $expected): void {
$entity_display = $this->prophesize(LayoutEntityDisplayInterface::class);
$entity_display->isOverridable()->willReturn($is_overridden);
diff --git a/core/modules/layout_builder/tests/src/Unit/LayoutBuilderRoutesTest.php b/core/modules/layout_builder/tests/src/Unit/LayoutBuilderRoutesTest.php
index 8bb67e92aa9..0afd41e1333 100644
--- a/core/modules/layout_builder/tests/src/Unit/LayoutBuilderRoutesTest.php
+++ b/core/modules/layout_builder/tests/src/Unit/LayoutBuilderRoutesTest.php
@@ -48,7 +48,7 @@ class LayoutBuilderRoutesTest extends UnitTestCase {
/**
* @covers ::onAlterRoutes
*/
- public function testOnAlterRoutes() {
+ public function testOnAlterRoutes(): void {
$expected = [
'test_route1' => new Route('/test/path1'),
'test_route_shared' => new Route('/test/path/shared2'),
diff --git a/core/modules/layout_builder/tests/src/Unit/LayoutEntityHelperTraitTest.php b/core/modules/layout_builder/tests/src/Unit/LayoutEntityHelperTraitTest.php
index d1c9978f2d3..b2cbb35ac1c 100644
--- a/core/modules/layout_builder/tests/src/Unit/LayoutEntityHelperTraitTest.php
+++ b/core/modules/layout_builder/tests/src/Unit/LayoutEntityHelperTraitTest.php
@@ -94,7 +94,7 @@ class LayoutEntityHelperTraitTest extends UnitTestCase {
*
* @dataProvider providerSectionsWithInlineComponents
*/
- public function testGetInlineBlockComponents($sections, $expected_components) {
+ public function testGetInlineBlockComponents($sections, $expected_components): void {
$test_class = new TestClass();
$this->assertSame($expected_components, $test_class->getInlineBlockComponents($sections));
}
@@ -104,7 +104,7 @@ class LayoutEntityHelperTraitTest extends UnitTestCase {
*
* @dataProvider providerSectionsWithInlineComponents
*/
- public function testGetInlineBlockRevisionIdsInSections($sections, $components, $expected_revision_ids) {
+ public function testGetInlineBlockRevisionIdsInSections($sections, $components, $expected_revision_ids): void {
$test_class = new TestClass();
$this->assertSame($expected_revision_ids, $test_class->getInlineBlockRevisionIdsInSections($sections));
}
diff --git a/core/modules/layout_builder/tests/src/Unit/LayoutSectionStorageParamConverterTest.php b/core/modules/layout_builder/tests/src/Unit/LayoutSectionStorageParamConverterTest.php
index e4bf73efbf1..9a79a080435 100644
--- a/core/modules/layout_builder/tests/src/Unit/LayoutSectionStorageParamConverterTest.php
+++ b/core/modules/layout_builder/tests/src/Unit/LayoutSectionStorageParamConverterTest.php
@@ -19,7 +19,7 @@ class LayoutSectionStorageParamConverterTest extends UnitTestCase {
/**
* @covers ::convert
*/
- public function testConvert() {
+ public function testConvert(): void {
$section_storage_manager = $this->prophesize(SectionStorageManagerInterface::class);
$converter = new LayoutSectionStorageParamConverter($section_storage_manager->reveal());
@@ -42,7 +42,7 @@ class LayoutSectionStorageParamConverterTest extends UnitTestCase {
/**
* @covers ::convert
*/
- public function testConvertNoType() {
+ public function testConvertNoType(): void {
$section_storage_manager = $this->prophesize(SectionStorageManagerInterface::class);
$converter = new LayoutSectionStorageParamConverter($section_storage_manager->reveal());
@@ -61,7 +61,7 @@ class LayoutSectionStorageParamConverterTest extends UnitTestCase {
/**
* @covers ::convert
*/
- public function testConvertInvalidConverter() {
+ public function testConvertInvalidConverter(): void {
$section_storage_manager = $this->prophesize(SectionStorageManagerInterface::class);
$converter = new LayoutSectionStorageParamConverter($section_storage_manager->reveal());
diff --git a/core/modules/layout_builder/tests/src/Unit/LayoutTempstoreRepositoryTest.php b/core/modules/layout_builder/tests/src/Unit/LayoutTempstoreRepositoryTest.php
index 694e2db2265..b0fdde1e9e7 100644
--- a/core/modules/layout_builder/tests/src/Unit/LayoutTempstoreRepositoryTest.php
+++ b/core/modules/layout_builder/tests/src/Unit/LayoutTempstoreRepositoryTest.php
@@ -20,7 +20,7 @@ class LayoutTempstoreRepositoryTest extends UnitTestCase {
* @covers ::get
* @covers ::has
*/
- public function testGetEmptyTempstore() {
+ public function testGetEmptyTempstore(): void {
$section_storage = $this->prophesize(SectionStorageInterface::class);
$section_storage->getStorageType()->willReturn('my_storage_type');
$section_storage->getStorageId()->willReturn('my_storage_id');
@@ -43,7 +43,7 @@ class LayoutTempstoreRepositoryTest extends UnitTestCase {
* @covers ::get
* @covers ::has
*/
- public function testGetLoadedTempstore() {
+ public function testGetLoadedTempstore(): void {
$section_storage = $this->prophesize(SectionStorageInterface::class);
$section_storage->getStorageType()->willReturn('my_storage_type');
$section_storage->getStorageId()->willReturn('my_storage_id');
@@ -66,7 +66,7 @@ class LayoutTempstoreRepositoryTest extends UnitTestCase {
/**
* @covers ::get
*/
- public function testGetInvalidEntry() {
+ public function testGetInvalidEntry(): void {
$section_storage = $this->prophesize(SectionStorageInterface::class);
$section_storage->getStorageType()->willReturn('my_storage_type');
$section_storage->getStorageId()->willReturn('my_storage_id');
diff --git a/core/modules/layout_builder/tests/src/Unit/LayoutTempstoreRouteEnhancerTest.php b/core/modules/layout_builder/tests/src/Unit/LayoutTempstoreRouteEnhancerTest.php
index 98e8d3eef6b..cae00582fee 100644
--- a/core/modules/layout_builder/tests/src/Unit/LayoutTempstoreRouteEnhancerTest.php
+++ b/core/modules/layout_builder/tests/src/Unit/LayoutTempstoreRouteEnhancerTest.php
@@ -22,7 +22,7 @@ class LayoutTempstoreRouteEnhancerTest extends UnitTestCase {
/**
* @covers ::enhance
*/
- public function testEnhance() {
+ public function testEnhance(): void {
$section_storage = $this->prophesize(SectionStorageInterface::class);
$layout_tempstore_repository = $this->prophesize(LayoutTempstoreRepositoryInterface::class);
$layout_tempstore_repository->get($section_storage->reveal())->willReturn('the_return_value');
diff --git a/core/modules/layout_builder/tests/src/Unit/OverridesSectionStorageTest.php b/core/modules/layout_builder/tests/src/Unit/OverridesSectionStorageTest.php
index fbafb7eef13..8b05201660a 100644
--- a/core/modules/layout_builder/tests/src/Unit/OverridesSectionStorageTest.php
+++ b/core/modules/layout_builder/tests/src/Unit/OverridesSectionStorageTest.php
@@ -88,7 +88,7 @@ class OverridesSectionStorageTest extends UnitTestCase {
* @param array $defaults
* The defaults to pass to ::extractEntityFromRoute().
*/
- public function testExtractEntityFromRoute($success, $expected_entity_type_id, $value, array $defaults) {
+ public function testExtractEntityFromRoute($success, $expected_entity_type_id, $value, array $defaults): void {
if ($expected_entity_type_id) {
$entity_without_layout = $this->prophesize(FieldableEntityInterface::class);
$entity_without_layout->hasField(OverridesSectionStorage::FIELD_NAME)->willReturn(FALSE);
@@ -163,7 +163,7 @@ class OverridesSectionStorageTest extends UnitTestCase {
* @covers ::getEntityTypes
* @covers \Drupal\layout_builder\Routing\LayoutBuilderRoutesTrait::buildLayoutRoutes
*/
- public function testBuildRoutes() {
+ public function testBuildRoutes(): void {
$entity_types = [];
$not_fieldable = $this->prophesize(EntityTypeInterface::class);
diff --git a/core/modules/layout_builder/tests/src/Unit/SectionComponentTest.php b/core/modules/layout_builder/tests/src/Unit/SectionComponentTest.php
index c3dc9732430..0561034479e 100644
--- a/core/modules/layout_builder/tests/src/Unit/SectionComponentTest.php
+++ b/core/modules/layout_builder/tests/src/Unit/SectionComponentTest.php
@@ -25,7 +25,7 @@ class SectionComponentTest extends UnitTestCase {
/**
* @covers ::toRenderArray
*/
- public function testToRenderArray() {
+ public function testToRenderArray(): void {
$existing_block = $this->prophesize(BlockPluginInterface::class);
$existing_block->getPluginId()->willReturn('block_plugin_id');
diff --git a/core/modules/layout_builder/tests/src/Unit/SectionRenderTest.php b/core/modules/layout_builder/tests/src/Unit/SectionRenderTest.php
index 63c52f408c2..d0f3950d106 100644
--- a/core/modules/layout_builder/tests/src/Unit/SectionRenderTest.php
+++ b/core/modules/layout_builder/tests/src/Unit/SectionRenderTest.php
@@ -101,7 +101,7 @@ class SectionRenderTest extends UnitTestCase {
/**
* @covers ::toRenderArray
*/
- public function testToRenderArray() {
+ public function testToRenderArray(): void {
$block_content = ['#markup' => 'The block content.'];
$placeholder_label = 'Placeholder Label';
$render_array = [
@@ -150,7 +150,7 @@ class SectionRenderTest extends UnitTestCase {
/**
* @covers ::toRenderArray
*/
- public function testToRenderArrayAccessDenied() {
+ public function testToRenderArrayAccessDenied(): void {
$block = $this->prophesize(BlockPluginInterface::class);
$this->blockManager->createInstance('block_plugin_id', ['id' => 'block_plugin_id'])->willReturn($block->reveal());
@@ -182,7 +182,7 @@ class SectionRenderTest extends UnitTestCase {
/**
* @covers ::toRenderArray
*/
- public function testToRenderArrayPreview() {
+ public function testToRenderArrayPreview(): void {
$block_content = ['#markup' => 'The block content.'];
$placeholder_label = 'Placeholder Label';
$render_array = [
@@ -232,7 +232,7 @@ class SectionRenderTest extends UnitTestCase {
/**
* @covers ::toRenderArray
*/
- public function testToRenderArrayEmpty() {
+ public function testToRenderArrayEmpty(): void {
$section = [];
$expected = [];
$result = (new Section('layout_onecol', [], $section))->toRenderArray();
@@ -242,7 +242,7 @@ class SectionRenderTest extends UnitTestCase {
/**
* @covers ::toRenderArray
*/
- public function testContextAwareBlock() {
+ public function testContextAwareBlock(): void {
$block_content = ['#markup' => 'The block content.'];
$placeholder_label = 'Placeholder Label';
$render_array = [
@@ -294,7 +294,7 @@ class SectionRenderTest extends UnitTestCase {
/**
* @covers ::toRenderArray
*/
- public function testToRenderArrayMissingPluginId() {
+ public function testToRenderArrayMissingPluginId(): void {
$this->expectException(PluginException::class);
$this->expectExceptionMessage('No plugin ID specified for component with "some_uuid" UUID');
(new Section('layout_onecol', [], [new SectionComponent('some_uuid', 'content')]))->toRenderArray();
diff --git a/core/modules/layout_builder/tests/src/Unit/SectionStorageManagerTest.php b/core/modules/layout_builder/tests/src/Unit/SectionStorageManagerTest.php
index 0f3f8f0cc4c..7acbae29c36 100644
--- a/core/modules/layout_builder/tests/src/Unit/SectionStorageManagerTest.php
+++ b/core/modules/layout_builder/tests/src/Unit/SectionStorageManagerTest.php
@@ -87,7 +87,7 @@ class SectionStorageManagerTest extends UnitTestCase {
/**
* @covers ::loadEmpty
*/
- public function testLoadEmpty() {
+ public function testLoadEmpty(): void {
$result = $this->manager->loadEmpty('the_plugin_id');
$this->assertInstanceOf(SectionStorageInterface::class, $result);
$this->assertSame($this->plugin->reveal(), $result);
@@ -96,7 +96,7 @@ class SectionStorageManagerTest extends UnitTestCase {
/**
* @covers ::load
*/
- public function testLoad() {
+ public function testLoad(): void {
$contexts = [
'the_context' => $this->prophesize(ContextInterface::class)->reveal(),
];
@@ -110,7 +110,7 @@ class SectionStorageManagerTest extends UnitTestCase {
/**
* @covers ::load
*/
- public function testLoadNull() {
+ public function testLoadNull(): void {
$contexts = [
'the_context' => $this->prophesize(ContextInterface::class)->reveal(),
];
@@ -124,7 +124,7 @@ class SectionStorageManagerTest extends UnitTestCase {
/**
* @covers ::findDefinitions
*/
- public function testFindDefinitions() {
+ public function testFindDefinitions(): void {
$this->discovery->getDefinitions()->willReturn([
'plugin1' => (new SectionStorageDefinition())->setClass(SectionStorageInterface::class),
'plugin2' => (new SectionStorageDefinition(['weight' => -5]))->setClass(SectionStorageInterface::class),
@@ -150,7 +150,7 @@ class SectionStorageManagerTest extends UnitTestCase {
* @param bool $plugin_is_applicable
* The result for the plugin's isApplicable() method to return.
*/
- public function testFindByContext($plugin_is_applicable) {
+ public function testFindByContext($plugin_is_applicable): void {
$cacheability = new CacheableMetadata();
$contexts = [
'foo' => new Context(new ContextDefinition('foo')),
@@ -204,7 +204,7 @@ class SectionStorageManagerTest extends UnitTestCase {
/**
* @covers ::findByContext
*/
- public function testFindByContextCacheableSectionStorage() {
+ public function testFindByContextCacheableSectionStorage(): void {
$cacheability = new CacheableMetadata();
$contexts = [
'foo' => new Context(new ContextDefinition('foo')),
diff --git a/core/modules/layout_builder/tests/src/Unit/SectionTest.php b/core/modules/layout_builder/tests/src/Unit/SectionTest.php
index c4813f26f04..d9960d0519d 100644
--- a/core/modules/layout_builder/tests/src/Unit/SectionTest.php
+++ b/core/modules/layout_builder/tests/src/Unit/SectionTest.php
@@ -51,7 +51,7 @@ class SectionTest extends UnitTestCase {
* @covers ::setComponent
* @covers ::getComponents
*/
- public function testGetComponents() {
+ public function testGetComponents(): void {
$expected = [
'existing-uuid' => (new SectionComponent('existing-uuid', 'some-region', ['id' => 'existing-block-id']))->setWeight(0),
'20000000-0000-1000-a000-000000000000' => (new SectionComponent('20000000-0000-1000-a000-000000000000', 'ordered-region', ['id' => 'second-block-id']))->setWeight(3),
@@ -64,7 +64,7 @@ class SectionTest extends UnitTestCase {
/**
* @covers ::getComponent
*/
- public function testGetComponentInvalidUuid() {
+ public function testGetComponentInvalidUuid(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid UUID "invalid-uuid"');
$this->section->getComponent('invalid-uuid');
@@ -73,7 +73,7 @@ class SectionTest extends UnitTestCase {
/**
* @covers ::getComponent
*/
- public function testGetComponent() {
+ public function testGetComponent(): void {
$expected = new SectionComponent('existing-uuid', 'some-region', ['id' => 'existing-block-id']);
$this->assertEquals($expected, $this->section->getComponent('existing-uuid'));
@@ -83,7 +83,7 @@ class SectionTest extends UnitTestCase {
* @covers ::removeComponent
* @covers ::getComponentsByRegion
*/
- public function testRemoveComponent() {
+ public function testRemoveComponent(): void {
$expected = [
'existing-uuid' => (new SectionComponent('existing-uuid', 'some-region', ['id' => 'existing-block-id']))->setWeight(0),
'20000000-0000-1000-a000-000000000000' => (new SectionComponent('20000000-0000-1000-a000-000000000000', 'ordered-region', ['id' => 'second-block-id']))->setWeight(3),
@@ -98,7 +98,7 @@ class SectionTest extends UnitTestCase {
* @covers ::getNextHighestWeight
* @covers ::getComponentsByRegion
*/
- public function testAppendComponent() {
+ public function testAppendComponent(): void {
$expected = [
'existing-uuid' => (new SectionComponent('existing-uuid', 'some-region', ['id' => 'existing-block-id']))->setWeight(0),
'20000000-0000-1000-a000-000000000000' => (new SectionComponent('20000000-0000-1000-a000-000000000000', 'ordered-region', ['id' => 'second-block-id']))->setWeight(3),
@@ -113,7 +113,7 @@ class SectionTest extends UnitTestCase {
/**
* @covers ::insertAfterComponent
*/
- public function testInsertAfterComponent() {
+ public function testInsertAfterComponent(): void {
$expected = [
'existing-uuid' => (new SectionComponent('existing-uuid', 'some-region', ['id' => 'existing-block-id']))->setWeight(0),
'20000000-0000-1000-a000-000000000000' => (new SectionComponent('20000000-0000-1000-a000-000000000000', 'ordered-region', ['id' => 'second-block-id']))->setWeight(4),
@@ -128,7 +128,7 @@ class SectionTest extends UnitTestCase {
/**
* @covers ::insertAfterComponent
*/
- public function testInsertAfterComponentValidUuidRegionMismatch() {
+ public function testInsertAfterComponentValidUuidRegionMismatch(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid preceding UUID "existing-uuid"');
$this->section->insertAfterComponent('existing-uuid', new SectionComponent('new-uuid', 'ordered-region'));
@@ -137,7 +137,7 @@ class SectionTest extends UnitTestCase {
/**
* @covers ::insertAfterComponent
*/
- public function testInsertAfterComponentInvalidUuid() {
+ public function testInsertAfterComponentInvalidUuid(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid preceding UUID "invalid-uuid"');
$this->section->insertAfterComponent('invalid-uuid', new SectionComponent('new-uuid', 'ordered-region'));
@@ -147,7 +147,7 @@ class SectionTest extends UnitTestCase {
* @covers ::insertComponent
* @covers ::getComponentsByRegion
*/
- public function testInsertComponent() {
+ public function testInsertComponent(): void {
$expected = [
'existing-uuid' => (new SectionComponent('existing-uuid', 'some-region', ['id' => 'existing-block-id']))->setWeight(0),
'20000000-0000-1000-a000-000000000000' => (new SectionComponent('20000000-0000-1000-a000-000000000000', 'ordered-region', ['id' => 'second-block-id']))->setWeight(4),
@@ -162,7 +162,7 @@ class SectionTest extends UnitTestCase {
/**
* @covers ::insertComponent
*/
- public function testInsertComponentAppend() {
+ public function testInsertComponentAppend(): void {
$expected = [
'existing-uuid' => (new SectionComponent('existing-uuid', 'some-region', ['id' => 'existing-block-id']))->setWeight(0),
'20000000-0000-1000-a000-000000000000' => (new SectionComponent('20000000-0000-1000-a000-000000000000', 'ordered-region', ['id' => 'second-block-id']))->setWeight(3),
@@ -177,7 +177,7 @@ class SectionTest extends UnitTestCase {
/**
* @covers ::insertComponent
*/
- public function testInsertComponentInvalidDelta() {
+ public function testInsertComponentInvalidDelta(): void {
$this->expectException(\OutOfBoundsException::class);
$this->expectExceptionMessage('Invalid delta "7" for the "new-uuid" component');
$this->section->insertComponent(7, new SectionComponent('new-uuid', 'ordered-region'));
@@ -203,7 +203,7 @@ class SectionTest extends UnitTestCase {
* @covers ::getThirdPartySettings
* @dataProvider providerTestGetThirdPartySettings
*/
- public function testGetThirdPartySettings($provider, $expected) {
+ public function testGetThirdPartySettings($provider, $expected): void {
$this->assertSame($expected, $this->section->getThirdPartySettings($provider));
}
@@ -278,7 +278,7 @@ class SectionTest extends UnitTestCase {
* @covers ::setThirdPartySetting
* @dataProvider providerTestSetThirdPartySetting
*/
- public function testSetThirdPartySetting($provider, $key, $value, $expected) {
+ public function testSetThirdPartySetting($provider, $key, $value, $expected): void {
$this->section->setThirdPartySetting($provider, $key, $value);
$this->assertSame($expected, $this->section->getThirdPartySettings($provider));
}
@@ -322,7 +322,7 @@ class SectionTest extends UnitTestCase {
* @covers ::unsetThirdPartySetting
* @dataProvider providerTestUnsetThirdPartySetting
*/
- public function testUnsetThirdPartySetting($provider, $key, $expected) {
+ public function testUnsetThirdPartySetting($provider, $key, $expected): void {
$this->section->unsetThirdPartySetting($provider, $key);
$this->assertSame($expected, $this->section->getThirdPartySettings($provider));
}
@@ -364,7 +364,7 @@ class SectionTest extends UnitTestCase {
/**
* @covers ::getThirdPartyProviders
*/
- public function testGetThirdPartyProviders() {
+ public function testGetThirdPartyProviders(): void {
$this->assertSame(['bad_judgement', 'hunt_and_peck'], $this->section->getThirdPartyProviders());
$this->section->unsetThirdPartySetting('hunt_and_peck', 'delay');
$this->assertSame(['bad_judgement'], $this->section->getThirdPartyProviders());
@@ -374,7 +374,7 @@ class SectionTest extends UnitTestCase {
* @covers ::getLayout
* @dataProvider providerTestGetLayout
*/
- public function testGetLayout(array $contexts, bool $should_context_apply) {
+ public function testGetLayout(array $contexts, bool $should_context_apply): void {
$layout = $this->prophesize(LayoutInterface::class);
$layout_plugin_manager = $this->prophesize(LayoutPluginManagerInterface::class);
$layout_plugin_manager->createInstance('layout_onecol', [])->willReturn($layout->reveal());
diff --git a/core/modules/layout_discovery/tests/src/Kernel/LayoutTest.php b/core/modules/layout_discovery/tests/src/Kernel/LayoutTest.php
index 0e6d1c6146d..f27f7098200 100644
--- a/core/modules/layout_discovery/tests/src/Kernel/LayoutTest.php
+++ b/core/modules/layout_discovery/tests/src/Kernel/LayoutTest.php
@@ -39,7 +39,7 @@ class LayoutTest extends KernelTestBase {
/**
* Tests that a layout provided by a theme has the preprocess function set.
*/
- public function testThemeProvidedLayout() {
+ public function testThemeProvidedLayout(): void {
$this->container->get('theme_installer')->install(['test_layout_theme']);
$this->config('system.theme')->set('default', 'test_layout_theme')->save();
@@ -52,7 +52,7 @@ class LayoutTest extends KernelTestBase {
*
* @dataProvider renderLayoutData
*/
- public function testRenderLayout($layout_id, $config, $regions, array $html) {
+ public function testRenderLayout($layout_id, $config, $regions, array $html): void {
$layout = $this->layoutPluginManager->createInstance($layout_id, $config);
$built['layout'] = $layout->build($regions);
$built['layout']['#prefix'] = 'Test prefix' . "\n";
diff --git a/core/modules/link/tests/src/Functional/LinkFieldTest.php b/core/modules/link/tests/src/Functional/LinkFieldTest.php
index c9028836c7c..c619a772ad4 100644
--- a/core/modules/link/tests/src/Functional/LinkFieldTest.php
+++ b/core/modules/link/tests/src/Functional/LinkFieldTest.php
@@ -75,7 +75,7 @@ class LinkFieldTest extends BrowserTestBase {
*
* This is being as one to avoid multiple Drupal install.
*/
- public function testLinkField() {
+ public function testLinkField(): void {
$this->doTestURLValidation();
$this->doTestLinkTitle();
$this->doTestLinkFormatter();
@@ -962,7 +962,7 @@ class LinkFieldTest extends BrowserTestBase {
/**
* Tests <nolink> and <none> as link uri.
*/
- public function testNoLinkUri() {
+ public function testNoLinkUri(): void {
$field_name = $this->randomMachineName();
$this->fieldStorage = FieldStorageConfig::create([
'field_name' => $field_name,
diff --git a/core/modules/link/tests/src/Functional/LinkFieldUITest.php b/core/modules/link/tests/src/Functional/LinkFieldUITest.php
index ac8d37f5b2f..332ebe0a059 100644
--- a/core/modules/link/tests/src/Functional/LinkFieldUITest.php
+++ b/core/modules/link/tests/src/Functional/LinkFieldUITest.php
@@ -74,7 +74,7 @@ class LinkFieldUITest extends BrowserTestBase {
/**
* Tests the link field UI.
*/
- public function testFieldUI() {
+ public function testFieldUI(): void {
foreach ($this->providerTestFieldUI() as $item) {
[$cardinality, $link_type, $title, $label, $field_name, $default_uri] = $item;
$this->runFieldUIItem($cardinality, $link_type, $title, $label, $field_name, $default_uri);
diff --git a/core/modules/link/tests/src/Functional/Views/LinkViewsTokensTest.php b/core/modules/link/tests/src/Functional/Views/LinkViewsTokensTest.php
index 01dcc01953f..434fe23fdf4 100644
--- a/core/modules/link/tests/src/Functional/Views/LinkViewsTokensTest.php
+++ b/core/modules/link/tests/src/Functional/Views/LinkViewsTokensTest.php
@@ -69,7 +69,7 @@ class LinkViewsTokensTest extends ViewTestBase {
}
- public function testLinkViewsTokens() {
+ public function testLinkViewsTokens(): void {
// Array of URI's to test.
$uris = [
'http://www.example.com' => 'example.com',
diff --git a/core/modules/link/tests/src/FunctionalJavascript/LinkFieldFormStatesTest.php b/core/modules/link/tests/src/FunctionalJavascript/LinkFieldFormStatesTest.php
index bc76b1e78a1..9bafa0db957 100644
--- a/core/modules/link/tests/src/FunctionalJavascript/LinkFieldFormStatesTest.php
+++ b/core/modules/link/tests/src/FunctionalJavascript/LinkFieldFormStatesTest.php
@@ -41,7 +41,7 @@ class LinkFieldFormStatesTest extends WebDriverTestBase {
/**
* @dataProvider linkFieldFormStatesData
*/
- public function testLinkFieldFormStates(string $uri, string $title) {
+ public function testLinkFieldFormStates(string $uri, string $title): void {
$this->drupalGet('entity_test/add');
$session = $this->assertSession();
$session->elementNotExists('css', '#edit-links-0-uri[required]');
diff --git a/core/modules/link/tests/src/Kernel/LinkItemSerializationTest.php b/core/modules/link/tests/src/Kernel/LinkItemSerializationTest.php
index 8d812ed9531..fe0767d178a 100644
--- a/core/modules/link/tests/src/Kernel/LinkItemSerializationTest.php
+++ b/core/modules/link/tests/src/Kernel/LinkItemSerializationTest.php
@@ -57,7 +57,7 @@ class LinkItemSerializationTest extends FieldKernelTestBase {
/**
* Tests the serialization.
*/
- public function testLinkSerialization() {
+ public function testLinkSerialization(): void {
// Create entity.
$entity = EntityTest::create();
$url = 'https://www.drupal.org?test_param=test_value';
@@ -85,7 +85,7 @@ class LinkItemSerializationTest extends FieldKernelTestBase {
/**
* Tests the deserialization.
*/
- public function testLinkDeserialization() {
+ public function testLinkDeserialization(): void {
// Create entity.
$entity = EntityTest::create();
$url = 'https://www.drupal.org?test_param=test_value';
diff --git a/core/modules/link/tests/src/Kernel/LinkItemTest.php b/core/modules/link/tests/src/Kernel/LinkItemTest.php
index 93470c5c88f..0ce867a1df8 100644
--- a/core/modules/link/tests/src/Kernel/LinkItemTest.php
+++ b/core/modules/link/tests/src/Kernel/LinkItemTest.php
@@ -73,7 +73,7 @@ class LinkItemTest extends FieldKernelTestBase {
/**
* Tests using entity fields of the link field type.
*/
- public function testLinkItem() {
+ public function testLinkItem(): void {
// Create entity.
$entity = EntityTest::create();
$url = 'https://www.drupal.org?test_param=test_value';
diff --git a/core/modules/link/tests/src/Kernel/LinkItemUrlValidationTest.php b/core/modules/link/tests/src/Kernel/LinkItemUrlValidationTest.php
index a1f15a9cb77..2b7f0da2b22 100644
--- a/core/modules/link/tests/src/Kernel/LinkItemUrlValidationTest.php
+++ b/core/modules/link/tests/src/Kernel/LinkItemUrlValidationTest.php
@@ -21,7 +21,7 @@ class LinkItemUrlValidationTest extends FieldKernelTestBase {
/**
* Tests link validation.
*/
- public function testExternalLinkValidation() {
+ public function testExternalLinkValidation(): void {
$definition = \Drupal::typedDataManager()
->createDataDefinition('field_item:link');
$link_item = \Drupal::typedDataManager()->create($definition);
diff --git a/core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldTest.php b/core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldTest.php
index 4acfdd5313c..202b2d04fe6 100644
--- a/core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldTest.php
+++ b/core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldTest.php
@@ -55,7 +55,7 @@ class LinkFieldTest extends KernelTestBase {
/**
* @covers ::alterFieldInstanceMigration
*/
- public function testAlterFieldInstanceMigration($method = 'alterFieldInstanceMigration') {
+ public function testAlterFieldInstanceMigration($method = 'alterFieldInstanceMigration'): void {
$this->plugin->$method($this->migration);
$expected = [
diff --git a/core/modules/link/tests/src/Unit/LinkFormatterTest.php b/core/modules/link/tests/src/Unit/LinkFormatterTest.php
index c4867bff3a7..658fe29d9b7 100644
--- a/core/modules/link/tests/src/Unit/LinkFormatterTest.php
+++ b/core/modules/link/tests/src/Unit/LinkFormatterTest.php
@@ -28,7 +28,7 @@ class LinkFormatterTest extends UnitTestCase {
*
* LinkItem::getUrl will throw \InvalidArgumentException.
*/
- public function testFormatterLinkItemUrlMalformed() {
+ public function testFormatterLinkItemUrlMalformed(): void {
$entity = $this->createMock(EntityInterface::class);
$linkItem = $this->createMock(LinkItemInterface::class);
@@ -70,7 +70,7 @@ class LinkFormatterTest extends UnitTestCase {
/**
* Tests when LinkItem::getUrl throws an unexpected exception.
*/
- public function testFormatterLinkItemUrlUnexpectedException() {
+ public function testFormatterLinkItemUrlUnexpectedException(): void {
$exception = new \Exception('Unexpected!!!');
$linkItem = $this->createMock(LinkItemInterface::class);
@@ -107,7 +107,7 @@ class LinkFormatterTest extends UnitTestCase {
/**
* Tests when LinkItem::getUrl returns a functional URL.
*/
- public function testFormatterLinkItem() {
+ public function testFormatterLinkItem(): void {
$expectedUrl = Url::fromUri('route:<front>');
$linkItem = $this->createMock(LinkItemInterface::class);
diff --git a/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkExternalProtocolsConstraintValidatorTest.php b/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkExternalProtocolsConstraintValidatorTest.php
index e88b6329672..b02a44b23f2 100644
--- a/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkExternalProtocolsConstraintValidatorTest.php
+++ b/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkExternalProtocolsConstraintValidatorTest.php
@@ -22,7 +22,7 @@ class LinkExternalProtocolsConstraintValidatorTest extends UnitTestCase {
* @dataProvider providerValidate
* @runInSeparateProcess
*/
- public function testValidate($url, $valid) {
+ public function testValidate($url, $valid): void {
$link = $this->createMock('Drupal\link\LinkItemInterface');
$link->expects($this->any())
->method('getUrl')
@@ -71,7 +71,7 @@ class LinkExternalProtocolsConstraintValidatorTest extends UnitTestCase {
*
* @see \Drupal\Core\Url::fromUri
*/
- public function testValidateWithMalformedUri() {
+ public function testValidateWithMalformedUri(): void {
$link = $this->createMock('Drupal\link\LinkItemInterface');
$link->expects($this->any())
->method('getUrl')
@@ -91,7 +91,7 @@ class LinkExternalProtocolsConstraintValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidateIgnoresInternalUrls() {
+ public function testValidateIgnoresInternalUrls(): void {
$link = $this->createMock('Drupal\link\LinkItemInterface');
$link->expects($this->any())
->method('getUrl')
diff --git a/core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldTest.php b/core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldTest.php
index b3996a7330b..bdb0dcbedd8 100644
--- a/core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldTest.php
+++ b/core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldTest.php
@@ -50,7 +50,7 @@ class LinkFieldTest extends UnitTestCase {
/**
* @covers ::defineValueProcessPipeline
*/
- public function testDefineValueProcessPipeline($method = 'defineValueProcessPipeline') {
+ public function testDefineValueProcessPipeline($method = 'defineValueProcessPipeline'): void {
$this->plugin->$method($this->migration, 'field_name', []);
$expected = [
diff --git a/core/modules/link/tests/src/Unit/Plugin/migrate/process/FieldLinkTest.php b/core/modules/link/tests/src/Unit/Plugin/migrate/process/FieldLinkTest.php
index fb09c54c68e..693505db949 100644
--- a/core/modules/link/tests/src/Unit/Plugin/migrate/process/FieldLinkTest.php
+++ b/core/modules/link/tests/src/Unit/Plugin/migrate/process/FieldLinkTest.php
@@ -20,7 +20,7 @@ class FieldLinkTest extends UnitTestCase {
*
* @dataProvider canonicalizeUriDataProvider
*/
- public function testCanonicalizeUri($url, $expected, $configuration = []) {
+ public function testCanonicalizeUri($url, $expected, $configuration = []): void {
$link_plugin = new FieldLink($configuration, '', [], $this->createMock(MigrationInterface::class));
$transformed = $link_plugin->transform([
'url' => $url,
@@ -110,7 +110,7 @@ class FieldLinkTest extends UnitTestCase {
/**
* Tests the attributes that are deeply serialized are discarded.
*/
- public function testCanonicalizeUriSerialized() {
+ public function testCanonicalizeUriSerialized(): void {
$link_plugin = new FieldLink([], '', [], $this->createMock(MigrationInterface::class));
$migrate_executable = $this->createMock(MigrateExecutableInterface::class);
$row = new Row();
diff --git a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php
index b88261d7e86..fc518b12f16 100644
--- a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php
@@ -36,7 +36,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
/**
* Tests update changes configuration translations if enabled after language.
*/
- public function testConfigTranslationImport() {
+ public function testConfigTranslationImport(): void {
$admin_user = $this->drupalCreateUser([
'administer modules',
'administer site configuration',
@@ -120,7 +120,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
/**
* Tests update changes configuration translations if enabled after language.
*/
- public function testConfigTranslationModuleInstall() {
+ public function testConfigTranslationModuleInstall(): void {
// Enable locale, block and config_translation modules.
$this->container->get('module_installer')->install(['block', 'config_translation']);
@@ -197,7 +197,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
/**
* Tests removing a string from Locale deletes configuration translations.
*/
- public function testLocaleRemovalAndConfigOverrideDelete() {
+ public function testLocaleRemovalAndConfigOverrideDelete(): void {
// Enable the locale module.
$this->container->get('module_installer')->install(['locale']);
$this->resetAll();
@@ -243,7 +243,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
/**
* Tests removing a string from Locale changes configuration translations.
*/
- public function testLocaleRemovalAndConfigOverridePreserve() {
+ public function testLocaleRemovalAndConfigOverridePreserve(): void {
// Enable the locale module.
$this->container->get('module_installer')->install(['locale']);
$this->resetAll();
@@ -309,7 +309,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
/**
* Tests setting a non-English language as default and importing configuration.
*/
- public function testConfigTranslationWithNonEnglishLanguageDefault() {
+ public function testConfigTranslationWithNonEnglishLanguageDefault(): void {
/** @var \Drupal\Core\Extension\ModuleInstallerInterface $module_installer */
$module_installer = $this->container->get('module_installer');
ConfigurableLanguage::createFromLangcode('af')->save();
diff --git a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
index 419037ea276..92aa33d3b2b 100644
--- a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
@@ -84,7 +84,7 @@ class LocaleConfigTranslationTest extends BrowserTestBase {
/**
* Tests basic configuration translation.
*/
- public function testConfigTranslation() {
+ public function testConfigTranslation(): void {
// Check that the maintenance message exists and create translation for it.
$source = '@site is currently under maintenance. We should be back shortly. Thank you for your patience.';
$string = $this->storage->findString(['source' => $source, 'context' => '', 'type' => 'configuration']);
@@ -231,7 +231,7 @@ class LocaleConfigTranslationTest extends BrowserTestBase {
/**
* Tests translatability of optional configuration in locale.
*/
- public function testOptionalConfiguration() {
+ public function testOptionalConfiguration(): void {
$this->assertNodeConfig(FALSE, FALSE);
// Enable the node module.
$this->drupalGet('admin/modules');
diff --git a/core/modules/locale/tests/src/Functional/LocaleContentTest.php b/core/modules/locale/tests/src/Functional/LocaleContentTest.php
index 1f4d1a27e00..9a26be4c0f3 100644
--- a/core/modules/locale/tests/src/Functional/LocaleContentTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleContentTest.php
@@ -30,7 +30,7 @@ class LocaleContentTest extends BrowserTestBase {
/**
* Verifies that machine name fields are always LTR.
*/
- public function testMachineNameLTR() {
+ public function testMachineNameLTR(): void {
// User to add and remove language.
$admin_user = $this->drupalCreateUser([
'administer languages',
@@ -68,7 +68,7 @@ class LocaleContentTest extends BrowserTestBase {
/**
* Tests if a content type can be set to multilingual and language is present.
*/
- public function testContentTypeLanguageConfiguration() {
+ public function testContentTypeLanguageConfiguration(): void {
$type1 = $this->drupalCreateContentType();
$type2 = $this->drupalCreateContentType();
@@ -159,7 +159,7 @@ class LocaleContentTest extends BrowserTestBase {
/**
* Tests if a dir and lang tags exist in node's attributes.
*/
- public function testContentTypeDirLang() {
+ public function testContentTypeDirLang(): void {
$type = $this->drupalCreateContentType();
// User to add and remove language.
diff --git a/core/modules/locale/tests/src/Functional/LocaleExportTest.php b/core/modules/locale/tests/src/Functional/LocaleExportTest.php
index 947ae8a8fe6..d64563686bd 100644
--- a/core/modules/locale/tests/src/Functional/LocaleExportTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleExportTest.php
@@ -54,7 +54,7 @@ class LocaleExportTest extends BrowserTestBase {
/**
* Tests exportation of translations.
*/
- public function testExportTranslation() {
+ public function testExportTranslation(): void {
$file_system = \Drupal::service('file_system');
// First import some known translations.
// This will also automatically add the 'fr' language.
@@ -130,7 +130,7 @@ class LocaleExportTest extends BrowserTestBase {
/**
* Tests exportation of translation template file.
*/
- public function testExportTranslationTemplateFile() {
+ public function testExportTranslationTemplateFile(): void {
// Load an admin page with JavaScript so _drupal_add_library() fires at
// least once and _locale_parse_js_file() gets to run at least once so that
// the locales_source table gets populated with something.
diff --git a/core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php b/core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php
index e1e3b6318be..62970c8e93c 100644
--- a/core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php
@@ -37,7 +37,7 @@ class LocaleFileSystemFormTest extends BrowserTestBase {
/**
* Tests translation directory settings on the file settings form.
*/
- public function testFileConfigurationPage() {
+ public function testFileConfigurationPage(): void {
// By default there should be no setting for the translation directory.
$this->drupalGet('admin/config/media/file-system');
$this->assertSession()->fieldNotExists('translation_path');
diff --git a/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php b/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
index 92dda41b44b..caa931fb8ec 100644
--- a/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
@@ -81,7 +81,7 @@ class LocaleImportFunctionalTest extends BrowserTestBase {
/**
* Tests import of standalone .po files.
*/
- public function testStandalonePoFile() {
+ public function testStandalonePoFile(): void {
// Try importing a .po file.
$this->importPoFile($this->getPoFile(), [
'langcode' => 'fr',
@@ -256,7 +256,7 @@ class LocaleImportFunctionalTest extends BrowserTestBase {
/**
* Tests msgctxt context support.
*/
- public function testLanguageContext() {
+ public function testLanguageContext(): void {
// Try importing a .po file.
$this->importPoFile($this->getPoFileWithContext(), [
'langcode' => 'hr',
@@ -271,7 +271,7 @@ class LocaleImportFunctionalTest extends BrowserTestBase {
/**
* Tests empty msgstr at end of .po file see #611786.
*/
- public function testEmptyMsgstr() {
+ public function testEmptyMsgstr(): void {
$langcode = 'hu';
// Try importing a .po file.
@@ -304,7 +304,7 @@ class LocaleImportFunctionalTest extends BrowserTestBase {
/**
* Tests .po file import with configuration translation.
*/
- public function testConfigPoFile() {
+ public function testConfigPoFile(): void {
// Values for translations to assert. Config key, original string,
// translation and config property name.
$config_strings = [
@@ -370,7 +370,7 @@ class LocaleImportFunctionalTest extends BrowserTestBase {
/**
* Tests .po file import with user.settings configuration.
*/
- public function testConfigTranslationImportingPoFile() {
+ public function testConfigTranslationImportingPoFile(): void {
// Set the language code.
$langcode = 'de';
@@ -387,7 +387,7 @@ class LocaleImportFunctionalTest extends BrowserTestBase {
/**
* Tests the translation are imported when a new language is created.
*/
- public function testCreatedLanguageTranslation() {
+ public function testCreatedLanguageTranslation(): void {
// Import a .po file to add de language.
$this->importPoFile($this->getPoFileWithConfigDe(), ['langcode' => 'de']);
diff --git a/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php b/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php
index 7a3879a6aef..157c16cbaf7 100644
--- a/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php
@@ -29,7 +29,7 @@ class LocaleJavascriptTranslationTest extends BrowserTestBase {
*/
protected $defaultTheme = 'stark';
- public function testFileParsing() {
+ public function testFileParsing(): void {
// This test is for ensuring that the regular expression in
// _locale_parse_js_file() finds translatable source strings in all valid
@@ -112,7 +112,7 @@ class LocaleJavascriptTranslationTest extends BrowserTestBase {
/**
* Assert translations JS is added before drupal.js, because it depends on it.
*/
- public function testLocaleTranslationJsDependencies() {
+ public function testLocaleTranslationJsDependencies(): void {
// User to add and remove language.
$admin_user = $this->drupalCreateUser([
'administer languages',
diff --git a/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php b/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php
index daae180c001..1a121099dbe 100644
--- a/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php
@@ -54,7 +54,7 @@ class LocaleLocaleLookupTest extends BrowserTestBase {
/**
* Tests that there are no circular dependencies.
*/
- public function testCircularDependency() {
+ public function testCircularDependency(): void {
// Ensure that we can enable early_translation_test on a non-english site.
$this->drupalGet('admin/modules');
$this->submitForm(['modules[early_translation_test][enable]' => TRUE], 'Install');
@@ -64,7 +64,7 @@ class LocaleLocaleLookupTest extends BrowserTestBase {
/**
* Tests language fallback defaults.
*/
- public function testLanguageFallbackDefaults() {
+ public function testLanguageFallbackDefaults(): void {
$this->drupalGet('');
// Ensure state of fallback languages persisted by
// locale_test_language_fallback_candidates_locale_lookup_alter() is empty.
@@ -80,7 +80,7 @@ class LocaleLocaleLookupTest extends BrowserTestBase {
*
* @dataProvider providerTestFixOldPluralStyle
*/
- public function testFixOldPluralStyle($translation_value, $expected) {
+ public function testFixOldPluralStyle($translation_value, $expected): void {
$string_storage = \Drupal::service('locale.storage');
$string = $string_storage->findString(['source' => 'Member for', 'context' => '']);
$lid = $string->getId();
diff --git a/core/modules/locale/tests/src/Functional/LocaleNonInteractiveInstallTest.php b/core/modules/locale/tests/src/Functional/LocaleNonInteractiveInstallTest.php
index dd63cbf3f43..43761ced262 100644
--- a/core/modules/locale/tests/src/Functional/LocaleNonInteractiveInstallTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleNonInteractiveInstallTest.php
@@ -64,7 +64,7 @@ PO;
/**
* Tests that the expected translated text appears on the login screen.
*/
- public function testInstallerTranslations() {
+ public function testInstallerTranslations(): void {
$this->drupalGet('user/login');
// cSpell:disable-next-line
$this->assertSession()->responseContains('Geben sie das Passwort für ihren Benutzernamen ein.');
diff --git a/core/modules/locale/tests/src/Functional/LocalePathTest.php b/core/modules/locale/tests/src/Functional/LocalePathTest.php
index 1b390d92f78..505252865f3 100644
--- a/core/modules/locale/tests/src/Functional/LocalePathTest.php
+++ b/core/modules/locale/tests/src/Functional/LocalePathTest.php
@@ -44,7 +44,7 @@ class LocalePathTest extends BrowserTestBase {
/**
* Tests if a language can be associated with a path alias.
*/
- public function testPathLanguageConfiguration() {
+ public function testPathLanguageConfiguration(): void {
// User to add and remove language.
$admin_user = $this->drupalCreateUser([
'administer languages',
diff --git a/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php b/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php
index a5f3fc73f13..52ab8f7da85 100644
--- a/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php
+++ b/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php
@@ -54,7 +54,7 @@ class LocalePluralFormatTest extends BrowserTestBase {
/**
* Tests locale_get_plural() and \Drupal::translation()->formatPlural().
*/
- public function testGetPluralFormat() {
+ public function testGetPluralFormat(): void {
// Import some .po files with formulas to set up the environment.
// These will also add the languages to the system.
$this->importPoFile($this->getPoFileWithSimplePlural(), [
@@ -163,7 +163,7 @@ class LocalePluralFormatTest extends BrowserTestBase {
/**
* Tests plural editing of DateFormatter strings.
*/
- public function testPluralEditDateFormatter() {
+ public function testPluralEditDateFormatter(): void {
// Import some .po files with formulas to set up the environment.
// These will also add the languages to the system.
@@ -237,7 +237,7 @@ class LocalePluralFormatTest extends BrowserTestBase {
/**
* Tests plural editing and export functionality.
*/
- public function testPluralEditExport() {
+ public function testPluralEditExport(): void {
// Import some .po files with formulas to set up the environment.
// These will also add the languages to the system.
$this->importPoFile($this->getPoFileWithSimplePlural(), [
diff --git a/core/modules/locale/tests/src/Functional/LocaleTranslatedSchemaDefinitionTest.php b/core/modules/locale/tests/src/Functional/LocaleTranslatedSchemaDefinitionTest.php
index 5d6d41cb92e..1c3941b1d06 100644
--- a/core/modules/locale/tests/src/Functional/LocaleTranslatedSchemaDefinitionTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleTranslatedSchemaDefinitionTest.php
@@ -46,7 +46,7 @@ class LocaleTranslatedSchemaDefinitionTest extends BrowserTestBase {
/**
* Tests that translated field descriptions do not affect the update system.
*/
- public function testTranslatedSchemaDefinition() {
+ public function testTranslatedSchemaDefinition(): void {
/** @var \Drupal\locale\StringDatabaseStorage $stringStorage */
$stringStorage = \Drupal::service('locale.storage');
@@ -70,7 +70,7 @@ class LocaleTranslatedSchemaDefinitionTest extends BrowserTestBase {
/**
* Tests that translations do not affect the update system.
*/
- public function testTranslatedUpdate() {
+ public function testTranslatedUpdate(): void {
// Visit the update page to collect any strings that may be translatable.
$user = $this->drupalCreateUser(['administer software updates']);
$this->drupalLogin($user);
diff --git a/core/modules/locale/tests/src/Functional/LocaleTranslationChangeProjectVersionTest.php b/core/modules/locale/tests/src/Functional/LocaleTranslationChangeProjectVersionTest.php
index 1e210134788..98f69bf059e 100644
--- a/core/modules/locale/tests/src/Functional/LocaleTranslationChangeProjectVersionTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleTranslationChangeProjectVersionTest.php
@@ -59,7 +59,7 @@ class LocaleTranslationChangeProjectVersionTest extends LocaleUpdateBase {
/**
* Tests update translations when project version changes.
*/
- public function testUpdateImportSourceRemote() {
+ public function testUpdateImportSourceRemote(): void {
// Verify that the project status has the old version.
$status = locale_translation_get_status(['contrib_module_one']);
diff --git a/core/modules/locale/tests/src/Functional/LocaleTranslationDownloadTest.php b/core/modules/locale/tests/src/Functional/LocaleTranslationDownloadTest.php
index 598026a11fc..80112d06aa5 100644
--- a/core/modules/locale/tests/src/Functional/LocaleTranslationDownloadTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleTranslationDownloadTest.php
@@ -47,7 +47,7 @@ class LocaleTranslationDownloadTest extends LocaleUpdateBase {
/**
* Tests translation download from remote sources.
*/
- public function testUpdateImportSourceRemote() {
+ public function testUpdateImportSourceRemote(): void {
// Provide remote and 'previously' downloaded translation file.
$this->setTranslationFiles();
diff --git a/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php
index 77d0d57d2b0..c339dfb98d0 100644
--- a/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php
@@ -34,7 +34,7 @@ class LocaleTranslationUiTest extends BrowserTestBase {
/**
* Enable interface translation to English.
*/
- public function testEnglishTranslation() {
+ public function testEnglishTranslation(): void {
$admin_user = $this->drupalCreateUser([
'administer languages',
'access administration pages',
@@ -49,7 +49,7 @@ class LocaleTranslationUiTest extends BrowserTestBase {
/**
* Adds a language and tests string translation by users with the appropriate permissions.
*/
- public function testStringTranslation() {
+ public function testStringTranslation(): void {
// User to add and remove language.
$admin_user = $this->drupalCreateUser([
'administer languages',
@@ -250,7 +250,7 @@ class LocaleTranslationUiTest extends BrowserTestBase {
/**
* Tests the rebuilding of JavaScript translation files on deletion.
*/
- public function testJavaScriptTranslation() {
+ public function testJavaScriptTranslation(): void {
$user = $this->drupalCreateUser([
'translate interface',
'administer languages',
@@ -331,7 +331,7 @@ class LocaleTranslationUiTest extends BrowserTestBase {
/**
* Tests the validation of the translation input.
*/
- public function testStringValidation() {
+ public function testStringValidation(): void {
// User to add language and strings.
$admin_user = $this->drupalCreateUser([
'administer languages',
@@ -392,7 +392,7 @@ class LocaleTranslationUiTest extends BrowserTestBase {
/**
* Tests translation search form.
*/
- public function testStringSearch() {
+ public function testStringSearch(): void {
// User to add and remove language.
$admin_user = $this->drupalCreateUser([
'administer languages',
@@ -552,7 +552,7 @@ class LocaleTranslationUiTest extends BrowserTestBase {
/**
* Tests that only changed strings are saved customized when edited.
*/
- public function testUICustomizedStrings() {
+ public function testUICustomizedStrings(): void {
$user = $this->drupalCreateUser([
'translate interface',
'administer languages',
diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php
index 7c0b88f606e..2950ab3937f 100644
--- a/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php
@@ -42,7 +42,7 @@ class LocaleUpdateCronTest extends LocaleUpdateBase {
/**
* Tests interface translation update using cron.
*/
- public function testUpdateCron() {
+ public function testUpdateCron(): void {
// Set a flag to let the locale_test module replace the project data with a
// set of test projects.
\Drupal::state()->set('locale.test_projects_alter', TRUE);
diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php
index d87706236a5..67476923dbc 100644
--- a/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php
@@ -37,7 +37,7 @@ class LocaleUpdateDevelopmentReleaseTest extends BrowserTestBase {
$this->submitForm(['predefined_langcode' => 'hu'], 'Add language');
}
- public function testLocaleUpdateDevelopmentRelease() {
+ public function testLocaleUpdateDevelopmentRelease(): void {
$projects = locale_translation_build_projects();
$this->assertEquals('8.0.x', $projects['drupal']->info['version'], 'The branch of the core dev release.');
$this->assertEquals('12.x-10.x', $projects['contrib']->info['version'], 'The branch of the contrib module dev release.');
diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php
index e80287c7c74..12b0a0ae75f 100644
--- a/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php
@@ -46,7 +46,7 @@ class LocaleUpdateInterfaceTest extends LocaleUpdateBase {
* Testing the Available updates summary on the side wide status page and the
* Available translation updates page.
*/
- public function testInterface() {
+ public function testInterface(): void {
// No language added.
// Check status page and Available translation updates page.
$this->drupalGet('admin/reports/status');
diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
index 0a727854037..b5ffc3fa473 100644
--- a/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
@@ -58,7 +58,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
* the most recent files are selected in the different check scenarios: check
* for local files only, check for both local and remote files.
*/
- public function testUpdateCheckStatus() {
+ public function testUpdateCheckStatus(): void {
// Case when contributed modules are absent.
$this->drupalGet('admin/reports/translations');
$this->assertSession()->pageTextContains('Missing translations for one project');
@@ -116,7 +116,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
* - Source: remote and local files
* - Import overwrite: all existing translations
*/
- public function testUpdateImportSourceRemote() {
+ public function testUpdateImportSourceRemote(): void {
$config = $this->config('locale.settings');
// Build the test environment.
@@ -187,7 +187,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
* - Source: local files only
* - Import overwrite: all existing translations
*/
- public function testUpdateImportSourceLocal() {
+ public function testUpdateImportSourceLocal(): void {
$config = $this->config('locale.settings');
// Build the test environment.
@@ -247,7 +247,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
* - Source: remote and local files
* - Import overwrite: only overwrite non-customized translations
*/
- public function testUpdateImportModeNonCustomized() {
+ public function testUpdateImportModeNonCustomized(): void {
$config = $this->config('locale.settings');
// Build the test environment.
@@ -287,7 +287,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
* - Source: remote and local files
* - Import overwrite: don't overwrite any existing translation
*/
- public function testUpdateImportModeNone() {
+ public function testUpdateImportModeNone(): void {
$config = $this->config('locale.settings');
// Build the test environment.
@@ -323,7 +323,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
/**
* Tests automatic translation import when a module is enabled.
*/
- public function testEnableUninstallModule() {
+ public function testEnableUninstallModule(): void {
// Make the hidden test modules look like a normal custom module.
\Drupal::state()->set('locale.test_system_info_alter', TRUE);
@@ -363,7 +363,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
* enabled modules and will import them. When a language is removed the system
* will remove all translations of that language from the database.
*/
- public function testEnableLanguage() {
+ public function testEnableLanguage(): void {
// Make the hidden test modules look like a normal custom module.
\Drupal::state()->set('locale.test_system_info_alter', TRUE);
@@ -421,7 +421,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
/**
* Tests automatic translation import when a custom language is added.
*/
- public function testEnableCustomLanguage() {
+ public function testEnableCustomLanguage(): void {
// Make the hidden test modules look like a normal custom module.
\Drupal::state()->set('locale.test_system_info_alter', TRUE);
diff --git a/core/modules/locale/tests/src/Kernel/LocaleBuildTest.php b/core/modules/locale/tests/src/Kernel/LocaleBuildTest.php
index 9b85c5673a1..b2ab15fcd9a 100644
--- a/core/modules/locale/tests/src/Kernel/LocaleBuildTest.php
+++ b/core/modules/locale/tests/src/Kernel/LocaleBuildTest.php
@@ -25,7 +25,7 @@ class LocaleBuildTest extends KernelTestBase {
/**
* Checks if a list of translatable projects gets built.
*/
- public function testBuildProjects() {
+ public function testBuildProjects(): void {
$this->container->get('module_handler')->loadInclude('locale', 'compare.inc');
/** @var \Drupal\Core\Extension\ExtensionList $module_list */
$module_list = \Drupal::service('extension.list.module');
diff --git a/core/modules/locale/tests/src/Kernel/LocaleConfigManagerTest.php b/core/modules/locale/tests/src/Kernel/LocaleConfigManagerTest.php
index 76415a56629..e50984dd4af 100644
--- a/core/modules/locale/tests/src/Kernel/LocaleConfigManagerTest.php
+++ b/core/modules/locale/tests/src/Kernel/LocaleConfigManagerTest.php
@@ -38,7 +38,7 @@ class LocaleConfigManagerTest extends KernelTestBase {
/**
* Tests hasTranslation().
*/
- public function testHasTranslation() {
+ public function testHasTranslation(): void {
$this->installSchema('locale', ['locales_location', 'locales_source', 'locales_target']);
$this->installConfig(['locale_test']);
$locale_config_manager = \Drupal::service('locale.config_manager');
@@ -55,7 +55,7 @@ class LocaleConfigManagerTest extends KernelTestBase {
/**
* Tests getStringTranslation().
*/
- public function testGetStringTranslation() {
+ public function testGetStringTranslation(): void {
$this->installSchema('locale', ['locales_location', 'locales_source', 'locales_target']);
$this->installConfig(['locale_test']);
@@ -76,7 +76,7 @@ class LocaleConfigManagerTest extends KernelTestBase {
/**
* Tests getDefaultConfigLangcode().
*/
- public function testGetDefaultConfigLangcode() {
+ public function testGetDefaultConfigLangcode(): void {
// Install the Language module's configuration so we can use the
// module_installer service.
$this->installConfig(['language']);
diff --git a/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberForeignTest.php b/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberForeignTest.php
index 2389a8aca1a..8648ca59f70 100644
--- a/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberForeignTest.php
+++ b/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberForeignTest.php
@@ -46,7 +46,7 @@ class LocaleConfigSubscriberForeignTest extends LocaleConfigSubscriberTest {
/**
* Tests that the language of default configuration was updated.
*/
- public function testDefaultConfigLanguage() {
+ public function testDefaultConfigLanguage(): void {
$this->assertEquals('hu', $this->configFactory->getEditable('locale_test.no_translation')->get('langcode'));
$this->assertEquals('hu', $this->configFactory->getEditable('locale_test.translation')->get('langcode'));
$this->assertEquals('Hungarian test', $this->configFactory->getEditable('locale_test.translation')->get('test'));
@@ -55,7 +55,7 @@ class LocaleConfigSubscriberForeignTest extends LocaleConfigSubscriberTest {
/**
* Tests creating translations of shipped configuration.
*/
- public function testCreateActiveTranslation() {
+ public function testCreateActiveTranslation(): void {
$config_name = 'locale_test.no_translation';
$this->saveLanguageActive($config_name, 'test', 'Test (Hungarian)', 'hu');
$this->assertTranslation($config_name, 'Test (Hungarian)', 'hu');
@@ -64,7 +64,7 @@ class LocaleConfigSubscriberForeignTest extends LocaleConfigSubscriberTest {
/**
* Tests importing community translations of shipped configuration.
*/
- public function testLocaleCreateActiveTranslation() {
+ public function testLocaleCreateActiveTranslation(): void {
$config_name = 'locale_test.no_translation';
$this->saveLocaleTranslationData($config_name, 'test', 'Test', 'Test (Hungarian)', 'hu', TRUE);
$this->assertTranslation($config_name, 'Test (Hungarian)', 'hu', FALSE);
@@ -73,7 +73,7 @@ class LocaleConfigSubscriberForeignTest extends LocaleConfigSubscriberTest {
/**
* Tests updating translations of shipped configuration.
*/
- public function testUpdateActiveTranslation() {
+ public function testUpdateActiveTranslation(): void {
$config_name = 'locale_test.translation';
$this->saveLanguageActive($config_name, 'test', 'Updated Hungarian test', 'hu');
$this->assertTranslation($config_name, 'Updated Hungarian test', 'hu');
@@ -82,7 +82,7 @@ class LocaleConfigSubscriberForeignTest extends LocaleConfigSubscriberTest {
/**
* Tests updating community translations of shipped configuration.
*/
- public function testLocaleUpdateActiveTranslation() {
+ public function testLocaleUpdateActiveTranslation(): void {
$config_name = 'locale_test.translation';
$this->saveLocaleTranslationData($config_name, 'test', 'English test', 'Updated Hungarian test', 'hu', TRUE);
$this->assertTranslation($config_name, 'Updated Hungarian test', 'hu', FALSE);
@@ -91,7 +91,7 @@ class LocaleConfigSubscriberForeignTest extends LocaleConfigSubscriberTest {
/**
* Tests deleting a translation override.
*/
- public function testDeleteTranslation() {
+ public function testDeleteTranslation(): void {
$config_name = 'locale_test.translation';
$this->deleteLanguageOverride($config_name, 'test', 'English test', 'de');
// The German translation in this case will be forced to the Hungarian
@@ -102,7 +102,7 @@ class LocaleConfigSubscriberForeignTest extends LocaleConfigSubscriberTest {
/**
* Tests deleting translations of shipped configuration.
*/
- public function testDeleteActiveTranslation() {
+ public function testDeleteActiveTranslation(): void {
$config_name = 'locale_test.translation';
$this->configFactory->getEditable($config_name)->delete();
// Deleting active configuration should not change the locale translation.
@@ -112,7 +112,7 @@ class LocaleConfigSubscriberForeignTest extends LocaleConfigSubscriberTest {
/**
* Tests deleting community translations of shipped configuration.
*/
- public function testLocaleDeleteActiveTranslation() {
+ public function testLocaleDeleteActiveTranslation(): void {
$config_name = 'locale_test.translation';
$this->deleteLocaleTranslationData($config_name, 'test', 'English test', 'hu');
// Deleting the locale translation should not change active config.
@@ -122,7 +122,7 @@ class LocaleConfigSubscriberForeignTest extends LocaleConfigSubscriberTest {
/**
* Tests that adding English creates a translation override.
*/
- public function testEnglish() {
+ public function testEnglish(): void {
$config_name = 'locale_test.translation';
ConfigurableLanguage::createFromLangcode('en')->save();
// Adding a language on the UI would normally call updateConfigTranslations.
diff --git a/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php b/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php
index 844e353175c..e0dd50c9396 100644
--- a/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php
+++ b/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php
@@ -107,7 +107,7 @@ class LocaleConfigSubscriberTest extends KernelTestBase {
/**
* Tests creating translations of shipped configuration.
*/
- public function testCreateTranslation() {
+ public function testCreateTranslation(): void {
$config_name = 'locale_test.no_translation';
$this->saveLanguageOverride($config_name, 'test', 'Test (German)', 'de');
@@ -117,7 +117,7 @@ class LocaleConfigSubscriberTest extends KernelTestBase {
/**
* Tests creating translations configuration with multi value settings.
*/
- public function testCreateTranslationMultiValue() {
+ public function testCreateTranslationMultiValue(): void {
$config_name = 'locale_test.translation_multiple';
$this->saveLanguageOverride($config_name, 'test_multiple', ['string' => 'String (German)', 'another_string' => 'Another string (German)'], 'de');
@@ -134,7 +134,7 @@ class LocaleConfigSubscriberTest extends KernelTestBase {
/**
* Tests importing community translations of shipped configuration.
*/
- public function testLocaleCreateTranslation() {
+ public function testLocaleCreateTranslation(): void {
$config_name = 'locale_test.no_translation';
$this->saveLocaleTranslationData($config_name, 'test', 'Test', 'Test (German)', 'de');
@@ -144,7 +144,7 @@ class LocaleConfigSubscriberTest extends KernelTestBase {
/**
* Tests updating translations of shipped configuration.
*/
- public function testUpdateTranslation() {
+ public function testUpdateTranslation(): void {
$config_name = 'locale_test.translation';
$this->saveLanguageOverride($config_name, 'test', 'Updated German test', 'de');
@@ -154,7 +154,7 @@ class LocaleConfigSubscriberTest extends KernelTestBase {
/**
* Tests updating community translations of shipped configuration.
*/
- public function testLocaleUpdateTranslation() {
+ public function testLocaleUpdateTranslation(): void {
$config_name = 'locale_test.translation';
$this->saveLocaleTranslationData($config_name, 'test', 'English test', 'Updated German test', 'de');
@@ -164,7 +164,7 @@ class LocaleConfigSubscriberTest extends KernelTestBase {
/**
* Tests deleting translations of shipped configuration.
*/
- public function testDeleteTranslation() {
+ public function testDeleteTranslation(): void {
$config_name = 'locale_test.translation';
$this->deleteLanguageOverride($config_name, 'test', 'English test', 'de');
@@ -177,7 +177,7 @@ class LocaleConfigSubscriberTest extends KernelTestBase {
/**
* Tests deleting community translations of shipped configuration.
*/
- public function testLocaleDeleteTranslation() {
+ public function testLocaleDeleteTranslation(): void {
$config_name = 'locale_test.translation';
$this->deleteLocaleTranslationData($config_name, 'test', 'English test', 'de');
diff --git a/core/modules/locale/tests/src/Kernel/LocaleConfigurableLanguageManagerTest.php b/core/modules/locale/tests/src/Kernel/LocaleConfigurableLanguageManagerTest.php
index 584bd5b4eea..49c598596f6 100644
--- a/core/modules/locale/tests/src/Kernel/LocaleConfigurableLanguageManagerTest.php
+++ b/core/modules/locale/tests/src/Kernel/LocaleConfigurableLanguageManagerTest.php
@@ -22,7 +22,7 @@ class LocaleConfigurableLanguageManagerTest extends KernelTestBase {
*/
protected static $modules = ['language', 'locale'];
- public function testGetLanguages() {
+ public function testGetLanguages(): void {
$this->installSchema('locale', ['locales_source', 'locales_target', 'locales_location']);
$default_language = ConfigurableLanguage::create(['label' => $this->randomMachineName(), 'id' => 'default', 'weight' => 0]);
$default_language->save();
diff --git a/core/modules/locale/tests/src/Kernel/LocaleStringIsSafeTest.php b/core/modules/locale/tests/src/Kernel/LocaleStringIsSafeTest.php
index 731c4986abc..7bf7e1767b9 100644
--- a/core/modules/locale/tests/src/Kernel/LocaleStringIsSafeTest.php
+++ b/core/modules/locale/tests/src/Kernel/LocaleStringIsSafeTest.php
@@ -23,7 +23,7 @@ class LocaleStringIsSafeTest extends KernelTestBase {
/**
* Tests for locale_string_is_safe().
*/
- public function testLocaleStringIsSafe() {
+ public function testLocaleStringIsSafe(): void {
// Check a translatable string without HTML.
$string = 'Hello world!';
$result = locale_string_is_safe($string);
@@ -52,7 +52,7 @@ class LocaleStringIsSafeTest extends KernelTestBase {
* In each assert* call we add a new line at the expected result to match the
* newline at the end of the template file.
*/
- public function testLocalizedTokenizedString() {
+ public function testLocalizedTokenizedString(): void {
$tests_to_do = [
1 => [
'original' => 'Go to the <a href="[locale_test:security_test1]">frontpage</a>',
diff --git a/core/modules/locale/tests/src/Kernel/LocaleStringTest.php b/core/modules/locale/tests/src/Kernel/LocaleStringTest.php
index 5feb8854561..0c26efa016e 100644
--- a/core/modules/locale/tests/src/Kernel/LocaleStringTest.php
+++ b/core/modules/locale/tests/src/Kernel/LocaleStringTest.php
@@ -52,7 +52,7 @@ class LocaleStringTest extends KernelTestBase {
/**
* Tests CRUD API.
*/
- public function testStringCrudApi() {
+ public function testStringCrudApi(): void {
// Create source string.
$source = $this->buildSourceString()->save();
$this->assertNotEmpty($source->lid);
@@ -123,7 +123,7 @@ class LocaleStringTest extends KernelTestBase {
/**
* Tests Search API loading multiple objects.
*/
- public function testStringSearchApi() {
+ public function testStringSearchApi(): void {
$language_count = 3;
// Strings 1 and 2 will have some common prefix.
// Source 1 will have all translations, not customized.
diff --git a/core/modules/locale/tests/src/Kernel/LocaleTranslationProjectsTest.php b/core/modules/locale/tests/src/Kernel/LocaleTranslationProjectsTest.php
index b48a9407f91..a63aadd5734 100644
--- a/core/modules/locale/tests/src/Kernel/LocaleTranslationProjectsTest.php
+++ b/core/modules/locale/tests/src/Kernel/LocaleTranslationProjectsTest.php
@@ -46,7 +46,7 @@ class LocaleTranslationProjectsTest extends KernelTestBase {
/**
* Tests locale_translation_clear_cache_projects().
*/
- public function testLocaleTranslationClearCacheProjects() {
+ public function testLocaleTranslationClearCacheProjects(): void {
$this->moduleHandler->loadInclude('locale', 'inc', 'locale.translation');
$expected = [];
diff --git a/core/modules/locale/tests/src/Kernel/LocaleTranslationTest.php b/core/modules/locale/tests/src/Kernel/LocaleTranslationTest.php
index b716b58e7c7..316384330f8 100644
--- a/core/modules/locale/tests/src/Kernel/LocaleTranslationTest.php
+++ b/core/modules/locale/tests/src/Kernel/LocaleTranslationTest.php
@@ -23,7 +23,7 @@ class LocaleTranslationTest extends KernelTestBase {
/**
* Tests that \Drupal\locale\LocaleTranslation is serializable.
*/
- public function testSerializable() {
+ public function testSerializable(): void {
$translation = $this->container->get('string_translator.locale.lookup');
$this->assertInstanceOf(LocaleTranslation::class, $translation);
diff --git a/core/modules/locale/tests/src/Kernel/LocaleUpdateTest.php b/core/modules/locale/tests/src/Kernel/LocaleUpdateTest.php
index b8e643159c6..3c04dc0f8ee 100644
--- a/core/modules/locale/tests/src/Kernel/LocaleUpdateTest.php
+++ b/core/modules/locale/tests/src/Kernel/LocaleUpdateTest.php
@@ -25,7 +25,7 @@ class LocaleUpdateTest extends KernelTestBase {
/**
* Checks if a list of translatable projects gets build.
*/
- public function testUpdateProjects() {
+ public function testUpdateProjects(): void {
$this->container->get('module_handler')->loadInclude('locale', 'compare.inc');
// Make the test modules look like a normal custom module. I.e. make the
diff --git a/core/modules/locale/tests/src/Kernel/Migrate/MigrateLocaleConfigsTest.php b/core/modules/locale/tests/src/Kernel/Migrate/MigrateLocaleConfigsTest.php
index 411da9032b7..c5d74904dbe 100644
--- a/core/modules/locale/tests/src/Kernel/Migrate/MigrateLocaleConfigsTest.php
+++ b/core/modules/locale/tests/src/Kernel/Migrate/MigrateLocaleConfigsTest.php
@@ -32,7 +32,7 @@ class MigrateLocaleConfigsTest extends MigrateDrupal6TestBase {
/**
* Tests migration of locale variables to locale.settings.yml.
*/
- public function testLocaleSettings() {
+ public function testLocaleSettings(): void {
$config = $this->config('locale.settings');
$this->assertTrue($config->get('cache_strings'));
$this->assertSame('languages', $config->get('javascript.directory'));
diff --git a/core/modules/locale/tests/src/Unit/LocaleLookupTest.php b/core/modules/locale/tests/src/Unit/LocaleLookupTest.php
index 9095f3664ea..6e10c231b90 100644
--- a/core/modules/locale/tests/src/Unit/LocaleLookupTest.php
+++ b/core/modules/locale/tests/src/Unit/LocaleLookupTest.php
@@ -98,7 +98,7 @@ class LocaleLookupTest extends UnitTestCase {
*
* @covers ::resolveCacheMiss
*/
- public function testResolveCacheMissWithoutFallback() {
+ public function testResolveCacheMissWithoutFallback(): void {
$args = [
'language' => 'en',
'source' => 'test',
@@ -136,7 +136,7 @@ class LocaleLookupTest extends UnitTestCase {
*
* @dataProvider resolveCacheMissWithFallbackProvider
*/
- public function testResolveCacheMissWithFallback($langcode, $string, $context, $expected) {
+ public function testResolveCacheMissWithFallback($langcode, $string, $context, $expected): void {
// These are fake words!
// cSpell:disable
$translations = [
@@ -219,7 +219,7 @@ class LocaleLookupTest extends UnitTestCase {
*
* @covers ::resolveCacheMiss
*/
- public function testResolveCacheMissWithPersist() {
+ public function testResolveCacheMissWithPersist(): void {
$args = [
'language' => 'en',
'source' => 'test',
@@ -251,7 +251,7 @@ class LocaleLookupTest extends UnitTestCase {
*
* @covers ::resolveCacheMiss
*/
- public function testResolveCacheMissNoTranslation() {
+ public function testResolveCacheMissNoTranslation(): void {
$string = $this->createMock('Drupal\locale\StringInterface');
$string->expects($this->once())
->method('addLocation')
@@ -291,7 +291,7 @@ class LocaleLookupTest extends UnitTestCase {
* @covers ::resolveCacheMiss
* @dataProvider providerFixOldPluralTranslationProvider
*/
- public function testFixOldPluralStyleTranslations($translations, $langcode, $string, $is_fix) {
+ public function testFixOldPluralStyleTranslations($translations, $langcode, $string, $is_fix): void {
$this->storage->expects($this->any())
->method('findTranslation')
->willReturnCallback(function ($argument) use ($translations) {
@@ -349,7 +349,7 @@ class LocaleLookupTest extends UnitTestCase {
*
* @dataProvider getCidProvider
*/
- public function testGetCid(array $roles, $expected) {
+ public function testGetCid(array $roles, $expected): void {
$this->user = $this->createMock('Drupal\Core\Session\AccountInterface');
$this->user->expects($this->any())
->method('getRoles')
diff --git a/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php b/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php
index d146fceb638..a890b81106c 100644
--- a/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php
+++ b/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php
@@ -67,7 +67,7 @@ class LocaleTranslationTest extends UnitTestCase {
/**
* Tests for \Drupal\locale\LocaleTranslation::destruct().
*/
- public function testDestruct() {
+ public function testDestruct(): void {
$translation = new LocaleTranslation($this->storage, $this->cache, $this->lock, $this->getConfigFactoryStub(), $this->languageManager, $this->requestStack);
// Prove that destruction works without errors when translations are empty.
$this->assertNull($translation->destruct());
diff --git a/core/modules/locale/tests/src/Unit/Menu/LocaleLocalTasksTest.php b/core/modules/locale/tests/src/Unit/Menu/LocaleLocalTasksTest.php
index f56b021476b..34c29ed504e 100644
--- a/core/modules/locale/tests/src/Unit/Menu/LocaleLocalTasksTest.php
+++ b/core/modules/locale/tests/src/Unit/Menu/LocaleLocalTasksTest.php
@@ -28,7 +28,7 @@ class LocaleLocalTasksTest extends LocalTaskIntegrationTestBase {
*
* @dataProvider getLocalePageRoutes
*/
- public function testLocalePageLocalTasks($route) {
+ public function testLocalePageLocalTasks($route): void {
$tasks = [
0 => ['locale.translate_page', 'locale.translate_import', 'locale.translate_export', 'locale.settings'],
];
diff --git a/core/modules/locale/tests/src/Unit/StringBaseTest.php b/core/modules/locale/tests/src/Unit/StringBaseTest.php
index e05a069a5b1..42598a6189f 100644
--- a/core/modules/locale/tests/src/Unit/StringBaseTest.php
+++ b/core/modules/locale/tests/src/Unit/StringBaseTest.php
@@ -17,7 +17,7 @@ class StringBaseTest extends UnitTestCase {
/**
* @covers ::save
*/
- public function testSaveWithoutStorage() {
+ public function testSaveWithoutStorage(): void {
$string = new SourceString(['source' => 'test']);
$this->expectException(StringStorageException::class);
$this->expectExceptionMessage('The string cannot be saved because its not bound to a storage: test');
@@ -27,7 +27,7 @@ class StringBaseTest extends UnitTestCase {
/**
* @covers ::delete
*/
- public function testDeleteWithoutStorage() {
+ public function testDeleteWithoutStorage(): void {
$string = new SourceString(['lid' => 1, 'source' => 'test']);
$this->expectException(StringStorageException::class);
$this->expectExceptionMessage('The string cannot be deleted because its not bound to a storage: test');
diff --git a/core/modules/media/tests/src/Functional/FieldFormatter/MediaThumbnailFormatterTest.php b/core/modules/media/tests/src/Functional/FieldFormatter/MediaThumbnailFormatterTest.php
index 6fcebc7422f..435dc275da7 100644
--- a/core/modules/media/tests/src/Functional/FieldFormatter/MediaThumbnailFormatterTest.php
+++ b/core/modules/media/tests/src/Functional/FieldFormatter/MediaThumbnailFormatterTest.php
@@ -28,7 +28,7 @@ class MediaThumbnailFormatterTest extends MediaFunctionalTestBase {
/**
* Tests the media thumbnail field formatter.
*/
- public function testRender() {
+ public function testRender(): void {
$this->drupalLogin($this->adminUser);
/** @var \Drupal\node\NodeStorage $node_storage */
diff --git a/core/modules/media/tests/src/Functional/FieldFormatter/OEmbedFormatterTest.php b/core/modules/media/tests/src/Functional/FieldFormatter/OEmbedFormatterTest.php
index c5426291dab..88c2cbf8e01 100644
--- a/core/modules/media/tests/src/Functional/FieldFormatter/OEmbedFormatterTest.php
+++ b/core/modules/media/tests/src/Functional/FieldFormatter/OEmbedFormatterTest.php
@@ -160,7 +160,7 @@ class OEmbedFormatterTest extends MediaFunctionalTestBase {
/**
* Tests that oEmbed media types' display can be configured correctly.
*/
- public function testDisplayConfiguration() {
+ public function testDisplayConfiguration(): void {
$account = $this->drupalCreateUser(['administer media display']);
$this->drupalLogin($account);
@@ -192,7 +192,7 @@ class OEmbedFormatterTest extends MediaFunctionalTestBase {
*
* @dataProvider providerRender
*/
- public function testRender($url, $resource_url, array $formatter_settings, array $selectors, bool $self_closing) {
+ public function testRender($url, $resource_url, array $formatter_settings, array $selectors, bool $self_closing): void {
$account = $this->drupalCreateUser(['view media']);
$this->drupalLogin($account);
diff --git a/core/modules/media/tests/src/Functional/FieldWidget/OEmbedFieldWidgetTest.php b/core/modules/media/tests/src/Functional/FieldWidget/OEmbedFieldWidgetTest.php
index 417c4652ffd..7b624617d36 100644
--- a/core/modules/media/tests/src/Functional/FieldWidget/OEmbedFieldWidgetTest.php
+++ b/core/modules/media/tests/src/Functional/FieldWidget/OEmbedFieldWidgetTest.php
@@ -22,7 +22,7 @@ class OEmbedFieldWidgetTest extends MediaFunctionalTestBase {
/**
* Tests that the oEmbed field widget shows the configured help text.
*/
- public function testFieldWidgetHelpText() {
+ public function testFieldWidgetHelpText(): void {
$account = $this->drupalCreateUser(['create media']);
$this->drupalLogin($account);
diff --git a/core/modules/media/tests/src/Functional/MediaAccessTest.php b/core/modules/media/tests/src/Functional/MediaAccessTest.php
index 4410a70a627..36a07513a8d 100644
--- a/core/modules/media/tests/src/Functional/MediaAccessTest.php
+++ b/core/modules/media/tests/src/Functional/MediaAccessTest.php
@@ -46,7 +46,7 @@ class MediaAccessTest extends MediaFunctionalTestBase {
/**
* Tests some access control functionality.
*/
- public function testMediaAccess() {
+ public function testMediaAccess(): void {
$assert_session = $this->assertSession();
$media_type = $this->createMediaType('test');
@@ -238,7 +238,7 @@ class MediaAccessTest extends MediaFunctionalTestBase {
/**
* Tests view access control on the canonical page.
*/
- public function testCanonicalMediaAccess() {
+ public function testCanonicalMediaAccess(): void {
$media_type = $this->createMediaType('test');
$assert_session = $this->assertSession();
@@ -282,7 +282,7 @@ class MediaAccessTest extends MediaFunctionalTestBase {
/**
* Tests unpublished media access.
*/
- public function testUnpublishedMediaUserAccess() {
+ public function testUnpublishedMediaUserAccess(): void {
\Drupal::configFactory()
->getEditable('media.settings')
->set('standalone_url', TRUE)
@@ -324,7 +324,7 @@ class MediaAccessTest extends MediaFunctionalTestBase {
/**
* Tests media access of anonymous user.
*/
- public function testMediaAnonymousUserAccess() {
+ public function testMediaAnonymousUserAccess(): void {
\Drupal::configFactory()
->getEditable('media.settings')
->set('standalone_url', TRUE)
@@ -363,7 +363,7 @@ class MediaAccessTest extends MediaFunctionalTestBase {
/**
* Tests access for embedded medias.
*/
- public function testReferencedRendering() {
+ public function testReferencedRendering(): void {
\Drupal::configFactory()
->getEditable('media.settings')
->set('standalone_url', TRUE)
diff --git a/core/modules/media/tests/src/Functional/MediaBulkFormTest.php b/core/modules/media/tests/src/Functional/MediaBulkFormTest.php
index 3b2c9193ab8..85c1d59eb15 100644
--- a/core/modules/media/tests/src/Functional/MediaBulkFormTest.php
+++ b/core/modules/media/tests/src/Functional/MediaBulkFormTest.php
@@ -62,7 +62,7 @@ class MediaBulkFormTest extends MediaFunctionalTestBase {
/**
* Tests the media bulk form.
*/
- public function testBulkForm() {
+ public function testBulkForm(): void {
$session = $this->getSession();
$page = $session->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/media/tests/src/Functional/MediaContextualLinksTest.php b/core/modules/media/tests/src/Functional/MediaContextualLinksTest.php
index a556126c05c..c9325a9fe69 100644
--- a/core/modules/media/tests/src/Functional/MediaContextualLinksTest.php
+++ b/core/modules/media/tests/src/Functional/MediaContextualLinksTest.php
@@ -28,7 +28,7 @@ class MediaContextualLinksTest extends MediaFunctionalTestBase {
/**
* Tests contextual links.
*/
- public function testMediaContextualLinks() {
+ public function testMediaContextualLinks(): void {
\Drupal::configFactory()
->getEditable('media.settings')
->set('standalone_url', TRUE)
diff --git a/core/modules/media/tests/src/Functional/MediaInstallTest.php b/core/modules/media/tests/src/Functional/MediaInstallTest.php
index 9af1cf25bf8..af2736c13b6 100644
--- a/core/modules/media/tests/src/Functional/MediaInstallTest.php
+++ b/core/modules/media/tests/src/Functional/MediaInstallTest.php
@@ -34,7 +34,7 @@ class MediaInstallTest extends BrowserTestBase {
/**
* Tests reinstalling after being uninstalled.
*/
- public function testReinstallAfterUninstall() {
+ public function testReinstallAfterUninstall(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/media/tests/src/Functional/MediaOverviewPageTest.php b/core/modules/media/tests/src/Functional/MediaOverviewPageTest.php
index 7d1f63e38c1..9328ef04c26 100644
--- a/core/modules/media/tests/src/Functional/MediaOverviewPageTest.php
+++ b/core/modules/media/tests/src/Functional/MediaOverviewPageTest.php
@@ -39,7 +39,7 @@ class MediaOverviewPageTest extends MediaFunctionalTestBase {
/**
* Tests that the Media overview page (/admin/content/media).
*/
- public function testMediaOverviewPage() {
+ public function testMediaOverviewPage(): void {
$assert_session = $this->assertSession();
// Check the view exists, is access-restricted, and some defaults are there.
diff --git a/core/modules/media/tests/src/Functional/MediaRequirementsTest.php b/core/modules/media/tests/src/Functional/MediaRequirementsTest.php
index 26cf3c8b6f6..119c147ee95 100644
--- a/core/modules/media/tests/src/Functional/MediaRequirementsTest.php
+++ b/core/modules/media/tests/src/Functional/MediaRequirementsTest.php
@@ -27,7 +27,7 @@ class MediaRequirementsTest extends MediaFunctionalTestBase {
/**
* Tests that the requirements check can handle a missing source field.
*/
- public function testMissingSourceFieldDefinition() {
+ public function testMissingSourceFieldDefinition(): void {
$media_type = $this->createMediaType('test');
/** @var \Drupal\field\FieldConfigInterface $field_definition */
$field_definition = $media_type->getSource()
diff --git a/core/modules/media/tests/src/Functional/MediaRevisionTest.php b/core/modules/media/tests/src/Functional/MediaRevisionTest.php
index 2125945a925..0ba502c4406 100644
--- a/core/modules/media/tests/src/Functional/MediaRevisionTest.php
+++ b/core/modules/media/tests/src/Functional/MediaRevisionTest.php
@@ -54,7 +54,7 @@ class MediaRevisionTest extends MediaFunctionalTestBase {
/**
* Checks media revision operations.
*/
- public function testRevisions() {
+ public function testRevisions(): void {
$assert = $this->assertSession();
$media = $this->createMedia('Sample media');
@@ -105,7 +105,7 @@ class MediaRevisionTest extends MediaFunctionalTestBase {
/**
* Tests creating revisions of a File media item.
*/
- public function testFileMediaRevision() {
+ public function testFileMediaRevision(): void {
$assert = $this->assertSession();
$uri = 'temporary://foo.txt';
@@ -147,7 +147,7 @@ class MediaRevisionTest extends MediaFunctionalTestBase {
/**
* Tests creating revisions of an Image media item.
*/
- public function testImageMediaRevision() {
+ public function testImageMediaRevision(): void {
$assert = $this->assertSession();
$this->createMediaType('image', ['id' => 'image', 'new_revision' => TRUE]);
diff --git a/core/modules/media/tests/src/Functional/MediaSettingsTest.php b/core/modules/media/tests/src/Functional/MediaSettingsTest.php
index 9dd0eae02fa..eacfd11ec21 100644
--- a/core/modules/media/tests/src/Functional/MediaSettingsTest.php
+++ b/core/modules/media/tests/src/Functional/MediaSettingsTest.php
@@ -32,7 +32,7 @@ class MediaSettingsTest extends MediaFunctionalTestBase {
/**
* Tests that media warning appears if oEmbed media types exists.
*/
- public function testStatusPage() {
+ public function testStatusPage(): void {
$assert_session = $this->assertSession();
$this->drupalGet('admin/reports/status');
diff --git a/core/modules/media/tests/src/Functional/MediaSourceFileTest.php b/core/modules/media/tests/src/Functional/MediaSourceFileTest.php
index 0fd7ee1619d..dc0d5ff1fd9 100644
--- a/core/modules/media/tests/src/Functional/MediaSourceFileTest.php
+++ b/core/modules/media/tests/src/Functional/MediaSourceFileTest.php
@@ -21,7 +21,7 @@ class MediaSourceFileTest extends MediaFunctionalTestBase {
/**
* Tests that it's possible to change the allowed file extensions.
*/
- public function testSourceFieldSettingsEditing() {
+ public function testSourceFieldSettingsEditing(): void {
$session = $this->getSession();
$page = $session->getPage();
$assert_session = $this->assertSession();
@@ -49,7 +49,7 @@ class MediaSourceFileTest extends MediaFunctionalTestBase {
/**
* Ensure source field deletion is not possible.
*/
- public function testPreventSourceFieldDeletion() {
+ public function testPreventSourceFieldDeletion(): void {
$media_type = $this->createMediaType('file');
$media_type_id = $media_type->id();
diff --git a/core/modules/media/tests/src/Functional/MediaSourceImageTest.php b/core/modules/media/tests/src/Functional/MediaSourceImageTest.php
index 9c42f342bb7..6b03a3555ba 100644
--- a/core/modules/media/tests/src/Functional/MediaSourceImageTest.php
+++ b/core/modules/media/tests/src/Functional/MediaSourceImageTest.php
@@ -26,7 +26,7 @@ class MediaSourceImageTest extends MediaFunctionalTestBase {
/**
* Test that non-main properties do not trigger source field value change.
*/
- public function testOnlyMainPropertiesTriggerSourceFieldChanged() {
+ public function testOnlyMainPropertiesTriggerSourceFieldChanged(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/media/tests/src/Functional/MediaTemplateSuggestionsTest.php b/core/modules/media/tests/src/Functional/MediaTemplateSuggestionsTest.php
index 3bd0e15485f..10a9bb03be9 100644
--- a/core/modules/media/tests/src/Functional/MediaTemplateSuggestionsTest.php
+++ b/core/modules/media/tests/src/Functional/MediaTemplateSuggestionsTest.php
@@ -28,7 +28,7 @@ class MediaTemplateSuggestionsTest extends MediaFunctionalTestBase {
/**
* Tests template suggestions from media_theme_suggestions_media().
*/
- public function testMediaThemeHookSuggestions() {
+ public function testMediaThemeHookSuggestions(): void {
$media_type = $this->createMediaType('test', [
'queue_thumbnail_downloads' => FALSE,
]);
diff --git a/core/modules/media/tests/src/Functional/MediaTypeCreationTest.php b/core/modules/media/tests/src/Functional/MediaTypeCreationTest.php
index ed68216a57f..647da9e993b 100644
--- a/core/modules/media/tests/src/Functional/MediaTypeCreationTest.php
+++ b/core/modules/media/tests/src/Functional/MediaTypeCreationTest.php
@@ -31,7 +31,7 @@ class MediaTypeCreationTest extends MediaFunctionalTestBase {
*
* @dataProvider providerMediaTypeCreationForm
*/
- public function testMediaTypeCreationForm($button_label, $address, $machine_name) {
+ public function testMediaTypeCreationForm($button_label, $address, $machine_name): void {
$this->drupalGet('/admin/structure/media/add');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->fieldExists('label')->setValue($this->randomString());
diff --git a/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php b/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php
index d308711405a..c22f17616e0 100644
--- a/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php
+++ b/core/modules/media/tests/src/Functional/MediaUiFunctionalTest.php
@@ -44,7 +44,7 @@ class MediaUiFunctionalTest extends MediaFunctionalTestBase {
/**
* Tests the media actions (add/edit/delete).
*/
- public function testMediaWithOnlyOneMediaType() {
+ public function testMediaWithOnlyOneMediaType(): void {
$session = $this->getSession();
$page = $session->getPage();
$assert_session = $this->assertSession();
@@ -167,7 +167,7 @@ class MediaUiFunctionalTest extends MediaFunctionalTestBase {
* Tests if the "media/add" page gives you a selecting option if there are
* multiple media types available.
*/
- public function testMediaWithMultipleMediaTypes() {
+ public function testMediaWithMultipleMediaTypes(): void {
$assert_session = $this->assertSession();
// Tests and creates the first media type.
@@ -190,7 +190,7 @@ class MediaUiFunctionalTest extends MediaFunctionalTestBase {
/**
* Tests that media in ER fields use the Rendered Entity formatter by default.
*/
- public function testRenderedEntityReferencedMedia() {
+ public function testRenderedEntityReferencedMedia(): void {
$assert_session = $this->assertSession();
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Page']);
@@ -203,7 +203,7 @@ class MediaUiFunctionalTest extends MediaFunctionalTestBase {
/**
* Tests the redirect URL after creating a media item.
*/
- public function testMediaCreateRedirect() {
+ public function testMediaCreateRedirect(): void {
$session = $this->getSession();
$page = $session->getPage();
$assert_session = $this->assertSession();
@@ -247,7 +247,7 @@ class MediaUiFunctionalTest extends MediaFunctionalTestBase {
/**
* Tests the media collection route.
*/
- public function testMediaCollectionRoute() {
+ public function testMediaCollectionRoute(): void {
/** @var \Drupal\Core\Entity\EntityStorageInterface $media_storage */
$media_storage = $this->container->get('entity_type.manager')->getStorage('media');
diff --git a/core/modules/media/tests/src/Functional/MediaUiReferenceWidgetTest.php b/core/modules/media/tests/src/Functional/MediaUiReferenceWidgetTest.php
index 189049615cb..d43f3c51b0c 100644
--- a/core/modules/media/tests/src/Functional/MediaUiReferenceWidgetTest.php
+++ b/core/modules/media/tests/src/Functional/MediaUiReferenceWidgetTest.php
@@ -115,7 +115,7 @@ class MediaUiReferenceWidgetTest extends MediaFunctionalTestBase {
*
* @dataProvider providerTestMediaReferenceWidget
*/
- public function testMediaReferenceWidget($cardinality, array $media_type_create_access, $list_access, $widget_id = 'entity_reference_autocomplete') {
+ public function testMediaReferenceWidget($cardinality, array $media_type_create_access, $list_access, $widget_id = 'entity_reference_autocomplete'): void {
$assert_session = $this->assertSession();
// Create two content types.
diff --git a/core/modules/media/tests/src/Functional/ProviderRepositoryTest.php b/core/modules/media/tests/src/Functional/ProviderRepositoryTest.php
index 1e7001bd75c..0beacd89167 100644
--- a/core/modules/media/tests/src/Functional/ProviderRepositoryTest.php
+++ b/core/modules/media/tests/src/Functional/ProviderRepositoryTest.php
@@ -32,7 +32,7 @@ class ProviderRepositoryTest extends MediaFunctionalTestBase {
*
* @dataProvider providerEmptyProviderList
*/
- public function testEmptyProviderList($content) {
+ public function testEmptyProviderList($content): void {
$response = $this->prophesize('\GuzzleHttp\Psr7\Response');
$response->getBody()->willReturn(Utils::streamFor($content));
@@ -69,7 +69,7 @@ class ProviderRepositoryTest extends MediaFunctionalTestBase {
*
* @dataProvider providerNonExistingProviderDatabase
*/
- public function testNonExistingProviderDatabase($providers_url, $exception_message) {
+ public function testNonExistingProviderDatabase($providers_url, $exception_message): void {
$this->config('media.settings')
->set('oembed_providers_url', $providers_url)
->save();
diff --git a/core/modules/media/tests/src/Functional/ResourceFetcherTest.php b/core/modules/media/tests/src/Functional/ResourceFetcherTest.php
index 62632e2222f..ec327a73ac7 100644
--- a/core/modules/media/tests/src/Functional/ResourceFetcherTest.php
+++ b/core/modules/media/tests/src/Functional/ResourceFetcherTest.php
@@ -68,7 +68,7 @@ class ResourceFetcherTest extends MediaFunctionalTestBase {
*
* @dataProvider providerFetchResource
*/
- public function testFetchResource($resource_url, $provider_name, $title) {
+ public function testFetchResource($resource_url, $provider_name, $title): void {
/** @var \Drupal\media\OEmbed\Resource $resource */
$resource = $this->container->get('media.oembed.resource_fetcher')
->fetchResource($resource_url);
diff --git a/core/modules/media/tests/src/Functional/Rest/MediaResourceTestBase.php b/core/modules/media/tests/src/Functional/Rest/MediaResourceTestBase.php
index 619856bfad9..a0bab34bd44 100644
--- a/core/modules/media/tests/src/Functional/Rest/MediaResourceTestBase.php
+++ b/core/modules/media/tests/src/Functional/Rest/MediaResourceTestBase.php
@@ -312,7 +312,7 @@ abstract class MediaResourceTestBase extends EntityResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPost() {
+ public function testPost(): void {
$file_storage = $this->container->get('entity_type.manager')->getStorage('file');
// Step 1: upload file, results in File entity marked temporary.
diff --git a/core/modules/media/tests/src/Functional/UrlResolverTest.php b/core/modules/media/tests/src/Functional/UrlResolverTest.php
index 201a73e8f92..8c849f9ce3b 100644
--- a/core/modules/media/tests/src/Functional/UrlResolverTest.php
+++ b/core/modules/media/tests/src/Functional/UrlResolverTest.php
@@ -75,7 +75,7 @@ class UrlResolverTest extends MediaFunctionalTestBase {
*
* @dataProvider providerEndpointMatching
*/
- public function testEndpointMatching($url, $resource_url) {
+ public function testEndpointMatching($url, $resource_url): void {
$this->assertSame(
$resource_url,
$this->container->get('media.oembed.url_resolver')->getResourceUrl($url)
@@ -87,7 +87,7 @@ class UrlResolverTest extends MediaFunctionalTestBase {
*
* @depends testEndpointMatching
*/
- public function testResourceUrlAlterHook() {
+ public function testResourceUrlAlterHook(): void {
$this->container->get('module_installer')->install(['media_test_oembed']);
$resource_url = $this->container->get('media.oembed.url_resolver')
@@ -130,7 +130,7 @@ class UrlResolverTest extends MediaFunctionalTestBase {
*
* @dataProvider providerUrlDiscovery
*/
- public function testUrlDiscovery($url, $resource_url) {
+ public function testUrlDiscovery($url, $resource_url): void {
$this->assertSame(
$this->container->get('media.oembed.url_resolver')->getResourceUrl($url),
$resource_url
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaDisplayTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaDisplayTest.php
index 60b50ac72e6..fdc8884e3fd 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaDisplayTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaDisplayTest.php
@@ -50,7 +50,7 @@ class MediaDisplayTest extends MediaJavascriptTestBase {
/**
* Tests basic media display.
*/
- public function testMediaDisplay() {
+ public function testMediaDisplay(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiAddTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiAddTest.php
index 9f44ef78191..259f0831ed6 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiAddTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiAddTest.php
@@ -15,7 +15,7 @@ class MediaEmbedFilterConfigurationUiAddTest extends MediaEmbedFilterTestBase {
* @covers ::media_form_filter_format_add_form_alter
* @dataProvider providerTestValidations
*/
- public function testValidationWhenAdding($filter_html_status, $filter_align_status, $filter_caption_status, $filter_html_image_secure_status, $media_embed, $allowed_html, $expected_error_message) {
+ public function testValidationWhenAdding($filter_html_status, $filter_align_status, $filter_caption_status, $filter_html_image_secure_status, $media_embed, $allowed_html, $expected_error_message): void {
$this->drupalGet('admin/config/content/formats/add');
// Enable the `filter_html` and `media_embed` filters.
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiEditTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiEditTest.php
index 498bf758552..0b798f85533 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiEditTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiEditTest.php
@@ -15,7 +15,7 @@ class MediaEmbedFilterConfigurationUiEditTest extends MediaEmbedFilterTestBase {
* @covers ::media_form_filter_format_edit_form_alter
* @dataProvider providerTestValidations
*/
- public function testValidationWhenEditing($filter_html_status, $filter_align_status, $filter_caption_status, $filter_html_image_secure_status, $media_embed, $allowed_html, $expected_error_message) {
+ public function testValidationWhenEditing($filter_html_status, $filter_align_status, $filter_caption_status, $filter_html_image_secure_status, $media_embed, $allowed_html, $expected_error_message): void {
$this->drupalGet('admin/config/content/formats/manage/media_embed_test');
// Enable the `filter_html` and `media_embed` filters.
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaReferenceFieldHelpTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaReferenceFieldHelpTest.php
index 4f1cf6d2bf5..be1e173d6d2 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaReferenceFieldHelpTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaReferenceFieldHelpTest.php
@@ -29,7 +29,7 @@ class MediaReferenceFieldHelpTest extends MediaJavascriptTestBase {
*
* @see media_form_field_ui_field_storage_add_form_alter()
*/
- public function testFieldCreationHelpText() {
+ public function testFieldCreationHelpText(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceAudioVideoTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceAudioVideoTest.php
index 05ff322ecb3..24c071a501c 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceAudioVideoTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceAudioVideoTest.php
@@ -24,7 +24,7 @@ class MediaSourceAudioVideoTest extends MediaSourceTestBase {
/**
* Check the Audio source functionality.
*/
- public function testAudioTypeCreation() {
+ public function testAudioTypeCreation(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -73,7 +73,7 @@ class MediaSourceAudioVideoTest extends MediaSourceTestBase {
/**
* Check the Video source functionality.
*/
- public function testVideoTypeCreation() {
+ public function testVideoTypeCreation(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceFileTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceFileTest.php
index c0662b5a2b2..d2733594e3f 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceFileTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceFileTest.php
@@ -22,7 +22,7 @@ class MediaSourceFileTest extends MediaSourceTestBase {
/**
* Tests the file media source.
*/
- public function testMediaFileSource() {
+ public function testMediaFileSource(): void {
// Skipped due to frequent random test failures.
$this->markTestSkipped();
$media_type_id = 'test_media_file_type';
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceImageTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceImageTest.php
index 0707eebad23..caeaf909fff 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceImageTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceImageTest.php
@@ -28,7 +28,7 @@ class MediaSourceImageTest extends MediaSourceTestBase {
/**
* Tests the image media source.
*/
- public function testMediaImageSource() {
+ public function testMediaImageSource(): void {
$media_type_id = 'test_media_image_type';
$source_field_id = 'field_media_image';
$provided_fields = [
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php
index 5f7d268fb05..2397324680c 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php
@@ -58,7 +58,7 @@ class MediaSourceOEmbedVideoTest extends MediaSourceTestBase {
/**
* Tests the oembed media source.
*/
- public function testMediaOEmbedVideoSource() {
+ public function testMediaOEmbedVideoSource(): void {
$media_type_id = 'test_media_oembed_type';
$provided_fields = [
'type',
@@ -238,7 +238,7 @@ class MediaSourceOEmbedVideoTest extends MediaSourceTestBase {
/**
* Tests that a security warning appears if iFrame domain is not set.
*/
- public function testOEmbedSecurityWarning() {
+ public function testOEmbedSecurityWarning(): void {
$media_type_id = 'test_media_oembed_type';
$source_id = 'oembed:video';
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaStandardProfileTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaStandardProfileTest.php
index 5fedf7ff3f6..2038495a8f4 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaStandardProfileTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaStandardProfileTest.php
@@ -48,7 +48,7 @@ class MediaStandardProfileTest extends MediaJavascriptTestBase {
* This prevents installing the standard profile for every test case and
* increases the performance of this test.
*/
- public function testMediaSources() {
+ public function testMediaSources(): void {
// This test currently frequently causes the SQLite database to lock, so
// skip the test on SQLite until the issue can be resolved.
// @todo https://www.drupal.org/project/drupal/issues/3273626
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaTypeCreationTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaTypeCreationTest.php
index 29495c9b367..699d97e9a18 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaTypeCreationTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaTypeCreationTest.php
@@ -23,7 +23,7 @@ class MediaTypeCreationTest extends MediaJavascriptTestBase {
/**
* Tests the source field behavior on the add media type form.
*/
- public function testSourceChangeOnMediaTypeCreationForm() {
+ public function testSourceChangeOnMediaTypeCreationForm(): void {
$session = $this->getSession();
$page = $session->getPage();
$assert_session = $this->assertSession();
@@ -62,7 +62,7 @@ class MediaTypeCreationTest extends MediaJavascriptTestBase {
/**
* Tests the media type creation form.
*/
- public function testMediaTypeCreationFormWithDefaultField() {
+ public function testMediaTypeCreationFormWithDefaultField(): void {
$session = $this->getSession();
$page = $session->getPage();
$assert_session = $this->assertSession();
@@ -149,7 +149,7 @@ class MediaTypeCreationTest extends MediaJavascriptTestBase {
/**
* Tests creation of media type, reusing an existing source field.
*/
- public function testMediaTypeCreationReuseSourceField() {
+ public function testMediaTypeCreationReuseSourceField(): void {
$session = $this->getSession();
$page = $session->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaUiJavascriptTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaUiJavascriptTest.php
index 6b98436161f..2fe4586bd57 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaUiJavascriptTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaUiJavascriptTest.php
@@ -50,7 +50,7 @@ class MediaUiJavascriptTest extends MediaJavascriptTestBase {
/**
* Tests a media type administration.
*/
- public function testMediaTypes() {
+ public function testMediaTypes(): void {
$session = $this->getSession();
$page = $session->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaViewsWizardTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaViewsWizardTest.php
index 1bdad51ef1b..1654f5879b2 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaViewsWizardTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaViewsWizardTest.php
@@ -24,7 +24,7 @@ class MediaViewsWizardTest extends MediaJavascriptTestBase {
/**
* Tests adding a view of media.
*/
- public function testMediaWizard() {
+ public function testMediaWizard(): void {
$session = $this->getSession();
$page = $session->getPage();
$assert_session = $this->assertSession();
@@ -60,7 +60,7 @@ class MediaViewsWizardTest extends MediaJavascriptTestBase {
/**
* Tests adding a view of media revisions.
*/
- public function testMediaRevisionWizard() {
+ public function testMediaRevisionWizard(): void {
$session = $this->getSession();
$page = $session->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/media/tests/src/Kernel/MediaAccessControlHandlerTest.php b/core/modules/media/tests/src/Kernel/MediaAccessControlHandlerTest.php
index 09522ba1bd3..f4b7ec987a5 100644
--- a/core/modules/media/tests/src/Kernel/MediaAccessControlHandlerTest.php
+++ b/core/modules/media/tests/src/Kernel/MediaAccessControlHandlerTest.php
@@ -42,7 +42,7 @@ class MediaAccessControlHandlerTest extends MediaKernelTestBase {
* @covers ::checkAccess
* @dataProvider providerAccess
*/
- public function testAccess(array $permissions, array $entity_values, string $operation, AccessResultInterface $expected_result, array $expected_cache_contexts, array $expected_cache_tags, bool $is_latest_revision) {
+ public function testAccess(array $permissions, array $entity_values, string $operation, AccessResultInterface $expected_result, array $expected_cache_contexts, array $expected_cache_tags, bool $is_latest_revision): void {
/** @var \Drupal\Core\Entity\RevisionableStorageInterface $entityStorage $entity_storage */
$entity_storage = $this->container->get('entity_type.manager')->getStorage('media');
@@ -91,7 +91,7 @@ class MediaAccessControlHandlerTest extends MediaKernelTestBase {
* @covers ::checkCreateAccess
* @dataProvider providerCreateAccess
*/
- public function testCreateAccess(array $permissions, AccessResultInterface $expected_result, array $expected_cache_contexts, array $expected_cache_tags) {
+ public function testCreateAccess(array $permissions, AccessResultInterface $expected_result, array $expected_cache_contexts, array $expected_cache_tags): void {
$user = $this->createUser($permissions);
/** @var \Drupal\Core\Entity\EntityAccessControlHandlerInterface $access_handler */
diff --git a/core/modules/media/tests/src/Kernel/MediaCreationTest.php b/core/modules/media/tests/src/Kernel/MediaCreationTest.php
index ff30f523e13..9034c3f5a3e 100644
--- a/core/modules/media/tests/src/Kernel/MediaCreationTest.php
+++ b/core/modules/media/tests/src/Kernel/MediaCreationTest.php
@@ -21,7 +21,7 @@ class MediaCreationTest extends MediaKernelTestBase {
/**
* Tests creating a media type programmatically.
*/
- public function testMediaTypeCreation() {
+ public function testMediaTypeCreation(): void {
$media_type_storage = $this->container->get('entity_type.manager')->getStorage('media_type');
$this->assertInstanceOf(MediaTypeInterface::class, MediaType::load($this->testMediaType->id()));
@@ -63,7 +63,7 @@ class MediaCreationTest extends MediaKernelTestBase {
/**
* Tests creating a media item programmatically.
*/
- public function testMediaEntityCreation() {
+ public function testMediaEntityCreation(): void {
$media = Media::create([
'bundle' => $this->testMediaType->id(),
'name' => 'Unnamed',
diff --git a/core/modules/media/tests/src/Kernel/MediaEmbedFilterDisabledIntegrationsTest.php b/core/modules/media/tests/src/Kernel/MediaEmbedFilterDisabledIntegrationsTest.php
index 2118c9bcfee..ed81c85ccb7 100644
--- a/core/modules/media/tests/src/Kernel/MediaEmbedFilterDisabledIntegrationsTest.php
+++ b/core/modules/media/tests/src/Kernel/MediaEmbedFilterDisabledIntegrationsTest.php
@@ -38,7 +38,7 @@ class MediaEmbedFilterDisabledIntegrationsTest extends MediaEmbedFilterTestBase
* @covers ::renderMedia
* @covers ::disableContextualLinks
*/
- public function testDisabledIntegrations() {
+ public function testDisabledIntegrations(): void {
$text = $this->createEmbedCode([
'data-entity-type' => 'media',
'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID,
diff --git a/core/modules/media/tests/src/Kernel/MediaEmbedFilterTest.php b/core/modules/media/tests/src/Kernel/MediaEmbedFilterTest.php
index eb2d1d3bdca..e283aae92bb 100644
--- a/core/modules/media/tests/src/Kernel/MediaEmbedFilterTest.php
+++ b/core/modules/media/tests/src/Kernel/MediaEmbedFilterTest.php
@@ -29,7 +29,7 @@ class MediaEmbedFilterTest extends MediaEmbedFilterTestBase {
*
* @dataProvider providerTestBasics
*/
- public function testBasics(array $embed_attributes, $expected_view_mode, array $expected_attributes, CacheableMetadata $expected_cacheability) {
+ public function testBasics(array $embed_attributes, $expected_view_mode, array $expected_attributes, CacheableMetadata $expected_cacheability): void {
$content = $this->createEmbedCode($embed_attributes);
$result = $this->applyFilter($content);
@@ -131,7 +131,7 @@ class MediaEmbedFilterTest extends MediaEmbedFilterTestBase {
*
* @dataProvider providerAccessUnpublished
*/
- public function testAccessUnpublished($allowed_to_view_unpublished, $expected_rendered, CacheableMetadata $expected_cacheability, array $expected_attachments) {
+ public function testAccessUnpublished($allowed_to_view_unpublished, $expected_rendered, CacheableMetadata $expected_cacheability, array $expected_attachments): void {
// Unpublish the embedded entity so we can test variations in behavior.
$this->embeddedEntity->setUnpublished()->save();
@@ -203,7 +203,7 @@ class MediaEmbedFilterTest extends MediaEmbedFilterTestBase {
* @covers ::applyPerEmbedMediaOverrides
* @dataProvider providerOverridesAltAndTitle
*/
- public function testOverridesAltAndTitle($title_field_property_enabled, array $expected_title_attributes) {
+ public function testOverridesAltAndTitle($title_field_property_enabled, array $expected_title_attributes): void {
// The `alt` field property is enabled by default, the `title` one is not.
if ($title_field_property_enabled) {
$source_field = FieldConfig::load('media.image.field_media_image');
@@ -280,7 +280,7 @@ class MediaEmbedFilterTest extends MediaEmbedFilterTestBase {
*
* @dataProvider providerMissingEntityIndicator
*/
- public function testMissingEntityIndicator($uuid, array $filter_ids, array $additional_attributes) {
+ public function testMissingEntityIndicator($uuid, array $filter_ids, array $additional_attributes): void {
$content = $this->createEmbedCode([
'data-entity-type' => 'media',
'data-entity-uuid' => $uuid,
@@ -360,7 +360,7 @@ class MediaEmbedFilterTest extends MediaEmbedFilterTestBase {
/**
* Tests that only <drupal-media> tags are processed.
*/
- public function testOnlyDrupalMediaTagProcessed() {
+ public function testOnlyDrupalMediaTagProcessed(): void {
$content = $this->createEmbedCode([
'data-entity-type' => 'media',
'data-entity-uuid' => $this->embeddedEntity->uuid(),
@@ -375,7 +375,7 @@ class MediaEmbedFilterTest extends MediaEmbedFilterTestBase {
/**
* Tests recursive rendering protection.
*/
- public function testRecursionProtection() {
+ public function testRecursionProtection(): void {
$text = $this->createEmbedCode([
'data-entity-type' => 'media',
'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID,
@@ -398,7 +398,7 @@ class MediaEmbedFilterTest extends MediaEmbedFilterTestBase {
* @covers \Drupal\filter\Plugin\Filter\FilterCaption
* @dataProvider providerFilterIntegration
*/
- public function testFilterIntegration(array $filter_ids, array $additional_attributes, $verification_selector, $expected_verification_success, array $expected_asset_libraries = [], $prefix = '', $suffix = '') {
+ public function testFilterIntegration(array $filter_ids, array $additional_attributes, $verification_selector, $expected_verification_success, array $expected_asset_libraries = [], $prefix = '', $suffix = ''): void {
$content = $this->createEmbedCode([
'data-entity-type' => 'media',
'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID,
diff --git a/core/modules/media/tests/src/Kernel/MediaEmbedFilterTranslationTest.php b/core/modules/media/tests/src/Kernel/MediaEmbedFilterTranslationTest.php
index 87ef07995b9..e5c9079c131 100644
--- a/core/modules/media/tests/src/Kernel/MediaEmbedFilterTranslationTest.php
+++ b/core/modules/media/tests/src/Kernel/MediaEmbedFilterTranslationTest.php
@@ -46,7 +46,7 @@ class MediaEmbedFilterTranslationTest extends MediaEmbedFilterTestBase {
*
* @dataProvider providerTranslationSituations
*/
- public function testTranslationSelection($text_langcode, $expected_title_langcode) {
+ public function testTranslationSelection($text_langcode, $expected_title_langcode): void {
$text = $this->createEmbedCode([
'data-entity-type' => 'media',
'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID,
diff --git a/core/modules/media/tests/src/Kernel/MediaLinkRelationsTest.php b/core/modules/media/tests/src/Kernel/MediaLinkRelationsTest.php
index a31a1970420..cc5077988bd 100644
--- a/core/modules/media/tests/src/Kernel/MediaLinkRelationsTest.php
+++ b/core/modules/media/tests/src/Kernel/MediaLinkRelationsTest.php
@@ -16,7 +16,7 @@ class MediaLinkRelationsTest extends MediaKernelTestBase {
/**
* Tests that all link relationships for Media exist.
*/
- public function testExistLinkRelationships() {
+ public function testExistLinkRelationships(): void {
/** @var \Drupal\Core\Http\LinkRelationTypeManager $link_relation_type_manager */
$link_relation_type_manager = $this->container->get('plugin.manager.link_relation_type');
$media = Media::create(['bundle' => $this->testMediaType->id()]);
diff --git a/core/modules/media/tests/src/Kernel/MediaMappingsConstraintValidatorTest.php b/core/modules/media/tests/src/Kernel/MediaMappingsConstraintValidatorTest.php
index f3c14403047..907e879bf39 100644
--- a/core/modules/media/tests/src/Kernel/MediaMappingsConstraintValidatorTest.php
+++ b/core/modules/media/tests/src/Kernel/MediaMappingsConstraintValidatorTest.php
@@ -35,7 +35,7 @@ class MediaMappingsConstraintValidatorTest extends KernelTestBase {
/**
* @covers ::validate
*/
- public function testMediaMappingSource() {
+ public function testMediaMappingSource(): void {
$media_type = $this->createMediaType('image', [
'id' => 'test',
]);
diff --git a/core/modules/media/tests/src/Kernel/MediaSourceFileTest.php b/core/modules/media/tests/src/Kernel/MediaSourceFileTest.php
index e5514efd4cf..971b9ccf6de 100644
--- a/core/modules/media/tests/src/Kernel/MediaSourceFileTest.php
+++ b/core/modules/media/tests/src/Kernel/MediaSourceFileTest.php
@@ -14,7 +14,7 @@ class MediaSourceFileTest extends MediaKernelTestBase {
/**
* Tests the file extension constraint.
*/
- public function testFileExtensionConstraint() {
+ public function testFileExtensionConstraint(): void {
$mediaType = $this->createMediaType('file');
// Create a random file that should fail.
$media = $this->generateMedia('test.patch', $mediaType);
@@ -32,7 +32,7 @@ class MediaSourceFileTest extends MediaKernelTestBase {
/**
* Tests a media file can be deleted.
*/
- public function testFileDeletion() {
+ public function testFileDeletion(): void {
$mediaType = $this->createMediaType('file');
$media = $this->generateMedia('test.txt', $mediaType);
$media->save();
diff --git a/core/modules/media/tests/src/Kernel/MediaSourceTest.php b/core/modules/media/tests/src/Kernel/MediaSourceTest.php
index 5e7b28eeec2..04310f18c5f 100644
--- a/core/modules/media/tests/src/Kernel/MediaSourceTest.php
+++ b/core/modules/media/tests/src/Kernel/MediaSourceTest.php
@@ -25,7 +25,7 @@ class MediaSourceTest extends MediaKernelTestBase {
/**
* Tests that metadata is correctly mapped irrespective of how media is saved.
*/
- public function testSave() {
+ public function testSave(): void {
$field_storage = FieldStorageConfig::create([
'entity_type' => 'media',
'field_name' => 'field_to_map_to',
@@ -91,7 +91,7 @@ class MediaSourceTest extends MediaKernelTestBase {
/**
* Tests default media name functionality.
*/
- public function testDefaultName() {
+ public function testDefaultName(): void {
// Make sure that the default name is set if not provided by the user.
/** @var \Drupal\media\MediaInterface $media */
$media = Media::create(['bundle' => $this->testMediaType->id()]);
@@ -135,7 +135,7 @@ class MediaSourceTest extends MediaKernelTestBase {
/**
* Tests metadata mapping functionality.
*/
- public function testMetadataMapping() {
+ public function testMetadataMapping(): void {
$field_name = 'field_to_map_to';
$attribute_name = 'attribute_to_map';
$storage = FieldStorageConfig::create([
@@ -216,7 +216,7 @@ class MediaSourceTest extends MediaKernelTestBase {
/**
* Tests the getSourceFieldValue() method.
*/
- public function testGetSourceFieldValue() {
+ public function testGetSourceFieldValue(): void {
/** @var \Drupal\media\MediaInterface $media */
$media = Media::create([
'bundle' => $this->testMediaType->id(),
@@ -234,7 +234,7 @@ class MediaSourceTest extends MediaKernelTestBase {
/**
* Tests the thumbnail functionality.
*/
- public function testThumbnail() {
+ public function testThumbnail(): void {
file_put_contents('public://thumbnail1.jpg', '');
file_put_contents('public://thumbnail2.jpg', '');
@@ -384,7 +384,7 @@ class MediaSourceTest extends MediaKernelTestBase {
/**
* Tests the media item constraints functionality.
*/
- public function testConstraints() {
+ public function testConstraints(): void {
// Test entity constraints.
\Drupal::state()->set('media_source_test_entity_constraints', [
'MediaTestConstraint' => [],
@@ -451,7 +451,7 @@ class MediaSourceTest extends MediaKernelTestBase {
/**
* Tests logic related to the automated source field creation.
*/
- public function testSourceFieldCreation() {
+ public function testSourceFieldCreation(): void {
/** @var \Drupal\media\MediaTypeInterface $type */
$type = MediaType::create([
'id' => 'test_type',
@@ -536,7 +536,7 @@ class MediaSourceTest extends MediaKernelTestBase {
/**
* Tests configuration form submit handler on the base media source plugin.
*/
- public function testSourceConfigurationSubmit() {
+ public function testSourceConfigurationSubmit(): void {
/** @var \Drupal\media\MediaSourceManager $manager */
$manager = $this->container->get('plugin.manager.media.source');
$form = [];
@@ -571,7 +571,7 @@ class MediaSourceTest extends MediaKernelTestBase {
/**
* Tests different display options for the source field.
*/
- public function testDifferentSourceFieldDisplays() {
+ public function testDifferentSourceFieldDisplays(): void {
$id = 'test_different_displays';
$field_name = 'field_media_different_display';
@@ -592,7 +592,7 @@ class MediaSourceTest extends MediaKernelTestBase {
/**
* Tests hidden source field in media type.
*/
- public function testHiddenSourceField() {
+ public function testHiddenSourceField(): void {
$id = 'test_hidden_source_field';
$field_name = 'field_media_hidden';
diff --git a/core/modules/media/tests/src/Kernel/MediaTest.php b/core/modules/media/tests/src/Kernel/MediaTest.php
index c932fb906c7..9fe65a2cd53 100644
--- a/core/modules/media/tests/src/Kernel/MediaTest.php
+++ b/core/modules/media/tests/src/Kernel/MediaTest.php
@@ -16,7 +16,7 @@ class MediaTest extends MediaKernelTestBase {
/**
* Tests various aspects of a media item.
*/
- public function testEntity() {
+ public function testEntity(): void {
$media = Media::create(['bundle' => $this->testMediaType->id()]);
$this->assertSame($media, $media->setOwnerId($this->user->id()), 'setOwnerId() method returns its own entity.');
@@ -25,7 +25,7 @@ class MediaTest extends MediaKernelTestBase {
/**
* Tests the Media "name" base field behavior.
*/
- public function testNameBaseField() {
+ public function testNameBaseField(): void {
/** @var \Drupal\Core\Field\BaseFieldDefinition[] $field_definitions */
$field_definitions = $this->container->get('entity_field.manager')
->getBaseFieldDefinitions('media');
@@ -39,7 +39,7 @@ class MediaTest extends MediaKernelTestBase {
/**
* Tests permissions based on a media type have the correct permissions.
*/
- public function testPermissions() {
+ public function testPermissions(): void {
$permissions = $this->container->get('user.permissions')->getPermissions();
$name = "create {$this->testMediaType->id()} media";
$this->assertArrayHasKey($name, $permissions);
diff --git a/core/modules/media/tests/src/Kernel/MediaTranslationTest.php b/core/modules/media/tests/src/Kernel/MediaTranslationTest.php
index 5161b795001..198a22e50e4 100644
--- a/core/modules/media/tests/src/Kernel/MediaTranslationTest.php
+++ b/core/modules/media/tests/src/Kernel/MediaTranslationTest.php
@@ -52,7 +52,7 @@ class MediaTranslationTest extends MediaKernelTestBase {
/**
* Tests translatable fields storage/retrieval.
*/
- public function testTranslatableFieldSaveLoad() {
+ public function testTranslatableFieldSaveLoad(): void {
/** @var \Drupal\Core\Entity\EntityTypeInterface $entity_type */
$entity_type = $this->container->get('entity_type.manager')->getDefinition('media');
$this->assertTrue($entity_type->isTranslatable(), 'Media is translatable.');
diff --git a/core/modules/media/tests/src/Kernel/OEmbedIframeControllerTest.php b/core/modules/media/tests/src/Kernel/OEmbedIframeControllerTest.php
index cabb585a524..05005000471 100644
--- a/core/modules/media/tests/src/Kernel/OEmbedIframeControllerTest.php
+++ b/core/modules/media/tests/src/Kernel/OEmbedIframeControllerTest.php
@@ -50,7 +50,7 @@ class OEmbedIframeControllerTest extends MediaKernelTestBase {
*
* @covers ::render
*/
- public function testBadHashParameter($hash) {
+ public function testBadHashParameter($hash): void {
/** @var callable $controller */
$controller = $this->container
->get('controller_resolver')
@@ -74,7 +74,7 @@ class OEmbedIframeControllerTest extends MediaKernelTestBase {
*
* @covers ::render
*/
- public function testResourcePassedToPreprocess() {
+ public function testResourcePassedToPreprocess(): void {
$hash = $this->container->get('media.oembed.iframe_url_helper')
->getHash('', 0, 0);
diff --git a/core/modules/media/tests/src/Kernel/OEmbedResourceConstraintValidatorTest.php b/core/modules/media/tests/src/Kernel/OEmbedResourceConstraintValidatorTest.php
index c069c05ac9e..8b6bc1282e5 100644
--- a/core/modules/media/tests/src/Kernel/OEmbedResourceConstraintValidatorTest.php
+++ b/core/modules/media/tests/src/Kernel/OEmbedResourceConstraintValidatorTest.php
@@ -41,7 +41,7 @@ class OEmbedResourceConstraintValidatorTest extends KernelTestBase {
/**
* @covers ::validate
*/
- public function testValidateEmptySource() {
+ public function testValidateEmptySource(): void {
$media = Media::create([
'bundle' => $this->createMediaType('oembed:video')->id(),
]);
@@ -68,7 +68,7 @@ class OEmbedResourceConstraintValidatorTest extends KernelTestBase {
/**
* @covers ::validate
*/
- public function testValidateUrlResolverInvoked() {
+ public function testValidateUrlResolverInvoked(): void {
$media = Media::create([
'bundle' => $this->createMediaType('oembed:video')->id(),
'field_media_oembed_video' => 'source value',
diff --git a/core/modules/media/tests/src/Kernel/OEmbedSourceTest.php b/core/modules/media/tests/src/Kernel/OEmbedSourceTest.php
index 8385d35e66e..38664c1b157 100644
--- a/core/modules/media/tests/src/Kernel/OEmbedSourceTest.php
+++ b/core/modules/media/tests/src/Kernel/OEmbedSourceTest.php
@@ -34,7 +34,7 @@ class OEmbedSourceTest extends MediaKernelTestBase {
/**
* @covers ::getMetadata
*/
- public function testGetMetadata() {
+ public function testGetMetadata(): void {
$configuration = [
'source_field' => 'field_test_oembed',
];
diff --git a/core/modules/media/tests/src/Kernel/Views/RevisionUserTest.php b/core/modules/media/tests/src/Kernel/Views/RevisionUserTest.php
index a374baa95d7..907ad9a151c 100644
--- a/core/modules/media/tests/src/Kernel/Views/RevisionUserTest.php
+++ b/core/modules/media/tests/src/Kernel/Views/RevisionUserTest.php
@@ -86,7 +86,7 @@ class RevisionUserTest extends ViewsKernelTestBase {
/**
* Tests the media_revision_user relationship.
*/
- public function testRevisionUser() {
+ public function testRevisionUser(): void {
$primary_author = $this->createUser();
$secondary_author = $this->createUser();
diff --git a/core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php b/core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php
index c4eb068ffcc..cd384efb2b4 100644
--- a/core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php
+++ b/core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php
@@ -77,7 +77,7 @@ class IFrameUrlHelperTest extends UnitTestCase {
*
* @dataProvider providerIsSecure
*/
- public function testIsSecure($url, $base_url, $secure) {
+ public function testIsSecure($url, $base_url, $secure): void {
$request_context = $this->createMock(RequestContext::class);
$request_context->expects($this->any())
->method('getCompleteBaseUrl')
diff --git a/core/modules/media/tests/src/Unit/ResourceTest.php b/core/modules/media/tests/src/Unit/ResourceTest.php
index cff1d3ab5bb..2c5904763ea 100644
--- a/core/modules/media/tests/src/Unit/ResourceTest.php
+++ b/core/modules/media/tests/src/Unit/ResourceTest.php
@@ -77,7 +77,7 @@ class ResourceTest extends UnitTestCase {
* @covers ::setDimensions
* @dataProvider setDimensionsTestCases
*/
- public function testSetDimensions($factory, $width, $height, $exception = NULL, $expected_width = NULL, $expected_height = NULL) {
+ public function testSetDimensions($factory, $width, $height, $exception = NULL, $expected_width = NULL, $expected_height = NULL): void {
if ($exception) {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage($exception);
diff --git a/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php b/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php
index 53fb0b9996c..f00a57e42ea 100644
--- a/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php
+++ b/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php
@@ -55,7 +55,7 @@ class MediaLibraryDisplayModeTest extends BrowserTestBase {
/**
* Tests that the Media Library can automatically configure display modes.
*/
- public function testDisplayModes() {
+ public function testDisplayModes(): void {
$this->createMediaType('file', [
'id' => 'type_one',
]);
diff --git a/core/modules/media_library/tests/src/Functional/SettingsFormTest.php b/core/modules/media_library/tests/src/Functional/SettingsFormTest.php
index 52a5af04f41..02cb854ae35 100644
--- a/core/modules/media_library/tests/src/Functional/SettingsFormTest.php
+++ b/core/modules/media_library/tests/src/Functional/SettingsFormTest.php
@@ -27,7 +27,7 @@ class SettingsFormTest extends BrowserTestBase {
/**
* Tests the Media Library settings form.
*/
- public function testSettingsForm() {
+ public function testSettingsForm(): void {
$account = $this->drupalCreateUser([
'access administration pages',
'administer media',
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/ContentModerationTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/ContentModerationTest.php
index a892fb05ea2..2d0460b0b29 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/ContentModerationTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/ContentModerationTest.php
@@ -188,7 +188,7 @@ class ContentModerationTest extends WebDriverTestBase {
/**
* Tests the media library widget only shows published media.
*/
- public function testAdministrationPage() {
+ public function testAdministrationPage(): void {
// User 1 should be able to see all media items.
$this->drupalLogin($this->rootUser);
$this->drupalGet('admin/content/media');
@@ -258,7 +258,7 @@ class ContentModerationTest extends WebDriverTestBase {
/**
* Tests the media library widget only shows published media.
*/
- public function testWidget() {
+ public function testWidget(): void {
$assert_session = $this->assertSession();
// All users should only be able to see published media items.
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/EmbeddedFormWidgetTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/EmbeddedFormWidgetTest.php
index dfe78f74195..1fb1b9a9352 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/EmbeddedFormWidgetTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/EmbeddedFormWidgetTest.php
@@ -97,7 +97,7 @@ class EmbeddedFormWidgetTest extends WebDriverTestBase {
*
* @dataProvider insertionReselectionProvider
*/
- public function testInsertionAndReselection($widget) {
+ public function testInsertionAndReselection($widget): void {
$this->container
->get('entity_display.repository')
->getFormDisplay('node', 'basic_page')
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php
index 9af1d593440..d432e031379 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php
@@ -74,7 +74,7 @@ class EntityReferenceWidgetTest extends MediaLibraryTestBase {
/**
* Tests that disabled media items don't capture focus on page load.
*/
- public function testFocusNotAppliedWithoutSelectionChange() {
+ public function testFocusNotAppliedWithoutSelectionChange(): void {
// Create a node with the maximum number of values for the field_twin_media
// field.
$node = $this->drupalCreateNode([
@@ -99,7 +99,7 @@ class EntityReferenceWidgetTest extends MediaLibraryTestBase {
/**
* Tests that the Media library's widget works as expected.
*/
- public function testWidget() {
+ public function testWidget(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -474,7 +474,7 @@ class EntityReferenceWidgetTest extends MediaLibraryTestBase {
/**
* Tests saving a required media library field.
*/
- public function testRequiredMediaField() {
+ public function testRequiredMediaField(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -599,7 +599,7 @@ JS;
/**
* Tests the preview displayed by the field widget.
*/
- public function testWidgetPreview() {
+ public function testWidgetPreview(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/FieldUiIntegrationTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/FieldUiIntegrationTest.php
index 4f27f165f1b..f3039311678 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/FieldUiIntegrationTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/FieldUiIntegrationTest.php
@@ -57,7 +57,7 @@ class FieldUiIntegrationTest extends MediaLibraryTestBase {
/**
* Tests field UI integration for media library widget.
*/
- public function testFieldUiIntegration() {
+ public function testFieldUiIntegration(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
$user = $this->drupalCreateUser([
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/MediaOverviewTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/MediaOverviewTest.php
index a79a8ccfdbb..a88502c6596 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/MediaOverviewTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/MediaOverviewTest.php
@@ -58,7 +58,7 @@ class MediaOverviewTest extends MediaLibraryTestBase {
/**
* Tests that the Media Library's administration page works as expected.
*/
- public function testAdministrationPage() {
+ public function testAdministrationPage(): void {
$session = $this->getSession();
$page = $session->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/TranslationsTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/TranslationsTest.php
index 4285aebff4f..f3dbb33ad1b 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/TranslationsTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/TranslationsTest.php
@@ -121,7 +121,7 @@ class TranslationsTest extends WebDriverTestBase {
/**
* Tests the media library widget shows all media only once.
*/
- public function testMediaLibraryTranslations() {
+ public function testMediaLibraryTranslations(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/ViewsUiIntegrationTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/ViewsUiIntegrationTest.php
index f47635b7726..73df14ec6fc 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/ViewsUiIntegrationTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/ViewsUiIntegrationTest.php
@@ -50,7 +50,7 @@ class ViewsUiIntegrationTest extends MediaLibraryTestBase {
/**
* Tests that the integration with Views works correctly.
*/
- public function testViewsAdmin() {
+ public function testViewsAdmin(): void {
$page = $this->getSession()->getPage();
// Assert that the widget can be seen and that there are 8 items.
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/WidgetAccessTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/WidgetAccessTest.php
index 7e27d0d09be..78f4d6acf00 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/WidgetAccessTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/WidgetAccessTest.php
@@ -25,7 +25,7 @@ class WidgetAccessTest extends MediaLibraryTestBase {
/**
* Tests that the widget access works as expected.
*/
- public function testWidgetAccess() {
+ public function testWidgetAccess(): void {
$assert_session = $this->assertSession();
$session = $this->getSession();
@@ -142,7 +142,7 @@ class WidgetAccessTest extends MediaLibraryTestBase {
/**
* Tests the widget with a required field that the user can't access.
*/
- public function testRequiredFieldNoAccess() {
+ public function testRequiredFieldNoAccess(): void {
// Make field_single_media_type required.
$fieldConfig = FieldConfig::loadByName('node', 'basic_page', 'field_single_media_type');
assert($fieldConfig instanceof FieldConfig);
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/WidgetAnonymousTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/WidgetAnonymousTest.php
index b54393b440f..d7efb311cda 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/WidgetAnonymousTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/WidgetAnonymousTest.php
@@ -45,7 +45,7 @@ class WidgetAnonymousTest extends MediaLibraryTestBase {
/**
* Tests that the widget works as expected for anonymous users.
*/
- public function testWidgetAnonymous() {
+ public function testWidgetAnonymous(): void {
$assert_session = $this->assertSession();
// Allow the anonymous user to create pages and view media.
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/WidgetOEmbedTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/WidgetOEmbedTest.php
index 42cb0595121..46277c473e6 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/WidgetOEmbedTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/WidgetOEmbedTest.php
@@ -51,7 +51,7 @@ class WidgetOEmbedTest extends MediaLibraryTestBase {
/**
* Tests that oEmbed media can be added in the Media library's widget.
*/
- public function testWidgetOEmbed() {
+ public function testWidgetOEmbed(): void {
$this->hijackProviderEndpoints();
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
@@ -238,7 +238,7 @@ class WidgetOEmbedTest extends MediaLibraryTestBase {
* @todo Merge this with testWidgetOEmbed() in
* https://www.drupal.org/project/drupal/issues/3087227
*/
- public function testWidgetOEmbedAdvancedUi() {
+ public function testWidgetOEmbedAdvancedUi(): void {
$this->config('media_library.settings')->set('advanced_ui', TRUE)->save();
$this->hijackProviderEndpoints();
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/WidgetUploadTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/WidgetUploadTest.php
index 483638746b1..40a1f70c987 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/WidgetUploadTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/WidgetUploadTest.php
@@ -27,7 +27,7 @@ class WidgetUploadTest extends MediaLibraryTestBase {
/**
* Tests that uploads in the 'media_library_widget' works as expected.
*/
- public function testWidgetUpload() {
+ public function testWidgetUpload(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
$driver = $this->getSession()->getDriver();
@@ -371,7 +371,7 @@ class WidgetUploadTest extends MediaLibraryTestBase {
* @todo Merge this with testWidgetUpload() in
* https://www.drupal.org/project/drupal/issues/3087227
*/
- public function testWidgetUploadAdvancedUi() {
+ public function testWidgetUploadAdvancedUi(): void {
$this->config('media_library.settings')->set('advanced_ui', TRUE)->save();
$assert_session = $this->assertSession();
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/WidgetViewsTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/WidgetViewsTest.php
index dd8e58a2a9a..09933c865a7 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/WidgetViewsTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/WidgetViewsTest.php
@@ -72,7 +72,7 @@ class WidgetViewsTest extends MediaLibraryTestBase {
/**
* Tests that the views in the Media library's widget work as expected.
*/
- public function testWidgetViews() {
+ public function testWidgetViews(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/WidgetWithoutTypesTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/WidgetWithoutTypesTest.php
index e4b03b1acb7..87eaea2af68 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/WidgetWithoutTypesTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/WidgetWithoutTypesTest.php
@@ -27,7 +27,7 @@ class WidgetWithoutTypesTest extends MediaLibraryTestBase {
/**
* Tests that the widget works as expected when media types are deleted.
*/
- public function testWidgetWithoutMediaTypes() {
+ public function testWidgetWithoutMediaTypes(): void {
$assert_session = $this->assertSession();
$user = $this->drupalCreateUser([
diff --git a/core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php b/core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php
index dcfb5e60f8b..31dba044ae9 100644
--- a/core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php
+++ b/core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php
@@ -88,7 +88,7 @@ class MediaLibraryAccessTest extends KernelTestBase {
/**
* Tests that the field widget opener respects entity creation permissions.
*/
- public function testFieldWidgetEntityCreateAccess() {
+ public function testFieldWidgetEntityCreateAccess(): void {
/** @var \Drupal\media_library\MediaLibraryUiBuilder $ui_builder */
$ui_builder = $this->container->get('media_library.ui_builder');
@@ -122,7 +122,7 @@ class MediaLibraryAccessTest extends KernelTestBase {
*
* @dataProvider editorOpenerAccessProvider
*/
- public function testEditorOpenerAccess($media_embed_enabled, $can_use_format) {
+ public function testEditorOpenerAccess($media_embed_enabled, $can_use_format): void {
$format = $this->container
->get('entity_type.manager')
->getStorage('filter_format')->create([
@@ -185,7 +185,7 @@ class MediaLibraryAccessTest extends KernelTestBase {
/**
* Tests that the field widget opener respects entity-specific access.
*/
- public function testFieldWidgetEntityEditAccess() {
+ public function testFieldWidgetEntityEditAccess(): void {
/** @var \Drupal\media_library\MediaLibraryUiBuilder $ui_builder */
$ui_builder = $this->container->get('media_library.ui_builder');
@@ -261,7 +261,7 @@ class MediaLibraryAccessTest extends KernelTestBase {
*
* @dataProvider providerFieldWidgetEntityFieldAccess
*/
- public function testFieldWidgetEntityFieldAccess(string $field_type) {
+ public function testFieldWidgetEntityFieldAccess(string $field_type): void {
$field_storage = FieldStorageConfig::create([
'type' => $field_type,
'entity_type' => 'entity_test_with_bundle',
@@ -319,7 +319,7 @@ class MediaLibraryAccessTest extends KernelTestBase {
/**
* Tests that media library access respects the media_library view.
*/
- public function testViewAccess() {
+ public function testViewAccess(): void {
/** @var \Drupal\media_library\MediaLibraryUiBuilder $ui_builder */
$ui_builder = $this->container->get('media_library.ui_builder');
diff --git a/core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php b/core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php
index defdd2ad7d0..1ff7738f516 100644
--- a/core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php
+++ b/core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php
@@ -67,7 +67,7 @@ class MediaLibraryAddFormTest extends KernelTestBase {
/**
* Tests the media library add form.
*/
- public function testMediaTypeAddForm() {
+ public function testMediaTypeAddForm(): void {
$entity_type_manager = \Drupal::entityTypeManager();
$image = $entity_type_manager->getStorage('media_type')->load('image');
$remote_video = $entity_type_manager->getStorage('media_type')->load('remote_video');
@@ -121,7 +121,7 @@ class MediaLibraryAddFormTest extends KernelTestBase {
/**
* Tests the validation of the library state in the media library add form.
*/
- public function testFormStateValidation() {
+ public function testFormStateValidation(): void {
$form_state = new FormState();
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('The media library state is not present in the form state.');
@@ -131,7 +131,7 @@ class MediaLibraryAddFormTest extends KernelTestBase {
/**
* Tests the validation of the selected type in the media library add form.
*/
- public function testSelectedTypeValidation() {
+ public function testSelectedTypeValidation(): void {
$state = MediaLibraryState::create('test', ['image', 'remote_video', 'header_image'], 'header_image', -1);
$form_state = new FormState();
$form_state->set('media_library_state', $state);
@@ -143,7 +143,7 @@ class MediaLibraryAddFormTest extends KernelTestBase {
/**
* Tests overwriting of the add form.
*/
- public function testDifferentAddForm() {
+ public function testDifferentAddForm(): void {
$this->enableModules(['media_library_form_overwrite_test']);
$entity_type_manager = \Drupal::entityTypeManager();
diff --git a/core/modules/media_library/tests/src/Kernel/MediaLibraryStateTest.php b/core/modules/media_library/tests/src/Kernel/MediaLibraryStateTest.php
index 84839b820ee..a861d534892 100644
--- a/core/modules/media_library/tests/src/Kernel/MediaLibraryStateTest.php
+++ b/core/modules/media_library/tests/src/Kernel/MediaLibraryStateTest.php
@@ -65,7 +65,7 @@ class MediaLibraryStateTest extends KernelTestBase {
/**
* Tests the media library state methods.
*/
- public function testMethods() {
+ public function testMethods(): void {
$opener_id = 'test';
$allowed_media_type_ids = ['document', 'image'];
$selected_media_type_id = 'image';
@@ -100,7 +100,7 @@ class MediaLibraryStateTest extends KernelTestBase {
* @covers ::create
* @dataProvider providerCreate
*/
- public function testCreate($opener_id, array $allowed_media_type_ids, $selected_type_id, $remaining_slots, $exception_message = '') {
+ public function testCreate($opener_id, array $allowed_media_type_ids, $selected_type_id, $remaining_slots, $exception_message = ''): void {
if ($exception_message) {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage($exception_message);
@@ -278,7 +278,7 @@ class MediaLibraryStateTest extends KernelTestBase {
* @covers ::fromRequest
* @dataProvider providerFromRequest
*/
- public function testFromRequest(array $query_overrides, $exception_expected) {
+ public function testFromRequest(array $query_overrides, $exception_expected): void {
// Override the query parameters and verify an exception is thrown when
// required state parameters are changed.
$query = MediaLibraryState::create('test', ['file', 'image'], 'image', 2)->all();
@@ -295,7 +295,7 @@ class MediaLibraryStateTest extends KernelTestBase {
/**
* @covers ::fromRequest
*/
- public function testFromRequestQueryLess() {
+ public function testFromRequestQueryLess(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('The opener ID parameter is required and must be a string.');
$state = MediaLibraryState::fromRequest(new Request());
@@ -366,7 +366,7 @@ class MediaLibraryStateTest extends KernelTestBase {
/**
* @covers ::getOpenerParameters
*/
- public function testOpenerParameters() {
+ public function testOpenerParameters(): void {
$state = MediaLibraryState::create('test', ['file'], 'file', -1, [
'foo' => 'baz',
]);
@@ -376,7 +376,7 @@ class MediaLibraryStateTest extends KernelTestBase {
/**
* Tests that hash is unaffected by allowed media type order.
*/
- public function testHashUnaffectedByMediaTypeOrder() {
+ public function testHashUnaffectedByMediaTypeOrder(): void {
$state1 = MediaLibraryState::create('test', ['file', 'image'], 'image', 2);
$state2 = MediaLibraryState::create('test', ['image', 'file'], 'image', 2);
$this->assertSame($state1->getHash(), $state2->getHash());
@@ -385,7 +385,7 @@ class MediaLibraryStateTest extends KernelTestBase {
/**
* Tests that hash is unaffected by opener parameter order.
*/
- public function testHashUnaffectedByOpenerParamOrder() {
+ public function testHashUnaffectedByOpenerParamOrder(): void {
$state1 = MediaLibraryState::create('test', ['file'], 'file', -1, [
'foo' => 'baz',
'baz' => 'foo',
diff --git a/core/modules/media_library/tests/src/Kernel/MediaLibraryWidgetTest.php b/core/modules/media_library/tests/src/Kernel/MediaLibraryWidgetTest.php
index dc32bcfd496..744d8776b41 100644
--- a/core/modules/media_library/tests/src/Kernel/MediaLibraryWidgetTest.php
+++ b/core/modules/media_library/tests/src/Kernel/MediaLibraryWidgetTest.php
@@ -98,7 +98,7 @@ class MediaLibraryWidgetTest extends KernelTestBase {
/**
* Test the media library widget access.
*/
- public function testWidgetAccess() {
+ public function testWidgetAccess(): void {
$entity = EntityTest::create([
'name' => 'sample entity',
]);
@@ -110,7 +110,7 @@ class MediaLibraryWidgetTest extends KernelTestBase {
/**
* Test the media library widget access with a revisionable entity type.
*/
- public function testRevisionableWidgetAccess() {
+ public function testRevisionableWidgetAccess(): void {
$allowed_revision = EntityTestRev::create([
'name' => 'allowed_access',
]);
diff --git a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php
index b490b8d3f9f..afe1cc34aa6 100644
--- a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php
+++ b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php
@@ -39,7 +39,7 @@ class MenuLinkContentDeleteFormTest extends BrowserTestBase {
/**
* Tests the MenuLinkContentDeleteForm class.
*/
- public function testMenuLinkContentDeleteForm() {
+ public function testMenuLinkContentDeleteForm(): void {
// Add new menu item.
$this->drupalGet('admin/structure/menu/manage/admin/add');
$this->submitForm([
diff --git a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php
index 412f40d8b94..10f523d8f4a 100644
--- a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php
+++ b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php
@@ -60,7 +60,7 @@ class MenuLinkContentFormTest extends BrowserTestBase {
/**
* Tests the 'link to any page' permission for a restricted page.
*/
- public function testMenuLinkContentFormLinkToAnyPage() {
+ public function testMenuLinkContentFormLinkToAnyPage(): void {
$menu_link = MenuLinkContent::create([
'title' => 'Menu link test',
'provider' => 'menu_link_content',
@@ -86,7 +86,7 @@ class MenuLinkContentFormTest extends BrowserTestBase {
/**
* Tests the MenuLinkContentForm class.
*/
- public function testMenuLinkContentForm() {
+ public function testMenuLinkContentForm(): void {
$this->drupalGet('admin/structure/menu/manage/admin/add');
// Test that other menus are not available when creating a new menu link.
$this->assertSession()->optionNotExists('edit-menu-parent', 'main:');
@@ -105,7 +105,7 @@ class MenuLinkContentFormTest extends BrowserTestBase {
/**
* Tests validation for the MenuLinkContentForm class.
*/
- public function testMenuLinkContentFormValidation() {
+ public function testMenuLinkContentFormValidation(): void {
$this->drupalGet('admin/structure/menu/manage/admin/add');
$this->submitForm([
'title[0][value]' => 'Test page',
@@ -117,7 +117,7 @@ class MenuLinkContentFormTest extends BrowserTestBase {
/**
* Tests the operations links alter related functional for menu_link_content.
*/
- public function testMenuLinkContentOperationsLink() {
+ public function testMenuLinkContentOperationsLink(): void {
\Drupal::service('module_installer')->install(['menu_operations_link_test']);
$menu_link = MenuLinkContent::create([
'title' => 'Menu link test',
diff --git a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php
index 91313eed275..fd2f3ff9429 100644
--- a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php
+++ b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php
@@ -74,7 +74,7 @@ class MenuLinkContentTranslationUITest extends ContentTranslationUITestBase {
/**
* Ensure that a translate link can be found on the menu edit form.
*/
- public function testTranslationLinkOnMenuEditForm() {
+ public function testTranslationLinkOnMenuEditForm(): void {
$this->drupalGet('admin/structure/menu/manage/tools');
$this->assertSession()->linkNotExists('Translate');
@@ -91,7 +91,7 @@ class MenuLinkContentTranslationUITest extends ContentTranslationUITestBase {
/**
* Tests that translation page inherits admin status of edit page.
*/
- public function testTranslationLinkTheme() {
+ public function testTranslationLinkTheme(): void {
$this->drupalLogin($this->administrator);
$entityId = $this->createEntity([], 'en');
diff --git a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php
index f5d7e7f804c..7bfd96a34ae 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php
@@ -58,7 +58,7 @@ class MenuLinkContentCacheabilityBubblingTest extends KernelTestBase {
/**
* Tests bubbleable metadata of menu links' outbound route/path processing.
*/
- public function testOutboundPathAndRouteProcessing() {
+ public function testOutboundPathAndRouteProcessing(): void {
$request_stack = \Drupal::requestStack();
/** @var \Symfony\Component\Routing\RequestContext $request_context */
$request_context = \Drupal::service('router.request_context');
diff --git a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentDeriverTest.php b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentDeriverTest.php
index 581bcdb5688..8bc185f00e7 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentDeriverTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentDeriverTest.php
@@ -41,7 +41,7 @@ class MenuLinkContentDeriverTest extends KernelTestBase {
/**
* Tests the rediscovering.
*/
- public function testRediscover() {
+ public function testRediscover(): void {
\Drupal::state()->set('menu_link_content_dynamic_route.routes', [
'route_name_1' => new Route('/example-path'),
]);
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 015a8ff86f9..0c296462639 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php
@@ -138,7 +138,7 @@ class MenuLinksTest extends KernelTestBase {
/**
* Assert that a link entity's created timestamp is set.
*/
- public function testCreateLink() {
+ public function testCreateLink(): void {
$options = [
'menu_name' => 'menu-test',
'bundle' => 'menu_link_content',
@@ -162,7 +162,7 @@ class MenuLinksTest extends KernelTestBase {
/**
* Tests that menu link pointing to entities get removed on entity remove.
*/
- public function testMenuLinkOnEntityDelete() {
+ public function testMenuLinkOnEntityDelete(): void {
// Create user.
$user = User::create(['name' => 'username']);
@@ -211,7 +211,7 @@ class MenuLinksTest extends KernelTestBase {
/**
* Tests automatic reparenting of menu links.
*/
- public function testMenuLinkReparenting($module = 'menu_test') {
+ public function testMenuLinkReparenting($module = 'menu_test'): void {
// Check the initial hierarchy.
$links = $this->createLinkHierarchy($module);
@@ -277,7 +277,7 @@ class MenuLinksTest extends KernelTestBase {
/**
* Tests the MenuLinkContent::preDelete function.
*/
- public function testMenuLinkContentReparenting() {
+ public function testMenuLinkContentReparenting(): void {
// Add new menu items in a hierarchy.
$parent = MenuLinkContent::create([
'title' => $this->randomMachineName(8),
@@ -311,7 +311,7 @@ class MenuLinksTest extends KernelTestBase {
/**
* Tests uninstalling a module providing default links.
*/
- public function testModuleUninstalledMenuLinks() {
+ public function testModuleUninstalledMenuLinks(): void {
\Drupal::service('module_installer')->install(['menu_test']);
\Drupal::service('plugin.manager.menu.link')->rebuild();
$menu_links = $this->menuLinkManager->loadLinksByRoute('menu_test.menu_test');
@@ -331,7 +331,7 @@ class MenuLinksTest extends KernelTestBase {
*
* @covers \Drupal\menu_link_content\Plugin\Validation\Constraint\MenuTreeHierarchyConstraintValidator::validate
*/
- public function testPendingRevisions() {
+ public function testPendingRevisions(): void {
/** @var \Drupal\Core\Entity\RevisionableStorageInterface $storage */
$storage = \Drupal::entityTypeManager()->getStorage('menu_link_content');
diff --git a/core/modules/menu_link_content/tests/src/Kernel/Migrate/MigrateMenuLinkContentStubTest.php b/core/modules/menu_link_content/tests/src/Kernel/Migrate/MigrateMenuLinkContentStubTest.php
index 446bf7bf955..27ec1a7c148 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/Migrate/MigrateMenuLinkContentStubTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/Migrate/MigrateMenuLinkContentStubTest.php
@@ -32,7 +32,7 @@ class MigrateMenuLinkContentStubTest extends MigrateDrupalTestBase {
/**
* Tests creation of menu link content stubs.
*/
- public function testStub() {
+ public function testStub(): void {
$this->performStubTest('menu_link_content');
}
diff --git a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkLocalizedTest.php b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkLocalizedTest.php
index 90cbc597370..69726693722 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkLocalizedTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkLocalizedTest.php
@@ -49,7 +49,7 @@ class MigrateMenuLinkLocalizedTest extends MigrateNodeTestBase {
/**
* Tests migration of menu link localized translations.
*/
- public function testMenuLinkLocalized() {
+ public function testMenuLinkLocalized(): void {
// A localized menu link.
$this->assertEntity('463', 'fr', 'fr - Test 1', 'secondary-links', 'fr - Test menu link 1', TRUE, FALSE, [
'attributes' => ['title' => 'fr - Test menu link 1'],
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 95433e265c4..81cbcdcbdb3 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
@@ -87,7 +87,7 @@ class MigrateMenuLinkTest extends MigrateNodeTestBase {
/**
* Tests migration of menu links.
*/
- public function testMenuLinks() {
+ public function testMenuLinks(): void {
$this->assertEntity('138', 'Test 1', 'secondary-links', 'Test menu link 1', TRUE, FALSE, ['attributes' => ['title' => 'Test menu link 1'], 'langcode' => 'en'], 'internal:/user/login', -50);
$this->assertEntity('139', 'Test 2', 'secondary-links', 'Test menu link 2', TRUE, TRUE, ['query' => ['foo' => 'bar'], 'attributes' => ['title' => 'Test menu link 2']], 'internal:/admin', -49);
$this->assertEntity('140', 'Drupal.org', 'secondary-links', NULL, TRUE, FALSE, ['attributes' => ['title' => '']], 'https://www.drupal.org', -50);
diff --git a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTranslationTest.php b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTranslationTest.php
index 786c8348f1a..3156baf14cf 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTranslationTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTranslationTest.php
@@ -46,7 +46,7 @@ class MigrateMenuLinkTranslationTest extends MigrateDrupal6TestBase {
/**
* Tests migration of menu links.
*/
- public function testMenuLinks() {
+ public function testMenuLinks(): void {
/** @var \Drupal\menu_link_content\Entity\MenuLinkContent $menu_link */
$menu_link = MenuLinkContent::load(139)->getTranslation('fr');
$this->assertInstanceOf(MenuLinkContent::class, $menu_link);
diff --git a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkLocalizedTest.php b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkLocalizedTest.php
index b85984a95d9..45f47c24a94 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkLocalizedTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkLocalizedTest.php
@@ -46,7 +46,7 @@ class MigrateMenuLinkLocalizedTest extends MigrateDrupal7TestBase {
/**
* Tests migration of menu link localized translations.
*/
- public function testMenuLinkLocalized() {
+ public function testMenuLinkLocalized(): void {
// A translate and localize menu, menu-test-menu.
$this->assertEntity(468, 'en', 'Yahoo', 'menu-test-menu', 'english description', TRUE, FALSE, ['attributes' => ['title' => 'english description'], 'alter' => TRUE], 'http://yahoo.com', 0);
$this->assertEntity(468, 'fr', 'fr - Yahoo', 'menu-test-menu', 'fr - description', TRUE, FALSE, ['attributes' => ['title' => 'english description'], 'alter' => TRUE], 'http://yahoo.com', 0);
diff --git a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php
index c7eb0bfd3d7..fa657573689 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php
@@ -60,7 +60,7 @@ class MigrateMenuLinkTest extends MigrateDrupal7TestBase {
/**
* Tests migration of menu links.
*/
- public function testMenuLinks() {
+ public function testMenuLinks(): void {
$this->assertEntity(469, 'und', 'Bing', static::MENU_NAME, 'Bing', TRUE, FALSE, ['attributes' => ['title' => 'Bing']], 'http://bing.com', 0);
// This link has an i18n translation so the language is changed to the
// default language of the source site.
diff --git a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTranslationTest.php b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTranslationTest.php
index bdc27f5c296..855a5bdeda3 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTranslationTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTranslationTest.php
@@ -46,7 +46,7 @@ class MigrateMenuLinkTranslationTest extends MigrateDrupal7TestBase {
/**
* Tests migration of menu link translations.
*/
- public function testMenuLinkTranslation() {
+ public function testMenuLinkTranslation(): void {
$this->assertEntity(467, 'fr', 'fr - Google', 'menu-test-menu', 'fr - Google description', TRUE, FALSE, ['attributes' => ['title' => 'Google']], 'http://google.com', 0);
}
diff --git a/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php b/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php
index 6ea6d2d922d..3c52968e4c7 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php
@@ -49,7 +49,7 @@ class PathAliasMenuLinkContentTest extends KernelTestBase {
/**
* Tests the path aliasing changing.
*/
- public function testPathAliasChange() {
+ public function testPathAliasChange(): void {
$path_alias = $this->createPathAlias('/test-page', '/my-blog');
$menu_link_content = MenuLinkContent::create([
'title' => 'Menu title',
diff --git a/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php b/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php
index 89b04e1412e..ad32b4211b8 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/process/LinkUriTest.php
@@ -51,7 +51,7 @@ class LinkUriTest extends KernelTestBase {
*
* @covers ::transform
*/
- public function testRouted($value, $expected) {
+ public function testRouted($value, $expected): void {
$actual = $this->doTransform($value);
$this->assertSame($expected, $actual);
}
@@ -92,7 +92,7 @@ class LinkUriTest extends KernelTestBase {
*
* @dataProvider providerTestNotRouted
*/
- public function testNotRouted($value, $exception_message) {
+ public function testNotRouted($value, $exception_message): void {
$this->expectException(MigrateException::class);
$this->expectExceptionMessage($exception_message);
$this->doTransform($value);
@@ -137,7 +137,7 @@ class LinkUriTest extends KernelTestBase {
*
* @covers ::transform
*/
- public function testDisablingRouteValidation($value, $expected) {
+ public function testDisablingRouteValidation($value, $expected): void {
// Create a node so we have a valid route.
Node::create([
'nid' => 1,
diff --git a/core/modules/menu_link_content/tests/src/Unit/MenuLinkContentEntityAccessTest.php b/core/modules/menu_link_content/tests/src/Unit/MenuLinkContentEntityAccessTest.php
index 0c718a0ff04..5aaf8e8059b 100644
--- a/core/modules/menu_link_content/tests/src/Unit/MenuLinkContentEntityAccessTest.php
+++ b/core/modules/menu_link_content/tests/src/Unit/MenuLinkContentEntityAccessTest.php
@@ -27,7 +27,7 @@ class MenuLinkContentEntityAccessTest extends UnitTestCase {
*
* @covers ::checkAccess
*/
- public function testUnrecognizedOperation() {
+ public function testUnrecognizedOperation(): void {
$entityType = $this->createMock(EntityTypeInterface::class);
$accessManager = $this->createMock(AccessManagerInterface::class);
$moduleHandler = $this->createMock(ModuleHandlerInterface::class);
diff --git a/core/modules/menu_link_content/tests/src/Unit/MenuLinkPluginTest.php b/core/modules/menu_link_content/tests/src/Unit/MenuLinkPluginTest.php
index 871214664c1..e9f8b4ff61e 100644
--- a/core/modules/menu_link_content/tests/src/Unit/MenuLinkPluginTest.php
+++ b/core/modules/menu_link_content/tests/src/Unit/MenuLinkPluginTest.php
@@ -17,7 +17,7 @@ class MenuLinkPluginTest extends UnitTestCase {
/**
* @covers ::getUuid
*/
- public function testGetInstanceReflection() {
+ public function testGetInstanceReflection(): void {
/** @var \Drupal\menu_link_content\Plugin\Menu\MenuLinkContent $menu_link_content_plugin */
$menu_link_content_plugin = $this->prophesize(MenuLinkContent::class);
$menu_link_content_plugin->getDerivativeId()->willReturn('test_id');
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuCacheTagsTest.php b/core/modules/menu_ui/tests/src/Functional/MenuCacheTagsTest.php
index c20df4062d1..216b68ef680 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuCacheTagsTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuCacheTagsTest.php
@@ -32,7 +32,7 @@ class MenuCacheTagsTest extends PageCacheTagsTestBase {
* Tests the following cache tags:
* - "menu:<menu ID>"
*/
- public function testMenuBlock() {
+ public function testMenuBlock(): void {
$url = Url::fromRoute('test_page_test.test_page');
// Create a Llama menu, add a link to it and place the corresponding block.
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuLinkReorderTest.php b/core/modules/menu_ui/tests/src/Functional/MenuLinkReorderTest.php
index 6dbfea26645..bb4e239f66e 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuLinkReorderTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuLinkReorderTest.php
@@ -35,7 +35,7 @@ class MenuLinkReorderTest extends BrowserTestBase {
/**
* Tests creating, editing, deleting menu links via node form widget.
*/
- public function testDefaultMenuLinkReorder() {
+ public function testDefaultMenuLinkReorder(): void {
// Add the main menu block.
$this->drupalPlaceBlock('system_menu_block:main');
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php
index cc80401f27c..4b9d8a6217e 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php
@@ -58,7 +58,7 @@ class MenuUiContentModerationTest extends BrowserTestBase {
/**
* Tests that node drafts can not modify the menu settings.
*/
- public function testMenuUiWithPendingRevisions() {
+ public function testMenuUiWithPendingRevisions(): void {
$editor = $this->drupalCreateUser([
'administer nodes',
'administer menu',
@@ -194,7 +194,7 @@ class MenuUiContentModerationTest extends BrowserTestBase {
/**
* Tests that unpublished content can be selected through the menu UI.
*/
- public function testMenuUiWithUnpublishedContent() {
+ public function testMenuUiWithUnpublishedContent(): void {
$editor_with_unpublished_content_access = $this->drupalCreateUser([
'administer nodes',
'administer menu',
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiContentTranslationTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiContentTranslationTest.php
index b280f8c0e13..cd619295b7c 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUiContentTranslationTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiContentTranslationTest.php
@@ -120,7 +120,7 @@ class MenuUiContentTranslationTest extends BrowserTestBase {
*
* @dataProvider provideChangeContentToPseudoLanguageData
*/
- public function testChangeContentToPseudoLanguage($langcode) {
+ public function testChangeContentToPseudoLanguage($langcode): void {
$node_title = 'Test node';
$menu_link_title_en = 'Test menu link EN';
$menu_link_title_pseudo = 'Test menu link PSEUDO';
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php
index 626ea46215d..d7e66741bf2 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php
@@ -60,7 +60,7 @@ class MenuUiLanguageTest extends BrowserTestBase {
/**
* Tests menu language settings and the defaults for menu link items.
*/
- public function testMenuLanguage() {
+ public function testMenuLanguage(): void {
// Create a test menu to test the various language-related settings.
// Machine name has to be lowercase.
$menu_name = $this->randomMachineName(16);
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php
index bbebee16c31..b880c6049c3 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php
@@ -77,7 +77,7 @@ class MenuUiNodeTest extends BrowserTestBase {
/**
* Tests creating, editing, deleting menu links via node form widget.
*/
- public function testMenuNodeFormWidget() {
+ public function testMenuNodeFormWidget(): void {
// Verify that cacheability metadata is bubbled from the menu link tree
// access checking that is performed when determining the "default parent
// item" options in menu_ui_form_node_type_form_alter(). The "log out" link
@@ -286,7 +286,7 @@ class MenuUiNodeTest extends BrowserTestBase {
/**
* Testing correct loading and saving of menu links via node form widget in a multilingual environment.
*/
- public function testMultilingualMenuNodeFormWidget() {
+ public function testMultilingualMenuNodeFormWidget(): void {
// Setup languages.
$langcodes = ['de'];
foreach ($langcodes as $langcode) {
@@ -376,7 +376,7 @@ class MenuUiNodeTest extends BrowserTestBase {
/**
* Tests creating menu links via node form widget for nodes with grants.
*/
- public function testMenuNodeWithGrantsFormWidget() {
+ public function testMenuNodeWithGrantsFormWidget(): void {
\Drupal::service('module_installer')->install(['node_access_test']);
node_access_rebuild();
$this->assertTrue(\Drupal::moduleHandler()->hasImplementations('node_grants'));
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
index 4e739339119..c7cca3ed5d5 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
@@ -113,7 +113,7 @@ class MenuUiTest extends BrowserTestBase {
/**
* Tests menu functionality using the admin and user interfaces.
*/
- public function testMenuAdministration() {
+ public function testMenuAdministration(): void {
// Log in the user.
$this->drupalLogin($this->adminUser);
$this->items = [];
@@ -615,7 +615,7 @@ class MenuUiTest extends BrowserTestBase {
/**
* Test logout link isn't displayed when the user is logged out.
*/
- public function testLogoutLinkVisibility() {
+ public function testLogoutLinkVisibility(): void {
$adminUserWithLinkAnyPage = $this->drupalCreateUser([
'access administration pages',
'administer blocks',
@@ -654,7 +654,7 @@ class MenuUiTest extends BrowserTestBase {
/**
* Adds and removes a menu link with a query string and fragment.
*/
- public function testMenuQueryAndFragment() {
+ public function testMenuQueryAndFragment(): void {
$this->drupalLogin($this->adminUser);
// Make a path with query and fragment on.
@@ -689,7 +689,7 @@ class MenuUiTest extends BrowserTestBase {
/**
* Tests renaming the built-in menu.
*/
- public function testSystemMenuRename() {
+ public function testSystemMenuRename(): void {
$this->drupalLogin($this->adminUser);
$edit = [
'label' => $this->randomMachineName(16),
@@ -707,7 +707,7 @@ class MenuUiTest extends BrowserTestBase {
/**
* Tests that menu items pointing to unpublished nodes are editable.
*/
- public function testUnpublishedNodeMenuItem() {
+ public function testUnpublishedNodeMenuItem(): void {
$this->drupalLogin($this->drupalCreateUser([
'access administration pages',
'administer blocks',
@@ -1056,7 +1056,7 @@ class MenuUiTest extends BrowserTestBase {
/**
* Tests if admin users, other than UID1, can access parents AJAX callback.
*/
- public function testMenuParentsJsAccess() {
+ public function testMenuParentsJsAccess(): void {
$this->drupalLogin($this->drupalCreateUser(['administer menu']));
// Just check access to the callback overall, the POST data is irrelevant.
$this->drupalGet('admin/structure/menu/parents', ['query' => [MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_ajax']], ['X-Requested-With: XMLHttpRequest']);
@@ -1072,7 +1072,7 @@ class MenuUiTest extends BrowserTestBase {
/**
* Tests the "expand all items" feature.
*/
- public function testExpandAllItems() {
+ public function testExpandAllItems(): void {
$this->drupalLogin($this->adminUser);
$menu = $this->addCustomMenu();
$node = $this->drupalCreateNode(['type' => 'article']);
@@ -1195,7 +1195,7 @@ class MenuUiTest extends BrowserTestBase {
/**
* Tests that menu links with pending revisions can not be re-parented.
*/
- public function testMenuUiWithPendingRevisions() {
+ public function testMenuUiWithPendingRevisions(): void {
$this->drupalLogin($this->adminUser);
$assert_session = $this->assertSession();
@@ -1239,7 +1239,7 @@ class MenuUiTest extends BrowserTestBase {
/**
* Tests the user login/logout links.
*/
- public function testUserLoginUserLogoutLinks() {
+ public function testUserLoginUserLogoutLinks(): void {
MenuLinkContent::create([
'menu' => 'tools',
'link' => [
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUninstallTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUninstallTest.php
index 2e37dd7c78b..f7193dd0886 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUninstallTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUninstallTest.php
@@ -29,7 +29,7 @@ class MenuUninstallTest extends BrowserTestBase {
/**
* Tests Menu uninstall.
*/
- public function testMenuUninstall() {
+ public function testMenuUninstall(): void {
\Drupal::service('module_installer')->uninstall(['menu_ui']);
\Drupal::entityTypeManager()->getStorage('menu')->resetCache(['admin']);
diff --git a/core/modules/menu_ui/tests/src/FunctionalJavascript/MenuUiJavascriptTest.php b/core/modules/menu_ui/tests/src/FunctionalJavascript/MenuUiJavascriptTest.php
index 547161c321e..a174b7a33c1 100644
--- a/core/modules/menu_ui/tests/src/FunctionalJavascript/MenuUiJavascriptTest.php
+++ b/core/modules/menu_ui/tests/src/FunctionalJavascript/MenuUiJavascriptTest.php
@@ -39,7 +39,7 @@ class MenuUiJavascriptTest extends WebDriverTestBase {
/**
* Tests the contextual links on a menu block.
*/
- public function testBlockContextualLinks() {
+ public function testBlockContextualLinks(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer menu',
'access contextual links',
diff --git a/core/modules/menu_ui/tests/src/Kernel/Migrate/MigrateMenuSettingsTest.php b/core/modules/menu_ui/tests/src/Kernel/Migrate/MigrateMenuSettingsTest.php
index e6c09084f93..f999699a031 100644
--- a/core/modules/menu_ui/tests/src/Kernel/Migrate/MigrateMenuSettingsTest.php
+++ b/core/modules/menu_ui/tests/src/Kernel/Migrate/MigrateMenuSettingsTest.php
@@ -24,7 +24,7 @@ class MigrateMenuSettingsTest extends MigrateDrupal7TestBase {
$this->executeMigration('menu_settings');
}
- public function testMigration() {
+ public function testMigration(): void {
$this->assertTrue(\Drupal::config('menu_ui.settings')->get('override_parent_selector'));
}
diff --git a/core/modules/migrate/tests/src/Functional/MigrateNoMigrateDrupalTest.php b/core/modules/migrate/tests/src/Functional/MigrateNoMigrateDrupalTest.php
index 5c725d4f607..926337cca38 100644
--- a/core/modules/migrate/tests/src/Functional/MigrateNoMigrateDrupalTest.php
+++ b/core/modules/migrate/tests/src/Functional/MigrateNoMigrateDrupalTest.php
@@ -45,7 +45,7 @@ class MigrateNoMigrateDrupalTest extends BrowserTestBase {
/**
* Tests execution of a migration.
*/
- public function testExecutionNoMigrateDrupal() {
+ public function testExecutionNoMigrateDrupal(): void {
$this->drupalGet('/migrate_no_migrate_drupal_test/execute');
$this->assertSession()->pageTextContains('Migration was successful.');
$node_1 = Node::load(1);
diff --git a/core/modules/migrate/tests/src/Functional/process/DownloadFunctionalTest.php b/core/modules/migrate/tests/src/Functional/process/DownloadFunctionalTest.php
index fd805e9a444..e3da55e64a3 100644
--- a/core/modules/migrate/tests/src/Functional/process/DownloadFunctionalTest.php
+++ b/core/modules/migrate/tests/src/Functional/process/DownloadFunctionalTest.php
@@ -31,7 +31,7 @@ class DownloadFunctionalTest extends BrowserTestBase {
/**
* Tests that an exception is thrown bu migration continues with the next row.
*/
- public function testExceptionThrow() {
+ public function testExceptionThrow(): void {
$invalid_url = "{$this->baseUrl}/not-existent-404";
$valid_url = "{$this->baseUrl}/core/misc/favicon.ico";
diff --git a/core/modules/migrate/tests/src/Kernel/HighWaterTest.php b/core/modules/migrate/tests/src/Kernel/HighWaterTest.php
index c2b92150ca5..35fdf14d6d9 100644
--- a/core/modules/migrate/tests/src/Kernel/HighWaterTest.php
+++ b/core/modules/migrate/tests/src/Kernel/HighWaterTest.php
@@ -88,7 +88,7 @@ class HighWaterTest extends MigrateTestBase {
/**
* Tests high water property of SqlBase.
*/
- public function testHighWater() {
+ public function testHighWater(): void {
// Assert all of the nodes have been imported.
$this->assertNodeExists('Item 1');
$this->assertNodeExists('Item 2');
@@ -143,7 +143,7 @@ class HighWaterTest extends MigrateTestBase {
/**
* Tests that the high water value can be 0.
*/
- public function testZeroHighwater() {
+ public function testZeroHighwater(): void {
// Assert all of the nodes have been imported.
$this->assertNodeExists('Item 1');
$this->assertNodeExists('Item 2');
@@ -176,7 +176,7 @@ class HighWaterTest extends MigrateTestBase {
/**
* Tests that deleting the high water value causes all rows to be reimported.
*/
- public function testNullHighwater() {
+ public function testNullHighwater(): void {
// Assert all of the nodes have been imported.
$this->assertNodeExists('Item 1');
$this->assertNodeExists('Item 2');
@@ -209,7 +209,7 @@ class HighWaterTest extends MigrateTestBase {
/**
* Tests high water property of SqlBase when rows marked for update.
*/
- public function testHighWaterUpdate() {
+ public function testHighWaterUpdate(): void {
// Assert all of the nodes have been imported.
$this->assertNodeExists('Item 1');
$this->assertNodeExists('Item 2');
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateBundleTest.php b/core/modules/migrate/tests/src/Kernel/MigrateBundleTest.php
index 23444fad376..2e336c933a1 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateBundleTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateBundleTest.php
@@ -38,7 +38,7 @@ class MigrateBundleTest extends MigrateTestBase {
/**
* Tests setting the bundle in the destination.
*/
- public function testDestinationBundle() {
+ public function testDestinationBundle(): void {
$term_data_rows = [
['id' => 1, 'name' => 'Category 1'],
];
@@ -75,7 +75,7 @@ class MigrateBundleTest extends MigrateTestBase {
/**
* Tests setting the bundle in the process pipeline.
*/
- public function testProcessBundle() {
+ public function testProcessBundle(): void {
$term_data_rows = [
['id' => 1, 'vocab' => 'categories', 'name' => 'Category 1'],
['id' => 2, 'vocab' => 'tags', 'name' => 'Tag 1'],
@@ -115,7 +115,7 @@ class MigrateBundleTest extends MigrateTestBase {
/**
* Tests setting bundles both in process and destination.
*/
- public function testMixedBundles() {
+ public function testMixedBundles(): void {
$term_data_rows = [
['id' => 1, 'vocab' => 'categories', 'name' => 'Category 1'],
['id' => 2, 'name' => 'Tag 1'],
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateConfigRollbackTest.php b/core/modules/migrate/tests/src/Kernel/MigrateConfigRollbackTest.php
index 77519c38606..ad535fb2012 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateConfigRollbackTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateConfigRollbackTest.php
@@ -23,7 +23,7 @@ class MigrateConfigRollbackTest extends MigrateTestBase {
/**
* Tests rolling back configuration.
*/
- public function testConfigRollback() {
+ public function testConfigRollback(): void {
// Use system.site configuration to demonstrate importing and rolling back
// configuration.
$variable = [
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateEmbeddedDataTest.php b/core/modules/migrate/tests/src/Kernel/MigrateEmbeddedDataTest.php
index ff4a49e9e69..3a07a281d99 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateEmbeddedDataTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateEmbeddedDataTest.php
@@ -23,7 +23,7 @@ class MigrateEmbeddedDataTest extends KernelTestBase {
/**
* Tests the embedded_data source plugin.
*/
- public function testEmbeddedData() {
+ public function testEmbeddedData(): void {
$data_rows = [
['key' => '1', 'field1' => 'f1value1', 'field2' => 'f2value1'],
['key' => '2', 'field1' => 'f1value2', 'field2' => 'f2value2'],
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php
index ebba72f8180..aec71c6fbb7 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php
@@ -109,7 +109,7 @@ class MigrateEntityContentBaseTest extends KernelTestBase {
/**
* Tests importing and rolling back translated entities.
*/
- public function testTranslated() {
+ public function testTranslated(): void {
// Create a destination.
$this->createDestination(['translations' => TRUE]);
@@ -176,7 +176,7 @@ class MigrateEntityContentBaseTest extends KernelTestBase {
/**
* Tests creation of ID columns table with definitions taken from entity type.
*/
- public function testEntityWithStringId() {
+ public function testEntityWithStringId(): void {
$this->enableModules(['migrate_entity_test']);
$this->installEntitySchema('migrate_string_id_entity_test');
@@ -222,7 +222,7 @@ class MigrateEntityContentBaseTest extends KernelTestBase {
/**
* Tests empty destinations.
*/
- public function testEmptyDestinations() {
+ public function testEmptyDestinations(): void {
$this->enableModules(['migrate_entity_test']);
$this->installEntitySchema('migrate_string_id_entity_test');
@@ -283,7 +283,7 @@ class MigrateEntityContentBaseTest extends KernelTestBase {
/**
* Tests stub rows.
*/
- public function testStubRows() {
+ public function testStubRows(): void {
// Create a destination.
$this->createDestination([]);
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentValidationTest.php b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentValidationTest.php
index 8759491ceeb..719f9bf8d1d 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentValidationTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentValidationTest.php
@@ -64,7 +64,7 @@ class MigrateEntityContentValidationTest extends KernelTestBase {
/**
* Tests an import with invalid data and checks error messages.
*/
- public function test1() {
+ public function test1(): void {
// Make sure that a user with uid 2 exists.
$this->container
->get('entity_type.manager')
@@ -119,7 +119,7 @@ class MigrateEntityContentValidationTest extends KernelTestBase {
/**
* Tests an import with invalid data and checks error messages.
*/
- public function test2() {
+ public function test2(): void {
$long_username = $this->randomString(61);
$username_constraint = new UserNameConstraint();
@@ -162,7 +162,7 @@ class MigrateEntityContentValidationTest extends KernelTestBase {
/**
* Tests validation for entities that are instances of EntityOwnerInterface.
*/
- public function testEntityOwnerValidation() {
+ public function testEntityOwnerValidation(): void {
// Text format access is impacted by user permissions.
$filter_test_format = FilterFormat::load('filter_test');
assert($filter_test_format instanceof FilterFormatInterface);
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateEventsTest.php b/core/modules/migrate/tests/src/Kernel/MigrateEventsTest.php
index b60bbfb935e..ee758359047 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateEventsTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateEventsTest.php
@@ -57,7 +57,7 @@ class MigrateEventsTest extends KernelTestBase {
/**
* Tests migration events.
*/
- public function testMigrateEvents() {
+ public function testMigrateEvents(): void {
// Run a simple little migration, which should trigger one of each event
// other than map_delete.
$definition = [
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateExecutableTest.php b/core/modules/migrate/tests/src/Kernel/MigrateExecutableTest.php
index 4fbcb9550ed..c42db1e9809 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateExecutableTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateExecutableTest.php
@@ -30,7 +30,7 @@ class MigrateExecutableTest extends MigrateTestBase {
/**
* Tests the MigrateExecutable class.
*/
- public function testMigrateExecutable() {
+ public function testMigrateExecutable(): void {
$data_rows = [
['key' => '1', 'field1' => 'f1value1', 'field2' => 'f2value1'],
['key' => '2', 'field1' => 'f1value2', 'field2' => 'f2value2'],
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateExternalTranslatedTest.php b/core/modules/migrate/tests/src/Kernel/MigrateExternalTranslatedTest.php
index cc9c2aa4564..9a8cb82563a 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateExternalTranslatedTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateExternalTranslatedTest.php
@@ -54,7 +54,7 @@ class MigrateExternalTranslatedTest extends MigrateTestBase {
/**
* Tests importing and rolling back our data.
*/
- public function testMigrations() {
+ public function testMigrations(): void {
/** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */
$storage = $this->container->get('entity_type.manager')->getStorage('node');
$this->assertCount(0, $storage->loadMultiple());
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateInterruptionTest.php b/core/modules/migrate/tests/src/Kernel/MigrateInterruptionTest.php
index f1453020b79..a501470e4fc 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateInterruptionTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateInterruptionTest.php
@@ -36,7 +36,7 @@ class MigrateInterruptionTest extends KernelTestBase {
/**
* Tests migration interruptions.
*/
- public function testMigrateEvents() {
+ public function testMigrateEvents(): void {
// Run a simple little migration, which should trigger one of each event
// other than map_delete.
$definition = [
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateLookupTest.php b/core/modules/migrate/tests/src/Kernel/MigrateLookupTest.php
index cbc58e4159f..cc38eb55212 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateLookupTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateLookupTest.php
@@ -51,7 +51,7 @@ class MigrateLookupTest extends MigrateTestBase {
/**
* Tests scenarios around single id lookups.
*/
- public function testSingleLookup() {
+ public function testSingleLookup(): void {
$this->executeMigration('sample_lookup_migration');
// Test numerically indexed source id.
@@ -70,7 +70,7 @@ class MigrateLookupTest extends MigrateTestBase {
/**
* Tests an invalid lookup.
*/
- public function testInvalidIdLookup() {
+ public function testInvalidIdLookup(): void {
$this->executeMigration('sample_lookup_migration');
$this->expectException(MigrateException::class);
$this->expectExceptionMessage("Extra unknown items for map migrate_map_sample_lookup_migration in source IDs: array (\n 'invalid_id' => 25,\n)");
@@ -82,7 +82,7 @@ class MigrateLookupTest extends MigrateTestBase {
/**
* Tests lookups with multiple source ids.
*/
- public function testMultipleSourceIds() {
+ public function testMultipleSourceIds(): void {
$this->executeMigration('sample_lookup_migration_multiple_source_ids');
// Test with full set of numerically indexed source ids.
@@ -128,7 +128,7 @@ class MigrateLookupTest extends MigrateTestBase {
* @throws \Drupal\Component\Plugin\Exception\PluginException
* @throws \Drupal\migrate\MigrateException
*/
- public function testMultipleMigrationLookup() {
+ public function testMultipleMigrationLookup(): void {
$migrations = [
'sample_lookup_migration',
'sample_lookup_migration_2',
@@ -153,7 +153,7 @@ class MigrateLookupTest extends MigrateTestBase {
/**
* Tests a lookup with string source ids.
*/
- public function testLookupWithStringIds() {
+ public function testLookupWithStringIds(): void {
$this->executeMigration('sample_lookup_migration_string_ids');
// Test numerically indexed source id.
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateMessageTest.php b/core/modules/migrate/tests/src/Kernel/MigrateMessageTest.php
index 603df93fa84..26b89ecda80 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateMessageTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateMessageTest.php
@@ -79,7 +79,7 @@ class MigrateMessageTest extends KernelTestBase implements MigrateMessageInterfa
/**
* Tests migration interruptions.
*/
- public function testMessagesNotTeed() {
+ public function testMessagesNotTeed(): void {
// We don't ask for messages to be teed, so don't expect any.
$executable = new MigrateExecutable($this->migration, $this);
$executable->import();
@@ -89,7 +89,7 @@ class MigrateMessageTest extends KernelTestBase implements MigrateMessageInterfa
/**
* Tests migration interruptions.
*/
- public function testMessagesTeed() {
+ public function testMessagesTeed(): void {
// Ask to receive any messages sent to the idmap.
\Drupal::service('event_dispatcher')->addListener(MigrateEvents::IDMAP_MESSAGE,
[$this, 'mapMessageRecorder']);
@@ -106,7 +106,7 @@ class MigrateMessageTest extends KernelTestBase implements MigrateMessageInterfa
* This method returns an iterator of StdClass objects. Check that these
* objects have the expected keys.
*/
- public function testGetMessages() {
+ public function testGetMessages(): void {
$id = $this->migration->getPluginId();
$expected_message = (object) [
'src_name' => 'source_message',
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateProcessErrorMessagesTest.php b/core/modules/migrate/tests/src/Kernel/MigrateProcessErrorMessagesTest.php
index e4ff4bc1d48..53717f98be2 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateProcessErrorMessagesTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateProcessErrorMessagesTest.php
@@ -99,7 +99,7 @@ class MigrateProcessErrorMessagesTest extends MigrateTestBase {
/**
* Tests format of map messages saved from plugin exceptions.
*/
- public function testProcessErrorMessage() {
+ public function testProcessErrorMessage(): void {
$this->definition['process']['error']['plugin'] = 'test_error';
$this->idMap->saveMessage(['id' => 1], "process_errors_migration:error:test_error: Process exception.", MigrationInterface::MESSAGE_ERROR)->shouldBeCalled();
@@ -119,7 +119,7 @@ class MigrateProcessErrorMessagesTest extends MigrateTestBase {
* plugins while being executed inside a sub_process pipeline as they
* bubble up to the main migration.
*/
- public function testSubProcessErrorMessage() {
+ public function testSubProcessErrorMessage(): void {
$this->definition['process']['subprocess_error'] = [
'plugin' => 'sub_process',
'source' => 'my_property',
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateRollbackEntityConfigTest.php b/core/modules/migrate/tests/src/Kernel/MigrateRollbackEntityConfigTest.php
index 000561f902c..2bf89c3fe37 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateRollbackEntityConfigTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateRollbackEntityConfigTest.php
@@ -42,7 +42,7 @@ class MigrateRollbackEntityConfigTest extends MigrateTestBase {
/**
* Tests rolling back configuration entity translations.
*/
- public function testConfigEntityRollback() {
+ public function testConfigEntityRollback(): void {
// We use vocabularies to demonstrate importing and rolling back
// configuration entities with translations. First, import vocabularies.
$vocabulary_data_rows = [
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php b/core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php
index f9f2523f917..21739cc9eae 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php
@@ -37,7 +37,7 @@ class MigrateRollbackTest extends MigrateTestBase {
/**
* Tests rolling back configuration and content entities.
*/
- public function testRollback() {
+ public function testRollback(): void {
// We use vocabularies to demonstrate importing and rolling back
// configuration entities.
$vocabulary_data_rows = [
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateSkipRowTest.php b/core/modules/migrate/tests/src/Kernel/MigrateSkipRowTest.php
index 01c57be9fb5..50a8d555b28 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateSkipRowTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateSkipRowTest.php
@@ -26,7 +26,7 @@ class MigrateSkipRowTest extends KernelTestBase {
/**
* Tests migration interruptions.
*/
- public function testPrepareRowSkip() {
+ public function testPrepareRowSkip(): void {
// Run a simple little migration with two data rows which should be skipped
// in different ways.
$definition = [
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php b/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php
index 5c74d6e582d..95d62ce50d4 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php
@@ -146,7 +146,7 @@ abstract class MigrateSourceTestBase extends KernelTestBase {
*
* @dataProvider providerSource
*/
- public function testSource(array $source_data, array $expected_data, $expected_count = NULL, array $configuration = [], $high_water = NULL) {
+ public function testSource(array $source_data, array $expected_data, $expected_count = NULL, array $configuration = [], $high_water = NULL): void {
$plugin = $this->getPlugin($configuration);
$clone_plugin = clone $plugin;
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php b/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php
index f8191e642ab..68330c078d7 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php
@@ -88,7 +88,7 @@ abstract class MigrateSqlSourceTestBase extends MigrateSourceTestBase {
*
* @requires extension pdo_sqlite
*/
- public function testSource(array $source_data, array $expected_data, $expected_count = NULL, array $configuration = [], $high_water = NULL, $expected_cache_key = NULL) {
+ public function testSource(array $source_data, array $expected_data, $expected_count = NULL, array $configuration = [], $high_water = NULL, $expected_cache_key = NULL): void {
$plugin = $this->getPlugin($configuration);
// Since we don't yet inject the database connection, we need to use a
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateStatusTest.php b/core/modules/migrate/tests/src/Kernel/MigrateStatusTest.php
index 862b6630dbb..9c37c91bbbb 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateStatusTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateStatusTest.php
@@ -16,7 +16,7 @@ class MigrateStatusTest extends MigrateTestBase {
/**
* Tests different connection types.
*/
- public function testStatus() {
+ public function testStatus(): void {
// Create a minimally valid migration.
$definition = [
'id' => 'migrate_status_test',
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateStubTest.php b/core/modules/migrate/tests/src/Kernel/MigrateStubTest.php
index e2544533b0b..ec313786788 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateStubTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateStubTest.php
@@ -68,7 +68,7 @@ class MigrateStubTest extends MigrateTestBase {
/**
* Tests stub creation.
*/
- public function testCreateStub() {
+ public function testCreateStub(): void {
$this->assertSame([], $this->migrateLookup->lookup('sample_stubbing_migration', [17]));
$ids = $this->migrateStub->createStub('sample_stubbing_migration', [17]);
$this->assertSame([$ids], $this->migrateLookup->lookup('sample_stubbing_migration', [17]));
@@ -78,7 +78,7 @@ class MigrateStubTest extends MigrateTestBase {
/**
* Tests raw stub creation.
*/
- public function testCreateStubRawReturn() {
+ public function testCreateStubRawReturn(): void {
$this->assertSame([], $this->migrateLookup->lookup('sample_stubbing_migration', [17]));
$ids = $this->migrateStub->createStub('sample_stubbing_migration', [17], [], FALSE);
$this->assertSame($ids, [$this->migrateLookup->lookup('sample_stubbing_migration', [17])[0]['nid']]);
@@ -88,7 +88,7 @@ class MigrateStubTest extends MigrateTestBase {
/**
* Tests stub creation with default values.
*/
- public function testStubWithDefaultValues() {
+ public function testStubWithDefaultValues(): void {
$this->assertSame([], $this->migrateLookup->lookup('sample_stubbing_migration', [17]));
$ids = $this->migrateStub->createStub('sample_stubbing_migration', [17], ['title' => "Placeholder for source id 17"]);
$this->assertSame([$ids], $this->migrateLookup->lookup('sample_stubbing_migration', [17]));
@@ -106,7 +106,7 @@ class MigrateStubTest extends MigrateTestBase {
/**
* Tests stub creation with bundle fields.
*/
- public function testStubWithBundleFields() {
+ public function testStubWithBundleFields(): void {
$this->createContentType(['type' => 'node_stub']);
// Make "Body" field required to make stubbing populate field value.
$body_field = FieldConfig::loadByName('node', 'node_stub', 'body');
@@ -124,7 +124,7 @@ class MigrateStubTest extends MigrateTestBase {
/**
* Tests invalid source id count.
*/
- public function testInvalidSourceIdCount() {
+ public function testInvalidSourceIdCount(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Expected and provided source id counts do not match.');
$this->migrateStub->createStub('sample_stubbing_migration_with_multiple_source_ids', [17]);
@@ -133,7 +133,7 @@ class MigrateStubTest extends MigrateTestBase {
/**
* Tests invalid source ids keys.
*/
- public function testInvalidSourceIdKeys() {
+ public function testInvalidSourceIdKeys(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("'version_id' is defined as a source ID but has no value.");
$this->migrateStub->createStub('sample_stubbing_migration_with_multiple_source_ids', ['id' => 17, 'not_a_key' => 17]);
diff --git a/core/modules/migrate/tests/src/Kernel/MigrationPluginManagerTest.php b/core/modules/migrate/tests/src/Kernel/MigrationPluginManagerTest.php
index f6b702ed056..ce8e85a1378 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrationPluginManagerTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrationPluginManagerTest.php
@@ -40,7 +40,7 @@ class MigrationPluginManagerTest extends MigrateTestBase {
*
* @dataProvider providerCreateInstanceByTag
*/
- public function testCreateInstancesByTag($tags, $expected) {
+ public function testCreateInstancesByTag($tags, $expected): void {
// The test module includes a migration that does not use the migration_tags
// property. It is there to confirm that it is not included in the results.
// We create it to ensure it is a valid migration.
diff --git a/core/modules/migrate/tests/src/Kernel/MigrationTest.php b/core/modules/migrate/tests/src/Kernel/MigrationTest.php
index a6d147d891e..45987063194 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrationTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrationTest.php
@@ -27,7 +27,7 @@ class MigrationTest extends KernelTestBase {
*
* @covers ::set
*/
- public function testSetInvalidation() {
+ public function testSetInvalidation(): void {
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration([
'source' => ['plugin' => 'empty'],
'destination' => ['plugin' => 'entity:entity_view_mode'],
diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/EntityExistsTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/EntityExistsTest.php
index ee124adffc6..9614b7adc3f 100644
--- a/core/modules/migrate/tests/src/Kernel/Plugin/EntityExistsTest.php
+++ b/core/modules/migrate/tests/src/Kernel/Plugin/EntityExistsTest.php
@@ -32,7 +32,7 @@ class EntityExistsTest extends KernelTestBase {
/**
* Tests the EntityExists plugin.
*/
- public function testEntityExists() {
+ public function testEntityExists(): void {
$user = User::create([
'name' => $this->randomString(),
]);
diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/EntityRevisionTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/EntityRevisionTest.php
index 67f706fd049..af01b70ef87 100644
--- a/core/modules/migrate/tests/src/Kernel/Plugin/EntityRevisionTest.php
+++ b/core/modules/migrate/tests/src/Kernel/Plugin/EntityRevisionTest.php
@@ -48,7 +48,7 @@ class EntityRevisionTest extends MigrateTestBase {
/**
* Tests that EntityRevision correctly handles revision translations.
*/
- public function testRevisionTranslation() {
+ public function testRevisionTranslation(): void {
ConfigurableLanguage::createFromLangcode('fr')->save();
/** @var \Drupal\node\NodeInterface $node */
diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php
index 043a5fa3ba3..2462874287f 100644
--- a/core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php
+++ b/core/modules/migrate/tests/src/Kernel/Plugin/LogTest.php
@@ -69,7 +69,7 @@ class LogTest extends KernelTestBase {
/**
* Tests the Log plugin.
*/
- public function testLog() {
+ public function testLog(): void {
$values = [
'nid' => 2,
'type' => 'page',
diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginConfigurationTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginConfigurationTest.php
index e53a72a5715..489684a48e8 100644
--- a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginConfigurationTest.php
+++ b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginConfigurationTest.php
@@ -30,7 +30,7 @@ class MigrationPluginConfigurationTest extends KernelTestBase {
*
* @dataProvider mergeProvider
*/
- public function testConfigurationMerge($id, $configuration, $expected) {
+ public function testConfigurationMerge($id, $configuration, $expected): void {
/** @var \Drupal\migrate\Plugin\MigrationInterface $migration */
$migration = $this->container->get('plugin.manager.migration')
->createInstance($id, $configuration);
diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php
index 5b3c2199e2e..cd318fdd23d 100644
--- a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php
+++ b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php
@@ -67,7 +67,7 @@ class MigrationPluginListTest extends KernelTestBase {
/**
* @covers ::getDefinitions
*/
- public function testGetDefinitions() {
+ public function testGetDefinitions(): void {
// Create an entity reference field to make sure that migrations derived by
// EntityReferenceTranslationDeriver do not get discovered without
// migrate_drupal enabled.
diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php
index 6aba47f61f9..151931e8f3e 100644
--- a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php
+++ b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php
@@ -24,7 +24,7 @@ class MigrationProvidersExistTest extends MigrateDrupalTestBase {
/**
* Tests that a missing source_module property raises an exception.
*/
- public function testSourceProvider() {
+ public function testSourceProvider(): void {
$this->enableModules(['migration_provider_test']);
$this->expectException(BadPluginDefinitionException::class);
$this->expectExceptionMessage('The no_source_module plugin must define the source_module property.');
@@ -34,7 +34,7 @@ class MigrationProvidersExistTest extends MigrateDrupalTestBase {
/**
* Tests that modules exist for all source plugins.
*/
- public function testProvidersExist() {
+ public function testProvidersExist(): void {
$this->enableAllModules();
/** @var \Drupal\migrate\Plugin\MigrateSourcePluginManager $plugin_manager */
@@ -61,7 +61,7 @@ class MigrationProvidersExistTest extends MigrateDrupalTestBase {
/**
* Tests that modules exist for all field plugins.
*/
- public function testFieldProvidersExist() {
+ public function testFieldProvidersExist(): void {
$expected_mappings = [
'userreference' => [
'source_module' => 'userreference',
@@ -176,7 +176,7 @@ class MigrationProvidersExistTest extends MigrateDrupalTestBase {
*
* @dataProvider fieldPluginDefinitionsProvider
*/
- public function testFieldProviderMissingRequiredProperty(array $definitions, $missing_property) {
+ public function testFieldProviderMissingRequiredProperty(array $definitions, $missing_property): void {
$discovery = $this->getMockBuilder(MigrateFieldPluginManager::class)
->disableOriginalConstructor()
->onlyMethods(['getDefinitions'])
diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php
index 4d38ee6a0c4..6724b8196c4 100644
--- a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php
+++ b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php
@@ -26,7 +26,7 @@ class MigrationTest extends KernelTestBase {
*
* @covers ::getProcessPlugins
*/
- public function testGetProcessPlugins() {
+ public function testGetProcessPlugins(): void {
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration([]);
$this->assertEquals([], $migration->getProcessPlugins([]));
}
@@ -36,7 +36,7 @@ class MigrationTest extends KernelTestBase {
*
* @covers ::getProcessPlugins
*/
- public function testGetProcessPluginsException() {
+ public function testGetProcessPluginsException(): void {
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration([]);
$this->expectException(MigrateException::class);
$this->expectExceptionMessage('Invalid process configuration for foobar');
@@ -83,7 +83,7 @@ class MigrationTest extends KernelTestBase {
*
* @covers ::getMigrationDependencies
*/
- public function testGetMigrationDependencies() {
+ public function testGetMigrationDependencies(): void {
$plugin_manager = \Drupal::service('plugin.manager.migration');
$plugin_definition = [
'id' => 'foo',
@@ -140,7 +140,7 @@ class MigrationTest extends KernelTestBase {
*
* @covers ::getDestinationIds
*/
- public function testGetDestinationIds() {
+ public function testGetDestinationIds(): void {
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration(['destinationIds' => ['foo' => 'bar']]);
$destination_ids = $migration->getDestinationIds();
$this->assertNotEmpty($destination_ids, 'Destination ids are not empty');
@@ -152,7 +152,7 @@ class MigrationTest extends KernelTestBase {
*
* @covers ::getDestinationPlugin
*/
- public function testGetDestinationPlugin() {
+ public function testGetDestinationPlugin(): void {
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration(['destination' => ['no_stub' => TRUE]]);
$this->expectException(MigrateSkipRowException::class);
$this->expectExceptionMessage("Stub requested but not made because no_stub configuration is set.");
diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/id_map/SqlTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/id_map/SqlTest.php
index b195b1586d7..88d68174789 100644
--- a/core/modules/migrate/tests/src/Kernel/Plugin/id_map/SqlTest.php
+++ b/core/modules/migrate/tests/src/Kernel/Plugin/id_map/SqlTest.php
@@ -83,7 +83,7 @@ class SqlTest extends MigrateTestBase {
*
* @dataProvider providerTestEnsureTables
*/
- public function testEnsureTables($ids) {
+ public function testEnsureTables($ids): void {
$this->migrationDefinition['source']['ids'] = $ids;
$migration = $this->migrationPluginManager->createStubMigration($this->migrationDefinition);
@@ -137,7 +137,7 @@ class SqlTest extends MigrateTestBase {
*
* @dataProvider providerTestFailEnsureTables
*/
- public function testFailEnsureTables($ids) {
+ public function testFailEnsureTables($ids): void {
// This just tests mysql, as other PDO integrations allow longer indexes.
if (Database::getConnection()->databaseType() !== 'mysql') {
$this->markTestSkipped("This test only runs for MySQL");
diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/source/MigrationSourceCacheTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/source/MigrationSourceCacheTest.php
index 8cf3e212453..436c181c00d 100644
--- a/core/modules/migrate/tests/src/Kernel/Plugin/source/MigrationSourceCacheTest.php
+++ b/core/modules/migrate/tests/src/Kernel/Plugin/source/MigrationSourceCacheTest.php
@@ -37,7 +37,7 @@ class MigrationSourceCacheTest extends MigrateTestBase {
/**
* Tests that counts for the same plugin_id are not crossed.
*/
- public function testCacheCountsNotContaminated() {
+ public function testCacheCountsNotContaminated(): void {
$migration_1_definition = [
'source' => [
'plugin' => 'cacheable_embedded_data',
@@ -91,7 +91,7 @@ class MigrationSourceCacheTest extends MigrateTestBase {
/**
* Test that values are pulled from the cache when appropriate.
*/
- public function testCacheCountsUsed() {
+ public function testCacheCountsUsed(): void {
$migration_definition = [
'source' => [
'plugin' => 'cacheable_embedded_data',
diff --git a/core/modules/migrate/tests/src/Kernel/QueryBatchTest.php b/core/modules/migrate/tests/src/Kernel/QueryBatchTest.php
index 9d5d35abff9..9c3d04ffffe 100644
--- a/core/modules/migrate/tests/src/Kernel/QueryBatchTest.php
+++ b/core/modules/migrate/tests/src/Kernel/QueryBatchTest.php
@@ -59,7 +59,7 @@ class QueryBatchTest extends KernelTestBase {
/**
* Tests a negative batch size throws an exception.
*/
- public function testBatchSizeNegative() {
+ public function testBatchSizeNegative(): void {
$this->expectException(MigrateException::class);
$this->expectExceptionMessage('batch_size must be greater than or equal to zero');
$plugin = $this->getPlugin(['batch_size' => -1]);
@@ -69,7 +69,7 @@ class QueryBatchTest extends KernelTestBase {
/**
* Tests a non integer batch size throws an exception.
*/
- public function testBatchSizeNonInteger() {
+ public function testBatchSizeNonInteger(): void {
$this->expectException(MigrateException::class);
$this->expectExceptionMessage('batch_size must be greater than or equal to zero');
$plugin = $this->getPlugin(['batch_size' => '1']);
@@ -151,7 +151,7 @@ class QueryBatchTest extends KernelTestBase {
*
* @dataProvider queryDataProvider
*/
- public function testQueryBatch($source_data, $expected_data, $num_rows, $configuration, $expected_batch_size, $expected_batch_count) {
+ public function testQueryBatch($source_data, $expected_data, $num_rows, $configuration, $expected_batch_size, $expected_batch_count): void {
$plugin = $this->getPlugin($configuration);
// Since we don't yet inject the database connection, we need to use a
diff --git a/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php b/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php
index 958bfc1320e..24cf0e760f3 100644
--- a/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php
+++ b/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php
@@ -39,7 +39,7 @@ class SqlBaseTest extends MigrateTestBase {
/**
* Tests different connection types.
*/
- public function testConnectionTypes() {
+ public function testConnectionTypes(): void {
$sql_base = new TestSqlBase([], $this->migration);
// Verify that falling back to the default 'migrate' connection (defined in
@@ -160,7 +160,7 @@ class SqlBaseTest extends MigrateTestBase {
*
* @dataProvider highWaterDataProvider
*/
- public function testHighWater($high_water = NULL, array $query_result = []) {
+ public function testHighWater($high_water = NULL, array $query_result = []): void {
$configuration = [
'high_water_property' => [
'name' => 'order',
diff --git a/core/modules/migrate/tests/src/Kernel/TrackChangesTest.php b/core/modules/migrate/tests/src/Kernel/TrackChangesTest.php
index 8618db5d1ec..0cd0d18f4d6 100644
--- a/core/modules/migrate/tests/src/Kernel/TrackChangesTest.php
+++ b/core/modules/migrate/tests/src/Kernel/TrackChangesTest.php
@@ -91,7 +91,7 @@ class TrackChangesTest extends MigrateTestBase {
/**
* Tests track changes property of SqlBase.
*/
- public function testTrackChanges() {
+ public function testTrackChanges(): void {
// Assert all of the terms have been imported.
$this->assertTermExists('name', 'Item 1');
$this->assertTermExists('name', 'Item 2');
diff --git a/core/modules/migrate/tests/src/Kernel/process/DownloadTest.php b/core/modules/migrate/tests/src/Kernel/process/DownloadTest.php
index e16d7c01b72..b11e3c43a6e 100644
--- a/core/modules/migrate/tests/src/Kernel/process/DownloadTest.php
+++ b/core/modules/migrate/tests/src/Kernel/process/DownloadTest.php
@@ -35,7 +35,7 @@ class DownloadTest extends FileTestBase {
/**
* Tests a download that overwrites an existing local file.
*/
- public function testOverwritingDownload() {
+ public function testOverwritingDownload(): void {
// Create a pre-existing file at the destination.
$destination_uri = $this->createUri('existing_file.txt');
@@ -48,7 +48,7 @@ class DownloadTest extends FileTestBase {
/**
* Tests a download that renames the downloaded file if there's a collision.
*/
- public function testNonDestructiveDownload() {
+ public function testNonDestructiveDownload(): void {
// Create a pre-existing file at the destination.
$destination_uri = $this->createUri('another_existing_file.txt');
@@ -61,7 +61,7 @@ class DownloadTest extends FileTestBase {
/**
* Tests that an exception is thrown if the destination URI is not writable.
*/
- public function testWriteProtectedDestination() {
+ public function testWriteProtectedDestination(): void {
// Create a pre-existing file at the destination.
$destination_uri = $this->createUri('not-writable.txt');
diff --git a/core/modules/migrate/tests/src/Kernel/process/ExtractTest.php b/core/modules/migrate/tests/src/Kernel/process/ExtractTest.php
index da857278af0..d59696fb1e6 100644
--- a/core/modules/migrate/tests/src/Kernel/process/ExtractTest.php
+++ b/core/modules/migrate/tests/src/Kernel/process/ExtractTest.php
@@ -63,7 +63,7 @@ class ExtractTest extends KernelTestBase {
* @param array $expected_data
* The expected results.
*/
- public function testMultipleValueExplode(array $source_data, array $expected_data) {
+ public function testMultipleValueExplode(array $source_data, array $expected_data): void {
$definition = $this->getDefinition();
$definition['source']['data_rows'] = [$source_data];
diff --git a/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php b/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php
index 87cb1ee8729..5cb1067f003 100644
--- a/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php
+++ b/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php
@@ -46,7 +46,7 @@ class FileCopyTest extends FileTestBase {
/**
* Tests successful imports/copies.
*/
- public function testSuccessfulCopies() {
+ public function testSuccessfulCopies(): void {
$file = $this->createUri(NULL, NULL, 'temporary');
$file_absolute = $this->fileSystem->realpath($file);
$data_sets = [
@@ -86,7 +86,7 @@ class FileCopyTest extends FileTestBase {
* @param string $destination_path
* The destination path to copy to.
*/
- public function testSuccessfulReuse($source_path, $destination_path) {
+ public function testSuccessfulReuse($source_path, $destination_path): void {
$file_reuse = $this->doTransform($source_path, $destination_path);
clearstatcache(TRUE, $destination_path);
@@ -127,7 +127,7 @@ class FileCopyTest extends FileTestBase {
/**
* Tests successful moves.
*/
- public function testSuccessfulMoves() {
+ public function testSuccessfulMoves(): void {
$file_1 = $this->createUri(NULL, NULL, 'temporary');
$file_1_absolute = $this->fileSystem->realpath($file_1);
$file_2 = $this->createUri(NULL, NULL, 'temporary');
@@ -162,7 +162,7 @@ class FileCopyTest extends FileTestBase {
/**
* Tests that non-existent files throw an exception.
*/
- public function testNonExistentSourceFile() {
+ public function testNonExistentSourceFile(): void {
$source = '/non/existent/file';
$this->expectException(MigrateException::class);
$this->expectExceptionMessage("File '/non/existent/file' does not exist");
@@ -174,7 +174,7 @@ class FileCopyTest extends FileTestBase {
*
* @covers ::transform
*/
- public function testNonWritableDestination() {
+ public function testNonWritableDestination(): void {
$source = $this->createUri('file.txt', NULL, 'temporary');
// Create the parent location.
@@ -199,7 +199,7 @@ class FileCopyTest extends FileTestBase {
/**
* Tests the 'rename' overwrite mode.
*/
- public function testRenameFile() {
+ public function testRenameFile(): void {
$source = $this->createUri(NULL, NULL, 'temporary');
$destination = $this->createUri('foo.txt', NULL, 'public');
$expected_destination = 'public://foo_0.txt';
@@ -211,7 +211,7 @@ class FileCopyTest extends FileTestBase {
/**
* Tests that remote URIs are delegated to the download plugin.
*/
- public function testDownloadRemoteUri() {
+ public function testDownloadRemoteUri(): void {
$download_plugin = $this->createMock(MigrateProcessInterface::class);
$download_plugin->expects($this->once())->method('transform');
diff --git a/core/modules/migrate/tests/src/Kernel/process/HandleMultiplesTest.php b/core/modules/migrate/tests/src/Kernel/process/HandleMultiplesTest.php
index 4b48da6e4c4..83344881e9d 100644
--- a/core/modules/migrate/tests/src/Kernel/process/HandleMultiplesTest.php
+++ b/core/modules/migrate/tests/src/Kernel/process/HandleMultiplesTest.php
@@ -117,7 +117,7 @@ class HandleMultiplesTest extends KernelTestBase {
* @param array $expected_data
* The expected results.
*/
- public function testScalarAndMultipleValues(array $source_data, array $expected_data) {
+ public function testScalarAndMultipleValues(array $source_data, array $expected_data): void {
$definition = $this->getDefinition();
$definition['source']['data_rows'] = [$source_data];
diff --git a/core/modules/migrate/tests/src/Kernel/process/RouteTest.php b/core/modules/migrate/tests/src/Kernel/process/RouteTest.php
index 1c022731381..9e043af333f 100644
--- a/core/modules/migrate/tests/src/Kernel/process/RouteTest.php
+++ b/core/modules/migrate/tests/src/Kernel/process/RouteTest.php
@@ -39,7 +39,7 @@ class RouteTest extends KernelTestBase {
*
* @dataProvider providerTestRoute
*/
- public function testRoute($value, $expected) {
+ public function testRoute($value, $expected): void {
$actual = $this->doTransform($value);
$this->assertSame($expected, $actual);
}
@@ -200,7 +200,7 @@ class RouteTest extends KernelTestBase {
*
* @dataProvider providerTestRouteWithParamQuery
*/
- public function testRouteWithParamQuery($value, $expected) {
+ public function testRouteWithParamQuery($value, $expected): void {
// Create a user so that user/1/edit is a valid path.
$this->setUpCurrentUser();
$this->installConfig(['user']);
diff --git a/core/modules/migrate/tests/src/Unit/Event/EventBaseTest.php b/core/modules/migrate/tests/src/Unit/Event/EventBaseTest.php
index 06632b51c55..7e3e48b92cb 100644
--- a/core/modules/migrate/tests/src/Unit/Event/EventBaseTest.php
+++ b/core/modules/migrate/tests/src/Unit/Event/EventBaseTest.php
@@ -19,7 +19,7 @@ class EventBaseTest extends UnitTestCase {
* @covers ::__construct
* @covers ::getMigration
*/
- public function testGetMigration() {
+ public function testGetMigration(): void {
$migration = $this->prophesize('\Drupal\migrate\Plugin\MigrationInterface')->reveal();
$message_service = $this->prophesize('\Drupal\migrate\MigrateMessageInterface')->reveal();
$event = new EventBase($migration, $message_service);
@@ -32,7 +32,7 @@ class EventBaseTest extends UnitTestCase {
* @covers ::__construct
* @covers ::logMessage
*/
- public function testLogMessage() {
+ public function testLogMessage(): void {
$migration = $this->prophesize('\Drupal\migrate\Plugin\MigrationInterface')->reveal();
$message_service = $this->prophesize('\Drupal\migrate\MigrateMessageInterface');
$event = new EventBase($migration, $message_service->reveal());
diff --git a/core/modules/migrate/tests/src/Unit/Event/MigrateImportEventTest.php b/core/modules/migrate/tests/src/Unit/Event/MigrateImportEventTest.php
index 7a900c88318..d02554744c7 100644
--- a/core/modules/migrate/tests/src/Unit/Event/MigrateImportEventTest.php
+++ b/core/modules/migrate/tests/src/Unit/Event/MigrateImportEventTest.php
@@ -19,7 +19,7 @@ class MigrateImportEventTest extends UnitTestCase {
* @covers ::__construct
* @covers ::getMigration
*/
- public function testGetMigration() {
+ public function testGetMigration(): void {
$migration = $this->prophesize('\Drupal\migrate\Plugin\MigrationInterface')->reveal();
$message_service = $this->prophesize('\Drupal\migrate\MigrateMessageInterface')->reveal();
$event = new MigrateImportEvent($migration, $message_service);
@@ -32,7 +32,7 @@ class MigrateImportEventTest extends UnitTestCase {
* @covers ::__construct
* @covers ::logMessage
*/
- public function testLogMessage() {
+ public function testLogMessage(): void {
$migration = $this->prophesize('\Drupal\migrate\Plugin\MigrationInterface');
$message_service = $this->prophesize('\Drupal\migrate\MigrateMessageInterface');
$event = new MigrateImportEvent($migration->reveal(), $message_service->reveal());
diff --git a/core/modules/migrate/tests/src/Unit/Event/MigratePostRowSaveEventTest.php b/core/modules/migrate/tests/src/Unit/Event/MigratePostRowSaveEventTest.php
index 5939bafe53a..81a8f5a5166 100644
--- a/core/modules/migrate/tests/src/Unit/Event/MigratePostRowSaveEventTest.php
+++ b/core/modules/migrate/tests/src/Unit/Event/MigratePostRowSaveEventTest.php
@@ -18,7 +18,7 @@ class MigratePostRowSaveEventTest extends EventBaseTest {
* @covers ::__construct
* @covers ::getDestinationIdValues
*/
- public function testGetDestinationIdValues() {
+ public function testGetDestinationIdValues(): void {
$migration = $this->prophesize('\Drupal\migrate\Plugin\MigrationInterface')->reveal();
$message_service = $this->prophesize('\Drupal\migrate\MigrateMessageInterface')->reveal();
$row = $this->prophesize('\Drupal\migrate\Row')->reveal();
@@ -32,7 +32,7 @@ class MigratePostRowSaveEventTest extends EventBaseTest {
* @covers ::__construct
* @covers ::getRow
*/
- public function testGetRow() {
+ public function testGetRow(): void {
$migration = $this->prophesize('\Drupal\migrate\Plugin\MigrationInterface')->reveal();
$message_service = $this->prophesize('\Drupal\migrate\MigrateMessageInterface');
$row = $this->prophesize('\Drupal\migrate\Row')->reveal();
diff --git a/core/modules/migrate/tests/src/Unit/Event/MigratePreRowSaveEventTest.php b/core/modules/migrate/tests/src/Unit/Event/MigratePreRowSaveEventTest.php
index b021cca2096..dc3b0671d90 100644
--- a/core/modules/migrate/tests/src/Unit/Event/MigratePreRowSaveEventTest.php
+++ b/core/modules/migrate/tests/src/Unit/Event/MigratePreRowSaveEventTest.php
@@ -18,7 +18,7 @@ class MigratePreRowSaveEventTest extends EventBaseTest {
* @covers ::__construct
* @covers ::getRow
*/
- public function testGetRow() {
+ public function testGetRow(): void {
$migration = $this->prophesize('\Drupal\migrate\Plugin\MigrationInterface')->reveal();
$message_service = $this->prophesize('\Drupal\migrate\MigrateMessageInterface')->reveal();
$row = $this->prophesize('\Drupal\migrate\Row')->reveal();
diff --git a/core/modules/migrate/tests/src/Unit/Exception/RequirementsExceptionTest.php b/core/modules/migrate/tests/src/Unit/Exception/RequirementsExceptionTest.php
index c68752cfb0a..6c7043c3f33 100644
--- a/core/modules/migrate/tests/src/Unit/Exception/RequirementsExceptionTest.php
+++ b/core/modules/migrate/tests/src/Unit/Exception/RequirementsExceptionTest.php
@@ -18,7 +18,7 @@ class RequirementsExceptionTest extends UnitTestCase {
/**
* @covers ::getRequirements
*/
- public function testGetRequirements() {
+ public function testGetRequirements(): void {
$exception = new RequirementsException('Missing requirements ', ['requirements' => static::MISSING_REQUIREMENTS]);
$this->assertEquals(['requirements' => static::MISSING_REQUIREMENTS], $exception->getRequirements());
}
@@ -27,7 +27,7 @@ class RequirementsExceptionTest extends UnitTestCase {
* @covers ::getRequirementsString
* @dataProvider getRequirementsProvider
*/
- public function testGetExceptionString($expected, $message, $requirements) {
+ public function testGetExceptionString($expected, $message, $requirements): void {
$exception = new RequirementsException($message, $requirements);
$this->assertEquals($expected, $exception->getRequirementsString());
}
diff --git a/core/modules/migrate/tests/src/Unit/MigrateExecutableMemoryExceededTest.php b/core/modules/migrate/tests/src/Unit/MigrateExecutableMemoryExceededTest.php
index 85085fed225..57e1622fadb 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateExecutableMemoryExceededTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateExecutableMemoryExceededTest.php
@@ -98,7 +98,7 @@ class MigrateExecutableMemoryExceededTest extends MigrateTestCase {
/**
* Tests memoryExceeded method when a new batch is needed.
*/
- public function testMemoryExceededNewBatch() {
+ public function testMemoryExceededNewBatch(): void {
// First case try reset and then start new batch.
$this->runMemoryExceededTest('starting new batch', TRUE);
}
@@ -106,14 +106,14 @@ class MigrateExecutableMemoryExceededTest extends MigrateTestCase {
/**
* Tests memoryExceeded method when enough is cleared.
*/
- public function testMemoryExceededClearedEnough() {
+ public function testMemoryExceededClearedEnough(): void {
$this->runMemoryExceededTest('reclaimed enough', FALSE, $this->memoryLimit, $this->memoryLimit * 0.75);
}
/**
* Tests memoryExceeded when memory usage is not exceeded.
*/
- public function testMemoryNotExceeded() {
+ public function testMemoryNotExceeded(): void {
$this->runMemoryExceededTest('', FALSE, floor($this->memoryLimit * 0.85) - 1);
}
diff --git a/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php b/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php
index fdd500aad36..05114d778b5 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php
@@ -79,7 +79,7 @@ class MigrateExecutableTest extends MigrateTestCase {
/**
* Tests an import with an incomplete rewinding.
*/
- public function testImportWithFailingRewind() {
+ public function testImportWithFailingRewind(): void {
$exception_message = $this->getRandomGenerator()->string();
$source = $this->createMock('Drupal\migrate\Plugin\MigrateSourceInterface');
$source->expects($this->once())
@@ -106,7 +106,7 @@ class MigrateExecutableTest extends MigrateTestCase {
/**
* Tests the import method with a valid row.
*/
- public function testImportWithValidRow() {
+ public function testImportWithValidRow(): void {
$source = $this->getMockSource();
$row = $this->getMockBuilder('Drupal\migrate\Row')
@@ -131,7 +131,7 @@ class MigrateExecutableTest extends MigrateTestCase {
/**
* Tests the import method with a valid row.
*/
- public function testImportWithValidRowWithoutDestinationId() {
+ public function testImportWithValidRowWithoutDestinationId(): void {
$source = $this->getMockSource();
$row = $this->getMockBuilder('Drupal\migrate\Row')
@@ -159,7 +159,7 @@ class MigrateExecutableTest extends MigrateTestCase {
/**
* Tests the import method with a valid row.
*/
- public function testImportWithValidRowNoDestinationValues() {
+ public function testImportWithValidRowNoDestinationValues(): void {
$source = $this->getMockSource();
$row = $this->getMockBuilder('Drupal\migrate\Row')
@@ -186,7 +186,7 @@ class MigrateExecutableTest extends MigrateTestCase {
*
* The MigrationException in this case is being thrown from the destination.
*/
- public function testImportWithValidRowWithDestinationMigrateException() {
+ public function testImportWithValidRowWithDestinationMigrateException(): void {
$exception_message = $this->getRandomGenerator()->string();
$source = $this->getMockSource();
@@ -214,7 +214,7 @@ class MigrateExecutableTest extends MigrateTestCase {
*
* The MigrationException in this case is being thrown from a process plugin.
*/
- public function testImportWithValidRowWithProcesMigrateException() {
+ public function testImportWithValidRowWithProcesMigrateException(): void {
$exception_message = $this->getRandomGenerator()->string();
$source = $this->getMockSource();
@@ -260,7 +260,7 @@ class MigrateExecutableTest extends MigrateTestCase {
/**
* Tests the import method with a regular Exception being thrown.
*/
- public function testImportWithValidRowWithException() {
+ public function testImportWithValidRowWithException(): void {
$exception_message = $this->getRandomGenerator()->string();
$source = $this->getMockSource();
@@ -286,7 +286,7 @@ class MigrateExecutableTest extends MigrateTestCase {
/**
* Tests the processRow method.
*/
- public function testProcessRow() {
+ public function testProcessRow(): void {
$expected = [
'test' => 'test destination',
'test1' => 'test1 destination',
@@ -315,7 +315,7 @@ class MigrateExecutableTest extends MigrateTestCase {
/**
* Tests the processRow method with an empty pipeline.
*/
- public function testProcessRowEmptyPipeline() {
+ public function testProcessRowEmptyPipeline(): void {
$this->migration->expects($this->once())
->method('getProcessPlugins')
->with(NULL)
@@ -328,7 +328,7 @@ class MigrateExecutableTest extends MigrateTestCase {
/**
* Tests the processRow pipeline exception.
*/
- public function testProcessRowPipelineException() {
+ public function testProcessRowPipelineException(): void {
$row = new Row();
$plugin = $this->prophesize(MigrateProcessInterface::class);
$plugin->getPluginDefinition()->willReturn(['handle_multiples' => FALSE]);
@@ -350,7 +350,7 @@ class MigrateExecutableTest extends MigrateTestCase {
/**
* Tests a plugin which stops the pipeline.
*/
- public function testStopPipeline() {
+ public function testStopPipeline(): void {
$row = new Row();
// Prophesize a plugin that stops the pipeline and returns 'first_plugin'.
$stop_plugin = $this->prophesize(MigrateProcessInterface::class);
@@ -377,7 +377,7 @@ class MigrateExecutableTest extends MigrateTestCase {
/**
* Tests a plugin which does not stop the pipeline.
*/
- public function testContinuePipeline() {
+ public function testContinuePipeline(): void {
$row = new Row();
// Prophesize a plugin that does not stop the pipeline.
$continue_plugin = $this->prophesize(MigrateProcessInterface::class);
@@ -407,7 +407,7 @@ class MigrateExecutableTest extends MigrateTestCase {
/**
* Tests the processRow method.
*/
- public function testProcessRowEmptyDestination() {
+ public function testProcessRowEmptyDestination(): void {
$expected = [
'test' => 'test destination',
'test1' => 'test1 destination',
@@ -481,7 +481,7 @@ class MigrateExecutableTest extends MigrateTestCase {
*
* @covers ::rollback
*/
- public function testRollback(array $id_map_records, bool $rollback_called = TRUE, array $source_id_keys = ['source'], array $destination_id_keys = ['destination'], int $expected_result = MigrationInterface::RESULT_COMPLETED) {
+ public function testRollback(array $id_map_records, bool $rollback_called = TRUE, array $source_id_keys = ['source'], array $destination_id_keys = ['destination'], int $expected_result = MigrationInterface::RESULT_COMPLETED): void {
$id_map = $this
->getTestRollbackIdMap($id_map_records, $source_id_keys, $destination_id_keys)
->reveal();
diff --git a/core/modules/migrate/tests/src/Unit/MigrateLookupTest.php b/core/modules/migrate/tests/src/Unit/MigrateLookupTest.php
index 7aa4eeeca54..e5db23be68f 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateLookupTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateLookupTest.php
@@ -26,7 +26,7 @@ class MigrateLookupTest extends MigrateTestCase {
*
* @covers ::lookup
*/
- public function testLookup() {
+ public function testLookup(): void {
$source_ids = ['id' => '1'];
$destination_ids = [[2]];
@@ -54,7 +54,7 @@ class MigrateLookupTest extends MigrateTestCase {
*
* @dataProvider providerExceptionOnMigrationNotFound
*/
- public function testExceptionOnMigrationNotFound($migrations, $message) {
+ public function testExceptionOnMigrationNotFound($migrations, $message): void {
$migration_plugin_manager = $this->prophesize(MigrationPluginManagerInterface::class);
$migration_plugin_manager->createInstances($migrations)->willReturn([]);
$this->expectException(PluginNotFoundException::class);
@@ -84,7 +84,7 @@ class MigrateLookupTest extends MigrateTestCase {
*
* @dataProvider providerExceptionOnMultipleMigrationsNotFound
*/
- public function testExceptionOnMultipleMigrationsNotFound($migrations, $message) {
+ public function testExceptionOnMultipleMigrationsNotFound($migrations, $message): void {
$migration_plugin_manager = $this->prophesize(MigrationPluginManagerInterface::class);
$migration_plugin_manager->createInstances($migrations)->willReturn([]);
$this->expectException(PluginException::class);
diff --git a/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php b/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php
index f8c42d46510..e853f974203 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php
@@ -154,7 +154,7 @@ class MigrateSourceTest extends MigrateTestCase {
/**
* @covers ::__construct
*/
- public function testHighwaterTrackChangesIncompatible() {
+ public function testHighwaterTrackChangesIncompatible(): void {
$source_config = ['track_changes' => TRUE, 'high_water_property' => ['name' => 'something']];
$this->expectException(MigrateException::class);
$this->getSource($source_config);
@@ -165,7 +165,7 @@ class MigrateSourceTest extends MigrateTestCase {
*
* @covers ::count
*/
- public function testCount() {
+ public function testCount(): void {
// Mock the cache to validate set() receives appropriate arguments.
$container = new ContainerBuilder();
$cache = $this->createMock(CacheBackendInterface::class);
@@ -203,7 +203,7 @@ class MigrateSourceTest extends MigrateTestCase {
*
* @covers ::count
*/
- public function testCountCacheKey() {
+ public function testCountCacheKey(): void {
// Mock the cache to validate set() receives appropriate arguments.
$container = new ContainerBuilder();
$cache = $this->createMock(CacheBackendInterface::class);
@@ -220,7 +220,7 @@ class MigrateSourceTest extends MigrateTestCase {
/**
* Tests that we don't get a row if prepareRow() is false.
*/
- public function testPrepareRowFalse() {
+ public function testPrepareRowFalse(): void {
$source = $this->getSource([], ['prepare_row_false' => TRUE]);
$source->rewind();
@@ -230,7 +230,7 @@ class MigrateSourceTest extends MigrateTestCase {
/**
* Tests that $row->needsUpdate() works as expected.
*/
- public function testNextNeedsUpdate() {
+ public function testNextNeedsUpdate(): void {
$source = $this->getSource();
// $row->needsUpdate() === TRUE so we get a row.
@@ -246,7 +246,7 @@ class MigrateSourceTest extends MigrateTestCase {
/**
* Tests that an outdated highwater mark does not cause a row to be imported.
*/
- public function testOutdatedHighwater() {
+ public function testOutdatedHighwater(): void {
$configuration = [
'high_water_property' => [
'name' => 'timestamp',
@@ -265,7 +265,7 @@ class MigrateSourceTest extends MigrateTestCase {
*
* @throws \Exception
*/
- public function testNewHighwater() {
+ public function testNewHighwater(): void {
$configuration = [
'high_water_property' => [
'name' => 'timestamp',
@@ -284,7 +284,7 @@ class MigrateSourceTest extends MigrateTestCase {
*
* @covers ::prepareRow
*/
- public function testPrepareRow() {
+ public function testPrepareRow(): void {
$this->migrationConfiguration['id'] = 'test_migration';
// Get a new migration with an id.
@@ -327,7 +327,7 @@ class MigrateSourceTest extends MigrateTestCase {
*
* @covers ::prepareRow
*/
- public function testPrepareRowGlobalPrepareSkip() {
+ public function testPrepareRowGlobalPrepareSkip(): void {
$this->migrationConfiguration['id'] = 'test_migration';
$migration = $this->getMigration();
@@ -356,7 +356,7 @@ class MigrateSourceTest extends MigrateTestCase {
*
* @covers ::prepareRow
*/
- public function testPrepareRowMigratePrepareSkip() {
+ public function testPrepareRowMigratePrepareSkip(): void {
$this->migrationConfiguration['id'] = 'test_migration';
$migration = $this->getMigration();
@@ -385,7 +385,7 @@ class MigrateSourceTest extends MigrateTestCase {
*
* @covers ::prepareRow
*/
- public function testPrepareRowPrepareException() {
+ public function testPrepareRowPrepareException(): void {
$this->migrationConfiguration['id'] = 'test_migration';
$migration = $this->getMigration();
@@ -420,7 +420,7 @@ class MigrateSourceTest extends MigrateTestCase {
/**
* Tests that default values are preserved for several source methods.
*/
- public function testDefaultPropertiesValues() {
+ public function testDefaultPropertiesValues(): void {
$this->migrationConfiguration['id'] = 'test_migration';
$migration = $this->getMigration();
$source = new StubSourceGeneratorPlugin([], '', [], $migration);
diff --git a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php
index d6873999b55..ded0535364e 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php
@@ -25,7 +25,7 @@ class MigrateSqlIdMapEnsureTablesTest extends MigrateTestCase {
/**
* Tests the ensureTables method when the tables do not exist.
*/
- public function testEnsureTablesNotExist() {
+ public function testEnsureTablesNotExist(): void {
$fields['source_ids_hash'] = [
'type' => 'varchar',
'length' => 64,
@@ -128,7 +128,7 @@ class MigrateSqlIdMapEnsureTablesTest extends MigrateTestCase {
/**
* Tests the ensureTables method when the tables exist.
*/
- public function testEnsureTablesExist() {
+ public function testEnsureTablesExist(): void {
$schema = $this->prophesize('Drupal\Core\Database\Schema');
$schema->tableExists('migrate_map_sql_idmap_test')->willReturn(TRUE);
$schema->fieldExists('migrate_map_sql_idmap_test', 'rollback_action')->willReturn(FALSE);
diff --git a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
index 166eb27746f..67e979bd116 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
@@ -161,7 +161,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
* - saving new to nonempty tables work.
* - updating work.
*/
- public function testSaveIdMapping() {
+ public function testSaveIdMapping(): void {
$source = [
'source_id_property' => 'source_value',
];
@@ -195,7 +195,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
/**
* Tests the SQL ID map set message method.
*/
- public function testSetMessage() {
+ public function testSetMessage(): void {
$message = $this->createMock('Drupal\migrate\MigrateMessageInterface');
$id_map = $this->getIdMap();
$id_map->setMessage($message);
@@ -205,7 +205,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
/**
* Tests the clear messages method.
*/
- public function testClearMessages() {
+ public function testClearMessages(): void {
$message = 'Hello world.';
$expected_results = [0, 1, 2, 3];
$id_map = $this->getIdMap();
@@ -225,7 +225,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
/**
* Tests the getRowsNeedingUpdate method for rows that need an update.
*/
- public function testGetRowsNeedingUpdate() {
+ public function testGetRowsNeedingUpdate(): void {
$id_map = $this->getIdMap();
$row_statuses = [
MigrateIdMapInterface::STATUS_IMPORTED,
@@ -281,7 +281,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
/**
* Tests the SQL ID map message count method by counting and saving messages.
*/
- public function testMessageCount() {
+ public function testMessageCount(): void {
$message = 'Hello world.';
$expected_results = [0, 1, 2, 3];
$id_map = $this->getIdMap();
@@ -297,7 +297,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
/**
* Tests the SQL ID map save message method.
*/
- public function testMessageSave() {
+ public function testMessageSave(): void {
$message = 'Hello world.';
$original_values = [
1 => ['message' => $message, 'level' => MigrationInterface::MESSAGE_ERROR],
@@ -348,7 +348,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
/**
* Tests the getRowBySource method.
*/
- public function testGetRowBySource() {
+ public function testGetRowBySource(): void {
$this->getDatabase([]);
$row = [
'sourceid1' => 'source_id_value_1',
@@ -404,7 +404,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
*
* @dataProvider lookupDestinationIdMappingDataProvider
*/
- public function testLookupDestinationIdMapping($num_source_fields, $num_destination_fields) {
+ public function testLookupDestinationIdMapping($num_source_fields, $num_destination_fields): void {
// Adjust the migration configuration according to the number of source and
// destination fields.
$this->sourceIds = [];
@@ -473,7 +473,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
/**
* Tests lookupDestinationIds().
*/
- public function testLookupDestinationIds() {
+ public function testLookupDestinationIds(): void {
// Simple map with one source and one destination ID.
$id_map = $this->setupRows(['nid'], ['nid'], [
[1, 101],
@@ -557,7 +557,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
/**
* Tests the getRowByDestination method.
*/
- public function testGetRowByDestination() {
+ public function testGetRowByDestination(): void {
$row = [
'sourceid1' => 'source_id_value_1',
'sourceid2' => 'source_id_value_2',
@@ -622,7 +622,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
*
* @dataProvider lookupSourceIdMappingDataProvider
*/
- public function testLookupSourceIdMapping($num_source_fields, $num_destination_fields) {
+ public function testLookupSourceIdMapping($num_source_fields, $num_destination_fields): void {
$source_id_property_prefix = 'source_id_property_';
$this->doTestLookupSourceIdMapping($num_source_fields, $num_destination_fields, $source_id_property_prefix);
}
@@ -641,7 +641,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
*
* @dataProvider lookupSourceIdMappingDataProvider
*/
- public function testLookupSourceIdMappingNonSqlCharacters($num_source_fields, $num_destination_fields) {
+ public function testLookupSourceIdMappingNonSqlCharacters($num_source_fields, $num_destination_fields): void {
$source_id_property_prefix = '$ource id property * ';
$this->doTestLookupSourceIdMapping($num_source_fields, $num_destination_fields, $source_id_property_prefix);
}
@@ -694,7 +694,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
/**
* Tests currentDestination() and currentSource().
*/
- public function testCurrentDestinationAndSource() {
+ public function testCurrentDestinationAndSource(): void {
// Simple map with one source and one destination ID.
$id_map = $this->setupRows(['nid'], ['nid'], [
[1, 101],
@@ -728,7 +728,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
* - One import.
* - Multiple imports.
*/
- public function testImportedCount() {
+ public function testImportedCount(): void {
$id_map = $this->getIdMap();
// Add a single failed row and assert zero imported rows.
$source = ['source_id_property' => 'source_value_failed'];
@@ -760,7 +760,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
* - One processed row.
* - Multiple processed rows.
*/
- public function testProcessedCount() {
+ public function testProcessedCount(): void {
$id_map = $this->getIdMap();
// Assert zero rows have been processed before adding rows.
$this->assertSame(0, $id_map->processedCount());
@@ -812,7 +812,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
*
* @dataProvider updateCountDataProvider
*/
- public function testUpdateCount($num_update_rows) {
+ public function testUpdateCount($num_update_rows): void {
for ($i = 0; $i < 5; $i++) {
$row = $this->idMapDefaults();
$row['sourceid1'] = "source_id_value_$i";
@@ -860,7 +860,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
*
* @dataProvider errorCountDataProvider
*/
- public function testErrorCount($num_error_rows) {
+ public function testErrorCount($num_error_rows): void {
for ($i = 0; $i < 5; $i++) {
$row = $this->idMapDefaults();
$row['sourceid1'] = "source_id_value_$i";
@@ -884,7 +884,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
/**
* Tests setting a row source_row_status to STATUS_NEEDS_UPDATE.
*/
- public function testSetUpdate() {
+ public function testSetUpdate(): void {
$id_map = $this->getIdMap();
$row_statuses = [
MigrateIdMapInterface::STATUS_IMPORTED,
@@ -932,7 +932,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
/**
* Tests prepareUpdate().
*/
- public function testPrepareUpdate() {
+ public function testPrepareUpdate(): void {
$id_map = $this->getIdMap();
$row_statuses = [
MigrateIdMapInterface::STATUS_IMPORTED,
@@ -978,7 +978,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
* - One error.
* - Multiple errors.
*/
- public function testDestroy() {
+ public function testDestroy(): void {
$id_map = $this->getIdMap();
// Initialize the ID map.
$id_map->getDatabase();
@@ -1001,7 +1001,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
/**
* Tests the getQualifiedMapTable method with a prefixed database.
*/
- public function testGetQualifiedMapTablePrefix() {
+ public function testGetQualifiedMapTablePrefix(): void {
$connection_options = [
'database' => ':memory:',
'prefix' => 'prefix',
@@ -1025,7 +1025,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
* - Sql::key()
* - Sql::current()
*/
- public function testIterators() {
+ public function testIterators(): void {
for ($i = 0; $i < 3; $i++) {
$row = $this->idMapDefaults();
$row['sourceid1'] = "source_id_value_$i";
@@ -1064,7 +1064,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
/**
* Tests the delayed creation of the "map" and "message" migrate tables.
*/
- public function testMapTableCreation() {
+ public function testMapTableCreation(): void {
$id_map = $this->getIdMap();
$map_table_name = $id_map->mapTableName();
$message_table_name = $id_map->messageTableName();
@@ -1096,7 +1096,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
*
* @dataProvider getHighestIdDataProvider
*/
- public function testGetHighestId(array $destination_ids, array $rows, $expected) {
+ public function testGetHighestId(array $destination_ids, array $rows, $expected): void {
$this->database = $this->getDatabase([]);
$this->sourceIds = $destination_ids;
$this->destinationIds = $destination_ids;
@@ -1177,7 +1177,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
*
* @dataProvider getHighestIdInvalidDataProvider
*/
- public function testGetHighestIdInvalid(array $destination_ids) {
+ public function testGetHighestIdInvalid(array $destination_ids): void {
$this->expectException(\LogicException::class);
$this->expectExceptionMessage('To determine the highest migrated ID the first ID must be an integer');
$this->destinationIds = $destination_ids;
diff --git a/core/modules/migrate/tests/src/Unit/MigrateStubTest.php b/core/modules/migrate/tests/src/Unit/MigrateStubTest.php
index 0494f4c18ef..99cf93c0a04 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateStubTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateStubTest.php
@@ -44,7 +44,7 @@ class MigrateStubTest extends UnitTestCase {
*
* @covers ::createStub
*/
- public function testCreateStub() {
+ public function testCreateStub(): void {
$destination_plugin = $this->prophesize(MigrateDestinationInterface::class);
$destination_plugin->import(Argument::type(Row::class))->willReturn(['id' => 2]);
@@ -71,7 +71,7 @@ class MigrateStubTest extends UnitTestCase {
/**
* Tests that an error is logged if the plugin manager throws an exception.
*/
- public function testExceptionOnPluginNotFound() {
+ public function testExceptionOnPluginNotFound(): void {
$this->migrationPluginManager->createInstances(['test_migration'])->willReturn([]);
$this->expectException(PluginNotFoundException::class);
$this->expectExceptionMessage("Plugin ID 'test_migration' was not found.");
@@ -82,7 +82,7 @@ class MigrateStubTest extends UnitTestCase {
/**
* Tests that an error is logged on derived migrations.
*/
- public function testExceptionOnDerivedMigration() {
+ public function testExceptionOnDerivedMigration(): void {
$this->migrationPluginManager->createInstances(['test_migration'])->willReturn([
'test_migration:d1' => $this->prophesize(MigrationInterface::class)->reveal(),
'test_migration:d2' => $this->prophesize(MigrationInterface::class)->reveal(),
diff --git a/core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php b/core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php
index 795fbfcacc6..fae8849d8c7 100644
--- a/core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php
@@ -40,7 +40,7 @@ class MigrationPluginManagerTest extends UnitTestCase {
*
* @dataProvider dependencyProvider
*/
- public function testDependencyBuilding($migrations_data, $result_ids) {
+ public function testDependencyBuilding($migrations_data, $result_ids): void {
$migrations = [];
foreach ($migrations_data as $migration_id => $migration_data) {
$migrations[$migration_id] = new TestMigrationMock($migration_id, $migration_data['migration_dependencies']);
@@ -71,7 +71,7 @@ class MigrationPluginManagerTest extends UnitTestCase {
/**
* Tests that expandPluginIds returns all derivatives.
*/
- public function testExpandPluginIds() {
+ public function testExpandPluginIds(): void {
$backend = $this->prophesize(CacheBackendInterface::class);
$cache = new \stdClass();
$cache->data = [
diff --git a/core/modules/migrate/tests/src/Unit/MigrationTest.php b/core/modules/migrate/tests/src/Unit/MigrationTest.php
index df4bc41657f..700986fe87d 100644
--- a/core/modules/migrate/tests/src/Unit/MigrationTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrationTest.php
@@ -31,7 +31,7 @@ class MigrationTest extends UnitTestCase {
*
* @dataProvider getInvalidMigrationDependenciesProvider
*/
- public function testMigrationDependenciesInConstructor(array $dependencies) {
+ public function testMigrationDependenciesInConstructor(array $dependencies): void {
$configuration = ['migration_dependencies' => $dependencies];
$plugin_id = 'test_migration';
@@ -51,7 +51,7 @@ class MigrationTest extends UnitTestCase {
*
* @covers ::checkRequirements
*/
- public function testRequirementsForSourcePlugin() {
+ public function testRequirementsForSourcePlugin(): void {
$migration = new TestMigration();
$source_plugin = $this->createMock('Drupal\Tests\migrate\Unit\RequirementsAwareSourceInterface');
@@ -73,7 +73,7 @@ class MigrationTest extends UnitTestCase {
*
* @covers ::checkRequirements
*/
- public function testRequirementsForDestinationPlugin() {
+ public function testRequirementsForDestinationPlugin(): void {
$migration = new TestMigration();
$source_plugin = $this->createMock('Drupal\migrate\Plugin\MigrateSourceInterface');
@@ -95,7 +95,7 @@ class MigrationTest extends UnitTestCase {
*
* @covers ::checkRequirements
*/
- public function testRequirementsForMigrations() {
+ public function testRequirementsForMigrations(): void {
$migration = new TestMigration();
// Setup source and destination plugins without any requirements.
@@ -140,7 +140,7 @@ class MigrationTest extends UnitTestCase {
*
* @covers ::getRequirements
*/
- public function testGetMigrations() {
+ public function testGetMigrations(): void {
$migration = new TestMigration();
$requirements = ['test_a', 'test_b', 'test_c', 'test_d'];
@@ -161,7 +161,7 @@ class MigrationTest extends UnitTestCase {
*
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
*/
- public function testMigrationDependenciesWithValidConfig($source, array $expected_value) {
+ public function testMigrationDependenciesWithValidConfig($source, array $expected_value): void {
$migration = new TestMigration();
// Set the plugin manager to support getMigrationDependencies().
@@ -189,7 +189,7 @@ class MigrationTest extends UnitTestCase {
*
* @group legacy
*/
- public function testMigrationDependenciesWithInvalidConfig(array $dependencies) {
+ public function testMigrationDependenciesWithInvalidConfig(array $dependencies): void {
$migration = new TestMigration();
// Set the plugin ID to test the returned message.
diff --git a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/CheckRequirementsTest.php b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/CheckRequirementsTest.php
index ac5c1023c73..b23f75dc4a8 100644
--- a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/CheckRequirementsTest.php
+++ b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/CheckRequirementsTest.php
@@ -22,7 +22,7 @@ class CheckRequirementsTest extends UnitTestCase {
/**
* Tests the check requirements exception message.
*/
- public function testException() {
+ public function testException(): void {
$destination = new Config(
['config_name' => 'test'],
'test',
diff --git a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php
index 17f4a2fae1a..8d98c309b68 100644
--- a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php
+++ b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php
@@ -26,7 +26,7 @@ class EntityContentBaseTest extends EntityTestBase {
*
* @covers ::import
*/
- public function testImport() {
+ public function testImport(): void {
$bundles = [];
$destination = new EntityTestDestination([], '', [],
$this->migration->reveal(),
@@ -60,7 +60,7 @@ class EntityContentBaseTest extends EntityTestBase {
*
* @covers ::import
*/
- public function testImportEntityLoadFailure() {
+ public function testImportEntityLoadFailure(): void {
$bundles = [];
$destination = new EntityTestDestination([], '', [],
$this->migration->reveal(),
@@ -79,7 +79,7 @@ class EntityContentBaseTest extends EntityTestBase {
/**
* Tests that translation destination fails for untranslatable entities.
*/
- public function testUntranslatable() {
+ public function testUntranslatable(): void {
// An entity type without a language.
$this->entityType->getKey('langcode')->willReturn('');
$this->entityType->getKey('id')->willReturn('id');
diff --git a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php
index e2a223256dd..3b721eb6f67 100644
--- a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php
+++ b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php
@@ -40,7 +40,7 @@ class EntityRevisionTest extends EntityTestBase {
/**
* Tests that revision destination fails for unrevisionable entities.
*/
- public function testUnrevisionable() {
+ public function testUnrevisionable(): void {
$this->entityType->getKey('id')->willReturn('id');
$this->entityType->getKey('revision')->willReturn('');
$this->entityFieldManager->getBaseFieldDefinitions('foo')
@@ -67,7 +67,7 @@ class EntityRevisionTest extends EntityTestBase {
/**
* Tests that translation destination fails for untranslatable entities.
*/
- public function testUntranslatable() {
+ public function testUntranslatable(): void {
$this->entityType->getKey('id')->willReturn('id');
$this->entityType->getKey('revision')->willReturn('vid');
$this->entityType->getKey('langcode')->willReturn('');
diff --git a/core/modules/migrate/tests/src/Unit/RowTest.php b/core/modules/migrate/tests/src/Unit/RowTest.php
index 2a779b0490f..69fce6f7860 100644
--- a/core/modules/migrate/tests/src/Unit/RowTest.php
+++ b/core/modules/migrate/tests/src/Unit/RowTest.php
@@ -87,7 +87,7 @@ class RowTest extends UnitTestCase {
/**
* Tests object creation: empty.
*/
- public function testRowWithoutData() {
+ public function testRowWithoutData(): void {
$row = new Row();
$this->assertSame([], $row->getSource(), 'Empty row');
}
@@ -95,7 +95,7 @@ class RowTest extends UnitTestCase {
/**
* Tests object creation: basic.
*/
- public function testRowWithBasicData() {
+ public function testRowWithBasicData(): void {
$row = new Row($this->testValues, $this->testSourceIds);
$this->assertSame($this->testValues, $row->getSource(), 'Row with data, simple id.');
}
@@ -103,7 +103,7 @@ class RowTest extends UnitTestCase {
/**
* Tests object creation: multiple source IDs.
*/
- public function testRowWithMultipleSourceIds() {
+ public function testRowWithMultipleSourceIds(): void {
$multi_source_ids = $this->testSourceIds + ['vid' => 'Node revision'];
$multi_source_ids_values = $this->testValues + ['vid' => 1];
$row = new Row($multi_source_ids_values, $multi_source_ids);
@@ -113,7 +113,7 @@ class RowTest extends UnitTestCase {
/**
* Tests object creation: invalid values.
*/
- public function testRowWithInvalidData() {
+ public function testRowWithInvalidData(): void {
$invalid_values = [
'title' => 'node X',
];
@@ -124,7 +124,7 @@ class RowTest extends UnitTestCase {
/**
* Tests source immutability after freeze.
*/
- public function testSourceFreeze() {
+ public function testSourceFreeze(): void {
$row = new Row($this->testValues, $this->testSourceIds);
$row->rehash();
$this->assertSame($this->testHash, $row->getHash(), 'Correct hash.');
@@ -139,7 +139,7 @@ class RowTest extends UnitTestCase {
/**
* Tests setting on a frozen row.
*/
- public function testSetFrozenRow() {
+ public function testSetFrozenRow(): void {
$row = new Row($this->testValues, $this->testSourceIds);
$row->freezeSource();
$this->expectException(\Exception::class);
@@ -150,7 +150,7 @@ class RowTest extends UnitTestCase {
/**
* Tests hashing.
*/
- public function testHashing() {
+ public function testHashing(): void {
$row = new Row($this->testValues, $this->testSourceIds);
$this->assertSame('', $row->getHash(), 'No hash at creation');
$row->rehash();
@@ -213,7 +213,7 @@ class RowTest extends UnitTestCase {
* @covers ::setIdMap
* @covers ::getIdMap
*/
- public function testGetSetIdMap() {
+ public function testGetSetIdMap(): void {
$row = new Row($this->testValues, $this->testSourceIds);
$test_id_map = [
'original_hash' => '',
@@ -227,7 +227,7 @@ class RowTest extends UnitTestCase {
/**
* Tests the source ID.
*/
- public function testSourceIdValues() {
+ public function testSourceIdValues(): void {
$row = new Row($this->testValues, $this->testSourceIds);
$this->assertSame(['nid' => $this->testValues['nid']], $row->getSourceIdValues());
}
@@ -235,7 +235,7 @@ class RowTest extends UnitTestCase {
/**
* Tests the multiple source IDs.
*/
- public function testMultipleSourceIdValues() {
+ public function testMultipleSourceIdValues(): void {
// Set values in same order as ids.
$multi_source_ids = $this->testSourceIds + [
'vid' => 'Node revision',
@@ -270,7 +270,7 @@ class RowTest extends UnitTestCase {
*
* @covers ::getSourceProperty
*/
- public function testGetSourceProperty() {
+ public function testGetSourceProperty(): void {
$row = new Row($this->testValues, $this->testSourceIds);
$this->assertSame($this->testValues['nid'], $row->getSourceProperty('nid'));
$this->assertSame($this->testValues['title'], $row->getSourceProperty('title'));
@@ -280,7 +280,7 @@ class RowTest extends UnitTestCase {
/**
* Tests setting and getting the destination.
*/
- public function testDestination() {
+ public function testDestination(): void {
$row = new Row($this->testValues, $this->testSourceIds);
$this->assertEmpty($row->getDestination());
$this->assertFalse($row->hasDestinationProperty('nid'));
@@ -294,7 +294,7 @@ class RowTest extends UnitTestCase {
/**
* Tests setting/getting multiple destination IDs.
*/
- public function testMultipleDestination() {
+ public function testMultipleDestination(): void {
$row = new Row($this->testValues, $this->testSourceIds);
// Set some deep nested values.
$row->setDestinationProperty('image/alt', 'alt text');
@@ -322,7 +322,7 @@ class RowTest extends UnitTestCase {
* @dataProvider getDataProvider
* @covers ::get
*/
- public function testGet($key, $expected_value) {
+ public function testGet($key, $expected_value): void {
$row = $this->createRowWithDestinationProperties($this->testGetSourceProperties, $this->testGetSourceIds, $this->testGetDestinationProperties);
$this->assertSame($expected_value, $row->get($key));
}
@@ -366,7 +366,7 @@ class RowTest extends UnitTestCase {
* @covers ::getMultiple
* @dataProvider getMultipleDataProvider
*/
- public function testGetMultiple(array $keys, array $expected_values) {
+ public function testGetMultiple(array $keys, array $expected_values): void {
$row = $this->createRowWithDestinationProperties($this->testGetSourceProperties, $this->testGetSourceIds, $this->testGetDestinationProperties);
$this->assertEquals(array_combine($keys, $expected_values), $row->getMultiple($keys));
}
diff --git a/core/modules/migrate/tests/src/Unit/SqlBaseTest.php b/core/modules/migrate/tests/src/Unit/SqlBaseTest.php
index 064e64343da..814566e9854 100644
--- a/core/modules/migrate/tests/src/Unit/SqlBaseTest.php
+++ b/core/modules/migrate/tests/src/Unit/SqlBaseTest.php
@@ -33,7 +33,7 @@ class SqlBaseTest extends UnitTestCase {
*
* @dataProvider sqlBaseTestProvider
*/
- public function testMapJoinable($expected_result, $id_map_is_sql, $with_id_map, $source_options = [], $id_map_options = []) {
+ public function testMapJoinable($expected_result, $id_map_is_sql, $with_id_map, $source_options = [], $id_map_options = []): void {
// Setup a connection object.
$source_connection = $this->getMockBuilder('Drupal\Core\Database\Connection')
->disableOriginalConstructor()
diff --git a/core/modules/migrate/tests/src/Unit/destination/ConfigTest.php b/core/modules/migrate/tests/src/Unit/destination/ConfigTest.php
index b4da80b4fd5..d7531ee90a8 100644
--- a/core/modules/migrate/tests/src/Unit/destination/ConfigTest.php
+++ b/core/modules/migrate/tests/src/Unit/destination/ConfigTest.php
@@ -18,7 +18,7 @@ class ConfigTest extends UnitTestCase {
/**
* Tests the import method.
*/
- public function testImport() {
+ public function testImport(): void {
$source = [
'test' => 'x',
];
@@ -65,7 +65,7 @@ class ConfigTest extends UnitTestCase {
/**
* Tests the import method.
*/
- public function testLanguageImport() {
+ public function testLanguageImport(): void {
$source = [
'langcode' => 'mi',
];
diff --git a/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php b/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php
index 98647c5d594..a2fc0bc4b85 100644
--- a/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php
+++ b/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php
@@ -74,7 +74,7 @@ class EntityRevisionTest extends UnitTestCase {
*
* @covers ::getEntity
*/
- public function testGetEntityDestinationValues() {
+ public function testGetEntityDestinationValues(): void {
$destination = $this->getEntityRevisionDestination([]);
// Return a dummy because we don't care what gets called.
$entity = $this->prophesize('\Drupal\Core\Entity\RevisionableInterface');
@@ -92,7 +92,7 @@ class EntityRevisionTest extends UnitTestCase {
*
* @covers ::getEntity
*/
- public function testGetEntityUpdateRevision() {
+ public function testGetEntityUpdateRevision(): void {
$destination = $this->getEntityRevisionDestination([]);
$entity = $this->prophesize('\Drupal\Core\Entity\RevisionableInterface');
@@ -119,7 +119,7 @@ class EntityRevisionTest extends UnitTestCase {
*
* @covers ::getEntity
*/
- public function testGetEntityNewRevision() {
+ public function testGetEntityNewRevision(): void {
$destination = $this->getEntityRevisionDestination([]);
$entity = $this->prophesize('\Drupal\Core\Entity\RevisionableInterface');
@@ -149,7 +149,7 @@ class EntityRevisionTest extends UnitTestCase {
*
* @covers ::getEntity
*/
- public function testGetEntityLoadFailure() {
+ public function testGetEntityLoadFailure(): void {
$destination = $this->getEntityRevisionDestination([]);
$entity_type = $this->prophesize('\Drupal\Core\Entity\EntityTypeInterface');
@@ -172,7 +172,7 @@ class EntityRevisionTest extends UnitTestCase {
*
* @covers ::save
*/
- public function testSave() {
+ public function testSave(): void {
$entity = $this->prophesize('\Drupal\Core\Entity\ContentEntityInterface');
$entity->save()
->shouldBeCalled();
diff --git a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php
index 159a6d41d93..db25c5c5d73 100644
--- a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php
+++ b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php
@@ -18,7 +18,7 @@ class PerComponentEntityDisplayTest extends MigrateTestCase {
/**
* Tests the entity display import method.
*/
- public function testImport() {
+ public function testImport(): void {
$values = [
'entity_type' => 'entity_type_test',
'bundle' => 'bundle_test',
diff --git a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php
index b93500261b2..9ccf8ea8c58 100644
--- a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php
+++ b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php
@@ -18,7 +18,7 @@ class PerComponentEntityFormDisplayTest extends MigrateTestCase {
/**
* Tests the entity display import method.
*/
- public function testImport() {
+ public function testImport(): void {
$values = [
'entity_type' => 'entity_type_test',
'bundle' => 'bundle_test',
diff --git a/core/modules/migrate/tests/src/Unit/process/ArrayBuildTest.php b/core/modules/migrate/tests/src/Unit/process/ArrayBuildTest.php
index 0cf92f27eac..63360241700 100644
--- a/core/modules/migrate/tests/src/Unit/process/ArrayBuildTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/ArrayBuildTest.php
@@ -28,7 +28,7 @@ class ArrayBuildTest extends MigrateProcessTestCase {
/**
* Tests successful transformation.
*/
- public function testTransform() {
+ public function testTransform(): void {
$source = [
['foo' => 'Foo', 'bar' => 'Bar'],
['foo' => 'foo bar', 'bar' => 'bar foo'],
@@ -44,7 +44,7 @@ class ArrayBuildTest extends MigrateProcessTestCase {
/**
* Tests non-existent key for the key configuration.
*/
- public function testNonExistentKey() {
+ public function testNonExistentKey(): void {
$source = [
['bar' => 'foo'],
];
@@ -56,7 +56,7 @@ class ArrayBuildTest extends MigrateProcessTestCase {
/**
* Tests non-existent key for the value configuration.
*/
- public function testNonExistentValue() {
+ public function testNonExistentValue(): void {
$source = [
['foo' => 'bar'],
];
@@ -68,7 +68,7 @@ class ArrayBuildTest extends MigrateProcessTestCase {
/**
* Tests one-dimensional array input.
*/
- public function testOneDimensionalArrayInput() {
+ public function testOneDimensionalArrayInput(): void {
$source = ['foo' => 'bar'];
$this->expectException(MigrateException::class);
$this->expectExceptionMessage('The input should be an array of arrays');
@@ -78,7 +78,7 @@ class ArrayBuildTest extends MigrateProcessTestCase {
/**
* Tests string input.
*/
- public function testStringInput() {
+ public function testStringInput(): void {
$source = 'foo';
$this->expectException(MigrateException::class);
$this->expectExceptionMessage('The input should be an array of arrays');
diff --git a/core/modules/migrate/tests/src/Unit/process/CallbackTest.php b/core/modules/migrate/tests/src/Unit/process/CallbackTest.php
index 485c4eb669b..a93ba2f7522 100644
--- a/core/modules/migrate/tests/src/Unit/process/CallbackTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/CallbackTest.php
@@ -19,7 +19,7 @@ class CallbackTest extends MigrateProcessTestCase {
*
* @dataProvider providerCallback
*/
- public function testCallback($callable) {
+ public function testCallback($callable): void {
$configuration = ['callable' => $callable];
$this->plugin = new Callback($configuration, 'map', []);
$value = $this->plugin->transform('FooBar', $this->migrateExecutable, $this->row, 'destination_property');
@@ -41,7 +41,7 @@ class CallbackTest extends MigrateProcessTestCase {
*
* @dataProvider providerCallbackArray
*/
- public function testCallbackArray($callable, $args, $result) {
+ public function testCallbackArray($callable, $args, $result): void {
$configuration = ['callable' => $callable, 'unpack_source' => TRUE];
$this->plugin = new Callback($configuration, 'map', []);
$value = $this->plugin->transform($args, $this->migrateExecutable, $this->row, 'destination_property');
@@ -90,7 +90,7 @@ class CallbackTest extends MigrateProcessTestCase {
*
* @dataProvider providerCallbackExceptions
*/
- public function testCallbackExceptions($message, array $configuration, $class = 'InvalidArgumentException', $args = NULL) {
+ public function testCallbackExceptions($message, array $configuration, $class = 'InvalidArgumentException', $args = NULL): void {
$this->expectException($class);
$this->expectExceptionMessage($message);
$this->plugin = new Callback($configuration, 'map', []);
diff --git a/core/modules/migrate/tests/src/Unit/process/ConcatTest.php b/core/modules/migrate/tests/src/Unit/process/ConcatTest.php
index 049e1e21d31..b4afe33f9e1 100644
--- a/core/modules/migrate/tests/src/Unit/process/ConcatTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/ConcatTest.php
@@ -25,7 +25,7 @@ class ConcatTest extends MigrateProcessTestCase {
/**
* Tests concat works without a delimiter.
*/
- public function testConcatWithoutDelimiter() {
+ public function testConcatWithoutDelimiter(): void {
$value = $this->plugin->transform(['foo', 'bar'], $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame('foobar', $value);
}
@@ -33,7 +33,7 @@ class ConcatTest extends MigrateProcessTestCase {
/**
* Tests concat fails properly on non-arrays.
*/
- public function testConcatWithNonArray() {
+ public function testConcatWithNonArray(): void {
$this->expectException(MigrateException::class);
$this->plugin->transform('foo', $this->migrateExecutable, $this->row, 'destination_property');
}
@@ -41,7 +41,7 @@ class ConcatTest extends MigrateProcessTestCase {
/**
* Tests concat works without a delimiter.
*/
- public function testConcatWithDelimiter() {
+ public function testConcatWithDelimiter(): void {
$this->plugin->setDelimiter('_');
$value = $this->plugin->transform(['foo', 'bar'], $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame('foo_bar', $value);
diff --git a/core/modules/migrate/tests/src/Unit/process/DefaultValueTest.php b/core/modules/migrate/tests/src/Unit/process/DefaultValueTest.php
index d2872b7877b..1f09bca8429 100644
--- a/core/modules/migrate/tests/src/Unit/process/DefaultValueTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/DefaultValueTest.php
@@ -21,7 +21,7 @@ class DefaultValueTest extends MigrateProcessTestCase {
*
* @dataProvider defaultValueDataProvider
*/
- public function testDefaultValue($configuration, $expected_value, $value) {
+ public function testDefaultValue($configuration, $expected_value, $value): void {
$process = new DefaultValue($configuration, 'default_value', []);
$value = $process->transform($value, $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame($expected_value, $value);
diff --git a/core/modules/migrate/tests/src/Unit/process/ExplodeTest.php b/core/modules/migrate/tests/src/Unit/process/ExplodeTest.php
index 0a790473507..ba005f2e458 100644
--- a/core/modules/migrate/tests/src/Unit/process/ExplodeTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/ExplodeTest.php
@@ -29,7 +29,7 @@ class ExplodeTest extends MigrateProcessTestCase {
/**
* Tests explode transform process works.
*/
- public function testTransform() {
+ public function testTransform(): void {
$value = $this->plugin->transform('foo,bar,tik', $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame(['foo', 'bar', 'tik'], $value);
}
@@ -37,7 +37,7 @@ class ExplodeTest extends MigrateProcessTestCase {
/**
* Tests explode transform process works with a limit.
*/
- public function testTransformLimit() {
+ public function testTransformLimit(): void {
$plugin = new Explode(['delimiter' => '_', 'limit' => 2], 'map', []);
$value = $plugin->transform('foo_bar_tik', $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame(['foo', 'bar_tik'], $value);
@@ -46,7 +46,7 @@ class ExplodeTest extends MigrateProcessTestCase {
/**
* Tests if the explode process can be chained with handles_multiple process.
*/
- public function testChainedTransform() {
+ public function testChainedTransform(): void {
$exploded = $this->plugin->transform('One,Two,Three', $this->migrateExecutable, $this->row, 'destination_property');
$concat = new Concat([], 'map', []);
@@ -57,7 +57,7 @@ class ExplodeTest extends MigrateProcessTestCase {
/**
* Tests explode fails properly on non-strings.
*/
- public function testExplodeWithNonString() {
+ public function testExplodeWithNonString(): void {
$this->expectException(MigrateException::class);
$this->expectExceptionMessage('is not a string');
$this->plugin->transform(['foo'], $this->migrateExecutable, $this->row, 'destination_property');
@@ -68,7 +68,7 @@ class ExplodeTest extends MigrateProcessTestCase {
*
* @dataProvider providerExplodeWithNonStrictAndEmptySource
*/
- public function testExplodeWithNonStrictAndEmptySource($value, $expected) {
+ public function testExplodeWithNonStrictAndEmptySource($value, $expected): void {
$plugin = new Explode(['delimiter' => '|', 'strict' => FALSE], 'map', []);
$processed = $plugin->transform($value, $this->migrateExecutable, $this->row, 'destination_property');
@@ -93,7 +93,7 @@ class ExplodeTest extends MigrateProcessTestCase {
/**
* Tests Explode exception handling when string-cast fails.
*/
- public function testExplodeWithNonStrictAndNonCastable() {
+ public function testExplodeWithNonStrictAndNonCastable(): void {
$plugin = new Explode(['delimiter' => '|', 'strict' => FALSE], 'map', []);
$this->expectException(MigrateException::class);
$this->expectExceptionMessage('cannot be casted to a string');
@@ -104,7 +104,7 @@ class ExplodeTest extends MigrateProcessTestCase {
/**
* Tests Explode return values with an empty string and strict check.
*/
- public function testExplodeWithStrictAndEmptyString() {
+ public function testExplodeWithStrictAndEmptyString(): void {
$plugin = new Explode(['delimiter' => '|'], 'map', []);
$processed = $plugin->transform('', $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame([''], $processed);
@@ -113,7 +113,7 @@ class ExplodeTest extends MigrateProcessTestCase {
/**
* Tests explode fails with empty delimiter.
*/
- public function testExplodeWithEmptyDelimiter() {
+ public function testExplodeWithEmptyDelimiter(): void {
$this->expectException(MigrateException::class);
$this->expectExceptionMessage('delimiter is empty');
$plugin = new Explode(['delimiter' => ''], 'map', []);
diff --git a/core/modules/migrate/tests/src/Unit/process/ExtractTest.php b/core/modules/migrate/tests/src/Unit/process/ExtractTest.php
index 4c44f848c64..15e19c6c693 100644
--- a/core/modules/migrate/tests/src/Unit/process/ExtractTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/ExtractTest.php
@@ -25,7 +25,7 @@ class ExtractTest extends MigrateProcessTestCase {
/**
* Tests successful extraction.
*/
- public function testExtract() {
+ public function testExtract(): void {
$value = $this->plugin->transform(['foo' => 'bar'], $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame('bar', $value);
}
@@ -35,7 +35,7 @@ class ExtractTest extends MigrateProcessTestCase {
*
* @dataProvider providerTestExtractInvalid
*/
- public function testExtractInvalid($value) {
+ public function testExtractInvalid($value): void {
$this->expectException(MigrateException::class);
$type = gettype($value);
$this->expectExceptionMessage(sprintf("Input should be an array, instead it was of type '%s'", $type));
@@ -45,7 +45,7 @@ class ExtractTest extends MigrateProcessTestCase {
/**
* Tests unsuccessful extraction.
*/
- public function testExtractFail() {
+ public function testExtractFail(): void {
$this->expectException(MigrateException::class);
$this->expectExceptionMessage("Array index missing, extraction failed for 'array(\n 'bar' => 'foo',\n)'. Consider adding a `default` key to the configuration.");
$this->plugin->transform(['bar' => 'foo'], $this->migrateExecutable, $this->row, 'destination_property');
@@ -54,7 +54,7 @@ class ExtractTest extends MigrateProcessTestCase {
/**
* Tests unsuccessful extraction.
*/
- public function testExtractFailDefault() {
+ public function testExtractFailDefault(): void {
$plugin = new Extract(['index' => ['foo'], 'default' => 'test'], 'map', []);
$value = $plugin->transform(['bar' => 'foo'], $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame('test', $value, '');
@@ -74,7 +74,7 @@ class ExtractTest extends MigrateProcessTestCase {
*
* @dataProvider providerExtractDefault
*/
- public function testExtractDefault(array $value, array $configuration, $expected) {
+ public function testExtractDefault(array $value, array $configuration, $expected): void {
$this->plugin = new Extract($configuration, 'map', []);
$value = $this->plugin->transform($value, $this->migrateExecutable, $this->row, 'destination_property');
diff --git a/core/modules/migrate/tests/src/Unit/process/FileCopyTest.php b/core/modules/migrate/tests/src/Unit/process/FileCopyTest.php
index 9b3a610273d..b23b6026b69 100644
--- a/core/modules/migrate/tests/src/Unit/process/FileCopyTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/FileCopyTest.php
@@ -29,7 +29,7 @@ class FileCopyTest extends MigrateProcessTestCase {
* @param $expected
* The expected value of the plugin configuration.
*/
- public function testFileProcessBaseConstructor($configuration, $expected) {
+ public function testFileProcessBaseConstructor($configuration, $expected): void {
$this->assertPlugin($configuration, $expected);
}
diff --git a/core/modules/migrate/tests/src/Unit/process/FlattenTest.php b/core/modules/migrate/tests/src/Unit/process/FlattenTest.php
index 571b568d61b..afd8e6d129b 100644
--- a/core/modules/migrate/tests/src/Unit/process/FlattenTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/FlattenTest.php
@@ -27,7 +27,7 @@ class FlattenTest extends MigrateProcessTestCase {
*
* @dataProvider providerTestFlatten
*/
- public function testFlatten($value, $expected) {
+ public function testFlatten($value, $expected): void {
$flattened = $this->plugin->transform($value, $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame($expected, $flattened);
}
@@ -58,7 +58,7 @@ class FlattenTest extends MigrateProcessTestCase {
*
* @dataProvider providerTestFlattenInvalid
*/
- public function testFlattenInvalid($value) {
+ public function testFlattenInvalid($value): void {
$this->expectException(MigrateException::class);
$type = gettype($value);
$this->expectExceptionMessage(sprintf("Input should be an array or an object, instead it was of type '%s'", $type));
diff --git a/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php b/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php
index 67c917ce943..0f0408aaa50 100644
--- a/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php
@@ -19,7 +19,7 @@ class FormatDateTest extends MigrateProcessTestCase {
/**
* Tests that missing configuration will throw an exception.
*/
- public function testMigrateExceptionMissingFromFormat() {
+ public function testMigrateExceptionMissingFromFormat(): void {
$configuration = [
'from_format' => '',
'to_format' => 'Y-m-d',
@@ -34,7 +34,7 @@ class FormatDateTest extends MigrateProcessTestCase {
/**
* Tests that missing configuration will throw an exception.
*/
- public function testMigrateExceptionMissingToFormat() {
+ public function testMigrateExceptionMissingToFormat(): void {
$configuration = [
'from_format' => 'm/d/Y',
'to_format' => '',
@@ -49,7 +49,7 @@ class FormatDateTest extends MigrateProcessTestCase {
/**
* Tests that date format mismatches will throw an exception.
*/
- public function testMigrateExceptionBadFormat() {
+ public function testMigrateExceptionBadFormat(): void {
$configuration = [
'from_format' => 'm/d/Y',
'to_format' => 'Y-m-d',
@@ -64,7 +64,7 @@ class FormatDateTest extends MigrateProcessTestCase {
/**
* Tests that an unexpected date value will throw an exception.
*/
- public function testMigrateExceptionUnexpectedValue() {
+ public function testMigrateExceptionUnexpectedValue(): void {
$configuration = [
'from_format' => 'm/d/Y',
'to_format' => 'Y-m-d',
@@ -90,7 +90,7 @@ class FormatDateTest extends MigrateProcessTestCase {
* @param $expected
* The expected value of the migration process plugin.
*/
- public function testTransform($configuration, $value, $expected) {
+ public function testTransform($configuration, $value, $expected): void {
$this->plugin = new FormatDate($configuration, 'test_format_date', []);
$actual = $this->plugin->transform($value, $this->migrateExecutable, $this->row, 'field_date');
diff --git a/core/modules/migrate/tests/src/Unit/process/GetTest.php b/core/modules/migrate/tests/src/Unit/process/GetTest.php
index a1e4b976947..fd3374e2ccf 100644
--- a/core/modules/migrate/tests/src/Unit/process/GetTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/GetTest.php
@@ -16,7 +16,7 @@ class GetTest extends MigrateProcessTestCase {
/**
* Tests the Get plugin when source is a string.
*/
- public function testTransformSourceString() {
+ public function testTransformSourceString(): void {
$this->row->expects($this->once())
->method('get')
->with('test')
@@ -29,7 +29,7 @@ class GetTest extends MigrateProcessTestCase {
/**
* Tests the Get plugin when source is an array.
*/
- public function testTransformSourceArray() {
+ public function testTransformSourceArray(): void {
$map = [
'test1' => 'source_value1',
'test2' => 'source_value2',
@@ -47,7 +47,7 @@ class GetTest extends MigrateProcessTestCase {
/**
* Tests the Get plugin when source is a string pointing to destination.
*/
- public function testTransformSourceStringAt() {
+ public function testTransformSourceStringAt(): void {
$this->row->expects($this->once())
->method('get')
->with('@@test')
@@ -60,7 +60,7 @@ class GetTest extends MigrateProcessTestCase {
/**
* Tests the Get plugin when source is an array pointing to destination.
*/
- public function testTransformSourceArrayAt() {
+ public function testTransformSourceArrayAt(): void {
$map = [
'test1' => 'source_value1',
'@@test2' => 'source_value2',
@@ -82,7 +82,7 @@ class GetTest extends MigrateProcessTestCase {
*
* @dataProvider integerValuesDataProvider
*/
- public function testIntegerValues($source, $expected_value) {
+ public function testIntegerValues($source, $expected_value): void {
$this->row->expects($this->atMost(2))
->method('get')
->willReturnOnConsecutiveCalls('val1', 'val2');
@@ -119,7 +119,7 @@ class GetTest extends MigrateProcessTestCase {
*
* An example of a syntax error is "Invalid tag_line detected".
*/
- public function testPluginSyntax() {
+ public function testPluginSyntax(): void {
$this->assertNotNull($this->prophesize(Get::class));
}
diff --git a/core/modules/migrate/tests/src/Unit/process/LogTest.php b/core/modules/migrate/tests/src/Unit/process/LogTest.php
index fa3abf6b3eb..949c5efc2a3 100644
--- a/core/modules/migrate/tests/src/Unit/process/LogTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/LogTest.php
@@ -19,7 +19,7 @@ class LogTest extends MigrateProcessTestCase {
*
* @dataProvider providerTestLog
*/
- public function testLog($value, $expected_message) {
+ public function testLog($value, $expected_message): void {
// Test the expected log message.
$this->migrateExecutable->expects($this->once())
->method('saveMessage')
diff --git a/core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php b/core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php
index 47f03d2aaa8..831e5474eef 100644
--- a/core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php
@@ -66,7 +66,7 @@ class MakeUniqueEntityFieldTest extends MigrateProcessTestCase {
*
* @dataProvider providerTestMakeUniqueEntityField
*/
- public function testMakeUniqueEntityField($count, $postfix = '', $start = NULL, $length = NULL) {
+ public function testMakeUniqueEntityField($count, $postfix = '', $start = NULL, $length = NULL): void {
$configuration = [
'entity_type' => 'test_entity_type',
'field' => 'test_field',
@@ -88,7 +88,7 @@ class MakeUniqueEntityFieldTest extends MigrateProcessTestCase {
/**
* Tests that invalid start position throws an exception.
*/
- public function testMakeUniqueEntityFieldEntityInvalidStart() {
+ public function testMakeUniqueEntityFieldEntityInvalidStart(): void {
$configuration = [
'entity_type' => 'test_entity_type',
'field' => 'test_field',
@@ -103,7 +103,7 @@ class MakeUniqueEntityFieldTest extends MigrateProcessTestCase {
/**
* Tests that invalid length option throws an exception.
*/
- public function testMakeUniqueEntityFieldEntityInvalidLength() {
+ public function testMakeUniqueEntityFieldEntityInvalidLength(): void {
$configuration = [
'entity_type' => 'test_entity_type',
'field' => 'test_field',
@@ -178,7 +178,7 @@ class MakeUniqueEntityFieldTest extends MigrateProcessTestCase {
/**
* Tests making an entity field value unique only for migrated entities.
*/
- public function testMakeUniqueEntityFieldMigrated() {
+ public function testMakeUniqueEntityFieldMigrated(): void {
$configuration = [
'entity_type' => 'test_entity_type',
'field' => 'test_field',
diff --git a/core/modules/migrate/tests/src/Unit/process/MenuLinkParentTest.php b/core/modules/migrate/tests/src/Unit/process/MenuLinkParentTest.php
index b0c53007c54..bc77d09ce8f 100644
--- a/core/modules/migrate/tests/src/Unit/process/MenuLinkParentTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/MenuLinkParentTest.php
@@ -91,7 +91,7 @@ class MenuLinkParentTest extends MigrateProcessTestCase {
*
* @dataProvider providerTransformException
*/
- public function testTransformException(array $source_value) {
+ public function testTransformException(array $source_value): void {
[$parent_id, $menu_name] = $source_value;
$this->migrateLookup->lookup(NULL, [1])->willReturn([]);
$plugin = new MenuLinkParent([], 'map', [], $this->migrateLookup->reveal(), $this->menuLinkManager->reveal(), $this->menuLinkStorage->reveal(), $this->migration->reveal());
@@ -138,7 +138,7 @@ class MenuLinkParentTest extends MigrateProcessTestCase {
*
* @dataProvider providerMenuLinkParent
*/
- public function testMenuLinkParent(array $source_value, $lookup_result, $plugin_id, $route_name, $expected_result) {
+ public function testMenuLinkParent(array $source_value, $lookup_result, $plugin_id, $route_name, $expected_result): void {
[$parent_id, $menu_name, $parent_link_path] = $source_value;
$this->migrateLookup->lookup(NULL, [$parent_id])
->willReturn([['id' => $lookup_result]]);
diff --git a/core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php b/core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php
index a849aedb41c..7700c06c430 100644
--- a/core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php
@@ -20,7 +20,7 @@ class MigrationLookupTest extends MigrationLookupTestCase {
/**
* @covers ::transform
*/
- public function testTransformWithStubSkipping() {
+ public function testTransformWithStubSkipping(): void {
$migration_plugin = $this->prophesize(MigrationInterface::class);
$migration_plugin_manager = $this->prophesize(MigrationPluginManagerInterface::class);
@@ -104,7 +104,7 @@ class MigrationLookupTest extends MigrationLookupTestCase {
*
* @dataProvider skipInvalidDataProvider
*/
- public function testSkipInvalid($value) {
+ public function testSkipInvalid($value): void {
$migration_plugin = $this->prophesize(MigrationInterface::class);
$migration_plugin_manager = $this->prophesize(MigrationPluginManagerInterface::class);
@@ -143,7 +143,7 @@ class MigrationLookupTest extends MigrationLookupTestCase {
*
* @dataProvider noSkipValidDataProvider
*/
- public function testNoSkipValid($value) {
+ public function testNoSkipValid($value): void {
$migration_plugin = $this->prophesize(MigrationInterface::class);
$migration_plugin_manager = $this->prophesize(MigrationPluginManagerInterface::class);
$id_map = $this->prophesize(MigrateIdMapInterface::class);
@@ -195,7 +195,7 @@ class MigrationLookupTest extends MigrationLookupTestCase {
*
* @dataProvider successfulLookupDataProvider
*/
- public function testSuccessfulLookup(array $source_id_values, array $destination_id_values, $source_value, $expected_value) {
+ public function testSuccessfulLookup(array $source_id_values, array $destination_id_values, $source_value, $expected_value): void {
$migration_plugin = $this->prophesize(MigrationInterface::class);
$this->migrateLookup->lookup('foo', $source_id_values)->willReturn([$destination_id_values]);
@@ -276,7 +276,7 @@ class MigrationLookupTest extends MigrationLookupTestCase {
/**
* Tests processing multiple source IDs.
*/
- public function testMultipleSourceIds() {
+ public function testMultipleSourceIds(): void {
$migration_plugin = $this->prophesize(MigrationInterface::class);
$this->migrateLookup->lookup('foo', ['id', 6])->willReturn([[2]]);
$configuration = [
@@ -290,7 +290,7 @@ class MigrationLookupTest extends MigrationLookupTestCase {
/**
* Tests processing multiple migrations and source IDs.
*/
- public function testMultipleMigrations() {
+ public function testMultipleMigrations(): void {
$migration_plugin = $this->prophesize(MigrationInterface::class);
$this->migrateLookup->lookup('example', [1])->willReturn([[2]]);
$this->migrateLookup->lookup('example', [2])->willReturn([]);
diff --git a/core/modules/migrate/tests/src/Unit/process/NullCoalesceTest.php b/core/modules/migrate/tests/src/Unit/process/NullCoalesceTest.php
index 765f19f7e42..d165c0bc09f 100644
--- a/core/modules/migrate/tests/src/Unit/process/NullCoalesceTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/NullCoalesceTest.php
@@ -21,7 +21,7 @@ class NullCoalesceTest extends MigrateProcessTestCase {
*
* @covers ::transform
*/
- public function testExceptionOnInvalidValue() {
+ public function testExceptionOnInvalidValue(): void {
$this->expectException(MigrateException::class);
(new NullCoalesce([], 'null_coalesce', []))->transform('invalid', $this->migrateExecutable, $this->row, 'destination_property');
}
@@ -40,7 +40,7 @@ class NullCoalesceTest extends MigrateProcessTestCase {
*
* @throws \Drupal\migrate\MigrateException
*/
- public function testTransform(array $source, $expected_result) {
+ public function testTransform(array $source, $expected_result): void {
$plugin = new NullCoalesce([], 'null_coalesce', []);
$result = $plugin->transform($source, $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame($expected_result, $result);
@@ -94,7 +94,7 @@ class NullCoalesceTest extends MigrateProcessTestCase {
*
* @throws \Drupal\migrate\MigrateException
*/
- public function testTransformWithDefault(array $source, $default_value, $expected_result) {
+ public function testTransformWithDefault(array $source, $default_value, $expected_result): void {
$plugin = new NullCoalesce(['default_value' => $default_value], 'null_coalesce', []);
$result = $plugin->transform($source, $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame($expected_result, $result);
diff --git a/core/modules/migrate/tests/src/Unit/process/ProcessPluginBaseTest.php b/core/modules/migrate/tests/src/Unit/process/ProcessPluginBaseTest.php
index 1b53569e92a..73af347e406 100644
--- a/core/modules/migrate/tests/src/Unit/process/ProcessPluginBaseTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/ProcessPluginBaseTest.php
@@ -23,7 +23,7 @@ class ProcessPluginBaseTest extends UnitTestCase {
* @covers ::stopPipeline
* @covers ::reset
*/
- public function testStopPipeline() {
+ public function testStopPipeline(): void {
$plugin = new ProcessPluginBase([], 'plugin_id', []);
$this->assertFalse($plugin->isPipelineStopped());
$stopPipeline = (new \ReflectionClass($plugin))->getMethod('stopPipeline');
diff --git a/core/modules/migrate/tests/src/Unit/process/SkipOnEmptyTest.php b/core/modules/migrate/tests/src/Unit/process/SkipOnEmptyTest.php
index 9b2236fef33..33e630977f6 100644
--- a/core/modules/migrate/tests/src/Unit/process/SkipOnEmptyTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/SkipOnEmptyTest.php
@@ -18,7 +18,7 @@ class SkipOnEmptyTest extends MigrateProcessTestCase {
/**
* @covers ::process
*/
- public function testProcessSkipsOnEmpty() {
+ public function testProcessSkipsOnEmpty(): void {
$configuration['method'] = 'process';
$plugin = new SkipOnEmpty($configuration, 'skip_on_empty', []);
$this->assertFalse($plugin->isPipelineStopped());
@@ -29,7 +29,7 @@ class SkipOnEmptyTest extends MigrateProcessTestCase {
/**
* @covers ::process
*/
- public function testProcessBypassesOnNonEmpty() {
+ public function testProcessBypassesOnNonEmpty(): void {
$configuration['method'] = 'process';
$plugin = new SkipOnEmpty($configuration, 'skip_on_empty', []);
$value = $plugin
@@ -41,7 +41,7 @@ class SkipOnEmptyTest extends MigrateProcessTestCase {
/**
* @covers ::row
*/
- public function testRowSkipsOnEmpty() {
+ public function testRowSkipsOnEmpty(): void {
$configuration['method'] = 'row';
$this->expectException(MigrateSkipRowException::class);
(new SkipOnEmpty($configuration, 'skip_on_empty', []))
@@ -51,7 +51,7 @@ class SkipOnEmptyTest extends MigrateProcessTestCase {
/**
* @covers ::row
*/
- public function testRowBypassesOnNonEmpty() {
+ public function testRowBypassesOnNonEmpty(): void {
$configuration['method'] = 'row';
$value = (new SkipOnEmpty($configuration, 'skip_on_empty', []))
->transform(' ', $this->migrateExecutable, $this->row, 'destination_property');
@@ -63,7 +63,7 @@ class SkipOnEmptyTest extends MigrateProcessTestCase {
*
* @covers ::row
*/
- public function testRowSkipWithoutMessage() {
+ public function testRowSkipWithoutMessage(): void {
$configuration = [
'method' => 'row',
];
@@ -77,7 +77,7 @@ class SkipOnEmptyTest extends MigrateProcessTestCase {
*
* @covers ::row
*/
- public function testRowSkipWithMessage() {
+ public function testRowSkipWithMessage(): void {
$configuration = [
'method' => 'row',
'message' => 'The value is empty',
@@ -91,7 +91,7 @@ class SkipOnEmptyTest extends MigrateProcessTestCase {
/**
* Tests repeated execution of a process plugin can reset the pipeline stoppage correctly.
*/
- public function testMultipleTransforms() {
+ public function testMultipleTransforms(): void {
$configuration['method'] = 'process';
$plugin = new SkipOnEmpty($configuration, 'skip_on_empty', []);
diff --git a/core/modules/migrate/tests/src/Unit/process/SkipRowIfNotSetTest.php b/core/modules/migrate/tests/src/Unit/process/SkipRowIfNotSetTest.php
index e299df14983..554b7d21059 100644
--- a/core/modules/migrate/tests/src/Unit/process/SkipRowIfNotSetTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/SkipRowIfNotSetTest.php
@@ -20,7 +20,7 @@ class SkipRowIfNotSetTest extends MigrateProcessTestCase {
*
* @covers ::transform
*/
- public function testRowSkipWithoutMessage() {
+ public function testRowSkipWithoutMessage(): void {
$configuration = [
'index' => 'some_key',
];
@@ -34,7 +34,7 @@ class SkipRowIfNotSetTest extends MigrateProcessTestCase {
*
* @covers ::transform
*/
- public function testRowSkipWithMessage() {
+ public function testRowSkipWithMessage(): void {
$configuration = [
'index' => 'some_key',
'message' => "The 'some_key' key is not set",
diff --git a/core/modules/migrate/tests/src/Unit/process/StaticMapTest.php b/core/modules/migrate/tests/src/Unit/process/StaticMapTest.php
index ed2fd7377ac..04053a64fbc 100644
--- a/core/modules/migrate/tests/src/Unit/process/StaticMapTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/StaticMapTest.php
@@ -28,7 +28,7 @@ class StaticMapTest extends MigrateProcessTestCase {
/**
* Tests map when the source is a string.
*/
- public function testMapWithSourceString() {
+ public function testMapWithSourceString(): void {
$value = $this->plugin->transform('foo', $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame(['bar' => 'baz'], $value);
}
@@ -36,7 +36,7 @@ class StaticMapTest extends MigrateProcessTestCase {
/**
* Tests map when the source is a list.
*/
- public function testMapWithSourceList() {
+ public function testMapWithSourceList(): void {
$value = $this->plugin->transform(['foo', 'bar'], $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame('baz', $value);
}
@@ -44,7 +44,7 @@ class StaticMapTest extends MigrateProcessTestCase {
/**
* Tests when the source is empty.
*/
- public function testMapWithEmptySource() {
+ public function testMapWithEmptySource(): void {
$this->expectException(MigrateException::class);
$this->plugin->transform([], $this->migrateExecutable, $this->row, 'destination_property');
}
@@ -52,7 +52,7 @@ class StaticMapTest extends MigrateProcessTestCase {
/**
* Tests when the source is invalid.
*/
- public function testMapWithInvalidSource() {
+ public function testMapWithInvalidSource(): void {
$this->expectException(MigrateSkipRowException::class);
$this->expectExceptionMessage(sprintf("No static mapping found for '%s' and no default value provided for destination '%s'.", Variable::export(['bar']), 'destination_property'));
$this->plugin->transform(['bar'], $this->migrateExecutable, $this->row, 'destination_property');
@@ -61,7 +61,7 @@ class StaticMapTest extends MigrateProcessTestCase {
/**
* Tests when the source is invalid but there's a default.
*/
- public function testMapWithInvalidSourceWithADefaultValue() {
+ public function testMapWithInvalidSourceWithADefaultValue(): void {
$configuration['map']['foo']['bar'] = 'baz';
$configuration['default_value'] = 'test';
$this->plugin = new StaticMap($configuration, 'map', []);
@@ -72,7 +72,7 @@ class StaticMapTest extends MigrateProcessTestCase {
/**
* Tests when the source is invalid but there's a default value of NULL.
*/
- public function testMapWithInvalidSourceWithANullDefaultValue() {
+ public function testMapWithInvalidSourceWithANullDefaultValue(): void {
$configuration['map']['foo']['bar'] = 'baz';
$configuration['default_value'] = NULL;
$this->plugin = new StaticMap($configuration, 'map', []);
@@ -83,7 +83,7 @@ class StaticMapTest extends MigrateProcessTestCase {
/**
* Tests when the source is invalid and bypass is enabled.
*/
- public function testMapWithInvalidSourceAndBypass() {
+ public function testMapWithInvalidSourceAndBypass(): void {
$configuration['map']['foo']['bar'] = 'baz';
$configuration['default_value'] = 'test';
$configuration['bypass'] = TRUE;
@@ -96,7 +96,7 @@ class StaticMapTest extends MigrateProcessTestCase {
/**
* Tests when the source is NULL.
*/
- public function testWithNullSourceNotInMap() {
+ public function testWithNullSourceNotInMap(): void {
$this->expectException(MigrateSkipRowException::class);
$this->expectExceptionMessage("No static mapping found for 'NULL' and no default value provided for destination 'destination_property'");
$this->plugin->transform(NULL, $this->migrateExecutable, $this->row, 'destination_property');
@@ -105,7 +105,7 @@ class StaticMapTest extends MigrateProcessTestCase {
/**
* Tests when the source is invalid but there's a default.
*/
- public function testWithNullSource() {
+ public function testWithNullSource(): void {
$configuration['map']['foo']['bar'] = 'baz';
$configuration['map'][NULL] = 'mapped NULL';
$this->plugin = new StaticMap($configuration, 'map', []);
diff --git a/core/modules/migrate/tests/src/Unit/process/SubProcessTest.php b/core/modules/migrate/tests/src/Unit/process/SubProcessTest.php
index 6fa1c8d801b..d8ba9cbac00 100644
--- a/core/modules/migrate/tests/src/Unit/process/SubProcessTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/SubProcessTest.php
@@ -40,7 +40,7 @@ class SubProcessTest extends MigrateProcessTestCase {
*
* @dataProvider providerTestSubProcess
*/
- public function testSubProcess($process_configuration, $source_values = []) {
+ public function testSubProcess($process_configuration, $source_values = []): void {
$migration = $this->getMigration();
// Set up the properties for the sub_process.
$plugin = new SubProcess($process_configuration, 'sub_process', []);
@@ -134,7 +134,7 @@ class SubProcessTest extends MigrateProcessTestCase {
*
* @dataProvider providerTestNotFoundSubProcess
*/
- public function testNotFoundSubProcess($process_configuration, $source_values = []) {
+ public function testNotFoundSubProcess($process_configuration, $source_values = []): void {
$migration = $this->getMigration();
// Set up the properties for the sub_process.
$plugin = new SubProcess($process_configuration, 'sub_process', []);
@@ -200,7 +200,7 @@ class SubProcessTest extends MigrateProcessTestCase {
*
* @dataProvider providerTestSourceNotArray
*/
- public function testSourceNotArray($source_values, $type) {
+ public function testSourceNotArray($source_values, $type): void {
$process = new SubProcess(['process' => ['foo' => 'source_foo']], 'sub_process', []);
$this->expectException(MigrateException::class);
$this->expectExceptionMessage("Input array should hold elements of type array, instead element was of type '$type'");
diff --git a/core/modules/migrate/tests/src/Unit/process/SubstrTest.php b/core/modules/migrate/tests/src/Unit/process/SubstrTest.php
index 6ce82d60e3a..a40e9186b00 100644
--- a/core/modules/migrate/tests/src/Unit/process/SubstrTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/SubstrTest.php
@@ -30,7 +30,7 @@ class SubstrTest extends MigrateProcessTestCase {
*
* @dataProvider providerTestSubstr
*/
- public function testSubstr($start = NULL, $length = NULL, $expected = NULL) {
+ public function testSubstr($start = NULL, $length = NULL, $expected = NULL): void {
$configuration['start'] = $start;
$configuration['length'] = $length;
$this->plugin = new Substr($configuration, 'map', []);
@@ -61,7 +61,7 @@ class SubstrTest extends MigrateProcessTestCase {
/**
* Tests invalid input type.
*/
- public function testSubstrFail() {
+ public function testSubstrFail(): void {
$configuration = [];
$this->plugin = new Substr($configuration, 'map', []);
$this->expectException(MigrateException::class);
@@ -72,7 +72,7 @@ class SubstrTest extends MigrateProcessTestCase {
/**
* Tests that the start parameter is an integer.
*/
- public function testStartIsString() {
+ public function testStartIsString(): void {
$configuration['start'] = '2';
$this->plugin = new Substr($configuration, 'map', []);
$this->expectException(MigrateException::class);
@@ -83,7 +83,7 @@ class SubstrTest extends MigrateProcessTestCase {
/**
* Tests that the length parameter is an integer.
*/
- public function testLengthIsString() {
+ public function testLengthIsString(): void {
$configuration['length'] = '1';
$this->plugin = new Substr($configuration, 'map', []);
$this->expectException(MigrateException::class);
diff --git a/core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php b/core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php
index 41d00eef0e2..c54ff69065c 100644
--- a/core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php
@@ -43,7 +43,7 @@ class UrlEncodeTest extends MigrateTestCase {
* Cover various encoding scenarios.
* @dataProvider urlDataProvider
*/
- public function testUrls($input, $output) {
+ public function testUrls($input, $output): void {
$this->assertEquals($output, $this->doTransform($input));
}
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/IdMapTableNoDummyTest.php b/core/modules/migrate_drupal/tests/src/Kernel/IdMapTableNoDummyTest.php
index e0273f964db..ce9b5a3f9ef 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/IdMapTableNoDummyTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/IdMapTableNoDummyTest.php
@@ -32,7 +32,7 @@ class IdMapTableNoDummyTest extends MigrateDrupal6TestBase {
/**
* Tests that dummy map tables do not exist.
*/
- public function testNoDummyTables() {
+ public function testNoDummyTables(): void {
$database = \Drupal::database();
$tables = $database->schema()->findTables('%migrate_map%');
$dummy_tables = preg_grep("/.*migrate_map_([0-9a-fA-F]){13}/", $tables);
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php b/core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php
index 4a225068326..34c933c6f38 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php
@@ -51,7 +51,7 @@ class MigrateFieldPluginManagerTest extends MigrateDrupalTestBase {
*
* @covers ::getPluginIdFromFieldType
*/
- public function testPluginSelection() {
+ public function testPluginSelection(): void {
$this->assertSame('link', $this->pluginManager->getPluginIdFromFieldType('link', ['core' => 6]));
$this->assertSame('link_field', $this->pluginManager->getPluginIdFromFieldType('link_field', ['core' => 7]));
$this->assertSame('image', $this->pluginManager->getPluginIdFromFieldType('image', ['core' => 7]));
@@ -73,7 +73,7 @@ class MigrateFieldPluginManagerTest extends MigrateDrupalTestBase {
* @covers ::getPluginIdFromFieldType
* @dataProvider nonExistentPluginExceptionsData
*/
- public function testNonExistentPluginExceptions($core, $field_type) {
+ public function testNonExistentPluginExceptions($core, $field_type): void {
$this->expectException(PluginNotFoundException::class);
$this->expectExceptionMessage(sprintf("Plugin ID '%s' was not found.", $field_type));
$this->pluginManager->getPluginIdFromFieldType($field_type, ['core' => $core]);
@@ -109,7 +109,7 @@ class MigrateFieldPluginManagerTest extends MigrateDrupalTestBase {
/**
* Tests that plugins with no explicit weight are given a weight of 0.
*/
- public function testDefaultWeight() {
+ public function testDefaultWeight(): void {
$definitions = $this->pluginManager->getDefinitions();
$deprecated_plugins = [
'date',
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/NodeMigrationTypePluginAlterTest.php b/core/modules/migrate_drupal/tests/src/Kernel/NodeMigrationTypePluginAlterTest.php
index 935a7212ab4..ceba413d05b 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/NodeMigrationTypePluginAlterTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/NodeMigrationTypePluginAlterTest.php
@@ -44,7 +44,7 @@ class NodeMigrationTypePluginAlterTest extends MigrateTestBase {
*
* @throws \Exception
*/
- public function testMigrationPluginAlter($type, array $migration_definitions, array $expected) {
+ public function testMigrationPluginAlter($type, array $migration_definitions, array $expected): void {
$this->makeNodeMigrateMapTable($type, '7');
migrate_drupal_migration_plugins_alter($migration_definitions);
$this->assertSame($expected, $migration_definitions);
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 e422156c333..b1f6d9e8af9 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
@@ -46,7 +46,7 @@ class DestinationCategoryTest extends MigrateDrupalTestBase {
/**
* Tests that all D6 migrations are tagged as either Configuration or Content.
*/
- public function testD6Categories() {
+ public function testD6Categories(): void {
$migrations = $this->drupal6Migrations();
$this->assertArrayHasKey('d6_node:page', $migrations);
$this->assertCategories($migrations);
@@ -55,7 +55,7 @@ class DestinationCategoryTest extends MigrateDrupalTestBase {
/**
* Tests that all D7 migrations are tagged as either Configuration or Content.
*/
- public function testD7Categories() {
+ public function testD7Categories(): void {
$migrations = $this->drupal7Migrations();
$this->assertArrayHasKey('d7_node:page', $migrations);
$this->assertCategories($migrations);
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityConstructorTest.php b/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityConstructorTest.php
index 3de02ecbef3..7e7b2d6d92d 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityConstructorTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityConstructorTest.php
@@ -32,7 +32,7 @@ class ContentEntityConstructorTest extends KernelTestBase {
*
* @dataProvider providerTestConstructor
*/
- public function testConstructor($configuration, $plugin_definition, $exception_class, $expected) {
+ public function testConstructor($configuration, $plugin_definition, $exception_class, $expected): void {
$migration = $this->prophesize(MigrationInterface::class)->reveal();
$this->expectException($exception_class);
$this->expectExceptionMessage($expected);
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 5417aaa200b..c4cdaa3596b 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
@@ -215,7 +215,7 @@ class ContentEntityTest extends KernelTestBase {
*
* @dataProvider migrationConfigurationProvider
*/
- public function testUserSource(array $configuration) {
+ public function testUserSource(array $configuration): void {
$migration = $this->migrationPluginManager
->createStubMigration($this->migrationDefinition('content_entity:user', $configuration));
$user_source = $migration->getSourcePlugin();
@@ -246,7 +246,7 @@ class ContentEntityTest extends KernelTestBase {
*
* @dataProvider migrationConfigurationProvider
*/
- public function testFileSource(array $configuration) {
+ public function testFileSource(array $configuration): void {
$file = File::create([
'filename' => 'foo.txt',
'uid' => $this->user->id(),
@@ -281,7 +281,7 @@ class ContentEntityTest extends KernelTestBase {
*
* @dataProvider migrationConfigurationProvider
*/
- public function testNodeSource(array $configuration) {
+ public function testNodeSource(array $configuration): void {
$configuration += ['bundle' => $this->bundle];
$migration = $this->migrationPluginManager
->createStubMigration($this->migrationDefinition('content_entity:node', $configuration));
@@ -333,7 +333,7 @@ class ContentEntityTest extends KernelTestBase {
*
* @dataProvider migrationConfigurationProvider
*/
- public function testMediaSource(array $configuration) {
+ public function testMediaSource(array $configuration): void {
$values = [
'id' => 'image',
'label' => 'Image',
@@ -385,7 +385,7 @@ class ContentEntityTest extends KernelTestBase {
*
* @dataProvider migrationConfigurationProvider
*/
- public function testTermSource(array $configuration) {
+ public function testTermSource(array $configuration): void {
$term2 = Term::create([
'vid' => $this->vocabulary,
'name' => 'Granny Smith',
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/StateFileExistsTest.php b/core/modules/migrate_drupal/tests/src/Kernel/StateFileExistsTest.php
index 209d686a81a..318b2674b08 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/StateFileExistsTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/StateFileExistsTest.php
@@ -77,7 +77,7 @@ class StateFileExistsTest extends MigrateDrupalTestBase {
/**
* Tests that the migrate_drupal.yml files exist as needed.
*/
- public function testMigrationState() {
+ public function testMigrationState(): void {
// Install all available modules.
$module_handler = $this->container->get('module_handler');
$all_modules = $this->coreModuleListDataProvider();
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d6/EntityContentBaseTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d6/EntityContentBaseTest.php
index 7805a02fb2b..5923841e6a6 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/d6/EntityContentBaseTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/d6/EntityContentBaseTest.php
@@ -63,7 +63,7 @@ class EntityContentBaseTest extends MigrateDrupal6TestBase {
*
* This is the default behavior.
*/
- public function testOverwriteAllMappedProperties() {
+ public function testOverwriteAllMappedProperties(): void {
$this->executeMigration('d6_user');
/** @var \Drupal\user\UserInterface $account */
$account = User::load(2);
@@ -77,7 +77,7 @@ class EntityContentBaseTest extends MigrateDrupal6TestBase {
*
* The selected properties are specified in the destination configuration.
*/
- public function testOverwriteProperties() {
+ public function testOverwriteProperties(): void {
// Execute the migration in migrate_overwrite_test, which documents how
// property overwrites work.
$this->executeMigration('users');
@@ -95,7 +95,7 @@ class EntityContentBaseTest extends MigrateDrupal6TestBase {
/**
* Tests that translation destination fails for untranslatable entities.
*/
- public function testUntranslatable() {
+ public function testUntranslatable(): void {
$this->enableModules(['language_test']);
$this->installEntitySchema('no_language_entity_test');
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php
index 05aac26fb9f..0dc1bfe1819 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php
@@ -86,7 +86,7 @@ class FieldDiscoveryTest extends MigrateDrupal6TestBase {
*
* @covers ::addAllFieldProcesses
*/
- public function testAddAllFieldProcesses() {
+ public function testAddAllFieldProcesses(): void {
$expected_process_keys = [
'field_commander',
'field_company',
@@ -128,7 +128,7 @@ class FieldDiscoveryTest extends MigrateDrupal6TestBase {
* @covers ::addAllFieldProcesses
* @dataProvider addAllFieldProcessesAltersData
*/
- public function testAddAllFieldProcessesAlters($field_plugin_method, $expected_process) {
+ public function testAddAllFieldProcessesAlters($field_plugin_method, $expected_process): void {
$this->assertFieldProcess($this->fieldDiscovery, $this->migrationPluginManager, FieldDiscoveryInterface::DRUPAL_6, $field_plugin_method, $expected_process);
}
@@ -221,7 +221,7 @@ class FieldDiscoveryTest extends MigrateDrupal6TestBase {
*
* @covers ::addAllFieldProcesses
*/
- public function testAddFields() {
+ public function testAddFields(): void {
$this->migrateFields();
$field_discovery = $this->container->get('migrate_drupal.field_discovery');
$migration_plugin_manager = $this->container->get('plugin.manager.migration');
@@ -278,7 +278,7 @@ class FieldDiscoveryTest extends MigrateDrupal6TestBase {
*
* @covers ::getAllFields
*/
- public function testGetAllFields() {
+ public function testGetAllFields(): void {
$field_discovery_test = new FieldDiscoveryTestClass($this->fieldPluginManager, $this->migrationPluginManager, $this->logger);
$actual_fields = $field_discovery_test->getAllFields('6');
$actual_node_types = array_keys($actual_fields['node']);
@@ -300,7 +300,7 @@ class FieldDiscoveryTest extends MigrateDrupal6TestBase {
*
* @covers ::getSourcePlugin
*/
- public function testGetSourcePlugin() {
+ public function testGetSourcePlugin(): void {
$this->assertSourcePlugin('6', FieldInstance::class, [
'requirements_met' => TRUE,
'id' => 'd6_field_instance',
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d6/FollowUpMigrationsTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d6/FollowUpMigrationsTest.php
index e9ae850dd5e..503c7577028 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/d6/FollowUpMigrationsTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/d6/FollowUpMigrationsTest.php
@@ -39,7 +39,7 @@ class FollowUpMigrationsTest extends MigrateNodeTestBase {
/**
* Tests entity reference translations.
*/
- public function testEntityReferenceTranslations() {
+ public function testEntityReferenceTranslations(): void {
// Test the entity reference field before the follow-up migrations.
$node = Node::load(10);
$this->assertSame('13', $node->get('field_reference')->target_id);
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php
index 10c8b051c13..5a97d323ea1 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php
@@ -56,7 +56,7 @@ class MigrateDrupal6AuditIdsTest extends MigrateDrupal6TestBase {
/**
* Tests multiple migrations to the same destination with no ID conflicts.
*/
- public function testMultipleMigrationWithoutIdConflicts() {
+ public function testMultipleMigrationWithoutIdConflicts(): void {
// Create a node of type page.
$node = Node::create(['type' => 'page', 'title' => 'foo']);
$node->moderation_state->value = 'published';
@@ -94,7 +94,7 @@ class MigrateDrupal6AuditIdsTest extends MigrateDrupal6TestBase {
/**
* Tests all migrations with no ID conflicts.
*/
- public function testAllMigrationsWithNoIdConflicts() {
+ public function testAllMigrationsWithNoIdConflicts(): void {
$migrations = $this->container
->get('plugin.manager.migration')
->createInstancesByTag('Drupal 6');
@@ -112,7 +112,7 @@ class MigrateDrupal6AuditIdsTest extends MigrateDrupal6TestBase {
/**
* Tests all migrations with ID conflicts.
*/
- public function testAllMigrationsWithIdConflicts() {
+ public function testAllMigrationsWithIdConflicts(): void {
// Get all Drupal 6 migrations.
$migrations = $this->container
->get('plugin.manager.migration')
@@ -149,7 +149,7 @@ class MigrateDrupal6AuditIdsTest extends MigrateDrupal6TestBase {
/**
* Tests draft revisions ID conflicts.
*/
- public function testDraftRevisionIdConflicts() {
+ public function testDraftRevisionIdConflicts(): void {
// Create a published node of type page.
$node = Node::create(['type' => 'page', 'title' => 'foo']);
$node->moderation_state->value = 'published';
@@ -183,7 +183,7 @@ class MigrateDrupal6AuditIdsTest extends MigrateDrupal6TestBase {
/**
* Tests ID conflicts for inaccessible nodes.
*/
- public function testNodeGrantsIdConflicts() {
+ public function testNodeGrantsIdConflicts(): void {
// Enable the node_test module to restrict access to page nodes.
$this->enableModules(['node_test']);
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrationProcessTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrationProcessTest.php
index bab20406ab0..ace3933fec7 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrationProcessTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrationProcessTest.php
@@ -28,7 +28,7 @@ class MigrationProcessTest extends MigrateDrupal6TestBase {
*
* @throws \Exception
*/
- public function testGetProcess() {
+ public function testGetProcess(): void {
/** @var \Drupal\migrate\Plugin\MigrationPluginManagerInterface $plugin_manager */
$plugin_manager = $this->container->get('plugin.manager.migration');
$migrations = $plugin_manager->createInstancesByTag('Drupal 6');
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d6/VariableTranslationCheckRequirementsTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d6/VariableTranslationCheckRequirementsTest.php
index c586dcc9346..1f4811127b6 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/d6/VariableTranslationCheckRequirementsTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/d6/VariableTranslationCheckRequirementsTest.php
@@ -29,7 +29,7 @@ class VariableTranslationCheckRequirementsTest extends MigrateDrupal6TestBase {
/**
* Tests exception in thrown when the i18n_variable table does not exist.
*/
- public function testCheckRequirements() {
+ public function testCheckRequirements(): void {
$this->expectException(RequirementsException::class);
$this->expectExceptionMessage("Source database table 'i18n_variable' does not exist");
$this->getMigration('d6_system_maintenance_translation')
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php
index cdff846a186..dfd50dbf6d4 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php
@@ -117,7 +117,7 @@ class FieldDiscoveryTest extends MigrateDrupal7TestBase {
*
* @covers ::addAllFieldProcesses
*/
- public function testAddAllFieldProcesses() {
+ public function testAddAllFieldProcesses(): void {
$expected_process_keys = [
'comment_body',
'field_integer',
@@ -172,7 +172,7 @@ class FieldDiscoveryTest extends MigrateDrupal7TestBase {
* @covers ::addAllFieldProcesses
* @dataProvider addAllFieldProcessesAltersData
*/
- public function testAddAllFieldProcessesAlters($field_plugin_method, $expected_process) {
+ public function testAddAllFieldProcessesAlters($field_plugin_method, $expected_process): void {
$this->assertFieldProcess($this->fieldDiscovery, $this->migrationPluginManager, FieldDiscoveryInterface::DRUPAL_7, $field_plugin_method, $expected_process);
}
@@ -322,7 +322,7 @@ class FieldDiscoveryTest extends MigrateDrupal7TestBase {
*
* @covers ::getAllFields
*/
- public function testGetAllFields() {
+ public function testGetAllFields(): void {
$field_discovery_test = new FieldDiscoveryTestClass($this->fieldPluginManager, $this->migrationPluginManager, $this->logger);
$actual_fields = $field_discovery_test->getAllFields('7');
$this->assertSame(['comment', 'node', 'user', 'taxonomy_term'], array_keys($actual_fields));
@@ -348,7 +348,7 @@ class FieldDiscoveryTest extends MigrateDrupal7TestBase {
*
* @covers ::getSourcePlugin
*/
- public function testGetSourcePlugin() {
+ public function testGetSourcePlugin(): void {
$this->assertSourcePlugin('7', FieldInstance::class, [
'requirements_met' => TRUE,
'id' => 'd7_field_instance',
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d7/FollowUpMigrationsTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d7/FollowUpMigrationsTest.php
index 2daa074ebef..9494cb64023 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/d7/FollowUpMigrationsTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/d7/FollowUpMigrationsTest.php
@@ -72,7 +72,7 @@ class FollowUpMigrationsTest extends MigrateDrupal7TestBase {
*
* @dataProvider providerTestEntityReferenceTranslations
*/
- public function testEntityReferenceTranslations($node_migrations) {
+ public function testEntityReferenceTranslations($node_migrations): void {
$this->executeMigrations($node_migrations);
// Test the entity reference field before the follow-up migrations.
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php
index 41e1d7589b7..a0adb83a9be 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php
@@ -54,7 +54,7 @@ class MigrateDrupal7AuditIdsTest extends MigrateDrupal7TestBase {
/**
* Tests multiple migrations to the same destination with no ID conflicts.
*/
- public function testMultipleMigrationWithoutIdConflicts() {
+ public function testMultipleMigrationWithoutIdConflicts(): void {
// Create a node of type page.
$node = Node::create(['type' => 'page', 'title' => 'foo']);
$node->moderation_state->value = 'published';
@@ -92,7 +92,7 @@ class MigrateDrupal7AuditIdsTest extends MigrateDrupal7TestBase {
/**
* Tests all migrations with no ID conflicts.
*/
- public function testAllMigrationsWithNoIdConflicts() {
+ public function testAllMigrationsWithNoIdConflicts(): void {
$migrations = $this->container
->get('plugin.manager.migration')
->createInstancesByTag('Drupal 7');
@@ -110,7 +110,7 @@ class MigrateDrupal7AuditIdsTest extends MigrateDrupal7TestBase {
/**
* Tests all migrations with ID conflicts.
*/
- public function testAllMigrationsWithIdConflicts() {
+ public function testAllMigrationsWithIdConflicts(): void {
$migrations = $this->container
->get('plugin.manager.migration')
->createInstancesByTag('Drupal 7');
@@ -146,7 +146,7 @@ class MigrateDrupal7AuditIdsTest extends MigrateDrupal7TestBase {
/**
* Tests draft revisions ID conflicts.
*/
- public function testDraftRevisionIdConflicts() {
+ public function testDraftRevisionIdConflicts(): void {
// Create a published node of type page.
$node = Node::create(['type' => 'page', 'title' => 'foo']);
$node->moderation_state->value = 'published';
@@ -180,7 +180,7 @@ class MigrateDrupal7AuditIdsTest extends MigrateDrupal7TestBase {
/**
* Tests ID conflicts for inaccessible nodes.
*/
- public function testNodeGrantsIdConflicts() {
+ public function testNodeGrantsIdConflicts(): void {
// Enable the node_test module to restrict access to page nodes.
$this->enableModules(['node_test']);
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrationProcessTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrationProcessTest.php
index 86e039838b6..f523b24e987 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrationProcessTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrationProcessTest.php
@@ -28,7 +28,7 @@ class MigrationProcessTest extends MigrateDrupal7TestBase {
*
* @throws \Exception
*/
- public function testGetProcess() {
+ public function testGetProcess(): void {
/** @var \Drupal\migrate\Plugin\MigrationPluginManagerInterface $plugin_manager */
$plugin_manager = $this->container->get('plugin.manager.migration');
$migrations = $plugin_manager->createInstancesByTag('Drupal 7');
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/dependencies/MigrateDependenciesTest.php b/core/modules/migrate_drupal/tests/src/Kernel/dependencies/MigrateDependenciesTest.php
index b7167925202..92351d30a35 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/dependencies/MigrateDependenciesTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/dependencies/MigrateDependenciesTest.php
@@ -22,7 +22,7 @@ class MigrateDependenciesTest extends MigrateDrupal6TestBase {
/**
* Tests that the order is correct when loading several migrations.
*/
- public function testMigrationDependenciesOrder() {
+ public function testMigrationDependenciesOrder(): void {
$migration_items = ['d6_comment', 'd6_filter_format', 'd6_node:page'];
/** @var \Drupal\migrate\Plugin\RequirementsInterface[] $migrations */
$migrations = $this->container->get('plugin.manager.migration')->createInstances($migration_items);
diff --git a/core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php b/core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php
index a7378e5a7e7..56367c808ee 100644
--- a/core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php
+++ b/core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php
@@ -32,7 +32,7 @@ trait ValidateMigrationStateTestTrait {
* made for the two cases where migrations are yet to be written and where
* migrations are not needed.
*/
- public function testMigrationState() {
+ public function testMigrationState(): void {
// Level separator of destination and source properties.
$separator = ',';
diff --git a/core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php b/core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php
index 22187e8767f..a51b8a03cbf 100644
--- a/core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php
+++ b/core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php
@@ -62,7 +62,7 @@ class FieldDiscoveryTest extends UnitTestCase {
* @covers ::getEntityFields
* @dataProvider getEntityFieldsData
*/
- public function testGetEntityFields($entity_type_id, array $expected_fields) {
+ public function testGetEntityFields($entity_type_id, array $expected_fields): void {
$test_data = [
'getAllFields' => [
'7' => $this->getAllFieldData(),
@@ -139,7 +139,7 @@ class FieldDiscoveryTest extends UnitTestCase {
* @covers ::getBundleFields
* @dataProvider getBundleFieldsData
*/
- public function testGetBundleFields($entity_type_id, $bundle, array $expected_fields) {
+ public function testGetBundleFields($entity_type_id, $bundle, array $expected_fields): void {
$test_data = [
'getAllFields' => [
'7' => $this->getAllFieldData(),
@@ -225,7 +225,7 @@ class FieldDiscoveryTest extends UnitTestCase {
* @covers ::getCoreVersion
* @dataProvider getCoreVersionData
*/
- public function testGetCoreVersion(array $tags, $expected_result) {
+ public function testGetCoreVersion(array $tags, $expected_result): void {
$migration = $this->prophesize(MigrationInterface::class);
$migration->getMigrationTags()->willReturn($tags);
$field_discovery = new FieldDiscoveryTestClass($this->fieldPluginManager->reveal(), $this->migrationPluginManager->reveal(), $this->logger->reveal());
@@ -315,7 +315,7 @@ class FieldDiscoveryTest extends UnitTestCase {
* @covers ::getFieldInstanceStubMigrationDefinition
* @dataProvider getFieldInstanceStubMigrationDefinition
*/
- public function testGetFieldInstanceStubMigrationDefinition($core, $expected_definition) {
+ public function testGetFieldInstanceStubMigrationDefinition($core, $expected_definition): void {
$field_discovery = new FieldDiscoveryTestClass($this->fieldPluginManager->reveal(), $this->migrationPluginManager->reveal(), $this->logger->reveal());
if (!$expected_definition) {
$this->expectException(\InvalidArgumentException::class);
diff --git a/core/modules/migrate_drupal/tests/src/Unit/MigrateFieldPluginManagerTest.php b/core/modules/migrate_drupal/tests/src/Unit/MigrateFieldPluginManagerTest.php
index a5b1dd0ed88..30cdf4134f5 100644
--- a/core/modules/migrate_drupal/tests/src/Unit/MigrateFieldPluginManagerTest.php
+++ b/core/modules/migrate_drupal/tests/src/Unit/MigrateFieldPluginManagerTest.php
@@ -28,7 +28,7 @@ class MigrateFieldPluginManagerTest extends UnitTestCase {
* @covers ::findDefinitions
* @dataProvider weightsData
*/
- public function testWeights($field_type, $core, $expected_plugin_id) {
+ public function testWeights($field_type, $core, $expected_plugin_id): void {
/** @var \Drupal\Core\Cache\CacheBackendInterface $cache */
$cache = $this->prophesize(CacheBackendInterface::class)->reveal();
/** @var \Drupal\Core\Extension\ModuleHandlerInterfaceModuleHandlerInterface $module_handler */
diff --git a/core/modules/migrate_drupal/tests/src/Unit/MigrationConfigurationTraitTest.php b/core/modules/migrate_drupal/tests/src/Unit/MigrationConfigurationTraitTest.php
index 2ce3b23ca32..08a69bd166f 100644
--- a/core/modules/migrate_drupal/tests/src/Unit/MigrationConfigurationTraitTest.php
+++ b/core/modules/migrate_drupal/tests/src/Unit/MigrationConfigurationTraitTest.php
@@ -18,7 +18,7 @@ class MigrationConfigurationTraitTest extends UnitTestCase {
* @covers ::getLegacyDrupalVersion
* @dataProvider providerTestGetLegacyDrupalVersion
*/
- public function testGetLegacyDrupalVersion($expected_version_string, $schema_version, $exception, $system_table_exists) {
+ public function testGetLegacyDrupalVersion($expected_version_string, $schema_version, $exception, $system_table_exists): void {
if ($schema_version) {
$statement = $this->createMock('\Drupal\Core\Database\StatementInterface');
$statement->expects($this->any())
diff --git a/core/modules/migrate_drupal/tests/src/Unit/MigrationStateUnitTest.php b/core/modules/migrate_drupal/tests/src/Unit/MigrationStateUnitTest.php
index 52d5a1209be..2231f1ca954 100644
--- a/core/modules/migrate_drupal/tests/src/Unit/MigrationStateUnitTest.php
+++ b/core/modules/migrate_drupal/tests/src/Unit/MigrationStateUnitTest.php
@@ -38,7 +38,7 @@ class MigrationStateUnitTest extends UnitTestCase {
* @covers ::getSourceState
* @covers ::getDestinationsForSource
*/
- public function testGetUpgradeStates($modules_to_enable, $files, $field_plugins, $migrations, $source_system_data, $expected_7, $expected_6) {
+ public function testGetUpgradeStates($modules_to_enable, $files, $field_plugins, $migrations, $source_system_data, $expected_7, $expected_6): void {
$fieldPluginManager = $this->prophesize(MigrateFieldPluginManagerInterface::class);
$fieldPluginManager->getDefinitions()->willReturn($field_plugins);
$moduleHandler = $this->prophesize(ModuleHandlerInterface::class);
diff --git a/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php b/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php
index e18e8fbfe50..5ec777cbc7d 100644
--- a/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php
+++ b/core/modules/migrate_drupal/tests/src/Unit/source/DrupalSqlBaseTest.php
@@ -77,7 +77,7 @@ class DrupalSqlBaseTest extends MigrateTestCase {
/**
* @covers ::checkRequirements
*/
- public function testSourceProviderNotActive() {
+ public function testSourceProviderNotActive(): void {
$plugin = new TestDrupalSqlBase([], 'placeholder_id', $this->pluginDefinition, $this->getMigration(), $this->state, $this->entityTypeManager);
$plugin->setDatabase($this->getDatabase($this->databaseContents));
$this->expectException(RequirementsException::class);
@@ -96,7 +96,7 @@ class DrupalSqlBaseTest extends MigrateTestCase {
/**
* @covers ::checkRequirements
*/
- public function testSourceDatabaseError() {
+ public function testSourceDatabaseError(): void {
$plugin = new TestDrupalSqlBase([], 'test', $this->pluginDefinition, $this->getMigration(), $this->state, $this->entityTypeManager);
$this->expectException(RequirementsException::class);
$this->expectExceptionMessage('No database connection configured for source plugin test');
@@ -115,7 +115,7 @@ class DrupalSqlBaseTest extends MigrateTestCase {
*
* @dataProvider providerMinimumVersion
*/
- public function testMinimumVersion($success, $minimum_version, $schema_version) {
+ public function testMinimumVersion($success, $minimum_version, $schema_version): void {
$this->pluginDefinition['minimum_version'] = $minimum_version;
$this->databaseContents['system'][0]['status'] = 1;
$this->databaseContents['system'][0]['schema_version'] = $schema_version;
diff --git a/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php b/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php
index f4dde78af2b..90b7574236b 100644
--- a/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php
+++ b/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php
@@ -80,7 +80,7 @@ class Drupal6SqlBaseTest extends MigrateTestCase {
/**
* Tests for Drupal6SqlBase::getSystemData().
*/
- public function testGetSystemData() {
+ public function testGetSystemData(): void {
$system_data = $this->base->getSystemData();
// Should be 1 theme and 2 modules.
$this->assertCount(1, $system_data['theme']);
@@ -93,7 +93,7 @@ class Drupal6SqlBaseTest extends MigrateTestCase {
/**
* Tests for Drupal6SqlBase::moduleExists().
*/
- public function testDrupal6ModuleExists() {
+ public function testDrupal6ModuleExists(): void {
// This module should exist.
$this->assertTrue($this->base->moduleExistsWrapper('module1'));
@@ -105,7 +105,7 @@ class Drupal6SqlBaseTest extends MigrateTestCase {
/**
* Tests for Drupal6SqlBase::getModuleSchemaVersion().
*/
- public function testGetModuleSchemaVersion() {
+ public function testGetModuleSchemaVersion(): void {
// Non-existent module.
$this->assertFalse($this->base->getModuleSchemaVersionWrapper('module3'));
@@ -119,7 +119,7 @@ class Drupal6SqlBaseTest extends MigrateTestCase {
/**
* Tests for Drupal6SqlBase::variableGet().
*/
- public function testVariableGet() {
+ public function testVariableGet(): void {
// Test default value.
$this->assertEquals('my_default', $this->base->variableGetWrapper('non_existent_variable', 'my_default'));
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/CredentialFormTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/CredentialFormTest.php
index 598e3d71ed4..7d7950911b9 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/CredentialFormTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/CredentialFormTest.php
@@ -31,7 +31,7 @@ class CredentialFormTest extends MigrateUpgradeTestBase {
*
* @dataProvider providerCredentialForm
*/
- public function testCredentialFrom($path_to_database) {
+ public function testCredentialFrom($path_to_database): void {
$this->loadFixture($this->getModulePath('migrate_drupal') . $path_to_database);
$session = $this->assertSession();
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateAccessTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateAccessTest.php
index 555643666a8..b20f7647ab7 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateAccessTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateAccessTest.php
@@ -28,7 +28,7 @@ class MigrateAccessTest extends BrowserTestBase {
/**
* Tests that only user 1 can access the migrate UI.
*/
- public function testAccess() {
+ public function testAccess(): void {
$this->drupalLogin($this->rootUser);
$this->drupalGet('upgrade');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateControllerTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateControllerTest.php
index 952768053b7..68071daba55 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateControllerTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateControllerTest.php
@@ -53,7 +53,7 @@ class MigrateControllerTest extends BrowserTestBase {
/**
* Tests the upgrade report with the view enabled, disabled and uninstalled.
*/
- public function testUpgradeReport() {
+ public function testUpgradeReport(): void {
$session = $this->assertSession();
$this->assertTrue(View::load('watchdog')->status(), 'Watchdog view is enabled');
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 06605bc5a0d..2dfab8159c7 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeFormStepsTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeFormStepsTest.php
@@ -54,7 +54,7 @@ class MigrateUpgradeFormStepsTest extends BrowserTestBase {
* this order; Overview or Incremental, if a migration has already been run
* then Credential, Id conflict, if conflicts are detected, and lastly Review.
*/
- public function testMigrateUpgradeReviewPage() {
+ public function testMigrateUpgradeReviewPage(): void {
/** @var \Drupal\Core\TempStore\PrivateTempStore $store */
$store = \Drupal::service('tempstore.private')->get('migrate_drupal_ui');
$state = \Drupal::service('state');
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php
index 8d8df57c015..6d43a5339d8 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php
@@ -42,7 +42,7 @@ abstract class MultilingualReviewPageTestBase extends MigrateUpgradeTestBase {
*
* @see \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeExecuteTestBase
*/
- public function testMigrateUpgradeReviewPage() {
+ public function testMigrateUpgradeReviewPage(): void {
$this->prepare();
// Start the upgrade process.
$this->submitCredentialForm();
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/NoMultilingualReviewPageTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/NoMultilingualReviewPageTestBase.php
index cc8339e7d59..51aed92c5a6 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/NoMultilingualReviewPageTestBase.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/NoMultilingualReviewPageTestBase.php
@@ -12,7 +12,7 @@ abstract class NoMultilingualReviewPageTestBase extends MultilingualReviewPageTe
/**
* Tests the review page when content_translation is enabled.
*/
- public function testMigrateUpgradeReviewPage() {
+ public function testMigrateUpgradeReviewPage(): void {
$this->prepare();
// Start the upgrade process.
$this->submitCredentialForm();
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/SourceProviderTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/SourceProviderTest.php
index 8027de89720..b82af20b89f 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/SourceProviderTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/SourceProviderTest.php
@@ -26,7 +26,7 @@ class SourceProviderTest extends MigrateUpgradeTestBase {
*
* @dataProvider providerSourceProvider
*/
- public function testSourceProvider($path_to_database) {
+ public function testSourceProvider($path_to_database): void {
$this->loadFixture($this->getModulePath('migrate_drupal') . $path_to_database);
$session = $this->assertSession();
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php
index 020531ac236..8904bc3e1d0 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php
@@ -70,7 +70,7 @@ class IdConflictTest extends MigrateUpgradeExecuteTestBase {
/**
* Tests ID Conflict form.
*/
- public function testIdConflictForm() {
+ public function testIdConflictForm(): void {
// Start the upgrade process.
$this->submitCredentialForm();
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NodeClassicTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NodeClassicTest.php
index d81318589d9..1e2284a242a 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NodeClassicTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NodeClassicTest.php
@@ -77,7 +77,7 @@ class NodeClassicTest extends MigrateUpgradeExecuteTestBase {
/**
* Tests node classic migration via the UI.
*/
- public function testNodeClassicUpgrade() {
+ public function testNodeClassicUpgrade(): void {
// Add a node classic migrate table to d8.
$this->makeNodeMigrateMapTable(NodeMigrateType::NODE_MIGRATE_TYPE_CLASSIC, '6');
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 060f7c32d27..c2cabe175d0 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
@@ -198,7 +198,7 @@ class Upgrade6Test extends MigrateUpgradeExecuteTestBase {
/**
* Executes all steps of migrations upgrade.
*/
- public function testUpgradeAndIncremental() {
+ public function testUpgradeAndIncremental(): void {
// Perform upgrade followed by an incremental upgrade.
$this->doUpgradeAndIncremental();
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php
index 92e20e00f2c..940869b3aec 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php
@@ -44,7 +44,7 @@ class DoubleSlashTest extends MigrateUpgradeExecuteTestBase {
/**
* Executes all steps of migrations upgrade.
*/
- public function testMigrateUpgradeExecute() {
+ public function testMigrateUpgradeExecute(): void {
// Change fid 1 to a filename that does not exist.
$this->sourceDatabase
->update('file_managed')
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/FilePathTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/FilePathTest.php
index 5ad0a0ffb04..b00490702e1 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/FilePathTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/FilePathTest.php
@@ -94,7 +94,7 @@ class FilePathTest extends MigrateUpgradeTestBase {
*
* @dataProvider providerTestFilePath
*/
- public function testFilePath(string $file_private_path, string $file_public_path, string $file_temporary_path, string $private, string $public, string $temporary) {
+ public function testFilePath(string $file_private_path, string $file_public_path, string $file_temporary_path, string $private, string $public, string $temporary): void {
$this->sourceFileScheme['private'] = $file_private_path;
$this->sourceFileScheme['public'] = $file_public_path;
$this->sourceFileScheme['temporary'] = $file_temporary_path;
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/IdConflictTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/IdConflictTest.php
index 0975977ff7e..38bd909f992 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/IdConflictTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/IdConflictTest.php
@@ -70,7 +70,7 @@ class IdConflictTest extends MigrateUpgradeExecuteTestBase {
/**
* Tests ID Conflict form.
*/
- public function testIdConflictForm() {
+ public function testIdConflictForm(): void {
// Start the upgrade process.
$this->submitCredentialForm();
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 990af208a51..fb81cd8e3e2 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
@@ -224,7 +224,7 @@ class Upgrade7Test extends MigrateUpgradeExecuteTestBase {
/**
* Executes all steps of migrations upgrade.
*/
- public function testUpgradeAndIncremental() {
+ public function testUpgradeAndIncremental(): void {
// Perform upgrade followed by an incremental upgrade.
$this->doUpgradeAndIncremental();
diff --git a/core/modules/migrate_drupal_ui/tests/src/FunctionalJavascript/SettingsTest.php b/core/modules/migrate_drupal_ui/tests/src/FunctionalJavascript/SettingsTest.php
index 796de8ce159..f85771b52b6 100644
--- a/core/modules/migrate_drupal_ui/tests/src/FunctionalJavascript/SettingsTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/FunctionalJavascript/SettingsTest.php
@@ -58,7 +58,7 @@ class SettingsTest extends WebDriverTestBase {
*
* @dataProvider providerTestCredentialForm
*/
- public function testCredentialForm($source_connection, $version, array $manual, array $databases, $expected_source_connection) {
+ public function testCredentialForm($source_connection, $version, array $manual, array $databases, $expected_source_connection): void {
// Write settings.
$migrate_file_public_path = '/var/www/drupal7/sites/default/files';
$migrate_file_private_path = '/var/www/drupal7/sites/default/files/private';
diff --git a/core/modules/migrate_drupal_ui/tests/src/Kernel/MigrationLabelExistTest.php b/core/modules/migrate_drupal_ui/tests/src/Kernel/MigrationLabelExistTest.php
index e79cfa196c2..70741c025e9 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Kernel/MigrationLabelExistTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Kernel/MigrationLabelExistTest.php
@@ -19,7 +19,7 @@ class MigrationLabelExistTest extends MigrateDrupalTestBase {
/**
* Tests that labels exist for all migrations.
*/
- public function testLabelExist() {
+ public function testLabelExist(): void {
// Install all available modules.
$module_handler = $this->container->get('module_handler');
$modules = $this->coreModuleListDataProvider();
diff --git a/core/modules/mysql/tests/src/Functional/InstallerIsolationLevelExistingSettingsTest.php b/core/modules/mysql/tests/src/Functional/InstallerIsolationLevelExistingSettingsTest.php
index 4eae070981e..c69477688ce 100644
--- a/core/modules/mysql/tests/src/Functional/InstallerIsolationLevelExistingSettingsTest.php
+++ b/core/modules/mysql/tests/src/Functional/InstallerIsolationLevelExistingSettingsTest.php
@@ -30,7 +30,7 @@ class InstallerIsolationLevelExistingSettingsTest extends InstallerExistingSetti
/**
* Verifies that isolation_level is not set in the database settings.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
$contents = file_get_contents($this->container->getParameter('app.root') . '/' . $this->siteDirectory . '/settings.php');
// Test that isolation_level was not set.
diff --git a/core/modules/mysql/tests/src/Functional/InstallerIsolationLevelNoDatabaseSettingsTest.php b/core/modules/mysql/tests/src/Functional/InstallerIsolationLevelNoDatabaseSettingsTest.php
index 28809d55b1e..274833e3970 100644
--- a/core/modules/mysql/tests/src/Functional/InstallerIsolationLevelNoDatabaseSettingsTest.php
+++ b/core/modules/mysql/tests/src/Functional/InstallerIsolationLevelNoDatabaseSettingsTest.php
@@ -35,7 +35,7 @@ class InstallerIsolationLevelNoDatabaseSettingsTest extends InstallerTestBase {
/**
* Verifies that the isolation_level was added to the database settings.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
$contents = file_get_contents($this->container->getParameter('app.root') . '/' . $this->siteDirectory . '/settings.php');
// Test that isolation_level was set to "READ COMMITTED".
diff --git a/core/modules/mysql/tests/src/Functional/RequirementsTest.php b/core/modules/mysql/tests/src/Functional/RequirementsTest.php
index a1a07d785ca..00cb54351cb 100644
--- a/core/modules/mysql/tests/src/Functional/RequirementsTest.php
+++ b/core/modules/mysql/tests/src/Functional/RequirementsTest.php
@@ -40,7 +40,7 @@ class RequirementsTest extends BrowserTestBase {
/**
* Test the isolation level warning message on status page.
*/
- public function testIsolationLevelWarningNotDisplaying() {
+ public function testIsolationLevelWarningNotDisplaying(): void {
$admin_user = $this->drupalCreateUser([
'administer site configuration',
'access site reports',
diff --git a/core/modules/mysql/tests/src/Kernel/mysql/Console/DbDumpCommandTest.php b/core/modules/mysql/tests/src/Kernel/mysql/Console/DbDumpCommandTest.php
index c50710c36a8..a2a5814db96 100644
--- a/core/modules/mysql/tests/src/Kernel/mysql/Console/DbDumpCommandTest.php
+++ b/core/modules/mysql/tests/src/Kernel/mysql/Console/DbDumpCommandTest.php
@@ -43,7 +43,7 @@ class DbDumpCommandTest extends DriverSpecificKernelTestBase {
/**
* Tests the command directly.
*/
- public function testDbDumpCommand() {
+ public function testDbDumpCommand(): void {
$command = new DbDumpCommand();
$command_tester = new CommandTester($command);
$command_tester->execute([]);
@@ -63,7 +63,7 @@ class DbDumpCommandTest extends DriverSpecificKernelTestBase {
/**
* Tests schema only option.
*/
- public function testSchemaOnly() {
+ public function testSchemaOnly(): void {
$command = new DbDumpCommand();
$command_tester = new CommandTester($command);
$command_tester->execute(['--schema-only' => 'router']);
@@ -89,7 +89,7 @@ class DbDumpCommandTest extends DriverSpecificKernelTestBase {
/**
* Tests insert count option.
*/
- public function testInsertCount() {
+ public function testInsertCount(): void {
$command = new DbDumpCommand();
$command_tester = new CommandTester($command);
$command_tester->execute(['--insert-count' => '1']);
diff --git a/core/modules/mysql/tests/src/Kernel/mysql/DatabaseExceptionWrapperTest.php b/core/modules/mysql/tests/src/Kernel/mysql/DatabaseExceptionWrapperTest.php
index b29a9a39670..a94d9bd3267 100644
--- a/core/modules/mysql/tests/src/Kernel/mysql/DatabaseExceptionWrapperTest.php
+++ b/core/modules/mysql/tests/src/Kernel/mysql/DatabaseExceptionWrapperTest.php
@@ -24,7 +24,7 @@ class DatabaseExceptionWrapperTest extends DriverSpecificKernelTestBase {
* connection not to emulate statement preparation. Still, this is only valid
* for the MySql driver.
*/
- public function testPrepareStatementFailOnPreparation() {
+ public function testPrepareStatementFailOnPreparation(): void {
$connection_info = Database::getConnectionInfo('default');
$connection_info['default']['pdo'][\PDO::ATTR_EMULATE_PREPARES] = FALSE;
Database::addConnectionInfo('default', 'foo', $connection_info['default']);
@@ -36,7 +36,7 @@ class DatabaseExceptionWrapperTest extends DriverSpecificKernelTestBase {
/**
* Tests Connection::prepareStatement exception on execution.
*/
- public function testPrepareStatementFailOnExecution() {
+ public function testPrepareStatementFailOnExecution(): void {
$this->expectException(\PDOException::class);
$stmt = $this->connection->prepareStatement('bananas', []);
$stmt->execute();
diff --git a/core/modules/mysql/tests/src/Kernel/mysql/DbDumpTest.php b/core/modules/mysql/tests/src/Kernel/mysql/DbDumpTest.php
index 1fa439dc54b..5ce39f6aa63 100644
--- a/core/modules/mysql/tests/src/Kernel/mysql/DbDumpTest.php
+++ b/core/modules/mysql/tests/src/Kernel/mysql/DbDumpTest.php
@@ -146,7 +146,7 @@ class DbDumpTest extends DriverSpecificKernelTestBase {
/**
* Tests the command directly.
*/
- public function testDbDumpCommand() {
+ public function testDbDumpCommand(): void {
$application = new DbDumpApplication();
$command = $application->find('dump-database-d8-mysql');
$command_tester = new CommandTester($command);
@@ -175,7 +175,7 @@ class DbDumpTest extends DriverSpecificKernelTestBase {
/**
* Tests loading the script back into the database.
*/
- public function testScriptLoad() {
+ public function testScriptLoad(): void {
// Generate the script.
$application = new DbDumpApplication();
$command = $application->find('dump-database-d8-mysql');
diff --git a/core/modules/mysql/tests/src/Kernel/mysql/MysqlDriverTest.php b/core/modules/mysql/tests/src/Kernel/mysql/MysqlDriverTest.php
index a620aa1a734..4fcb75b60aa 100644
--- a/core/modules/mysql/tests/src/Kernel/mysql/MysqlDriverTest.php
+++ b/core/modules/mysql/tests/src/Kernel/mysql/MysqlDriverTest.php
@@ -18,7 +18,7 @@ class MysqlDriverTest extends DriverSpecificKernelTestBase {
/**
* @covers \Drupal\mysql\Driver\Database\mysql\Connection
*/
- public function testConnection() {
+ public function testConnection(): void {
$connection = new Connection($this->createMock(StubPDO::class), []);
$this->assertInstanceOf(Connection::class, $connection);
}
diff --git a/core/modules/mysql/tests/src/Kernel/mysql/PrefixInfoTest.php b/core/modules/mysql/tests/src/Kernel/mysql/PrefixInfoTest.php
index 7c4a9e3e656..d36cba80edd 100644
--- a/core/modules/mysql/tests/src/Kernel/mysql/PrefixInfoTest.php
+++ b/core/modules/mysql/tests/src/Kernel/mysql/PrefixInfoTest.php
@@ -23,7 +23,7 @@ class PrefixInfoTest extends DriverSpecificKernelTestBase {
* The other two by Drupal core supported databases do not have this variable
* set in the return array.
*/
- public function testGetPrefixInfo() {
+ public function testGetPrefixInfo(): void {
$connection_info = Database::getConnectionInfo('default');
// Copy the default connection info to the 'extra' key.
diff --git a/core/modules/mysql/tests/src/Kernel/mysql/TemporaryQueryTest.php b/core/modules/mysql/tests/src/Kernel/mysql/TemporaryQueryTest.php
index e2457f91b8e..1bf811b104a 100644
--- a/core/modules/mysql/tests/src/Kernel/mysql/TemporaryQueryTest.php
+++ b/core/modules/mysql/tests/src/Kernel/mysql/TemporaryQueryTest.php
@@ -16,7 +16,7 @@ class TemporaryQueryTest extends TemporaryQueryTestBase {
/**
* Confirms that temporary tables work.
*/
- public function testTemporaryQuery() {
+ public function testTemporaryQuery(): void {
parent::testTemporaryQuery();
$connection = $this->getConnection();
diff --git a/core/modules/mysql/tests/src/Unit/InstallTasksTest.php b/core/modules/mysql/tests/src/Unit/InstallTasksTest.php
index 552c7240ae4..cd5447eee39 100644
--- a/core/modules/mysql/tests/src/Unit/InstallTasksTest.php
+++ b/core/modules/mysql/tests/src/Unit/InstallTasksTest.php
@@ -130,7 +130,7 @@ class InstallTasksTest extends UnitTestCase {
/**
* @covers ::name
*/
- public function testNameWithNoConnection() {
+ public function testNameWithNoConnection(): void {
$tasks = $this->createTasksNoConnection();
$this->assertSame('MySQL, MariaDB, Percona Server, or equivalent', $tasks->name());
}
diff --git a/core/modules/navigation/tests/src/Functional/NavigationLogoTest.php b/core/modules/navigation/tests/src/Functional/NavigationLogoTest.php
index 4bba206c353..6e88c1ea702 100644
--- a/core/modules/navigation/tests/src/Functional/NavigationLogoTest.php
+++ b/core/modules/navigation/tests/src/Functional/NavigationLogoTest.php
@@ -71,7 +71,7 @@ class NavigationLogoTest extends BrowserTestBase {
/**
* Tests Navigation logo configuration base options.
*/
- public function testSettingsLogoOptionsForm() {
+ public function testSettingsLogoOptionsForm(): void {
// Navigate to the settings form.
$this->drupalGet('/admin/config/user-interface/navigation/settings');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/navigation/tests/src/Functional/NavigationShortcutsBlockTest.php b/core/modules/navigation/tests/src/Functional/NavigationShortcutsBlockTest.php
index 7f917ac765d..3dadbce4f60 100644
--- a/core/modules/navigation/tests/src/Functional/NavigationShortcutsBlockTest.php
+++ b/core/modules/navigation/tests/src/Functional/NavigationShortcutsBlockTest.php
@@ -34,7 +34,7 @@ class NavigationShortcutsBlockTest extends PageCacheTagsTestBase {
/**
* Tests visibility and cacheability of shortcuts in the navigation bar.
*/
- public function testNavigationBlock() {
+ public function testNavigationBlock(): void {
$this->drupalPlaceBlock('page_title_block', ['id' => 'title']);
$test_page_url = Url::fromRoute('test_page_test.test_page');
diff --git a/core/modules/navigation/tests/src/Functional/NavigationTopBarTest.php b/core/modules/navigation/tests/src/Functional/NavigationTopBarTest.php
index f12426c9087..84fc5a0acdc 100644
--- a/core/modules/navigation/tests/src/Functional/NavigationTopBarTest.php
+++ b/core/modules/navigation/tests/src/Functional/NavigationTopBarTest.php
@@ -75,7 +75,7 @@ class NavigationTopBarTest extends BrowserTestBase {
/**
* Tests the top bar visibility.
*/
- public function testTopBarVisibility() {
+ public function testTopBarVisibility(): void {
$this->drupalGet($this->node->toUrl());
// Top Bar is not visible if the feature flag module is disabled.
diff --git a/core/modules/navigation/tests/src/Functional/NavigationUserBlockTest.php b/core/modules/navigation/tests/src/Functional/NavigationUserBlockTest.php
index 80553ce174e..0c4ba264fd1 100644
--- a/core/modules/navigation/tests/src/Functional/NavigationUserBlockTest.php
+++ b/core/modules/navigation/tests/src/Functional/NavigationUserBlockTest.php
@@ -64,7 +64,7 @@ class NavigationUserBlockTest extends PageCacheTagsTestBase {
/**
* Test output of user navigation block with regards to caching and contents.
*/
- public function testNavigationUserBlock() {
+ public function testNavigationUserBlock(): void {
// Verify some basic cacheability metadata. Ensures that we're not doing
// anything so egregious as to upset expected caching behavior. In this
// case, as an anonymous user, we should have zero effect on the page.
diff --git a/core/modules/navigation/tests/src/Kernel/SystemMenuNavigationBlockTest.php b/core/modules/navigation/tests/src/Kernel/SystemMenuNavigationBlockTest.php
index ecd606ac13d..ff8ff524004 100644
--- a/core/modules/navigation/tests/src/Kernel/SystemMenuNavigationBlockTest.php
+++ b/core/modules/navigation/tests/src/Kernel/SystemMenuNavigationBlockTest.php
@@ -160,7 +160,7 @@ class SystemMenuNavigationBlockTest extends KernelTestBase {
/**
* Tests calculation of a system navigation menu block's config dependencies.
*/
- public function testSystemMenuBlockConfigDependencies() {
+ public function testSystemMenuBlockConfigDependencies(): void {
$block = Block::create([
'plugin' => 'navigation_menu:' . $this->menu->id(),
'region' => 'content',
@@ -187,7 +187,7 @@ class SystemMenuNavigationBlockTest extends KernelTestBase {
/**
* Tests the config start level and depth.
*/
- public function testConfigLevelDepth() {
+ public function testConfigLevelDepth(): void {
// Helper function to generate a configured navigation block instance.
$place_block = function ($level, $depth) {
return $this->blockManager->createInstance('navigation_menu:' . $this->menu->id(), [
diff --git a/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php b/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php
index 7191ec33fd9..1e319d6f0c7 100644
--- a/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php
+++ b/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php
@@ -29,7 +29,7 @@ class MultiStepNodeFormBasicOptionsTest extends NodeTestBase {
/**
* Tests changing the default values of basic options to ensure they persist.
*/
- public function testMultiStepNodeFormBasicOptions() {
+ public function testMultiStepNodeFormBasicOptions(): void {
// Prepare a user to create the node.
$web_user = $this->drupalCreateUser([
'administer nodes',
diff --git a/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php b/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
index 7b0542c1c26..996f176d4e7 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
@@ -122,7 +122,7 @@ class NodeAccessBaseTableTest extends NodeTestBase {
* - Test that user 4 can view all content created above.
* - Test that user 4 can view all content on taxonomy listing.
*/
- public function testNodeAccessBasic() {
+ public function testNodeAccessBasic(): void {
$num_simple_users = 2;
$simple_users = [];
diff --git a/core/modules/node/tests/src/Functional/NodeAccessCacheabilityTest.php b/core/modules/node/tests/src/Functional/NodeAccessCacheabilityTest.php
index 3f74d9c63d7..f7bd6518a68 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessCacheabilityTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessCacheabilityTest.php
@@ -61,7 +61,7 @@ class NodeAccessCacheabilityTest extends NodeTestBase {
*
* @see node_query_node_access_alter()
*/
- public function testNodeAccessCacheabilitySafeguard() {
+ public function testNodeAccessCacheabilitySafeguard(): void {
// The node grants cache context should be added automatically.
$this->drupalGet(new Url('node_access_test_auto_bubbling'));
$this->assertCacheContext('user.node_grants:view');
@@ -86,7 +86,7 @@ class NodeAccessCacheabilityTest extends NodeTestBase {
/**
* Tests that the user cache contexts are correctly set.
*/
- public function testNodeAccessCacheContext() {
+ public function testNodeAccessCacheContext(): void {
// Create a user, with edit/delete own content permission.
$test_user1 = $this->drupalCreateUser([
'access content',
diff --git a/core/modules/node/tests/src/Functional/NodeAccessCacheabilityWithNodeGrants.php b/core/modules/node/tests/src/Functional/NodeAccessCacheabilityWithNodeGrants.php
index 0e07f770f57..da08430a93f 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessCacheabilityWithNodeGrants.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessCacheabilityWithNodeGrants.php
@@ -31,7 +31,7 @@ class NodeAccessCacheabilityWithNodeGrants extends BrowserTestBase {
/**
* Tests node view access cacheability with node grants.
*/
- public function testAccessCacheabilityWithNodeGrants() {
+ public function testAccessCacheabilityWithNodeGrants(): void {
NodeType::create(['type' => 'page', 'name' => 'Page'])->save();
$this->createEntityReferenceField('node', 'page', 'ref', 'Ref', 'node');
EntityViewDisplay::create([
diff --git a/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php b/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
index 464cd0fafe1..295196ac434 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
@@ -91,7 +91,7 @@ class NodeAccessFieldTest extends NodeTestBase {
/**
* Tests administering fields when node access is restricted.
*/
- public function testNodeAccessAdministerField() {
+ public function testNodeAccessAdministerField(): void {
// Create a page node.
$fieldData = [];
$value = $fieldData[0]['value'] = $this->randomMachineName();
diff --git a/core/modules/node/tests/src/Functional/NodeAccessGrantsCacheContextTest.php b/core/modules/node/tests/src/Functional/NodeAccessGrantsCacheContextTest.php
index e89972e5cba..a5190f0ed22 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessGrantsCacheContextTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessGrantsCacheContextTest.php
@@ -115,7 +115,7 @@ class NodeAccessGrantsCacheContextTest extends NodeTestBase {
/**
* Tests NodeAccessGrantsCacheContext::getContext().
*/
- public function testCacheContext() {
+ public function testCacheContext(): void {
$this->assertUserCacheContext([
0 => 'view.all:0;node_access_test_author:0;node_access_all:0',
1 => 'all',
diff --git a/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php b/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php
index c419b95772e..4266eb94139 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php
@@ -51,7 +51,7 @@ class NodeAccessLanguageFallbackTest extends NodeTestBase {
/**
* Tests node access fallback handling with multiple node languages.
*/
- public function testNodeAccessLanguageFallback() {
+ public function testNodeAccessLanguageFallback(): void {
// The node_access_test module allows nodes to be marked private. We need to
// ensure that system honors the fallback system of node access properly.
// Note that node_access_test_language is language-sensitive and does not
diff --git a/core/modules/node/tests/src/Functional/NodeAccessMenuLinkTest.php b/core/modules/node/tests/src/Functional/NodeAccessMenuLinkTest.php
index 8fc6ab0ebd3..260c6d69e7f 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessMenuLinkTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessMenuLinkTest.php
@@ -53,7 +53,7 @@ class NodeAccessMenuLinkTest extends NodeTestBase {
/**
* SA-CORE-2015-003: Tests menu links to nodes when node access is restricted.
*/
- public function testNodeAccessMenuLink() {
+ public function testNodeAccessMenuLink(): void {
$menu_link_title = $this->randomString();
diff --git a/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php b/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php
index c151eeff5a9..dd835dc4508 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php
@@ -57,7 +57,7 @@ class NodeAccessPagerTest extends BrowserTestBase {
/**
* Tests the comment pager for nodes with multiple grants per realm.
*/
- public function testCommentPager() {
+ public function testCommentPager(): void {
// Create a node.
$node = $this->drupalCreateNode();
diff --git a/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php b/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php
index 110476ec20d..5d8a68a37b0 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php
@@ -52,7 +52,7 @@ class NodeAccessRebuildNodeGrantsTest extends NodeTestBase {
/**
* Tests rebuilding the node access permissions table with content.
*/
- public function testNodeAccessRebuildNodeGrants() {
+ public function testNodeAccessRebuildNodeGrants(): void {
\Drupal::service('module_installer')->install(['node_access_test']);
\Drupal::state()->set('node_access_test.private', TRUE);
node_access_test_add_field(NodeType::load('page'));
@@ -108,7 +108,7 @@ class NodeAccessRebuildNodeGrantsTest extends NodeTestBase {
/**
* Tests rebuilding the node access permissions table with no content.
*/
- public function testNodeAccessRebuildNoAccessModules() {
+ public function testNodeAccessRebuildNoAccessModules(): void {
// Default realm access is present.
$this->assertEquals(1, \Drupal::service('node.grant_storage')->count(), 'There is an all realm access record');
diff --git a/core/modules/node/tests/src/Functional/NodeAdminTest.php b/core/modules/node/tests/src/Functional/NodeAdminTest.php
index f0e4c5bca54..d7480271918 100644
--- a/core/modules/node/tests/src/Functional/NodeAdminTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAdminTest.php
@@ -86,7 +86,7 @@ class NodeAdminTest extends NodeTestBase {
/**
* Tests that the table sorting works on the content admin pages.
*/
- public function testContentAdminSort() {
+ public function testContentAdminSort(): void {
$this->drupalLogin($this->adminUser);
$changed = \Drupal::time()->getRequestTime();
@@ -141,7 +141,7 @@ class NodeAdminTest extends NodeTestBase {
*
* @see TaxonomyNodeFilterTestCase
*/
- public function testContentAdminPages() {
+ public function testContentAdminPages(): void {
$this->drupalLogin($this->adminUser);
// Use an explicit changed time to ensure the expected order in the content
@@ -240,7 +240,7 @@ class NodeAdminTest extends NodeTestBase {
/**
* Tests content overview for a multilingual site.
*/
- public function testContentAdminPageMultilingual() {
+ public function testContentAdminPageMultilingual(): void {
$this->drupalLogin($this->adminUser);
\Drupal::service('module_installer')->install(['language']);
diff --git a/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php b/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
index 05912e35cc1..27ebb5cb2c2 100644
--- a/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
+++ b/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
@@ -69,7 +69,7 @@ class NodeBlockFunctionalTest extends NodeTestBase {
/**
* Tests the recent comments block.
*/
- public function testRecentNodeBlock() {
+ public function testRecentNodeBlock(): void {
$this->drupalLogin($this->adminUser);
// Disallow anonymous users to view content.
diff --git a/core/modules/node/tests/src/Functional/NodeContextualLinksTest.php b/core/modules/node/tests/src/Functional/NodeContextualLinksTest.php
index 201f88c4242..bc0273833f0 100644
--- a/core/modules/node/tests/src/Functional/NodeContextualLinksTest.php
+++ b/core/modules/node/tests/src/Functional/NodeContextualLinksTest.php
@@ -28,7 +28,7 @@ class NodeContextualLinksTest extends NodeTestBase {
/**
* Tests contextual links.
*/
- public function testNodeContextualLinks() {
+ public function testNodeContextualLinks(): void {
// Create a node item.
$node = Node::create([
'type' => 'article',
diff --git a/core/modules/node/tests/src/Functional/NodeCreationTest.php b/core/modules/node/tests/src/Functional/NodeCreationTest.php
index 332c25488ef..5b68c2f6218 100644
--- a/core/modules/node/tests/src/Functional/NodeCreationTest.php
+++ b/core/modules/node/tests/src/Functional/NodeCreationTest.php
@@ -54,7 +54,7 @@ class NodeCreationTest extends NodeTestBase {
/**
* Tests the order of the node types on the add page.
*/
- public function testNodeAddPageOrder() {
+ public function testNodeAddPageOrder(): void {
$this->createContentType(['type' => 'bundle_1', 'name' => 'Bundle 1']);
$this->createContentType(['type' => 'bundle_2', 'name' => 'Aaa Bundle 2']);
$admin_content_types = $this->drupalCreateUser(['bypass node access']);
@@ -66,7 +66,7 @@ class NodeCreationTest extends NodeTestBase {
/**
* Creates a "Basic page" node and verifies its consistency in the database.
*/
- public function testNodeCreation() {
+ public function testNodeCreation(): void {
$node_type_storage = \Drupal::entityTypeManager()->getStorage('node_type');
// Test /node/add page with only one content type.
@@ -126,7 +126,7 @@ class NodeCreationTest extends NodeTestBase {
/**
* Verifies that a transaction rolls back the failed creation.
*/
- public function testFailedPageCreation() {
+ public function testFailedPageCreation(): void {
// Create a node.
$edit = [
'uid' => $this->loggedInUser->id(),
@@ -159,7 +159,7 @@ class NodeCreationTest extends NodeTestBase {
/**
* Creates an unpublished node and confirms correct redirect behavior.
*/
- public function testUnpublishedNodeCreation() {
+ public function testUnpublishedNodeCreation(): void {
// Set the front page to the test page.
$this->config('system.site')->set('page.front', '/test-page')->save();
@@ -190,7 +190,7 @@ class NodeCreationTest extends NodeTestBase {
/**
* Creates nodes with different authored dates.
*/
- public function testAuthoredDate() {
+ public function testAuthoredDate(): void {
$now = \Drupal::time()->getRequestTime();
$admin = $this->drupalCreateUser([], NULL, TRUE);
$this->drupalLogin($admin);
@@ -259,7 +259,7 @@ class NodeCreationTest extends NodeTestBase {
/**
* Tests the author autocompletion textfield.
*/
- public function testAuthorAutocomplete() {
+ public function testAuthorAutocomplete(): void {
$admin_user = $this->drupalCreateUser([
'administer nodes',
'create page content',
@@ -287,7 +287,7 @@ class NodeCreationTest extends NodeTestBase {
/**
* Check node/add when no node types exist.
*/
- public function testNodeAddWithoutContentTypes() {
+ public function testNodeAddWithoutContentTypes(): void {
$this->drupalGet('node/add');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->linkByHrefNotExists('/admin/structure/types/add');
diff --git a/core/modules/node/tests/src/Functional/NodeEditFormTest.php b/core/modules/node/tests/src/Functional/NodeEditFormTest.php
index b4e49e2975a..d46066c7e76 100644
--- a/core/modules/node/tests/src/Functional/NodeEditFormTest.php
+++ b/core/modules/node/tests/src/Functional/NodeEditFormTest.php
@@ -69,7 +69,7 @@ class NodeEditFormTest extends NodeTestBase {
/**
* Checks node edit functionality.
*/
- public function testNodeEdit() {
+ public function testNodeEdit(): void {
$this->drupalLogin($this->webUser);
$title_key = 'title[0][value]';
@@ -165,7 +165,7 @@ class NodeEditFormTest extends NodeTestBase {
/**
* Tests changing a node's "authored by" field.
*/
- public function testNodeEditAuthoredBy() {
+ public function testNodeEditAuthoredBy(): void {
$this->drupalLogin($this->adminUser);
// Create node to edit.
@@ -226,7 +226,7 @@ class NodeEditFormTest extends NodeTestBase {
/**
* Tests the node meta information.
*/
- public function testNodeMetaInformation() {
+ public function testNodeMetaInformation(): void {
// Check that regular users (i.e. without the 'administer nodes' permission)
// can not see the meta information.
$this->drupalLogin($this->webUser);
diff --git a/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php b/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php
index e7da9b66118..ec7473488c9 100644
--- a/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php
+++ b/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php
@@ -29,7 +29,7 @@ class NodeEntityViewModeAlterTest extends NodeTestBase {
/**
* Create a "Basic page" node and verify its consistency in the database.
*/
- public function testNodeViewModeChange() {
+ public function testNodeViewModeChange(): void {
$web_user = $this->drupalCreateUser([
'create page content',
'edit own page content',
diff --git a/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php b/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php
index bd909ddf96e..84d7c390d1e 100644
--- a/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php
+++ b/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php
@@ -73,7 +73,7 @@ class NodeFieldMultilingualTest extends BrowserTestBase {
/**
* Tests whether field languages are correctly set through the node form.
*/
- public function testMultilingualNodeForm() {
+ public function testMultilingualNodeForm(): void {
// Create "Basic page" content.
$langcode = language_get_default_langcode('node', 'page');
$title_key = 'title[0][value]';
@@ -125,7 +125,7 @@ class NodeFieldMultilingualTest extends BrowserTestBase {
/**
* Tests multilingual field display settings.
*/
- public function testMultilingualDisplaySettings() {
+ public function testMultilingualDisplaySettings(): void {
// Create "Basic page" content.
$title_key = 'title[0][value]';
$title_value = $this->randomMachineName(8);
diff --git a/core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php b/core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php
index 86cbea3be51..56c995e9471 100644
--- a/core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php
+++ b/core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php
@@ -62,7 +62,7 @@ class NodeFormSaveChangedTimeTest extends BrowserTestBase {
/**
* Tests the changed time after API and FORM save without changes.
*/
- public function testChangedTimeAfterSaveWithoutChanges() {
+ public function testChangedTimeAfterSaveWithoutChanges(): void {
$storage = $this->container->get('entity_type.manager')->getStorage('node');
$storage->resetCache([1]);
$node = $storage->load(1);
diff --git a/core/modules/node/tests/src/Functional/NodeHelpTest.php b/core/modules/node/tests/src/Functional/NodeHelpTest.php
index 7062c663955..83a5d17d307 100644
--- a/core/modules/node/tests/src/Functional/NodeHelpTest.php
+++ b/core/modules/node/tests/src/Functional/NodeHelpTest.php
@@ -68,7 +68,7 @@ class NodeHelpTest extends BrowserTestBase {
/**
* Verifies that help text appears on node add/edit forms.
*/
- public function testNodeShowHelpText() {
+ public function testNodeShowHelpText(): void {
// Check the node add form.
$this->drupalGet('node/add/' . $this->testType);
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/node/tests/src/Functional/NodeLinksTest.php b/core/modules/node/tests/src/Functional/NodeLinksTest.php
index 28458361f24..479eea2f673 100644
--- a/core/modules/node/tests/src/Functional/NodeLinksTest.php
+++ b/core/modules/node/tests/src/Functional/NodeLinksTest.php
@@ -28,7 +28,7 @@ class NodeLinksTest extends NodeTestBase {
/**
* Tests that the links can be hidden in the view display settings.
*/
- public function testHideLinks() {
+ public function testHideLinks(): void {
$node = $this->drupalCreateNode([
'type' => 'article',
'promote' => NodeInterface::PROMOTED,
diff --git a/core/modules/node/tests/src/Functional/NodePostSettingsTest.php b/core/modules/node/tests/src/Functional/NodePostSettingsTest.php
index abc1c244b65..e0a1b0813e5 100644
--- a/core/modules/node/tests/src/Functional/NodePostSettingsTest.php
+++ b/core/modules/node/tests/src/Functional/NodePostSettingsTest.php
@@ -33,7 +33,7 @@ class NodePostSettingsTest extends NodeTestBase {
/**
* Confirms "Basic page" content type and post information is on a new node.
*/
- public function testPagePostInfo() {
+ public function testPagePostInfo(): void {
// Set "Basic page" content type to display post information.
$edit = [];
diff --git a/core/modules/node/tests/src/Functional/NodePreviewAnonymousTest.php b/core/modules/node/tests/src/Functional/NodePreviewAnonymousTest.php
index 8899d4c9395..a62ef8f2c3f 100644
--- a/core/modules/node/tests/src/Functional/NodePreviewAnonymousTest.php
+++ b/core/modules/node/tests/src/Functional/NodePreviewAnonymousTest.php
@@ -48,7 +48,7 @@ class NodePreviewAnonymousTest extends BrowserTestBase {
/**
* Checks the node preview functionality for anonymous users.
*/
- public function testAnonymousPagePreview() {
+ public function testAnonymousPagePreview(): void {
$title_key = 'title[0][value]';
$body_key = 'body[0][value]';
diff --git a/core/modules/node/tests/src/Functional/NodeQueryAlterTest.php b/core/modules/node/tests/src/Functional/NodeQueryAlterTest.php
index 350c7da2b86..eedf8e81d43 100644
--- a/core/modules/node/tests/src/Functional/NodeQueryAlterTest.php
+++ b/core/modules/node/tests/src/Functional/NodeQueryAlterTest.php
@@ -81,7 +81,7 @@ class NodeQueryAlterTest extends NodeTestBase {
* Verifies that a non-standard table alias can be used, and that a user with
* node access can view the nodes.
*/
- public function testNodeQueryAlterLowLevelWithAccess() {
+ public function testNodeQueryAlterLowLevelWithAccess(): void {
// User with access should be able to view 4 nodes.
try {
$query = Database::getConnection()->select('node', 'n')
@@ -101,7 +101,7 @@ class NodeQueryAlterTest extends NodeTestBase {
/**
* Tests 'node_access' query alter with revision-enabled nodes.
*/
- public function testNodeQueryAlterWithRevisions() {
+ public function testNodeQueryAlterWithRevisions(): void {
// Execute a query that only deals with the 'node_revision' table.
try {
$query = \Drupal::entityTypeManager()->getStorage('node')->getQuery();
@@ -123,7 +123,7 @@ class NodeQueryAlterTest extends NodeTestBase {
* Verifies that a non-standard table alias can be used, and that a user
* without node access cannot view the nodes.
*/
- public function testNodeQueryAlterLowLevelNoAccess() {
+ public function testNodeQueryAlterLowLevelNoAccess(): void {
// User without access should be able to view 0 nodes.
try {
$query = Database::getConnection()->select('node', 'n')
@@ -146,7 +146,7 @@ class NodeQueryAlterTest extends NodeTestBase {
* Verifies that a non-standard table alias can be used, and that a user with
* view-only node access cannot edit the nodes.
*/
- public function testNodeQueryAlterLowLevelEditAccess() {
+ public function testNodeQueryAlterLowLevelEditAccess(): void {
// User with view-only access should not be able to edit nodes.
try {
$query = Database::getConnection()->select('node', 'n')
@@ -174,7 +174,7 @@ class NodeQueryAlterTest extends NodeTestBase {
* add a record to {node_access} paired with a corresponding privilege in
* hook_node_grants().
*/
- public function testNodeQueryAlterOverride() {
+ public function testNodeQueryAlterOverride(): void {
$record = [
'nid' => 0,
'gid' => 0,
diff --git a/core/modules/node/tests/src/Functional/NodeRSSContentTest.php b/core/modules/node/tests/src/Functional/NodeRSSContentTest.php
index f4eed676325..861c8c55577 100644
--- a/core/modules/node/tests/src/Functional/NodeRSSContentTest.php
+++ b/core/modules/node/tests/src/Functional/NodeRSSContentTest.php
@@ -49,7 +49,7 @@ class NodeRSSContentTest extends NodeTestBase {
/**
* Ensures that a new node includes the custom data when added to an RSS feed.
*/
- public function testNodeRSSContent() {
+ public function testNodeRSSContent(): void {
// Create a node.
$node = $this->drupalCreateNode(['type' => 'article', 'promote' => 1]);
@@ -79,7 +79,7 @@ class NodeRSSContentTest extends NodeTestBase {
/**
* Tests relative, root-relative, protocol-relative and absolute URLs.
*/
- public function testUrlHandling() {
+ public function testUrlHandling(): void {
// Only the plain_text text format is available by default, which escapes
// all HTML.
FilterFormat::create([
diff --git a/core/modules/node/tests/src/Functional/NodeRevisionsAllTest.php b/core/modules/node/tests/src/Functional/NodeRevisionsAllTest.php
index a6d80e14603..6b5c4c02c22 100644
--- a/core/modules/node/tests/src/Functional/NodeRevisionsAllTest.php
+++ b/core/modules/node/tests/src/Functional/NodeRevisionsAllTest.php
@@ -111,7 +111,7 @@ class NodeRevisionsAllTest extends NodeTestBase {
/**
* Checks node revision operations.
*/
- public function testRevisions() {
+ public function testRevisions(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$nodes = $this->nodes;
$logs = $this->revisionLogs;
diff --git a/core/modules/node/tests/src/Functional/NodeRevisionsTest.php b/core/modules/node/tests/src/Functional/NodeRevisionsTest.php
index 2cf8a475def..dcd52e7ff0c 100644
--- a/core/modules/node/tests/src/Functional/NodeRevisionsTest.php
+++ b/core/modules/node/tests/src/Functional/NodeRevisionsTest.php
@@ -141,7 +141,7 @@ class NodeRevisionsTest extends NodeTestBase {
/**
* Checks node revision related operations.
*/
- public function testRevisions() {
+ public function testRevisions(): void {
// Access to the revision page for a node with 1 revision is allowed.
$node = $this->drupalCreateNode();
$this->drupalGet("node/" . $node->id() . "/revisions/" . $node->getRevisionId() . "/view");
@@ -337,7 +337,7 @@ class NodeRevisionsTest extends NodeTestBase {
/**
* Checks that revisions are correctly saved without log messages.
*/
- public function testNodeRevisionWithoutLogMessage() {
+ public function testNodeRevisionWithoutLogMessage(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
// Create a node with an initial log message.
$revision_log = $this->randomMachineName(10);
@@ -384,7 +384,7 @@ class NodeRevisionsTest extends NodeTestBase {
/**
* Tests the revision translations are correctly reverted.
*/
- public function testRevisionTranslationRevert() {
+ public function testRevisionTranslationRevert(): void {
// Create a node and a few revisions.
$node = $this->drupalCreateNode(['langcode' => 'en']);
diff --git a/core/modules/node/tests/src/Functional/NodeRevisionsUiBypassAccessTest.php b/core/modules/node/tests/src/Functional/NodeRevisionsUiBypassAccessTest.php
index d88e780ed67..4b48e2fb733 100644
--- a/core/modules/node/tests/src/Functional/NodeRevisionsUiBypassAccessTest.php
+++ b/core/modules/node/tests/src/Functional/NodeRevisionsUiBypassAccessTest.php
@@ -53,7 +53,7 @@ class NodeRevisionsUiBypassAccessTest extends NodeTestBase {
/**
* Checks that the Revision tab is displayed correctly.
*/
- public function testDisplayRevisionTab() {
+ public function testDisplayRevisionTab(): void {
$this->drupalPlaceBlock('local_tasks_block');
$this->drupalLogin($this->editor);
diff --git a/core/modules/node/tests/src/Functional/NodeRevisionsUiTest.php b/core/modules/node/tests/src/Functional/NodeRevisionsUiTest.php
index f6972c2d991..6afd5099422 100644
--- a/core/modules/node/tests/src/Functional/NodeRevisionsUiTest.php
+++ b/core/modules/node/tests/src/Functional/NodeRevisionsUiTest.php
@@ -49,7 +49,7 @@ class NodeRevisionsUiTest extends NodeTestBase {
/**
* Checks that unchecking 'Create new revision' works when editing a node.
*/
- public function testNodeFormSaveWithoutRevision() {
+ public function testNodeFormSaveWithoutRevision(): void {
$this->drupalLogin($this->editor);
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
@@ -94,7 +94,7 @@ class NodeRevisionsUiTest extends NodeTestBase {
/**
* Checks HTML double escaping of revision logs.
*/
- public function testNodeRevisionDoubleEscapeFix() {
+ public function testNodeRevisionDoubleEscapeFix(): void {
$this->drupalLogin($this->editor);
$nodes = [];
@@ -139,7 +139,7 @@ class NodeRevisionsUiTest extends NodeTestBase {
/**
* Checks the Revisions tab.
*/
- public function testNodeRevisionsTabWithDefaultRevision() {
+ public function testNodeRevisionsTabWithDefaultRevision(): void {
$this->drupalLogin($this->editor);
// Create the node.
diff --git a/core/modules/node/tests/src/Functional/NodeRssCacheTest.php b/core/modules/node/tests/src/Functional/NodeRssCacheTest.php
index d25a98bcfa6..152db78d4b9 100644
--- a/core/modules/node/tests/src/Functional/NodeRssCacheTest.php
+++ b/core/modules/node/tests/src/Functional/NodeRssCacheTest.php
@@ -54,7 +54,7 @@ class NodeRssCacheTest extends NodeTestBase {
/**
* Ensure the RSS teaser render does not interfere with default theme cache.
*/
- public function testNodeRssCacheContent() {
+ public function testNodeRssCacheContent(): void {
// Only the plain_text text format is available by default, which escapes
// all HTML.
FilterFormat::create([
diff --git a/core/modules/node/tests/src/Functional/NodeSaveTest.php b/core/modules/node/tests/src/Functional/NodeSaveTest.php
index e851907608a..47cae0f2dcb 100644
--- a/core/modules/node/tests/src/Functional/NodeSaveTest.php
+++ b/core/modules/node/tests/src/Functional/NodeSaveTest.php
@@ -52,7 +52,7 @@ class NodeSaveTest extends NodeTestBase {
* - save the content
* - check if node exists
*/
- public function testImport() {
+ public function testImport(): void {
// Node ID must be a number that is not in the database.
$nids = \Drupal::entityTypeManager()->getStorage('node')->getQuery()
->accessCheck(FALSE)
@@ -87,7 +87,7 @@ class NodeSaveTest extends NodeTestBase {
/**
* Verifies accuracy of the "created" and "changed" timestamp functionality.
*/
- public function testTimestamps() {
+ public function testTimestamps(): void {
// Use the default timestamps.
$edit = [
'uid' => $this->webUser->id(),
@@ -150,7 +150,7 @@ class NodeSaveTest extends NodeTestBase {
* This test determines changes in hook_ENTITY_TYPE_presave() and verifies
* that the static node load cache is cleared upon save.
*/
- public function testDeterminingChanges() {
+ public function testDeterminingChanges(): void {
// Initial creation.
$node = Node::create([
'uid' => $this->webUser->id(),
@@ -185,7 +185,7 @@ class NodeSaveTest extends NodeTestBase {
*
* @see node_test_node_insert()
*/
- public function testNodeSaveOnInsert() {
+ public function testNodeSaveOnInsert(): void {
// node_test_node_insert() triggers a save on insert if the title equals
// 'new'.
$node = $this->drupalCreateNode(['title' => 'new']);
diff --git a/core/modules/node/tests/src/Functional/NodeSyndicateBlockTest.php b/core/modules/node/tests/src/Functional/NodeSyndicateBlockTest.php
index bcf143b57be..3d85099d0d4 100644
--- a/core/modules/node/tests/src/Functional/NodeSyndicateBlockTest.php
+++ b/core/modules/node/tests/src/Functional/NodeSyndicateBlockTest.php
@@ -37,7 +37,7 @@ class NodeSyndicateBlockTest extends NodeTestBase {
/**
* Tests that the "Syndicate" block is shown when enabled.
*/
- public function testSyndicateBlock() {
+ public function testSyndicateBlock(): void {
// Place the "Syndicate" block and confirm that it is rendered.
$this->drupalPlaceBlock('node_syndicate_block', ['id' => 'test_syndicate_block', 'label' => 'Subscribe to RSS Feed']);
$this->drupalGet('');
diff --git a/core/modules/node/tests/src/Functional/NodeTitleTest.php b/core/modules/node/tests/src/Functional/NodeTitleTest.php
index 6f3890c6858..b2157a5e799 100644
--- a/core/modules/node/tests/src/Functional/NodeTitleTest.php
+++ b/core/modules/node/tests/src/Functional/NodeTitleTest.php
@@ -58,7 +58,7 @@ class NodeTitleTest extends NodeTestBase {
/**
* Creates one node and tests if the node title has the correct value.
*/
- public function testNodeTitle() {
+ public function testNodeTitle(): void {
// Create "Basic page" content with title.
// Add the node to the frontpage so we can test if teaser links are
// clickable.
diff --git a/core/modules/node/tests/src/Functional/NodeTitleXSSTest.php b/core/modules/node/tests/src/Functional/NodeTitleXSSTest.php
index 8d8772c81b2..800c82bf507 100644
--- a/core/modules/node/tests/src/Functional/NodeTitleXSSTest.php
+++ b/core/modules/node/tests/src/Functional/NodeTitleXSSTest.php
@@ -21,7 +21,7 @@ class NodeTitleXSSTest extends NodeTestBase {
/**
* Tests XSS functionality with a node entity.
*/
- public function testNodeTitleXSS() {
+ public function testNodeTitleXSS(): void {
// Prepare a user to do the stuff.
$web_user = $this->drupalCreateUser([
'create page content',
diff --git a/core/modules/node/tests/src/Functional/NodeTranslationUITest.php b/core/modules/node/tests/src/Functional/NodeTranslationUITest.php
index 33fd1e33f9a..a0ebfa7ba75 100644
--- a/core/modules/node/tests/src/Functional/NodeTranslationUITest.php
+++ b/core/modules/node/tests/src/Functional/NodeTranslationUITest.php
@@ -81,7 +81,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
/**
* Tests the basic translation UI.
*/
- public function testTranslationUI() {
+ public function testTranslationUI(): void {
parent::testTranslationUI();
$this->doUninstallTest();
}
@@ -89,7 +89,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
/**
* Tests changing the published status on a node without fields.
*/
- public function testPublishedStatusNoFields() {
+ public function testPublishedStatusNoFields(): void {
// Test changing the published status of an article without fields.
$this->drupalLogin($this->administrator);
// Delete all fields.
@@ -245,7 +245,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
/**
* Tests that translation page inherits admin status of edit page.
*/
- public function testTranslationLinkTheme() {
+ public function testTranslationLinkTheme(): void {
$this->drupalLogin($this->administrator);
$article = $this->drupalCreateNode(['type' => 'article', 'langcode' => $this->langcodes[0]]);
@@ -275,7 +275,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
/**
* Tests that no metadata is stored for a disabled bundle.
*/
- public function testDisabledBundle() {
+ public function testDisabledBundle(): void {
// Create a bundle that does not have translation enabled.
$disabledBundle = $this->randomMachineName();
$this->drupalCreateContentType(['type' => $disabledBundle, 'name' => $disabledBundle]);
@@ -304,7 +304,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
/**
* Tests that translations are rendered properly.
*/
- public function testTranslationRendering() {
+ public function testTranslationRendering(): void {
// Add a comment field to the article content type.
\Drupal::service('module_installer')->install(['comment']);
$this->addDefaultCommentField('node', 'article');
@@ -507,7 +507,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
/**
* Tests that revision translations are rendered properly.
*/
- public function testRevisionTranslationRendering() {
+ public function testRevisionTranslationRendering(): void {
$storage = \Drupal::entityTypeManager()->getStorage('node');
// Create a node.
@@ -556,7 +556,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
/**
* Tests title is not escaped (but XSS-filtered) for details form element.
*/
- public function testDetailsTitleIsNotEscaped() {
+ public function testDetailsTitleIsNotEscaped(): void {
// Create an image field.
\Drupal::service('module_installer')->install(['image']);
FieldStorageConfig::create([
@@ -601,7 +601,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase {
* When language neutral content is displayed on interface language, it should
* consider the interface language for creating the content link.
*/
- public function testUrlPrefixOnLanguageNeutralContent() {
+ public function testUrlPrefixOnLanguageNeutralContent(): void {
$this->drupalLogin($this->administrator);
$neutral_langcodes = [
LanguageInterface::LANGCODE_NOT_SPECIFIED,
diff --git a/core/modules/node/tests/src/Functional/NodeTypeInitialLanguageTest.php b/core/modules/node/tests/src/Functional/NodeTypeInitialLanguageTest.php
index 0461876c81d..d2dcc13b7f0 100644
--- a/core/modules/node/tests/src/Functional/NodeTypeInitialLanguageTest.php
+++ b/core/modules/node/tests/src/Functional/NodeTypeInitialLanguageTest.php
@@ -48,7 +48,7 @@ class NodeTypeInitialLanguageTest extends NodeTestBase {
* The default initial language must be the site's default, and the language
* locked option must be on.
*/
- public function testNodeTypeInitialLanguageDefaults() {
+ public function testNodeTypeInitialLanguageDefaults(): void {
$this->drupalGet('admin/structure/types/manage/article');
$this->assertTrue($this->assertSession()->optionExists('edit-language-configuration-langcode', LanguageInterface::LANGCODE_SITE_DEFAULT)->isSelected());
$this->assertSession()->checkboxNotChecked('edit-language-configuration-language-alterable');
@@ -111,7 +111,7 @@ class NodeTypeInitialLanguageTest extends NodeTestBase {
/**
* Tests language field visibility features.
*/
- public function testLanguageFieldVisibility() {
+ public function testLanguageFieldVisibility(): void {
// Creates a node to test Language field visibility feature.
$edit = [
'title[0][value]' => $this->randomMachineName(8),
diff --git a/core/modules/node/tests/src/Functional/NodeTypeTest.php b/core/modules/node/tests/src/Functional/NodeTypeTest.php
index a33a18f7ca4..d8ff8e338f1 100644
--- a/core/modules/node/tests/src/Functional/NodeTypeTest.php
+++ b/core/modules/node/tests/src/Functional/NodeTypeTest.php
@@ -38,7 +38,7 @@ class NodeTypeTest extends NodeTestBase {
*
* Load available node types and validate the returned data.
*/
- public function testNodeTypeGetFunctions() {
+ public function testNodeTypeGetFunctions(): void {
$node_types = NodeType::loadMultiple();
$node_names = node_type_get_names();
@@ -55,7 +55,7 @@ class NodeTypeTest extends NodeTestBase {
/**
* Tests creating a content type programmatically and via a form.
*/
- public function testNodeTypeCreation() {
+ public function testNodeTypeCreation(): void {
// Create a content type programmatically.
$type = $this->drupalCreateContentType();
@@ -106,7 +106,7 @@ class NodeTypeTest extends NodeTestBase {
/**
* Tests editing a node type using the UI.
*/
- public function testNodeTypeEditing() {
+ public function testNodeTypeEditing(): void {
$assert = $this->assertSession();
$this->drupalPlaceBlock('system_breadcrumb_block');
$web_user = $this->drupalCreateUser([
@@ -181,7 +181,7 @@ class NodeTypeTest extends NodeTestBase {
/**
* Tests deleting a content type that still has content.
*/
- public function testNodeTypeDeletion() {
+ public function testNodeTypeDeletion(): void {
$this->drupalPlaceBlock('page_title_block');
// Create a content type programmatically.
$type = $this->drupalCreateContentType();
@@ -234,7 +234,7 @@ class NodeTypeTest extends NodeTestBase {
/**
* Tests operations from Field UI and User modules for content types.
*/
- public function testNodeTypeOperations() {
+ public function testNodeTypeOperations(): void {
// Create an admin user who can only manage node fields.
$admin_user_1 = $this->drupalCreateUser([
'administer content types',
@@ -266,7 +266,7 @@ class NodeTypeTest extends NodeTestBase {
/**
* Tests for when there are no content types defined.
*/
- public function testNodeTypeNoContentType() {
+ public function testNodeTypeNoContentType(): void {
/** @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface $bundle_info */
$bundle_info = \Drupal::service('entity_type.bundle.info');
$this->assertCount(2, $bundle_info->getBundleInfo('node'), 'The bundle information service has 2 bundles for the Node entity type.');
diff --git a/core/modules/node/tests/src/Functional/NodeTypeTranslationTest.php b/core/modules/node/tests/src/Functional/NodeTypeTranslationTest.php
index 0066864056c..2167a0802b4 100644
--- a/core/modules/node/tests/src/Functional/NodeTypeTranslationTest.php
+++ b/core/modules/node/tests/src/Functional/NodeTypeTranslationTest.php
@@ -104,7 +104,7 @@ class NodeTypeTranslationTest extends BrowserTestBase {
/**
* Tests the node type translation.
*/
- public function testNodeTypeTranslation() {
+ public function testNodeTypeTranslation(): void {
$type = $this->randomMachineName(16);
$name = $this->randomString();
$this->drupalLogin($this->adminUser);
@@ -141,7 +141,7 @@ class NodeTypeTranslationTest extends BrowserTestBase {
/**
* Tests the node type title label translation.
*/
- public function testNodeTypeTitleLabelTranslation() {
+ public function testNodeTypeTitleLabelTranslation(): void {
$type = $this->randomMachineName(16);
$name = $this->randomString();
$this->drupalLogin($this->adminUser);
diff --git a/core/modules/node/tests/src/Functional/NodeViewLanguageTest.php b/core/modules/node/tests/src/Functional/NodeViewLanguageTest.php
index 68e0ec6ca5f..c0d9a22d966 100644
--- a/core/modules/node/tests/src/Functional/NodeViewLanguageTest.php
+++ b/core/modules/node/tests/src/Functional/NodeViewLanguageTest.php
@@ -28,7 +28,7 @@ class NodeViewLanguageTest extends NodeTestBase {
/**
* Tests the language extra field display.
*/
- public function testViewLanguage() {
+ public function testViewLanguage(): void {
// Add Spanish language.
ConfigurableLanguage::createFromLangcode('es')->save();
diff --git a/core/modules/node/tests/src/Functional/NodeViewTest.php b/core/modules/node/tests/src/Functional/NodeViewTest.php
index 2b6b85f07a6..c8b28123213 100644
--- a/core/modules/node/tests/src/Functional/NodeViewTest.php
+++ b/core/modules/node/tests/src/Functional/NodeViewTest.php
@@ -20,7 +20,7 @@ class NodeViewTest extends NodeTestBase {
/**
* Tests the html head links.
*/
- public function testHtmlHeadLinks() {
+ public function testHtmlHeadLinks(): void {
$node = $this->drupalCreateNode();
$this->drupalGet($node->toUrl());
@@ -35,7 +35,7 @@ class NodeViewTest extends NodeTestBase {
/**
* Tests the Link header.
*/
- public function testLinkHeader() {
+ public function testLinkHeader(): void {
$node = $this->drupalCreateNode();
$this->drupalGet($node->toUrl());
$this->assertArrayNotHasKey('Link', $this->getSession()->getResponseHeaders());
@@ -44,7 +44,7 @@ class NodeViewTest extends NodeTestBase {
/**
* Tests that we store and retrieve multi-byte UTF-8 characters correctly.
*/
- public function testMultiByteUtf8() {
+ public function testMultiByteUtf8(): void {
$title = '🐝';
// To ensure that the title has multi-byte characters, we compare the byte
// length to the character length.
diff --git a/core/modules/node/tests/src/Functional/PagePreviewTest.php b/core/modules/node/tests/src/Functional/PagePreviewTest.php
index 9f86a2d3fff..5caa943e084 100644
--- a/core/modules/node/tests/src/Functional/PagePreviewTest.php
+++ b/core/modules/node/tests/src/Functional/PagePreviewTest.php
@@ -195,7 +195,7 @@ class PagePreviewTest extends NodeTestBase {
/**
* Checks the node preview functionality.
*/
- public function testPagePreview() {
+ public function testPagePreview(): void {
$title_key = 'title[0][value]';
$body_key = 'body[0][value]';
$term_key = $this->fieldName . '[target_id]';
@@ -449,7 +449,7 @@ class PagePreviewTest extends NodeTestBase {
/**
* Checks the node preview functionality, when using revisions.
*/
- public function testPagePreviewWithRevisions() {
+ public function testPagePreviewWithRevisions(): void {
$title_key = 'title[0][value]';
$body_key = 'body[0][value]';
$term_key = $this->fieldName . '[target_id]';
@@ -505,7 +505,7 @@ class PagePreviewTest extends NodeTestBase {
/**
* Checks the node preview accessible for simultaneous node editing.
*/
- public function testSimultaneousPreview() {
+ public function testSimultaneousPreview(): void {
$title_key = 'title[0][value]';
$node = $this->drupalCreateNode([]);
@@ -529,7 +529,7 @@ class PagePreviewTest extends NodeTestBase {
/**
* Tests node preview with dynamic_page_cache and anonymous users.
*/
- public function testPagePreviewCache() {
+ public function testPagePreviewCache(): void {
\Drupal::service('module_installer')->uninstall(['node_test']);
$this->drupalLogout();
$title_key = 'title[0][value]';
diff --git a/core/modules/node/tests/src/Functional/PageViewTest.php b/core/modules/node/tests/src/Functional/PageViewTest.php
index c395bf1ece4..caa93a5c5fe 100644
--- a/core/modules/node/tests/src/Functional/PageViewTest.php
+++ b/core/modules/node/tests/src/Functional/PageViewTest.php
@@ -21,7 +21,7 @@ class PageViewTest extends NodeTestBase {
/**
* Tests editing a node by users with various access permissions.
*/
- public function testPageView() {
+ public function testPageView(): void {
// Create a node to view.
$node = $this->drupalCreateNode();
$this->assertNotEmpty(Node::load($node->id()), 'Node created.');
diff --git a/core/modules/node/tests/src/Functional/Rest/NodeResourceTestBase.php b/core/modules/node/tests/src/Functional/Rest/NodeResourceTestBase.php
index 3820281dc60..484f73791cf 100644
--- a/core/modules/node/tests/src/Functional/Rest/NodeResourceTestBase.php
+++ b/core/modules/node/tests/src/Functional/Rest/NodeResourceTestBase.php
@@ -229,7 +229,7 @@ abstract class NodeResourceTestBase extends EntityResourceTestBase {
*
* @see \Drupal\Tests\rest\Functional\EntityResource\Term\TermResourceTestBase::testPatchPath()
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
$this->initAuthentication();
$this->provisionEntityResource();
$this->setUpAuthorization('GET');
diff --git a/core/modules/node/tests/src/Functional/Rest/NodeXmlAnonTest.php b/core/modules/node/tests/src/Functional/Rest/NodeXmlAnonTest.php
index cfc875e052e..68faeeb20d1 100644
--- a/core/modules/node/tests/src/Functional/Rest/NodeXmlAnonTest.php
+++ b/core/modules/node/tests/src/Functional/Rest/NodeXmlAnonTest.php
@@ -33,7 +33,7 @@ class NodeXmlAnonTest extends NodeResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/node/tests/src/Functional/Rest/NodeXmlBasicAuthTest.php b/core/modules/node/tests/src/Functional/Rest/NodeXmlBasicAuthTest.php
index 550d3e9a746..b12d2969f24 100644
--- a/core/modules/node/tests/src/Functional/Rest/NodeXmlBasicAuthTest.php
+++ b/core/modules/node/tests/src/Functional/Rest/NodeXmlBasicAuthTest.php
@@ -43,7 +43,7 @@ class NodeXmlBasicAuthTest extends NodeResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/node/tests/src/Functional/Rest/NodeXmlCookieTest.php b/core/modules/node/tests/src/Functional/Rest/NodeXmlCookieTest.php
index 568e6cb621d..53785df4e6c 100644
--- a/core/modules/node/tests/src/Functional/Rest/NodeXmlCookieTest.php
+++ b/core/modules/node/tests/src/Functional/Rest/NodeXmlCookieTest.php
@@ -38,7 +38,7 @@ class NodeXmlCookieTest extends NodeResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php b/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php
index abbd2bda064..056e9511f06 100644
--- a/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php
+++ b/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php
@@ -67,7 +67,7 @@ class BulkFormAccessTest extends NodeTestBase {
/**
* Tests if nodes that may not be edited, can not be edited in bulk.
*/
- public function testNodeEditAccess() {
+ public function testNodeEditAccess(): void {
// Create an account who will be the author of a private node.
$author = $this->drupalCreateUser();
// Create a private node (author may view, edit and delete, others may not).
@@ -143,7 +143,7 @@ class BulkFormAccessTest extends NodeTestBase {
/**
* Tests if nodes that may not be deleted, can not be deleted in bulk.
*/
- public function testNodeDeleteAccess() {
+ public function testNodeDeleteAccess(): void {
// Create an account who will be the author of a private node.
$author = $this->drupalCreateUser();
// Create a private node (author may view, edit and delete, others may not).
diff --git a/core/modules/node/tests/src/Functional/Views/BulkFormTest.php b/core/modules/node/tests/src/Functional/Views/BulkFormTest.php
index ca6445ade1f..83d21c4d965 100644
--- a/core/modules/node/tests/src/Functional/Views/BulkFormTest.php
+++ b/core/modules/node/tests/src/Functional/Views/BulkFormTest.php
@@ -102,7 +102,7 @@ class BulkFormTest extends NodeTestBase {
/**
* Tests the node bulk form.
*/
- public function testBulkForm() {
+ public function testBulkForm(): void {
// Unpublish a node using the bulk form.
$node = reset($this->nodes);
$this->assertTrue($node->isPublished(), 'Node is initially published');
@@ -223,7 +223,7 @@ class BulkFormTest extends NodeTestBase {
/**
* Tests multiple deletion.
*/
- public function testBulkDeletion() {
+ public function testBulkDeletion(): void {
// Select a bunch of translated and untranslated nodes and check that
// nodes and individual translations are properly deleted.
$edit = [
diff --git a/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php b/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php
index 5b7c04534fe..2587f69f6fa 100644
--- a/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php
+++ b/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php
@@ -85,7 +85,7 @@ class FilterNodeAccessTest extends NodeTestBase {
/**
* Tests the node access filter.
*/
- public function testFilterNodeAccess() {
+ public function testFilterNodeAccess(): void {
$this->drupalLogin($this->users[0]);
$this->drupalGet('test_filter_node_access');
// Test that the private node of the current user is shown.
diff --git a/core/modules/node/tests/src/Functional/Views/FrontPageTest.php b/core/modules/node/tests/src/Functional/Views/FrontPageTest.php
index 70acac958a1..b21aba3e70b 100644
--- a/core/modules/node/tests/src/Functional/Views/FrontPageTest.php
+++ b/core/modules/node/tests/src/Functional/Views/FrontPageTest.php
@@ -56,7 +56,7 @@ class FrontPageTest extends ViewTestBase {
/**
* Tests the frontpage.
*/
- public function testFrontPage() {
+ public function testFrontPage(): void {
$site_name = $this->randomMachineName();
$this->config('system.site')
->set('name', $site_name)
@@ -177,7 +177,7 @@ class FrontPageTest extends ViewTestBase {
/**
* Tests the cache tags when using the "none" cache plugin.
*/
- public function testCacheTagsWithCachePluginNone() {
+ public function testCacheTagsWithCachePluginNone(): void {
$this->enablePageCaching();
$this->doTestFrontPageViewCacheTags(FALSE);
}
@@ -185,7 +185,7 @@ class FrontPageTest extends ViewTestBase {
/**
* Tests the cache tags when using the "tag" cache plugin.
*/
- public function testCacheTagsWithCachePluginTag() {
+ public function testCacheTagsWithCachePluginTag(): void {
$this->enablePageCaching();
$view = Views::getView('frontpage');
@@ -201,7 +201,7 @@ class FrontPageTest extends ViewTestBase {
/**
* Tests the cache tags when using the "time" cache plugin.
*/
- public function testCacheTagsWithCachePluginTime() {
+ public function testCacheTagsWithCachePluginTime(): void {
$this->enablePageCaching();
$view = Views::getView('frontpage');
diff --git a/core/modules/node/tests/src/Functional/Views/NodeContextualLinksTest.php b/core/modules/node/tests/src/Functional/Views/NodeContextualLinksTest.php
index 19fe5b932bc..4f8de11b36a 100644
--- a/core/modules/node/tests/src/Functional/Views/NodeContextualLinksTest.php
+++ b/core/modules/node/tests/src/Functional/Views/NodeContextualLinksTest.php
@@ -34,7 +34,7 @@ class NodeContextualLinksTest extends NodeTestBase {
*
* @see https://www.drupal.org/node/2379811
*/
- public function testPageWithDisabledContextualModule() {
+ public function testPageWithDisabledContextualModule(): void {
\Drupal::service('module_installer')->uninstall(['contextual']);
\Drupal::service('module_installer')->install(['views_ui']);
diff --git a/core/modules/node/tests/src/Functional/Views/NodeFieldFilterTest.php b/core/modules/node/tests/src/Functional/Views/NodeFieldFilterTest.php
index 18ab3b14ccd..c33d932ead0 100644
--- a/core/modules/node/tests/src/Functional/Views/NodeFieldFilterTest.php
+++ b/core/modules/node/tests/src/Functional/Views/NodeFieldFilterTest.php
@@ -71,7 +71,7 @@ class NodeFieldFilterTest extends NodeTestBase {
/**
* Tests body and title filters.
*/
- public function testFilters() {
+ public function testFilters(): void {
// Test the title filter page, which filters for title contains 'Comida'.
// Should show just the Spanish translation, once.
$this->assertPageCounts('test-title-filter', ['es' => 1, 'fr' => 0, 'en' => 0], 'Comida title filter');
diff --git a/core/modules/node/tests/src/Functional/Views/NodeFieldTokensTest.php b/core/modules/node/tests/src/Functional/Views/NodeFieldTokensTest.php
index 0340c1fe7fa..e7f060fe3d4 100644
--- a/core/modules/node/tests/src/Functional/Views/NodeFieldTokensTest.php
+++ b/core/modules/node/tests/src/Functional/Views/NodeFieldTokensTest.php
@@ -30,7 +30,7 @@ class NodeFieldTokensTest extends NodeTestBase {
/**
* Tests token replacement for Views tokens supplied by the Node module.
*/
- public function testViewsTokenReplacement() {
+ public function testViewsTokenReplacement(): void {
// Create the Article content type with a standard body field.
/** @var \Drupal\node\NodeTypeInterface $node_type */
$node_type = NodeType::create(['type' => 'article', 'name' => 'Article']);
diff --git a/core/modules/node/tests/src/Functional/Views/NodeIntegrationTest.php b/core/modules/node/tests/src/Functional/Views/NodeIntegrationTest.php
index 0868dfa8aca..41e24f110e1 100644
--- a/core/modules/node/tests/src/Functional/Views/NodeIntegrationTest.php
+++ b/core/modules/node/tests/src/Functional/Views/NodeIntegrationTest.php
@@ -26,7 +26,7 @@ class NodeIntegrationTest extends NodeTestBase {
/**
* Tests basic node view with a node type argument.
*/
- public function testNodeViewTypeArgument() {
+ public function testNodeViewTypeArgument(): void {
// Create two content types with three nodes each.
$types = [];
$all_nids = [];
diff --git a/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php b/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php
index 5863710fc93..745ace0c0bb 100644
--- a/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php
+++ b/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php
@@ -115,7 +115,7 @@ class NodeLanguageTest extends NodeTestBase {
/**
* Tests translation language filter, field, and sort.
*/
- public function testLanguages() {
+ public function testLanguages(): void {
// Test the page with no arguments. It is filtered to Spanish and French.
// The page shows node titles and languages.
$this->drupalGet('test-language');
@@ -255,7 +255,7 @@ class NodeLanguageTest extends NodeTestBase {
/**
* Tests native name display in language field.
*/
- public function testNativeLanguageField() {
+ public function testNativeLanguageField(): void {
$this->assertLanguageNames();
// Modify test view to display native language names and set translations.
diff --git a/core/modules/node/tests/src/Functional/Views/NodeViewsAnalyzeTest.php b/core/modules/node/tests/src/Functional/Views/NodeViewsAnalyzeTest.php
index bf44158b123..402e70bec76 100644
--- a/core/modules/node/tests/src/Functional/Views/NodeViewsAnalyzeTest.php
+++ b/core/modules/node/tests/src/Functional/Views/NodeViewsAnalyzeTest.php
@@ -31,7 +31,7 @@ class NodeViewsAnalyzeTest extends NodeTestBase {
/**
* Tests the implementation of node_views_analyze().
*/
- public function testNodeViewsAnalyze() {
+ public function testNodeViewsAnalyze(): void {
// Create user with permission to view analyze message on views_ui.
$admin_user = $this->createUser(['administer views']);
diff --git a/core/modules/node/tests/src/Functional/Views/RevisionLinkTest.php b/core/modules/node/tests/src/Functional/Views/RevisionLinkTest.php
index 82bdc32bef1..fe03b67cf6b 100644
--- a/core/modules/node/tests/src/Functional/Views/RevisionLinkTest.php
+++ b/core/modules/node/tests/src/Functional/Views/RevisionLinkTest.php
@@ -30,7 +30,7 @@ class RevisionLinkTest extends NodeTestBase {
/**
* Tests revision links.
*/
- public function testRevisionLinks() {
+ public function testRevisionLinks(): void {
// Create one user which can view/revert and delete and one which can only
// do one of them.
$this->drupalCreateContentType(['name' => 'page', 'type' => 'page']);
diff --git a/core/modules/node/tests/src/Functional/Views/StatusExtraTest.php b/core/modules/node/tests/src/Functional/Views/StatusExtraTest.php
index e3ba3b26efc..649af1c322b 100644
--- a/core/modules/node/tests/src/Functional/Views/StatusExtraTest.php
+++ b/core/modules/node/tests/src/Functional/Views/StatusExtraTest.php
@@ -34,7 +34,7 @@ class StatusExtraTest extends NodeTestBase {
/**
* Tests the status extra filter.
*/
- public function testStatusExtra() {
+ public function testStatusExtra(): void {
$node_author = $this->drupalCreateUser(['view own unpublished content']);
$node_author_not_unpublished = $this->drupalCreateUser();
$normal_user = $this->drupalCreateUser();
diff --git a/core/modules/node/tests/src/Functional/Views/Wizard/HiddenTaxonomyTermReferenceFieldWizardTest.php b/core/modules/node/tests/src/Functional/Views/Wizard/HiddenTaxonomyTermReferenceFieldWizardTest.php
index 0ad26d61508..48d2a994d62 100644
--- a/core/modules/node/tests/src/Functional/Views/Wizard/HiddenTaxonomyTermReferenceFieldWizardTest.php
+++ b/core/modules/node/tests/src/Functional/Views/Wizard/HiddenTaxonomyTermReferenceFieldWizardTest.php
@@ -32,7 +32,7 @@ class HiddenTaxonomyTermReferenceFieldWizardTest extends WizardTestBase {
/**
* Tests content type with a hidden Taxonomy Term Reference field.
*/
- public function testHiddenTaxonomyTermReferenceField() {
+ public function testHiddenTaxonomyTermReferenceField(): void {
// Create Article node type.
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
diff --git a/core/modules/node/tests/src/Functional/Views/Wizard/NodeRevisionWizardTest.php b/core/modules/node/tests/src/Functional/Views/Wizard/NodeRevisionWizardTest.php
index 1fc7e3a287f..13980085376 100644
--- a/core/modules/node/tests/src/Functional/Views/Wizard/NodeRevisionWizardTest.php
+++ b/core/modules/node/tests/src/Functional/Views/Wizard/NodeRevisionWizardTest.php
@@ -23,7 +23,7 @@ class NodeRevisionWizardTest extends WizardTestBase {
/**
* Tests creating a node revision view.
*/
- public function testViewAdd() {
+ public function testViewAdd(): void {
$this->drupalCreateContentType(['type' => 'article']);
// Create two nodes with two revision.
$node_storage = \Drupal::entityTypeManager()->getStorage('node');
diff --git a/core/modules/node/tests/src/FunctionalJavascript/CollapsedSummariesTest.php b/core/modules/node/tests/src/FunctionalJavascript/CollapsedSummariesTest.php
index 73d15194a55..84f4a376af9 100644
--- a/core/modules/node/tests/src/FunctionalJavascript/CollapsedSummariesTest.php
+++ b/core/modules/node/tests/src/FunctionalJavascript/CollapsedSummariesTest.php
@@ -45,7 +45,7 @@ class CollapsedSummariesTest extends WebDriverTestBase {
/**
* Confirm that summaries are provided for node meta at all widths.
*/
- public function testSummaries() {
+ public function testSummaries(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/node/tests/src/FunctionalJavascript/ContextualLinksTest.php b/core/modules/node/tests/src/FunctionalJavascript/ContextualLinksTest.php
index a390401c70c..4c499c01a86 100644
--- a/core/modules/node/tests/src/FunctionalJavascript/ContextualLinksTest.php
+++ b/core/modules/node/tests/src/FunctionalJavascript/ContextualLinksTest.php
@@ -92,7 +92,7 @@ class ContextualLinksTest extends WebDriverTestBase {
/**
* Tests the contextual links on revisions.
*/
- public function testRevisionContextualLinks() {
+ public function testRevisionContextualLinks(): void {
// Confirm that the "Edit" and "Delete" contextual links appear for the
// default revision.
$this->drupalGet('node/' . $this->nodes[0]->id());
diff --git a/core/modules/node/tests/src/FunctionalJavascript/NodeDeleteConfirmTest.php b/core/modules/node/tests/src/FunctionalJavascript/NodeDeleteConfirmTest.php
index 782e3fc65fe..2e040fee4c7 100644
--- a/core/modules/node/tests/src/FunctionalJavascript/NodeDeleteConfirmTest.php
+++ b/core/modules/node/tests/src/FunctionalJavascript/NodeDeleteConfirmTest.php
@@ -45,7 +45,7 @@ class NodeDeleteConfirmTest extends WebDriverTestBase {
/**
* Tests that the node delete operation opens in a modal.
*/
- public function testNodeDelete() {
+ public function testNodeDelete(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -92,7 +92,7 @@ class NodeDeleteConfirmTest extends WebDriverTestBase {
/**
* Tests that the node type delete operation opens in a modal.
*/
- public function testNodeTypeDelete() {
+ public function testNodeTypeDelete(): void {
$page = $this->getSession()->getPage();
// Delete node type using link on the content type list.
diff --git a/core/modules/node/tests/src/FunctionalJavascript/NodePreviewLinkTest.php b/core/modules/node/tests/src/FunctionalJavascript/NodePreviewLinkTest.php
index c557006ffa2..2a80ebe4145 100644
--- a/core/modules/node/tests/src/FunctionalJavascript/NodePreviewLinkTest.php
+++ b/core/modules/node/tests/src/FunctionalJavascript/NodePreviewLinkTest.php
@@ -50,7 +50,7 @@ class NodePreviewLinkTest extends WebDriverTestBase {
/**
* Tests the behavior of clicking preview links.
*/
- public function testPreviewLinks() {
+ public function testPreviewLinks(): void {
$assertSession = $this->assertSession();
$this->drupalGet('node/add/test');
$this->submitForm([
diff --git a/core/modules/node/tests/src/FunctionalJavascript/SettingSummariesContentTypeTest.php b/core/modules/node/tests/src/FunctionalJavascript/SettingSummariesContentTypeTest.php
index 35dbfb9767e..d5a9787b720 100644
--- a/core/modules/node/tests/src/FunctionalJavascript/SettingSummariesContentTypeTest.php
+++ b/core/modules/node/tests/src/FunctionalJavascript/SettingSummariesContentTypeTest.php
@@ -37,7 +37,7 @@ class SettingSummariesContentTypeTest extends WebDriverTestBase {
/**
* Tests a vertical tab 'Workflow' summary.
*/
- public function testWorkflowSummary() {
+ public function testWorkflowSummary(): void {
$this->drupalGet('admin/structure/types/manage/test');
$page = $this->getSession()->getPage();
$page->find('css', 'a[href="#edit-workflow"]')->click();
diff --git a/core/modules/node/tests/src/Kernel/Config/NodeImportChangeTest.php b/core/modules/node/tests/src/Kernel/Config/NodeImportChangeTest.php
index 32c95537c2e..14903396c27 100644
--- a/core/modules/node/tests/src/Kernel/Config/NodeImportChangeTest.php
+++ b/core/modules/node/tests/src/Kernel/Config/NodeImportChangeTest.php
@@ -41,7 +41,7 @@ class NodeImportChangeTest extends KernelTestBase {
/**
* Tests importing an updated content type.
*/
- public function testImportChange() {
+ public function testImportChange(): void {
$node_type_id = 'default';
$node_type_config_name = "node.type.$node_type_id";
diff --git a/core/modules/node/tests/src/Kernel/Config/NodeImportCreateTest.php b/core/modules/node/tests/src/Kernel/Config/NodeImportCreateTest.php
index 31ab0b4549f..50fa90bb682 100644
--- a/core/modules/node/tests/src/Kernel/Config/NodeImportCreateTest.php
+++ b/core/modules/node/tests/src/Kernel/Config/NodeImportCreateTest.php
@@ -37,7 +37,7 @@ class NodeImportCreateTest extends KernelTestBase {
/**
* Tests creating a content type during default config import.
*/
- public function testImportCreateDefault() {
+ public function testImportCreateDefault(): void {
$node_type_id = 'default';
// Check that the content type does not exist yet.
@@ -53,7 +53,7 @@ class NodeImportCreateTest extends KernelTestBase {
/**
* Tests creating a content type during config import.
*/
- public function testImportCreate() {
+ public function testImportCreate(): void {
$node_type_id = 'import';
$node_type_config_name = "node.type.$node_type_id";
diff --git a/core/modules/node/tests/src/Kernel/Migrate/MigrateNodeStubTest.php b/core/modules/node/tests/src/Kernel/Migrate/MigrateNodeStubTest.php
index 07ef5c59b6b..54b13c82142 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/MigrateNodeStubTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/MigrateNodeStubTest.php
@@ -38,7 +38,7 @@ class MigrateNodeStubTest extends MigrateDrupalTestBase {
/**
* Tests creation of node stubs.
*/
- public function testStub() {
+ public function testStub(): void {
$this->performStubTest('node');
}
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeBundleSettingsTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeBundleSettingsTest.php
index 66895fdd2cb..5896c230fe1 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeBundleSettingsTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeBundleSettingsTest.php
@@ -46,7 +46,7 @@ class MigrateNodeBundleSettingsTest extends MigrateDrupal6TestBase {
/**
* Tests Drupal 6 node type settings to Drupal 8 migration.
*/
- public function testNodeBundleSettings() {
+ public function testNodeBundleSettings(): void {
// Test settings on test_page bundle.
$node = Node::create(['type' => 'test_page']);
$this->assertSame(1, $node->status->value);
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 8f2e74562d2..de19dbd782f 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeCompleteTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeCompleteTest.php
@@ -58,7 +58,7 @@ class MigrateNodeCompleteTest extends MigrateNodeTestBase {
/**
* Tests the complete node migration.
*/
- public function testNodeCompleteMigration() {
+ public function testNodeCompleteMigration(): void {
$db = \Drupal::database();
$this->assertEquals($this->expectedNodeFieldRevisionTable(), $db->select('node_field_revision', 'nr')
->fields('nr')
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeConfigsTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeConfigsTest.php
index 3c8fcb0cb90..cada0043bb5 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeConfigsTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeConfigsTest.php
@@ -27,7 +27,7 @@ class MigrateNodeConfigsTest extends MigrateDrupal6TestBase {
/**
* Tests Drupal 6 node settings to Drupal 8 migration.
*/
- public function testNodeSettings() {
+ public function testNodeSettings(): void {
$config = $this->config('node.settings');
$this->assertFalse($config->get('use_admin_theme'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'node.settings', $config->get());
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeDeriverTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeDeriverTest.php
index fa2287eb65a..5ecaf4fa81c 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeDeriverTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeDeriverTest.php
@@ -30,7 +30,7 @@ class MigrateNodeDeriverTest extends MigrateDrupal6TestBase {
/**
* Tests node translation migrations with translation disabled.
*/
- public function testNoTranslations() {
+ public function testNoTranslations(): void {
// Without content_translation, there should be no translation migrations.
$migrations = $this->pluginManager->createInstances('d6_node_translation');
$this->assertSame([], $migrations,
@@ -40,7 +40,7 @@ class MigrateNodeDeriverTest extends MigrateDrupal6TestBase {
/**
* Tests node translation migrations with translation enabled.
*/
- public function testTranslations() {
+ public function testTranslations(): void {
// With content_translation, there should be translation migrations for
// each content type.
$this->enableModules(['language', 'content_translation']);
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 1e97db90bdf..e9e8d19750c 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeRevisionTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeRevisionTest.php
@@ -64,7 +64,7 @@ class MigrateNodeRevisionTest extends MigrateNodeTestBase {
/**
* Tests node revisions migration from Drupal 6 to 8.
*/
- public function testNodeRevision() {
+ public function testNodeRevision(): void {
$node = \Drupal::entityTypeManager()->getStorage('node')->loadRevision(2001);
/** @var \Drupal\node\NodeInterface $node */
$this->assertSame('1', $node->id());
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeSettingPromoteTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeSettingPromoteTest.php
index ad147582477..ee3c3571327 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeSettingPromoteTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeSettingPromoteTest.php
@@ -27,7 +27,7 @@ class MigrateNodeSettingPromoteTest extends MigrateDrupal6TestBase {
/**
* Tests migration of the promote checkbox's settings.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertSame('Promoted to front page', BaseFieldOverride::load('node.article.promote')->label());
}
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeSettingStatusTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeSettingStatusTest.php
index 867ef372e21..d96f6b4f0c9 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeSettingStatusTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeSettingStatusTest.php
@@ -27,7 +27,7 @@ class MigrateNodeSettingStatusTest extends MigrateDrupal6TestBase {
/**
* Tests migration of the publishing status checkbox's settings.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertSame('Publishing status', BaseFieldOverride::load('node.article.status')->label());
}
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeSettingStickyTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeSettingStickyTest.php
index 929f5d8f769..5e017b2be18 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeSettingStickyTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeSettingStickyTest.php
@@ -27,7 +27,7 @@ class MigrateNodeSettingStickyTest extends MigrateDrupal6TestBase {
/**
* Tests migration of the sticky checkbox's settings.
*/
- public function testMigration() {
+ public function testMigration(): void {
$this->assertSame('Sticky at the top of lists', BaseFieldOverride::load('node.article.sticky')->label());
}
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php
index 37061a889ac..f954fd6b233 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php
@@ -45,7 +45,7 @@ class MigrateNodeTest extends MigrateNodeTestBase {
/**
* Tests node migration from Drupal 6 to 8.
*/
- public function testNode() {
+ public function testNode(): void {
// Confirm there are only classic node migration map tables. This shows
// that only the classic migration ran.
$results = $this->nodeMigrateMapTableCount('6');
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTypeTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTypeTest.php
index ebb809cdaf9..af5cb11aa10 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTypeTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTypeTest.php
@@ -32,7 +32,7 @@ class MigrateNodeTypeTest extends MigrateDrupal6TestBase {
/**
* Tests Drupal 6 node type to Drupal 8 migration.
*/
- public function testNodeType() {
+ public function testNodeType(): void {
$id_map = $this->getMigration('d6_node_type')->getIdMap();
// Test the test_page content type.
$node_type_page = NodeType::load('test_page');
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateViewModesTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateViewModesTest.php
index 53e5bdbb180..4fc77447818 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateViewModesTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateViewModesTest.php
@@ -25,7 +25,7 @@ class MigrateViewModesTest extends MigrateDrupal6TestBase {
/**
* Tests Drupal 6 view modes to Drupal 8 migration.
*/
- public function testViewModes() {
+ public function testViewModes(): void {
// Test a new view mode.
$view_mode = EntityViewMode::load('node.preview');
$this->assertNotNull($view_mode);
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d6/NodeTranslationRedirectTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/NodeTranslationRedirectTest.php
index 1e4d7684eab..ab2d421b6f6 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d6/NodeTranslationRedirectTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/NodeTranslationRedirectTest.php
@@ -54,7 +54,7 @@ class NodeTranslationRedirectTest extends MigrateDrupal6TestBase {
/**
* Tests that not found node translations are redirected.
*/
- public function testNodeTranslationRedirect() {
+ public function testNodeTranslationRedirect(): void {
$kernel = $this->container->get('http_kernel');
$request = Request::create('/node/11');
$response = $kernel->handle($request);
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 2a35da3a0b0..22e0d43bd85 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeCompleteTest.php
@@ -99,7 +99,7 @@ class MigrateNodeCompleteTest extends MigrateDrupal7TestBase {
/**
* Tests the complete node migration.
*/
- public function testNodeCompleteMigration() {
+ public function testNodeCompleteMigration(): void {
// Confirm there are only complete node migration map tables. This shows
// that only the complete migration ran.
$results = $this->nodeMigrateMapTableCount('7');
@@ -161,7 +161,7 @@ class MigrateNodeCompleteTest extends MigrateDrupal7TestBase {
/**
* Tests rollback of the complete node migration.
*/
- public function testRollbackNodeComplete() {
+ public function testRollbackNodeComplete(): void {
$db = \Drupal::database();
$node_types = [
'article',
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeDeriverTest.php b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeDeriverTest.php
index 53d28823cb6..e9f152fcd72 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeDeriverTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeDeriverTest.php
@@ -21,7 +21,7 @@ class MigrateNodeDeriverTest extends MigrateDrupal7TestBase {
/**
* Tests node translation migrations with translation disabled.
*/
- public function testNoTranslations() {
+ public function testNoTranslations(): void {
// Without content_translation, there should be no translation migrations.
$migrations = $this->container->get('plugin.manager.migration')->createInstances('d7_node_translation');
$this->assertEmpty($migrations);
@@ -30,7 +30,7 @@ class MigrateNodeDeriverTest extends MigrateDrupal7TestBase {
/**
* Tests node translation migrations with translation enabled.
*/
- public function testTranslations() {
+ public function testTranslations(): void {
// With content_translation, there should be translation migrations for
// each content type.
$this->enableModules(['language', 'content_translation', 'filter']);
@@ -42,7 +42,7 @@ class MigrateNodeDeriverTest extends MigrateDrupal7TestBase {
*
* @group node
*/
- public function testBuilder() {
+ public function testBuilder(): void {
$process = $this->getMigration('d7_node:test_content_type')->getProcess();
$this->assertSame('field_boolean', $process['field_boolean'][0]['source']);
$this->assertSame('field_email', $process['field_email'][0]['source']);
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 b8d0634b700..dbc7cda1e20 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php
@@ -113,7 +113,7 @@ class MigrateNodeRevisionTest extends MigrateDrupal7TestBase {
/**
* Tests the migration of node revisions with translated nodes.
*/
- public function testNodeRevisions() {
+ public function testNodeRevisions(): void {
$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);
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeSettingsTest.php b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeSettingsTest.php
index b015f84ab39..e8fb178c4a0 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeSettingsTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeSettingsTest.php
@@ -34,7 +34,7 @@ class MigrateNodeSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests migration of node variables to node.settings config object.
*/
- public function testAggregatorSettings() {
+ public function testAggregatorSettings(): void {
$config = $this->config('node.settings');
$this->assertEquals(1, $config->get('use_admin_theme'));
}
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 35812b11e11..08ee83d79f9 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
@@ -153,7 +153,7 @@ class MigrateNodeTest extends MigrateDrupal7TestBase {
/**
* Tests node migration from Drupal 7 to 8.
*/
- public function testNode() {
+ public function testNode(): void {
// Confirm there are only classic node migration map tables. This shows
// that only the classic migration ran.
$results = $this->nodeMigrateMapTableCount('7');
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 0a40f6991ae..e1a2069d706 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTitleLabelTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTitleLabelTest.php
@@ -45,7 +45,7 @@ class MigrateNodeTitleLabelTest extends MigrateDrupal7TestBase {
/**
* Tests migration of node title field overrides.
*/
- public function testMigration() {
+ public function testMigration(): void {
// Forum title labels are overridden to 'Subject'.
$this->assertEntity('node.forum.title', 'Subject');
// Other content types use the default of 'Title' and are not overridden.
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 5cf09dd33f9..271f7bb608f 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php
@@ -82,7 +82,7 @@ class MigrateNodeTypeTest extends MigrateDrupal7TestBase {
/**
* Tests Drupal 7 node type to Drupal 8 migration.
*/
- public function testNodeType() {
+ public function testNodeType(): void {
$expected_available_menus = ['main'];
$expected_parent = 'main:';
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d7/NodeTranslationRedirectTest.php b/core/modules/node/tests/src/Kernel/Migrate/d7/NodeTranslationRedirectTest.php
index c8b83ad4fa2..19af9c5e738 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/NodeTranslationRedirectTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/NodeTranslationRedirectTest.php
@@ -54,7 +54,7 @@ class NodeTranslationRedirectTest extends MigrateDrupal7TestBase {
/**
* Tests that not found node translations are redirected.
*/
- public function testNodeTranslationRedirect() {
+ public function testNodeTranslationRedirect(): void {
$kernel = $this->container->get('http_kernel');
$request = Request::create('/node/3');
$response = $kernel->handle($request);
diff --git a/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareCombinationTest.php b/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareCombinationTest.php
index e17ddb6164d..e63e0b42d58 100644
--- a/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareCombinationTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareCombinationTest.php
@@ -209,7 +209,7 @@ class NodeAccessLanguageAwareCombinationTest extends NodeAccessTestBase {
/**
* Tests node access and node access queries with multiple node languages.
*/
- public function testNodeAccessLanguageAwareCombination() {
+ public function testNodeAccessLanguageAwareCombination(): void {
$expected_node_access = ['view' => TRUE, 'update' => FALSE, 'delete' => FALSE];
$expected_node_access_no_access = ['view' => FALSE, 'update' => FALSE, 'delete' => FALSE];
diff --git a/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php b/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php
index ffd9117da17..b61904165a7 100644
--- a/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php
@@ -161,7 +161,7 @@ class NodeAccessLanguageAwareTest extends NodeAccessTestBase {
/**
* Tests node access and node access queries with multiple node languages.
*/
- public function testNodeAccessLanguageAware() {
+ public function testNodeAccessLanguageAware(): void {
// The node_access_test_language module only grants view access.
$expected_node_access = ['view' => TRUE, 'update' => FALSE, 'delete' => FALSE];
$expected_node_access_no_access = ['view' => FALSE, 'update' => FALSE, 'delete' => FALSE];
diff --git a/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php b/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php
index 410f6e2b15a..5f8212d0d8f 100644
--- a/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php
@@ -53,7 +53,7 @@ class NodeAccessLanguageTest extends NodeAccessTestBase {
/**
* Tests node access with multiple node languages and no private nodes.
*/
- public function testNodeAccess() {
+ public function testNodeAccess(): void {
$web_user = $this->drupalCreateUser(['access content']);
$expected_node_access = ['view' => TRUE, 'update' => FALSE, 'delete' => FALSE];
@@ -123,7 +123,7 @@ class NodeAccessLanguageTest extends NodeAccessTestBase {
/**
* Tests node access with multiple node languages and private nodes.
*/
- public function testNodeAccessPrivate() {
+ public function testNodeAccessPrivate(): void {
$web_user = $this->drupalCreateUser(['access content']);
$expected_node_access = ['view' => TRUE, 'update' => FALSE, 'delete' => FALSE];
$expected_node_access_no_access = ['view' => FALSE, 'update' => FALSE, 'delete' => FALSE];
@@ -189,7 +189,7 @@ class NodeAccessLanguageTest extends NodeAccessTestBase {
/**
* Tests select queries with a 'node_access' tag and langcode metadata.
*/
- public function testNodeAccessQueryTag() {
+ public function testNodeAccessQueryTag(): void {
// Create a normal authenticated user.
$web_user = $this->drupalCreateUser(['access content']);
diff --git a/core/modules/node/tests/src/Kernel/NodeAccessRecordsTest.php b/core/modules/node/tests/src/Kernel/NodeAccessRecordsTest.php
index 6bb64dd4c4b..c2375cccdd5 100644
--- a/core/modules/node/tests/src/Kernel/NodeAccessRecordsTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeAccessRecordsTest.php
@@ -24,7 +24,7 @@ class NodeAccessRecordsTest extends NodeAccessTestBase {
/**
* Creates a node and tests the creation of node access rules.
*/
- public function testNodeAccessRecords() {
+ public function testNodeAccessRecords(): void {
// Create an article node.
$node1 = $this->drupalCreateNode(['type' => 'article']);
$this->assertNotEmpty(Node::load($node1->id()), 'Article node created.');
diff --git a/core/modules/node/tests/src/Kernel/NodeAccessTest.php b/core/modules/node/tests/src/Kernel/NodeAccessTest.php
index 6916657b2d6..741c4c20c61 100644
--- a/core/modules/node/tests/src/Kernel/NodeAccessTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeAccessTest.php
@@ -14,7 +14,7 @@ class NodeAccessTest extends NodeAccessTestBase {
/**
* Runs basic tests for node_access function.
*/
- public function testNodeAccess() {
+ public function testNodeAccess(): void {
// Ensures user without 'access content' permission can do nothing.
$web_user1 = $this->drupalCreateUser([
'create page content',
@@ -118,7 +118,7 @@ class NodeAccessTest extends NodeAccessTestBase {
/**
* Tests operations not supported by node grants.
*/
- public function testUnsupportedOperation() {
+ public function testUnsupportedOperation(): void {
$this->enableModules(['node_access_test_empty']);
$web_user = $this->drupalCreateUser(['access content']);
$node = $this->drupalCreateNode();
diff --git a/core/modules/node/tests/src/Kernel/NodeBodyFieldStorageTest.php b/core/modules/node/tests/src/Kernel/NodeBodyFieldStorageTest.php
index 883d1ccddb5..1f120fdc8d7 100644
--- a/core/modules/node/tests/src/Kernel/NodeBodyFieldStorageTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeBodyFieldStorageTest.php
@@ -45,7 +45,7 @@ class NodeBodyFieldStorageTest extends KernelTestBase {
/**
* Tests node body field storage persistence even if there are no instances.
*/
- public function testFieldOverrides() {
+ public function testFieldOverrides(): void {
$field_storage = FieldStorageConfig::loadByName('node', 'body');
$this->assertNotEmpty($field_storage, 'Node body field storage exists.');
$type = NodeType::create(['name' => 'Ponies', 'type' => 'ponies']);
diff --git a/core/modules/node/tests/src/Kernel/NodeFieldAccessTest.php b/core/modules/node/tests/src/Kernel/NodeFieldAccessTest.php
index 875d00c4ec9..b5ab7850e00 100644
--- a/core/modules/node/tests/src/Kernel/NodeFieldAccessTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeFieldAccessTest.php
@@ -45,7 +45,7 @@ class NodeFieldAccessTest extends EntityKernelTestBase {
/**
* Tests permissions on nodes status field.
*/
- public function testAccessToAdministrativeFields() {
+ public function testAccessToAdministrativeFields(): void {
// Create the page node type with revisions disabled.
$page = NodeType::create([
diff --git a/core/modules/node/tests/src/Kernel/NodeFieldOverridesTest.php b/core/modules/node/tests/src/Kernel/NodeFieldOverridesTest.php
index 8921a1e0a61..f727c846c8b 100644
--- a/core/modules/node/tests/src/Kernel/NodeFieldOverridesTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeFieldOverridesTest.php
@@ -44,7 +44,7 @@ class NodeFieldOverridesTest extends EntityKernelTestBase {
/**
* Tests that field overrides work as expected.
*/
- public function testFieldOverrides() {
+ public function testFieldOverrides(): void {
if (!NodeType::load('ponies')) {
NodeType::create(['name' => 'Ponies', 'type' => 'ponies'])->save();
}
diff --git a/core/modules/node/tests/src/Kernel/NodeListBuilderTest.php b/core/modules/node/tests/src/Kernel/NodeListBuilderTest.php
index 732106f8f75..82303fe1df5 100644
--- a/core/modules/node/tests/src/Kernel/NodeListBuilderTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeListBuilderTest.php
@@ -31,7 +31,7 @@ class NodeListBuilderTest extends KernelTestBase {
/**
* Tests that the correct cache contexts are set.
*/
- public function testCacheContexts() {
+ public function testCacheContexts(): void {
/** @var \Drupal\Core\Entity\EntityListBuilderInterface $list_builder */
$list_builder = $this->container->get('entity_type.manager')->getListBuilder('node');
diff --git a/core/modules/node/tests/src/Kernel/NodeLoadMultipleTest.php b/core/modules/node/tests/src/Kernel/NodeLoadMultipleTest.php
index 314399ec543..d68e83c9976 100644
--- a/core/modules/node/tests/src/Kernel/NodeLoadMultipleTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeLoadMultipleTest.php
@@ -32,7 +32,7 @@ class NodeLoadMultipleTest extends NodeAccessTestBase {
/**
* Creates four nodes and ensures that they are loaded correctly.
*/
- public function testNodeMultipleLoad() {
+ public function testNodeMultipleLoad(): void {
$node1 = $this->drupalCreateNode(['type' => 'article', 'promote' => 1]);
$node2 = $this->drupalCreateNode(['type' => 'article', 'promote' => 1]);
$node3 = $this->drupalCreateNode(['type' => 'article', 'promote' => 0]);
@@ -59,7 +59,7 @@ class NodeLoadMultipleTest extends NodeAccessTestBase {
/**
* Creates four nodes with not case sensitive fields and load them.
*/
- public function testNodeMultipleLoadCaseSensitiveFalse() {
+ public function testNodeMultipleLoadCaseSensitiveFalse(): void {
$field_first_storage = FieldStorageConfig::create([
'field_name' => 'field_first',
'entity_type' => 'node',
diff --git a/core/modules/node/tests/src/Kernel/NodeOwnerTest.php b/core/modules/node/tests/src/Kernel/NodeOwnerTest.php
index 9bf39b19c20..9bf8f9d2c96 100644
--- a/core/modules/node/tests/src/Kernel/NodeOwnerTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeOwnerTest.php
@@ -47,7 +47,7 @@ class NodeOwnerTest extends EntityKernelTestBase {
/**
* Tests node owner functionality.
*/
- public function testOwner() {
+ public function testOwner(): void {
$user = $this->createUser();
$container = \Drupal::getContainer();
@@ -84,7 +84,7 @@ class NodeOwnerTest extends EntityKernelTestBase {
/**
* Tests an unsaved node owner.
*/
- public function testUnsavedNodeOwner() {
+ public function testUnsavedNodeOwner(): void {
$user = User::create([
'name' => 'foo',
]);
diff --git a/core/modules/node/tests/src/Kernel/NodeTokenReplaceTest.php b/core/modules/node/tests/src/Kernel/NodeTokenReplaceTest.php
index 0a5380ec610..de91601f626 100644
--- a/core/modules/node/tests/src/Kernel/NodeTokenReplaceTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeTokenReplaceTest.php
@@ -39,7 +39,7 @@ class NodeTokenReplaceTest extends TokenReplaceKernelTestBase {
/**
* Creates a node, then tests the tokens generated from it.
*/
- public function testNodeTokenReplacement() {
+ public function testNodeTokenReplacement(): void {
$url_options = [
'absolute' => TRUE,
'language' => $this->interfaceLanguage,
diff --git a/core/modules/node/tests/src/Kernel/NodeValidationTest.php b/core/modules/node/tests/src/Kernel/NodeValidationTest.php
index 8394f06221e..634d692169c 100644
--- a/core/modules/node/tests/src/Kernel/NodeValidationTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeValidationTest.php
@@ -36,7 +36,7 @@ class NodeValidationTest extends EntityKernelTestBase {
/**
* Tests the node validation constraints.
*/
- public function testValidation() {
+ public function testValidation(): void {
$this->createUser();
$node = Node::create(['type' => 'page', 'title' => 'test', 'uid' => 1]);
$violations = $node->validate();
diff --git a/core/modules/node/tests/src/Kernel/NodeViewBuilderTest.php b/core/modules/node/tests/src/Kernel/NodeViewBuilderTest.php
index fffbf98c324..b149880bf03 100644
--- a/core/modules/node/tests/src/Kernel/NodeViewBuilderTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeViewBuilderTest.php
@@ -71,7 +71,7 @@ class NodeViewBuilderTest extends EntityKernelTestBase {
* @covers ::renderLinks
* @covers ::buildLinks
*/
- public function testPendingRevisionLinks() {
+ public function testPendingRevisionLinks(): void {
$account = User::create([
'name' => $this->randomString(),
]);
diff --git a/core/modules/node/tests/src/Kernel/SummaryLengthTest.php b/core/modules/node/tests/src/Kernel/SummaryLengthTest.php
index 423d1ebd87d..7ea6c8029cd 100644
--- a/core/modules/node/tests/src/Kernel/SummaryLengthTest.php
+++ b/core/modules/node/tests/src/Kernel/SummaryLengthTest.php
@@ -76,7 +76,7 @@ class SummaryLengthTest extends KernelTestBase {
/**
* Tests the node summary length functionality.
*/
- public function testSummaryLength() {
+ public function testSummaryLength(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
diff --git a/core/modules/node/tests/src/Kernel/Views/ArgumentNodeRevisionIdTest.php b/core/modules/node/tests/src/Kernel/Views/ArgumentNodeRevisionIdTest.php
index fcac6ca2091..3be3da3e2dc 100644
--- a/core/modules/node/tests/src/Kernel/Views/ArgumentNodeRevisionIdTest.php
+++ b/core/modules/node/tests/src/Kernel/Views/ArgumentNodeRevisionIdTest.php
@@ -43,7 +43,7 @@ class ArgumentNodeRevisionIdTest extends ViewsKernelTestBase {
/**
* Tests the node revision id argument via the node_vid handler.
*/
- public function testNodeRevisionRelationship() {
+ public function testNodeRevisionRelationship(): void {
NodeType::create(['type' => 'page', 'name' => 'page'])->save();
$node = Node::create(['type' => 'page', 'title' => 'test1', 'uid' => 1]);
$node->save();
diff --git a/core/modules/node/tests/src/Kernel/Views/ArgumentUidRevisionTest.php b/core/modules/node/tests/src/Kernel/Views/ArgumentUidRevisionTest.php
index 1a697482a0b..4cb435dd1bb 100644
--- a/core/modules/node/tests/src/Kernel/Views/ArgumentUidRevisionTest.php
+++ b/core/modules/node/tests/src/Kernel/Views/ArgumentUidRevisionTest.php
@@ -51,7 +51,7 @@ class ArgumentUidRevisionTest extends ViewsKernelTestBase {
/**
* Tests the node_uid_revision argument.
*/
- public function testArgument() {
+ public function testArgument(): void {
$expected_result = [];
$author = $this->createUser();
diff --git a/core/modules/node/tests/src/Kernel/Views/FilterUidRevisionTest.php b/core/modules/node/tests/src/Kernel/Views/FilterUidRevisionTest.php
index 8dc71430291..364c9c9bb76 100644
--- a/core/modules/node/tests/src/Kernel/Views/FilterUidRevisionTest.php
+++ b/core/modules/node/tests/src/Kernel/Views/FilterUidRevisionTest.php
@@ -44,7 +44,7 @@ class FilterUidRevisionTest extends KernelTestBase {
/**
* Tests the node_uid_revision filter.
*/
- public function testFilter() {
+ public function testFilter(): void {
$this->installEntitySchema('user');
$this->installEntitySchema('node');
$this->installSchema('node', ['node_access']);
diff --git a/core/modules/node/tests/src/Kernel/Views/NidArgumentTest.php b/core/modules/node/tests/src/Kernel/Views/NidArgumentTest.php
index 5f541ae6fa1..a421341ffc5 100644
--- a/core/modules/node/tests/src/Kernel/Views/NidArgumentTest.php
+++ b/core/modules/node/tests/src/Kernel/Views/NidArgumentTest.php
@@ -52,7 +52,7 @@ class NidArgumentTest extends ViewsKernelTestBase {
/**
* Tests the nid argument.
*/
- public function testNidArgument() {
+ public function testNidArgument(): void {
$view = Views::getView('test_nid_argument');
$view->setDisplay();
diff --git a/core/modules/node/tests/src/Kernel/Views/NodeViewsFieldAccessTest.php b/core/modules/node/tests/src/Kernel/Views/NodeViewsFieldAccessTest.php
index 376ec4897eb..9852db8ccb0 100644
--- a/core/modules/node/tests/src/Kernel/Views/NodeViewsFieldAccessTest.php
+++ b/core/modules/node/tests/src/Kernel/Views/NodeViewsFieldAccessTest.php
@@ -44,7 +44,7 @@ class NodeViewsFieldAccessTest extends FieldFieldAccessTestBase {
/**
* Check access for node fields.
*/
- public function testNodeFields() {
+ public function testNodeFields(): void {
$user = User::create([
'name' => 'test user',
]);
diff --git a/core/modules/node/tests/src/Kernel/Views/RevisionCreateTimestampTest.php b/core/modules/node/tests/src/Kernel/Views/RevisionCreateTimestampTest.php
index a622e951020..b9004855b57 100644
--- a/core/modules/node/tests/src/Kernel/Views/RevisionCreateTimestampTest.php
+++ b/core/modules/node/tests/src/Kernel/Views/RevisionCreateTimestampTest.php
@@ -42,7 +42,7 @@ class RevisionCreateTimestampTest extends ViewsKernelTestBase {
}
}
- public function testRevisionCreateTimestampView() {
+ public function testRevisionCreateTimestampView(): void {
$node_type = NodeType::create([
'type' => 'article',
'name' => 'Article',
diff --git a/core/modules/node/tests/src/Kernel/Views/RevisionRelationshipsTest.php b/core/modules/node/tests/src/Kernel/Views/RevisionRelationshipsTest.php
index e4f42346e96..4f2610eba21 100644
--- a/core/modules/node/tests/src/Kernel/Views/RevisionRelationshipsTest.php
+++ b/core/modules/node/tests/src/Kernel/Views/RevisionRelationshipsTest.php
@@ -56,7 +56,7 @@ class RevisionRelationshipsTest extends ViewsKernelTestBase {
/**
* Create a node with revision and rest result count for both views.
*/
- public function testNodeRevisionRelationship() {
+ public function testNodeRevisionRelationship(): void {
$type = NodeType::create(['type' => 'page', 'name' => 'page']);
$type->save();
$node = Node::create(['type' => 'page', 'title' => 'test', 'uid' => 1]);
diff --git a/core/modules/node/tests/src/Kernel/Views/RevisionUidTest.php b/core/modules/node/tests/src/Kernel/Views/RevisionUidTest.php
index fd8d97a693a..806b90b9f10 100644
--- a/core/modules/node/tests/src/Kernel/Views/RevisionUidTest.php
+++ b/core/modules/node/tests/src/Kernel/Views/RevisionUidTest.php
@@ -70,7 +70,7 @@ class RevisionUidTest extends ViewsKernelTestBase {
/**
* Tests the node_revision_uid relationship.
*/
- public function testRevisionUid() {
+ public function testRevisionUid(): void {
$primary_author = $this->createUser();
$secondary_author = $this->createUser();
diff --git a/core/modules/node/tests/src/Unit/NodeOperationAccessTest.php b/core/modules/node/tests/src/Unit/NodeOperationAccessTest.php
index 6e094dfa505..1b7f526fe2e 100644
--- a/core/modules/node/tests/src/Unit/NodeOperationAccessTest.php
+++ b/core/modules/node/tests/src/Unit/NodeOperationAccessTest.php
@@ -57,7 +57,7 @@ class NodeOperationAccessTest extends UnitTestCase {
*
* @dataProvider providerTestRevisionOperations
*/
- public function testRevisionOperations($operation, array $hasPermissionMap, $assertAccess, $isDefaultRevision = NULL) {
+ public function testRevisionOperations($operation, array $hasPermissionMap, $assertAccess, $isDefaultRevision = NULL): void {
$account = $this->createMock(AccountInterface::class);
$account->method('hasPermission')
->willReturnMap($hasPermissionMap);
diff --git a/core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php b/core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php
index 9234489298e..8ac5bd16cc5 100644
--- a/core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php
+++ b/core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php
@@ -62,7 +62,7 @@ class DenyNodePreviewTest extends UnitTestCase {
* @dataProvider providerPrivateImageStyleDownloadPolicy
* @covers ::check
*/
- public function testPrivateImageStyleDownloadPolicy($expected_result, $route_name) {
+ public function testPrivateImageStyleDownloadPolicy($expected_result, $route_name): void {
$this->routeMatch->expects($this->once())
->method('getRouteName')
->willReturn($route_name);
diff --git a/core/modules/node/tests/src/Unit/Plugin/views/field/NodeBulkFormTest.php b/core/modules/node/tests/src/Unit/Plugin/views/field/NodeBulkFormTest.php
index 517013ad8b5..7697ac4c56b 100644
--- a/core/modules/node/tests/src/Unit/Plugin/views/field/NodeBulkFormTest.php
+++ b/core/modules/node/tests/src/Unit/Plugin/views/field/NodeBulkFormTest.php
@@ -29,7 +29,7 @@ class NodeBulkFormTest extends UnitTestCase {
/**
* Tests the constructor assignment of actions.
*/
- public function testConstructor() {
+ public function testConstructor(): void {
$actions = [];
for ($i = 1; $i <= 2; $i++) {
diff --git a/core/modules/options/tests/src/Functional/OptionsFieldUITest.php b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
index d4c3c834c40..c351b77f82c 100644
--- a/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
+++ b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
@@ -91,7 +91,7 @@ class OptionsFieldUITest extends FieldTestBase {
/**
* Options (integer) : test 'allowed values' input.
*/
- public function testOptionsAllowedValuesInteger() {
+ public function testOptionsAllowedValuesInteger(): void {
$this->fieldName = 'field_options_integer';
$this->createOptionsField('list_integer');
$page = $this->getSession()->getPage();
@@ -163,7 +163,7 @@ class OptionsFieldUITest extends FieldTestBase {
/**
* Options (float) : test 'allowed values' input.
*/
- public function testOptionsAllowedValuesFloat() {
+ public function testOptionsAllowedValuesFloat(): void {
$this->fieldName = 'field_options_float';
$this->createOptionsField('list_float');
$page = $this->getSession()->getPage();
@@ -252,7 +252,7 @@ class OptionsFieldUITest extends FieldTestBase {
/**
* Options (text) : test 'allowed values' input.
*/
- public function testOptionsAllowedValuesText() {
+ public function testOptionsAllowedValuesText(): void {
$this->fieldName = 'field_options_text';
$this->createOptionsField('list_string');
$page = $this->getSession()->getPage();
@@ -393,7 +393,7 @@ class OptionsFieldUITest extends FieldTestBase {
/**
* Tests normal and key formatter display on node display.
*/
- public function testNodeDisplay() {
+ public function testNodeDisplay(): void {
$this->fieldName = $this->randomMachineName();
$this->createOptionsField('list_integer');
$node = $this->drupalCreateNode(['type' => $this->type]);
@@ -445,7 +445,7 @@ class OptionsFieldUITest extends FieldTestBase {
/**
* Confirms the allowed value list is a required field.
*/
- public function testRequiredPropertyForAllowedValuesList() {
+ public function testRequiredPropertyForAllowedValuesList(): void {
$field_types = [
'list_float',
'list_string',
diff --git a/core/modules/options/tests/src/Functional/OptionsFloatFieldImportTest.php b/core/modules/options/tests/src/Functional/OptionsFloatFieldImportTest.php
index d4485b3670f..4d77d65f9c5 100644
--- a/core/modules/options/tests/src/Functional/OptionsFloatFieldImportTest.php
+++ b/core/modules/options/tests/src/Functional/OptionsFloatFieldImportTest.php
@@ -57,7 +57,7 @@ class OptionsFloatFieldImportTest extends FieldTestBase {
/**
* Tests that importing list_float fields works.
*/
- public function testImport() {
+ public function testImport(): void {
$field_name = 'field_options_float';
$type = 'options_install_test';
diff --git a/core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.php b/core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.php
index 93c35c77342..e27e6075bb0 100644
--- a/core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.php
+++ b/core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.php
@@ -19,7 +19,7 @@ class OptionsSelectDynamicValuesTest extends OptionsDynamicValuesTestBase {
/**
* Tests the 'options_select' widget (single select).
*/
- public function testSelectListDynamic() {
+ public function testSelectListDynamic(): void {
// Create an entity.
$this->entity->save();
diff --git a/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php b/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php
index 32caa069a3c..d5daf17c248 100644
--- a/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php
+++ b/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php
@@ -127,7 +127,7 @@ class OptionsWidgetsTest extends FieldTestBase {
/**
* Tests the 'options_buttons' widget (single select).
*/
- public function testRadioButtons() {
+ public function testRadioButtons(): void {
// Create an instance of the 'single value' field.
$field = FieldConfig::create([
'field_storage' => $this->card1,
@@ -185,7 +185,7 @@ class OptionsWidgetsTest extends FieldTestBase {
/**
* Tests the 'options_buttons' widget (multiple select).
*/
- public function testCheckBoxes() {
+ public function testCheckBoxes(): void {
// Create an instance of the 'multiple values' field.
$field = FieldConfig::create([
'field_storage' => $this->card2,
@@ -275,7 +275,7 @@ class OptionsWidgetsTest extends FieldTestBase {
/**
* Tests the 'options_select' widget (single select).
*/
- public function testSelectListSingle() {
+ public function testSelectListSingle(): void {
// Create an instance of the 'single value' field.
$field = FieldConfig::create([
'field_storage' => $this->card1,
@@ -380,7 +380,7 @@ class OptionsWidgetsTest extends FieldTestBase {
/**
* Tests the '#required_error' attribute for the select list.
*/
- public function testSelectListRequiredErrorAttribute() {
+ public function testSelectListRequiredErrorAttribute(): void {
// Enable form alter hook.
\Drupal::state()->set('options_test.form_alter_enable', TRUE);
// Create an instance of the 'single value' field.
@@ -418,7 +418,7 @@ class OptionsWidgetsTest extends FieldTestBase {
/**
* Tests the 'options_select' widget (multiple select).
*/
- public function testSelectListMultiple() {
+ public function testSelectListMultiple(): void {
// Create an instance of the 'multiple values' field.
$field = FieldConfig::create([
'field_storage' => $this->card2,
@@ -543,7 +543,7 @@ class OptionsWidgetsTest extends FieldTestBase {
/**
* Tests the 'options_select' widget (float values).
*/
- public function testSelectListFloat() {
+ public function testSelectListFloat(): void {
// Create an instance of the 'float value' field.
$field = FieldConfig::create([
@@ -590,7 +590,7 @@ class OptionsWidgetsTest extends FieldTestBase {
/**
* Tests the 'options_select' and 'options_button' widget for empty value.
*/
- public function testEmptyValue() {
+ public function testEmptyValue(): void {
// Create an instance of the 'single value' field.
$field = FieldConfig::create([
'field_storage' => $this->card1,
@@ -642,7 +642,7 @@ class OptionsWidgetsTest extends FieldTestBase {
*
* @see options_test_options_list_alter()
*/
- public function testOptionsListAlter() {
+ public function testOptionsListAlter(): void {
$field1 = FieldConfig::create([
'field_storage' => $this->card1,
'bundle' => 'entity_test',
diff --git a/core/modules/options/tests/src/FunctionalJavascript/OptionsFieldUITest.php b/core/modules/options/tests/src/FunctionalJavascript/OptionsFieldUITest.php
index 0e09410257e..0e452344c44 100644
--- a/core/modules/options/tests/src/FunctionalJavascript/OptionsFieldUITest.php
+++ b/core/modules/options/tests/src/FunctionalJavascript/OptionsFieldUITest.php
@@ -85,7 +85,7 @@ class OptionsFieldUITest extends WebDriverTestBase {
*
* @dataProvider providerTestOptionsAllowedValues
*/
- public function testOptionsAllowedValues($option_type, $options, $is_string_option, string $add_row_method) {
+ public function testOptionsAllowedValues($option_type, $options, $is_string_option, string $add_row_method): void {
$assert = $this->assertSession();
$this->fieldName = 'field_options_text';
$this->createOptionsField($option_type);
@@ -213,7 +213,7 @@ class OptionsFieldUITest extends WebDriverTestBase {
/**
* Tests that the allowed options are available to the default value widget.
*/
- public function testDefaultValueOptions() {
+ public function testDefaultValueOptions(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
$bundle_path = 'admin/structure/types/manage/' . $this->type;
@@ -378,7 +378,7 @@ JS;
/**
* Tests `list_string` machine name with special characters.
*/
- public function testMachineNameSpecialCharacters() {
+ public function testMachineNameSpecialCharacters(): void {
$this->fieldName = 'field_options_text';
$this->createOptionsField('list_string');
$this->drupalGet($this->adminPath);
diff --git a/core/modules/options/tests/src/Kernel/OptionsFieldTest.php b/core/modules/options/tests/src/Kernel/OptionsFieldTest.php
index 49124334dbf..ad7eee65fbf 100644
--- a/core/modules/options/tests/src/Kernel/OptionsFieldTest.php
+++ b/core/modules/options/tests/src/Kernel/OptionsFieldTest.php
@@ -26,7 +26,7 @@ class OptionsFieldTest extends OptionsFieldUnitTestBase {
/**
* Tests that allowed values can be updated.
*/
- public function testUpdateAllowedValues() {
+ public function testUpdateAllowedValues(): void {
// All three options appear.
$entity = EntityTest::create();
$form = \Drupal::service('entity.form_builder')->getForm($entity);
@@ -103,7 +103,7 @@ class OptionsFieldTest extends OptionsFieldUnitTestBase {
/**
* Tests that ::generateSampleItems does not fail with empty allowed values.
*/
- public function testGenerateSampleItemsWithNoAllowedValues() {
+ public function testGenerateSampleItemsWithNoAllowedValues(): void {
$this->fieldStorage->setSetting('allowed_values', [])->save();
$entity = EntityTest::create();
$value = $entity->{$this->fieldName}->generateSampleItems();
diff --git a/core/modules/options/tests/src/Kernel/OptionsFormattersTest.php b/core/modules/options/tests/src/Kernel/OptionsFormattersTest.php
index 7953c990625..d6517ae4056 100644
--- a/core/modules/options/tests/src/Kernel/OptionsFormattersTest.php
+++ b/core/modules/options/tests/src/Kernel/OptionsFormattersTest.php
@@ -25,7 +25,7 @@ class OptionsFormattersTest extends OptionsFieldUnitTestBase {
/**
* Tests the formatters.
*/
- public function testFormatter() {
+ public function testFormatter(): void {
$entity = EntityTest::create();
$entity->{$this->fieldName}->value = 1;
diff --git a/core/modules/options/tests/src/Kernel/Views/FileViewsDataTest.php b/core/modules/options/tests/src/Kernel/Views/FileViewsDataTest.php
index 55826622335..2cb7f4906f0 100644
--- a/core/modules/options/tests/src/Kernel/Views/FileViewsDataTest.php
+++ b/core/modules/options/tests/src/Kernel/Views/FileViewsDataTest.php
@@ -44,7 +44,7 @@ class FileViewsDataTest extends ViewsKernelTestBase {
* @see file_field_views_data()
* @see file_field_views_data_views_data_alter()
*/
- public function testRelationshipViewsData() {
+ public function testRelationshipViewsData(): void {
// Create file field to entity_test.
FieldStorageConfig::create([
'entity_type' => 'entity_test',
diff --git a/core/modules/options/tests/src/Kernel/Views/OptionsListArgumentTest.php b/core/modules/options/tests/src/Kernel/Views/OptionsListArgumentTest.php
index 44c5e85f2ec..88e7d88cbf1 100644
--- a/core/modules/options/tests/src/Kernel/Views/OptionsListArgumentTest.php
+++ b/core/modules/options/tests/src/Kernel/Views/OptionsListArgumentTest.php
@@ -24,7 +24,7 @@ class OptionsListArgumentTest extends OptionsTestBase {
/**
* Tests the options field argument.
*/
- public function testViewsTestOptionsListArgument() {
+ public function testViewsTestOptionsListArgument(): void {
$view = Views::getView('test_options_list_argument_numeric');
$this->executeView($view, [1]);
diff --git a/core/modules/options/tests/src/Kernel/Views/OptionsListFilterTest.php b/core/modules/options/tests/src/Kernel/Views/OptionsListFilterTest.php
index 45053b0b6fe..2bbbddb7402 100644
--- a/core/modules/options/tests/src/Kernel/Views/OptionsListFilterTest.php
+++ b/core/modules/options/tests/src/Kernel/Views/OptionsListFilterTest.php
@@ -24,7 +24,7 @@ class OptionsListFilterTest extends OptionsTestBase {
/**
* Tests options list field filter.
*/
- public function testViewsTestOptionsListFilter() {
+ public function testViewsTestOptionsListFilter(): void {
$view = Views::getView('test_options_list_filter');
$this->executeView($view);
@@ -40,7 +40,7 @@ class OptionsListFilterTest extends OptionsTestBase {
/**
* Tests options list field filter when grouped.
*/
- public function testViewsTestOptionsListGroupedFilter() {
+ public function testViewsTestOptionsListGroupedFilter(): void {
$view = Views::getView('test_options_list_filter');
$filters = [
diff --git a/core/modules/options/tests/src/Kernel/Views/ViewsDataTest.php b/core/modules/options/tests/src/Kernel/Views/ViewsDataTest.php
index 6036d83cff6..f1eb578fe33 100644
--- a/core/modules/options/tests/src/Kernel/Views/ViewsDataTest.php
+++ b/core/modules/options/tests/src/Kernel/Views/ViewsDataTest.php
@@ -66,7 +66,7 @@ class ViewsDataTest extends OptionsTestBase {
/**
* Tests the option module's implementation of hook_field_views_data().
*/
- public function testOptionsFieldViewsData() {
+ public function testOptionsFieldViewsData(): void {
$field_data = \Drupal::service('views.views_data')->get('entity_test__test_options');
// Check that the options module has properly overridden default views data.
diff --git a/core/modules/page_cache/tests/src/Functional/PageCacheTagsIntegrationTest.php b/core/modules/page_cache/tests/src/Functional/PageCacheTagsIntegrationTest.php
index fdc7fe19467..de0ca9f2f06 100644
--- a/core/modules/page_cache/tests/src/Functional/PageCacheTagsIntegrationTest.php
+++ b/core/modules/page_cache/tests/src/Functional/PageCacheTagsIntegrationTest.php
@@ -62,7 +62,7 @@ class PageCacheTagsIntegrationTest extends BrowserTestBase {
/**
* Tests that cache tags are properly bubbled up to the page level.
*/
- public function testPageCacheTags() {
+ public function testPageCacheTags(): void {
$config = $this->config('language.types');
$config->set('configurable', [LanguageInterface::TYPE_INTERFACE, LanguageInterface::TYPE_CONTENT]);
$config->set('negotiation.language_content.enabled', [
diff --git a/core/modules/page_cache/tests/src/Functional/PageCacheTest.php b/core/modules/page_cache/tests/src/Functional/PageCacheTest.php
index f37c91af975..c26b5d76012 100644
--- a/core/modules/page_cache/tests/src/Functional/PageCacheTest.php
+++ b/core/modules/page_cache/tests/src/Functional/PageCacheTest.php
@@ -53,7 +53,7 @@ class PageCacheTest extends BrowserTestBase {
* Since tag based invalidation works, we know that our tag properly
* persisted.
*/
- public function testPageCacheTags() {
+ public function testPageCacheTags(): void {
$this->enablePageCaching();
$path = 'system-test/cache_tags_page';
@@ -85,7 +85,7 @@ class PageCacheTest extends BrowserTestBase {
/**
* Tests that the page cache doesn't depend on cacheability headers.
*/
- public function testPageCacheTagsIndependentFromCacheabilityHeaders() {
+ public function testPageCacheTagsIndependentFromCacheabilityHeaders(): void {
// Disable the cacheability headers.
$this->setContainerParameter('http.response.debug_cacheability_headers', FALSE);
$this->rebuildContainer();
@@ -122,7 +122,7 @@ class PageCacheTest extends BrowserTestBase {
*
* The request formats are specified via a query parameter.
*/
- public function testQueryParameterFormatRequests() {
+ public function testQueryParameterFormatRequests(): void {
$this->enablePageCaching();
$accept_header_cache_url = Url::fromRoute('system_test.page_cache_accept_header');
@@ -160,7 +160,7 @@ class PageCacheTest extends BrowserTestBase {
/**
* Tests support of requests with If-Modified-Since and If-None-Match headers.
*/
- public function testConditionalRequests() {
+ public function testConditionalRequests(): void {
$this->enablePageCaching();
// Fill the cache.
@@ -221,7 +221,7 @@ class PageCacheTest extends BrowserTestBase {
/**
* Tests cache headers.
*/
- public function testPageCache() {
+ public function testPageCache(): void {
$this->enablePageCaching();
// Fill the cache.
@@ -279,7 +279,7 @@ class PageCacheTest extends BrowserTestBase {
* This test verifies that, and it verifies that it does not happen for other
* roles.
*/
- public function testPageCacheAnonymousRolePermissions() {
+ public function testPageCacheAnonymousRolePermissions(): void {
$this->enablePageCaching();
$content_url = Url::fromRoute('system_test.permission_dependent_content');
@@ -329,7 +329,7 @@ class PageCacheTest extends BrowserTestBase {
/**
* Tests the 4xx-response cache tag is added and invalidated.
*/
- public function testPageCacheAnonymous403404() {
+ public function testPageCacheAnonymous403404(): void {
$admin_url = Url::fromRoute('system.admin');
$invalid_url = 'foo/does_not_exist';
$tests = [
@@ -405,7 +405,7 @@ class PageCacheTest extends BrowserTestBase {
/**
* Tests the omit_vary_cookie setting.
*/
- public function testPageCacheWithoutVaryCookie() {
+ public function testPageCacheWithoutVaryCookie(): void {
$this->enablePageCaching();
$settings['settings']['omit_vary_cookie'] = (object) [
@@ -430,7 +430,7 @@ class PageCacheTest extends BrowserTestBase {
/**
* Tests the setting of forms to be immutable.
*/
- public function testFormImmutability() {
+ public function testFormImmutability(): void {
// Install the module that provides the test form.
$this->container->get('module_installer')
->install(['page_cache_form_test']);
@@ -461,7 +461,7 @@ class PageCacheTest extends BrowserTestBase {
* Response object versus returning a Response object that implements the
* CacheableResponseInterface.
*/
- public function testCacheableResponseResponses() {
+ public function testCacheableResponseResponses(): void {
$this->enablePageCaching();
// GET a URL, which would be marked as a cache miss if it were cacheable.
@@ -507,7 +507,7 @@ class PageCacheTest extends BrowserTestBase {
/**
* Tests that HEAD requests are treated the same as GET requests.
*/
- public function testHead() {
+ public function testHead(): void {
/** @var \GuzzleHttp\ClientInterface $client */
$client = $this->getSession()->getDriver()->getClient()->getClient();
@@ -537,7 +537,7 @@ class PageCacheTest extends BrowserTestBase {
/**
* Tests a cacheable response with custom cache control.
*/
- public function testCacheableWithCustomCacheControl() {
+ public function testCacheableWithCustomCacheControl(): void {
$this->enablePageCaching();
$this->drupalGet('/system-test/custom-cache-control');
@@ -566,7 +566,7 @@ class PageCacheTest extends BrowserTestBase {
/**
* Tests that URLs are cached in a not normalized form.
*/
- public function testNoUrlNormalization() {
+ public function testNoUrlNormalization(): void {
// Use absolute URLs to avoid any processing.
$url = Url::fromRoute('<front>')->setAbsolute()->toString();
diff --git a/core/modules/path/tests/src/Functional/PathAdminTest.php b/core/modules/path/tests/src/Functional/PathAdminTest.php
index dc2305fc1b9..119c6703487 100644
--- a/core/modules/path/tests/src/Functional/PathAdminTest.php
+++ b/core/modules/path/tests/src/Functional/PathAdminTest.php
@@ -42,7 +42,7 @@ class PathAdminTest extends PathTestBase {
/**
* Tests the filtering aspect of the Path UI.
*/
- public function testPathFiltering() {
+ public function testPathFiltering(): void {
// Create test nodes.
$node1 = $this->drupalCreateNode();
$node2 = $this->drupalCreateNode();
diff --git a/core/modules/path/tests/src/Functional/PathAliasTest.php b/core/modules/path/tests/src/Functional/PathAliasTest.php
index 393b6ea5dd3..57f2c09a61a 100644
--- a/core/modules/path/tests/src/Functional/PathAliasTest.php
+++ b/core/modules/path/tests/src/Functional/PathAliasTest.php
@@ -55,7 +55,7 @@ class PathAliasTest extends PathTestBase {
/**
* Tests the path cache.
*/
- public function testPathCache() {
+ public function testPathCache(): void {
// Create test node.
$node1 = $this->drupalCreateNode();
@@ -89,7 +89,7 @@ class PathAliasTest extends PathTestBase {
/**
* Tests alias functionality through the admin interfaces.
*/
- public function testAdminAlias() {
+ public function testAdminAlias(): void {
// Create test node.
$node1 = $this->drupalCreateNode();
@@ -258,7 +258,7 @@ class PathAliasTest extends PathTestBase {
/**
* Tests alias functionality through the node interfaces.
*/
- public function testNodeAlias() {
+ public function testNodeAlias(): void {
// Create test node.
$node1 = $this->drupalCreateNode();
@@ -422,7 +422,7 @@ class PathAliasTest extends PathTestBase {
/**
* Tests that duplicate aliases fail validation.
*/
- public function testDuplicateNodeAlias() {
+ public function testDuplicateNodeAlias(): void {
// Create one node with a random alias.
$node_one = $this->drupalCreateNode();
$edit = [];
diff --git a/core/modules/path/tests/src/Functional/PathContentModerationTest.php b/core/modules/path/tests/src/Functional/PathContentModerationTest.php
index 7627592b78f..5c33a44a76d 100644
--- a/core/modules/path/tests/src/Functional/PathContentModerationTest.php
+++ b/core/modules/path/tests/src/Functional/PathContentModerationTest.php
@@ -92,7 +92,7 @@ class PathContentModerationTest extends BrowserTestBase {
/**
* Tests node path aliases on a moderated content type.
*/
- public function testNodePathAlias() {
+ public function testNodePathAlias(): void {
// Create some moderated content with a path alias.
$this->drupalGet('node/add/moderated');
$this->assertSession()->fieldValueEquals('path[0][alias]', '');
@@ -157,7 +157,7 @@ class PathContentModerationTest extends BrowserTestBase {
/**
* Tests that translated and moderated node can get new draft revision.
*/
- public function testTranslatedModeratedNodeAlias() {
+ public function testTranslatedModeratedNodeAlias(): void {
// Create one node with a random alias.
$default_node = $this->drupalCreateNode([
'type' => 'moderated',
diff --git a/core/modules/path/tests/src/Functional/PathLanguageTest.php b/core/modules/path/tests/src/Functional/PathLanguageTest.php
index 259f14b0f2e..eaeb08a834f 100644
--- a/core/modules/path/tests/src/Functional/PathLanguageTest.php
+++ b/core/modules/path/tests/src/Functional/PathLanguageTest.php
@@ -81,7 +81,7 @@ class PathLanguageTest extends PathTestBase {
/**
* Tests alias functionality through the admin interfaces.
*/
- public function testAliasTranslation() {
+ public function testAliasTranslation(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$english_node = $this->drupalCreateNode(['type' => 'page', 'langcode' => 'en']);
$english_alias = $this->randomMachineName();
diff --git a/core/modules/path/tests/src/Functional/PathLanguageUiTest.php b/core/modules/path/tests/src/Functional/PathLanguageUiTest.php
index 9a2d8040aa2..2310a71c401 100644
--- a/core/modules/path/tests/src/Functional/PathLanguageUiTest.php
+++ b/core/modules/path/tests/src/Functional/PathLanguageUiTest.php
@@ -58,7 +58,7 @@ class PathLanguageUiTest extends PathTestBase {
/**
* Tests that a language-neutral URL alias works.
*/
- public function testLanguageNeutralUrl() {
+ public function testLanguageNeutralUrl(): void {
$name = $this->randomMachineName(8);
$edit = [];
$edit['path[0][value]'] = '/admin/config/search/path';
@@ -73,7 +73,7 @@ class PathLanguageUiTest extends PathTestBase {
/**
* Tests that a default language URL alias works.
*/
- public function testDefaultLanguageUrl() {
+ public function testDefaultLanguageUrl(): void {
$name = $this->randomMachineName(8);
$edit = [];
$edit['path[0][value]'] = '/admin/config/search/path';
@@ -89,7 +89,7 @@ class PathLanguageUiTest extends PathTestBase {
/**
* Tests that a non-default language URL alias works.
*/
- public function testNonDefaultUrl() {
+ public function testNonDefaultUrl(): void {
$name = $this->randomMachineName(8);
$edit = [];
$edit['path[0][value]'] = '/admin/config/search/path';
@@ -105,7 +105,7 @@ class PathLanguageUiTest extends PathTestBase {
/**
* Tests language unspecific aliases are shown and saved in the node form.
*/
- public function testNotSpecifiedNode() {
+ public function testNotSpecifiedNode(): void {
// Create test node.
$node = $this->drupalCreateNode();
diff --git a/core/modules/path/tests/src/Functional/PathMediaFormTest.php b/core/modules/path/tests/src/Functional/PathMediaFormTest.php
index f19700c769d..e86ca9c8622 100644
--- a/core/modules/path/tests/src/Functional/PathMediaFormTest.php
+++ b/core/modules/path/tests/src/Functional/PathMediaFormTest.php
@@ -37,7 +37,7 @@ class PathMediaFormTest extends PathTestBase {
/**
* Tests the media form UI.
*/
- public function testMediaForm() {
+ public function testMediaForm(): void {
$assert_session = $this->assertSession();
// Create media type.
diff --git a/core/modules/path/tests/src/Functional/PathNodeFormTest.php b/core/modules/path/tests/src/Functional/PathNodeFormTest.php
index 6436a31daa4..895cf4b8251 100644
--- a/core/modules/path/tests/src/Functional/PathNodeFormTest.php
+++ b/core/modules/path/tests/src/Functional/PathNodeFormTest.php
@@ -40,7 +40,7 @@ class PathNodeFormTest extends PathTestBase {
/**
* Tests the node form ui.
*/
- public function testNodeForm() {
+ public function testNodeForm(): void {
$assert_session = $this->assertSession();
$this->drupalGet('node/add/page');
diff --git a/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php b/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php
index 1b902b37829..3d2a4e22e8f 100644
--- a/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php
+++ b/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php
@@ -50,7 +50,7 @@ class PathTaxonomyTermTest extends PathTestBase {
/**
* Tests alias functionality through the admin interfaces.
*/
- public function testTermAlias() {
+ public function testTermAlias(): void {
// Create a term in the default 'Tags' vocabulary with URL alias.
$vocabulary = Vocabulary::load('tags');
$description = $this->randomMachineName();
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 142558d1543..eefb3839b91 100644
--- a/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php
+++ b/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php
@@ -70,7 +70,7 @@ class MigrateUrlAliasTest extends MigrateDrupal6TestBase {
/**
* Tests the URL alias migration.
*/
- public function testUrlAlias() {
+ public function testUrlAlias(): void {
$this->executeMigrations([
'd6_node',
'd6_node_translation',
@@ -82,7 +82,7 @@ class MigrateUrlAliasTest extends MigrateDrupal6TestBase {
/**
* Tests the URL alias migration using the node complete migration.
*/
- public function testNodeCompleteUrlAlias() {
+ public function testNodeCompleteUrlAlias(): void {
$this->executeMigrations([
'd6_node_complete',
'd6_url_alias',
diff --git a/core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTest.php b/core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTest.php
index a176bad099c..9db686ad176 100644
--- a/core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTest.php
+++ b/core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTest.php
@@ -33,7 +33,7 @@ class MigrateUrlAliasTest extends MigrateUrlAliasTestBase {
/**
* Tests the URL alias migration with translated nodes.
*/
- public function testUrlAliasWithTranslatedNodes() {
+ public function testUrlAliasWithTranslatedNodes(): void {
// Alias for the 'The thing about Deep Space 9' node in English.
$path_alias = $this->loadPathAliasByConditions(['alias' => '/deep-space-9']);
$this->assertSame('/node/2', $path_alias->getPath());
diff --git a/core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTestBase.php b/core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTestBase.php
index 521aaaacd97..dd7e7716d7d 100644
--- a/core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTestBase.php
+++ b/core/modules/path/tests/src/Kernel/Migrate/d7/MigrateUrlAliasTestBase.php
@@ -50,7 +50,7 @@ abstract class MigrateUrlAliasTestBase extends MigrateDrupal7TestBase {
/**
* Tests the URL alias migration.
*/
- public function testUrlAlias() {
+ public function testUrlAlias(): void {
$path_alias = $this->loadPathAliasByConditions([
'path' => '/taxonomy/term/4',
'alias' => '/term33',
diff --git a/core/modules/path/tests/src/Kernel/PathItemTest.php b/core/modules/path/tests/src/Kernel/PathItemTest.php
index ee96c56772c..97648aabaef 100644
--- a/core/modules/path/tests/src/Kernel/PathItemTest.php
+++ b/core/modules/path/tests/src/Kernel/PathItemTest.php
@@ -57,7 +57,7 @@ class PathItemTest extends KernelTestBase {
/**
* Tests creating, loading, updating and deleting aliases through PathItem.
*/
- public function testPathItem() {
+ public function testPathItem(): void {
/** @var \Drupal\path_alias\AliasRepositoryInterface $alias_repository */
$alias_repository = \Drupal::service('path_alias.repository');
diff --git a/core/modules/path/tests/src/Kernel/PathNoCanonicalLinkTest.php b/core/modules/path/tests/src/Kernel/PathNoCanonicalLinkTest.php
index cfb78e9a9e4..e2fd58c8ca3 100644
--- a/core/modules/path/tests/src/Kernel/PathNoCanonicalLinkTest.php
+++ b/core/modules/path/tests/src/Kernel/PathNoCanonicalLinkTest.php
@@ -50,7 +50,7 @@ class PathNoCanonicalLinkTest extends KernelTestBase {
/**
* Tests for no canonical link templates.
*/
- public function testNoCanonicalLinkTemplate() {
+ public function testNoCanonicalLinkTemplate(): void {
$entity_type = EntityTestTranslatableUISkip::create([
'name' => 'name english',
'language' => 'en',
diff --git a/core/modules/path/tests/src/Unit/Field/PathFieldDefinitionTest.php b/core/modules/path/tests/src/Unit/Field/PathFieldDefinitionTest.php
index 6858ef56965..9b4c3f61d2c 100644
--- a/core/modules/path/tests/src/Unit/Field/PathFieldDefinitionTest.php
+++ b/core/modules/path/tests/src/Unit/Field/PathFieldDefinitionTest.php
@@ -30,7 +30,7 @@ class PathFieldDefinitionTest extends BaseFieldDefinitionTestBase {
* @covers ::getColumns
* @covers ::getSchema
*/
- public function testGetColumns() {
+ public function testGetColumns(): void {
$this->assertSame([], $this->definition->getColumns());
}
diff --git a/core/modules/path/tests/src/Unit/migrate/process/PathSetTranslatedTest.php b/core/modules/path/tests/src/Unit/migrate/process/PathSetTranslatedTest.php
index 03ece19d9d8..bb95375d972 100644
--- a/core/modules/path/tests/src/Unit/migrate/process/PathSetTranslatedTest.php
+++ b/core/modules/path/tests/src/Unit/migrate/process/PathSetTranslatedTest.php
@@ -29,7 +29,7 @@ class PathSetTranslatedTest extends MigrateProcessTestCase {
*
* @dataProvider transformDataProvider
*/
- public function testTransform($path, $node_translation, $expected_result) {
+ public function testTransform($path, $node_translation, $expected_result): void {
$plugin = new PathSetTranslated([], 'path_set_translated', []);
$this->assertSame($expected_result, $plugin->transform([$path, $node_translation], $this->migrateExecutable, $this->row, 'destination_property'));
}
diff --git a/core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php b/core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php
index d929616598e..87db7e56e63 100644
--- a/core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php
+++ b/core/modules/path_alias/tests/src/Functional/UrlAlterFunctionalTest.php
@@ -33,7 +33,7 @@ class UrlAlterFunctionalTest extends BrowserTestBase {
/**
* Tests that URL altering works and that it occurs in the correct order.
*/
- public function testUrlAlter() {
+ public function testUrlAlter(): void {
// Ensure that the path_alias table exists after Drupal installation.
$this->assertTrue(Database::getConnection()->schema()->tableExists('path_alias'), 'The path_alias table exists after Drupal installation.');
diff --git a/core/modules/path_alias/tests/src/Kernel/AliasTest.php b/core/modules/path_alias/tests/src/Kernel/AliasTest.php
index 92f1aee1d9f..4cf3e2536cd 100644
--- a/core/modules/path_alias/tests/src/Kernel/AliasTest.php
+++ b/core/modules/path_alias/tests/src/Kernel/AliasTest.php
@@ -44,7 +44,7 @@ class AliasTest extends KernelTestBase {
/**
* @covers ::preloadPathAlias
*/
- public function testPreloadPathAlias() {
+ public function testPreloadPathAlias(): void {
$path_alias_repository = $this->container->get('path_alias.repository');
// Every interesting language combination:
@@ -288,7 +288,7 @@ class AliasTest extends KernelTestBase {
/**
* @covers ::lookupBySystemPath
*/
- public function testLookupBySystemPath() {
+ public function testLookupBySystemPath(): void {
$this->createPathAlias('/test-source-Case', '/test-alias');
$path_alias_repository = $this->container->get('path_alias.repository');
@@ -299,7 +299,7 @@ class AliasTest extends KernelTestBase {
/**
* @covers ::lookupByAlias
*/
- public function testLookupByAlias() {
+ public function testLookupByAlias(): void {
$this->createPathAlias('/test-source', '/test-alias-Case');
$path_alias_repository = $this->container->get('path_alias.repository');
@@ -311,7 +311,7 @@ class AliasTest extends KernelTestBase {
* @covers \Drupal\path_alias\AliasManager::getPathByAlias
* @covers \Drupal\path_alias\AliasManager::getAliasByPath
*/
- public function testLookupPath() {
+ public function testLookupPath(): void {
// Create AliasManager and Path object.
$aliasManager = $this->container->get('path_alias.manager');
@@ -360,7 +360,7 @@ class AliasTest extends KernelTestBase {
/**
* Tests the alias whitelist.
*/
- public function testWhitelist() {
+ public function testWhitelist(): void {
$memoryCounterBackend = new MemoryCounterBackend(\Drupal::service(TimeInterface::class));
// Create AliasManager and Path object.
@@ -421,7 +421,7 @@ class AliasTest extends KernelTestBase {
/**
* Tests situation where the whitelist cache is deleted mid-request.
*/
- public function testWhitelistCacheDeletionMidRequest() {
+ public function testWhitelistCacheDeletionMidRequest(): void {
$memoryCounterBackend = new MemoryCounterBackend(\Drupal::service(TimeInterface::class));
// Create AliasManager and Path object.
diff --git a/core/modules/path_alias/tests/src/Kernel/PathHooksTest.php b/core/modules/path_alias/tests/src/Kernel/PathHooksTest.php
index c5cfee3814e..377c6c86e20 100644
--- a/core/modules/path_alias/tests/src/Kernel/PathHooksTest.php
+++ b/core/modules/path_alias/tests/src/Kernel/PathHooksTest.php
@@ -36,7 +36,7 @@ class PathHooksTest extends KernelTestBase {
* @covers ::postSave
* @covers ::postDelete
*/
- public function testPathHooks() {
+ public function testPathHooks(): void {
$path_alias = PathAlias::create([
'path' => '/' . $this->randomMachineName(),
'alias' => '/' . $this->randomMachineName(),
diff --git a/core/modules/path_alias/tests/src/Unit/AliasManagerTest.php b/core/modules/path_alias/tests/src/Unit/AliasManagerTest.php
index fd9234cf551..f5e1be108d3 100644
--- a/core/modules/path_alias/tests/src/Unit/AliasManagerTest.php
+++ b/core/modules/path_alias/tests/src/Unit/AliasManagerTest.php
@@ -86,7 +86,7 @@ class AliasManagerTest extends UnitTestCase {
*
* @covers ::getPathByAlias
*/
- public function testGetPathByAliasNoMatch() {
+ public function testGetPathByAliasNoMatch(): void {
$alias = '/' . $this->randomMachineName();
$language = new Language(['id' => 'en']);
@@ -111,7 +111,7 @@ class AliasManagerTest extends UnitTestCase {
*
* @covers ::getPathByAlias
*/
- public function testGetPathByAliasMatch() {
+ public function testGetPathByAliasMatch(): void {
$alias = $this->randomMachineName();
$path = $this->randomMachineName();
@@ -132,7 +132,7 @@ class AliasManagerTest extends UnitTestCase {
*
* @covers ::getPathByAlias
*/
- public function testGetPathByAliasLangcode() {
+ public function testGetPathByAliasLangcode(): void {
$alias = $this->randomMachineName();
$path = $this->randomMachineName();
@@ -154,7 +154,7 @@ class AliasManagerTest extends UnitTestCase {
*
* @covers ::getAliasByPath
*/
- public function testGetAliasByPathWhitelist() {
+ public function testGetAliasByPathWhitelist(): void {
$path_part1 = $this->randomMachineName();
$path_part2 = $this->randomMachineName();
$path = '/' . $path_part1 . '/' . $path_part2;
@@ -179,7 +179,7 @@ class AliasManagerTest extends UnitTestCase {
*
* @covers ::getAliasByPath
*/
- public function testGetAliasByPathNoMatch() {
+ public function testGetAliasByPathNoMatch(): void {
$path_part1 = $this->randomMachineName();
$path_part2 = $this->randomMachineName();
$path = '/' . $path_part1 . '/' . $path_part2;
@@ -226,7 +226,7 @@ class AliasManagerTest extends UnitTestCase {
* @covers ::getAliasByPath
* @covers ::writeCache
*/
- public function testGetAliasByPathMatch() {
+ public function testGetAliasByPathMatch(): void {
$path_part1 = $this->randomMachineName();
$path_part2 = $this->randomMachineName();
$path = '/' . $path_part1 . '/' . $path_part2;
@@ -264,7 +264,7 @@ class AliasManagerTest extends UnitTestCase {
* @covers ::getAliasByPath
* @covers ::writeCache
*/
- public function testGetAliasByPathCachedMatch() {
+ public function testGetAliasByPathCachedMatch(): void {
$path_part1 = $this->randomMachineName();
$path_part2 = $this->randomMachineName();
$path = '/' . $path_part1 . '/' . $path_part2;
@@ -318,7 +318,7 @@ class AliasManagerTest extends UnitTestCase {
* @covers ::getAliasByPath
* @covers ::writeCache
*/
- public function testGetAliasByPathCachedMissLanguage() {
+ public function testGetAliasByPathCachedMissLanguage(): void {
$path_part1 = $this->randomMachineName();
$path_part2 = $this->randomMachineName();
$path = '/' . $path_part1 . '/' . $path_part2;
@@ -367,7 +367,7 @@ class AliasManagerTest extends UnitTestCase {
* @covers ::getAliasByPath
* @covers ::writeCache
*/
- public function testGetAliasByPathCachedMissNoAlias() {
+ public function testGetAliasByPathCachedMissNoAlias(): void {
$path_part1 = $this->randomMachineName();
$path_part2 = $this->randomMachineName();
$path = '/' . $path_part1 . '/' . $path_part2;
@@ -415,7 +415,7 @@ class AliasManagerTest extends UnitTestCase {
* @covers ::getAliasByPath
* @covers ::writeCache
*/
- public function testGetAliasByPathUncachedMissNoAlias() {
+ public function testGetAliasByPathUncachedMissNoAlias(): void {
$path_part1 = $this->randomMachineName();
$path_part2 = $this->randomMachineName();
$path = '/' . $path_part1 . '/' . $path_part2;
@@ -462,7 +462,7 @@ class AliasManagerTest extends UnitTestCase {
/**
* @covers ::cacheClear
*/
- public function testCacheClear() {
+ public function testCacheClear(): void {
$path = '/path';
$alias = '/alias';
$language = $this->setUpCurrentLanguage();
@@ -499,7 +499,7 @@ class AliasManagerTest extends UnitTestCase {
* @covers ::getAliasByPath
* @covers ::writeCache
*/
- public function testGetAliasByPathUncachedMissWithAlias() {
+ public function testGetAliasByPathUncachedMissWithAlias(): void {
$path_part1 = $this->randomMachineName();
$path_part2 = $this->randomMachineName();
$path = '/' . $path_part1 . '/' . $path_part2;
diff --git a/core/modules/path_alias/tests/src/Unit/PathProcessor/AliasPathProcessorTest.php b/core/modules/path_alias/tests/src/Unit/PathProcessor/AliasPathProcessorTest.php
index 12ab0711dc5..b3a0ea3971c 100644
--- a/core/modules/path_alias/tests/src/Unit/PathProcessor/AliasPathProcessorTest.php
+++ b/core/modules/path_alias/tests/src/Unit/PathProcessor/AliasPathProcessorTest.php
@@ -46,7 +46,7 @@ class AliasPathProcessorTest extends UnitTestCase {
*
* @see \Drupal\path_alias\PathProcessor\AliasPathProcessor::processInbound
*/
- public function testProcessInbound() {
+ public function testProcessInbound(): void {
$this->aliasManager->expects($this->exactly(2))
->method('getPathByAlias')
->willReturnMap([
@@ -65,7 +65,7 @@ class AliasPathProcessorTest extends UnitTestCase {
*
* @dataProvider providerTestProcessOutbound
*/
- public function testProcessOutbound($path, array $options, $expected_path) {
+ public function testProcessOutbound($path, array $options, $expected_path): void {
$this->aliasManager->expects($this->any())
->method('getAliasByPath')
->willReturnMap([
diff --git a/core/modules/pgsql/tests/src/Kernel/pgsql/DatabaseExceptionWrapperTest.php b/core/modules/pgsql/tests/src/Kernel/pgsql/DatabaseExceptionWrapperTest.php
index c2749b75e30..e0e623927bf 100644
--- a/core/modules/pgsql/tests/src/Kernel/pgsql/DatabaseExceptionWrapperTest.php
+++ b/core/modules/pgsql/tests/src/Kernel/pgsql/DatabaseExceptionWrapperTest.php
@@ -16,7 +16,7 @@ class DatabaseExceptionWrapperTest extends DriverSpecificKernelTestBase {
/**
* Tests Connection::prepareStatement exception on execution.
*/
- public function testPrepareStatementFailOnExecution() {
+ public function testPrepareStatementFailOnExecution(): void {
$this->expectException(\PDOException::class);
$stmt = $this->connection->prepareStatement('bananas', []);
$stmt->execute();
diff --git a/core/modules/pgsql/tests/src/Kernel/pgsql/KernelTestBaseTest.php b/core/modules/pgsql/tests/src/Kernel/pgsql/KernelTestBaseTest.php
index 0530fe20015..41b00c9296b 100644
--- a/core/modules/pgsql/tests/src/Kernel/pgsql/KernelTestBaseTest.php
+++ b/core/modules/pgsql/tests/src/Kernel/pgsql/KernelTestBaseTest.php
@@ -17,7 +17,7 @@ class KernelTestBaseTest extends DriverSpecificKernelTestBase {
/**
* @covers ::setUp
*/
- public function testSetUp() {
+ public function testSetUp(): void {
// Ensure that the database tasks have been run during set up.
$this->assertSame('on', $this->connection->query("SHOW standard_conforming_strings")->fetchField());
$this->assertSame('escape', $this->connection->query("SHOW bytea_output")->fetchField());
diff --git a/core/modules/pgsql/tests/src/Kernel/pgsql/SchemaTest.php b/core/modules/pgsql/tests/src/Kernel/pgsql/SchemaTest.php
index 0b4cf94a0d4..9b4ad1f5f0e 100644
--- a/core/modules/pgsql/tests/src/Kernel/pgsql/SchemaTest.php
+++ b/core/modules/pgsql/tests/src/Kernel/pgsql/SchemaTest.php
@@ -312,7 +312,7 @@ class SchemaTest extends DriverSpecificSchemaTestBase {
/**
* Tests the method tableExists().
*/
- public function testTableExists() {
+ public function testTableExists(): void {
$table_name = 'test_table';
$table_specification = [
'fields' => [
@@ -341,7 +341,7 @@ class SchemaTest extends DriverSpecificSchemaTestBase {
/**
* Tests renaming a table where the new index name is equal to the table name.
*/
- public function testRenameTableWithNewIndexNameEqualsTableName() {
+ public function testRenameTableWithNewIndexNameEqualsTableName(): void {
// Special table names for colliding with the PostgreSQL new index name.
$table_name_old = 'some_new_table_name__id__idx';
$table_name_new = 'some_new_table_name';
diff --git a/core/modules/pgsql/tests/src/Kernel/pgsql/TemporaryQueryTest.php b/core/modules/pgsql/tests/src/Kernel/pgsql/TemporaryQueryTest.php
index a352360f5d5..e3c48441e14 100644
--- a/core/modules/pgsql/tests/src/Kernel/pgsql/TemporaryQueryTest.php
+++ b/core/modules/pgsql/tests/src/Kernel/pgsql/TemporaryQueryTest.php
@@ -16,7 +16,7 @@ class TemporaryQueryTest extends TemporaryQueryTestBase {
/**
* Confirms that temporary tables work.
*/
- public function testTemporaryQuery() {
+ public function testTemporaryQuery(): void {
parent::testTemporaryQuery();
$connection = $this->getConnection();
diff --git a/core/modules/pgsql/tests/src/Unit/SchemaTest.php b/core/modules/pgsql/tests/src/Unit/SchemaTest.php
index 1514d1a14ad..9880bdbb4fb 100644
--- a/core/modules/pgsql/tests/src/Unit/SchemaTest.php
+++ b/core/modules/pgsql/tests/src/Unit/SchemaTest.php
@@ -27,7 +27,7 @@ class SchemaTest extends UnitTestCase {
* @covers ::constraintExists
* @dataProvider providerComputedConstraintName
*/
- public function testComputedConstraintName($table_name, $name, $expected) {
+ public function testComputedConstraintName($table_name, $name, $expected): void {
$max_identifier_length = 63;
$connection = $this->prophesize('\Drupal\pgsql\Driver\Database\pgsql\Connection');
diff --git a/core/modules/phpass/tests/src/Unit/PasswordVerifyTest.php b/core/modules/phpass/tests/src/Unit/PasswordVerifyTest.php
index 3bb25198750..dd897c00a0f 100644
--- a/core/modules/phpass/tests/src/Unit/PasswordVerifyTest.php
+++ b/core/modules/phpass/tests/src/Unit/PasswordVerifyTest.php
@@ -22,7 +22,7 @@ class PasswordVerifyTest extends UnitTestCase {
*
* @covers ::hash
*/
- public function testPasswordHash() {
+ public function testPasswordHash(): void {
$samplePassword = $this->randomMachineName();
$sampleHash = $this->randomMachineName();
@@ -40,7 +40,7 @@ class PasswordVerifyTest extends UnitTestCase {
*
* @covers ::needsRehash
*/
- public function testPasswordNeedsRehash() {
+ public function testPasswordNeedsRehash(): void {
$sampleHash = $this->randomMachineName();
$corePassword = $this->prophesize(PasswordInterface::class);
@@ -56,7 +56,7 @@ class PasswordVerifyTest extends UnitTestCase {
*
* @covers ::check
*/
- public function testPasswordCheckUnknownHash() {
+ public function testPasswordCheckUnknownHash(): void {
$samplePassword = $this->randomMachineName();
$sampleHash = $this->randomMachineName();
@@ -77,7 +77,7 @@ class PasswordVerifyTest extends UnitTestCase {
* @covers ::enforceLog2Boundaries
* @covers ::base64Encode
*/
- public function testPasswordCheckSupported() {
+ public function testPasswordCheckSupported(): void {
$validPassword = 'valid password';
// cspell:disable
@@ -108,7 +108,7 @@ class PasswordVerifyTest extends UnitTestCase {
*
* @covers ::enforceLog2Boundaries
*/
- public function testWithinBounds() {
+ public function testWithinBounds(): void {
$hasher = new PhpassHashedPasswordLog2BoundariesDouble();
$this->assertEquals(PhpassHashedPassword::MIN_HASH_COUNT, $hasher->enforceLog2Boundaries(1), "Min hash count enforced");
$this->assertEquals(PhpassHashedPassword::MAX_HASH_COUNT, $hasher->enforceLog2Boundaries(100), "Max hash count enforced");
@@ -121,7 +121,7 @@ class PasswordVerifyTest extends UnitTestCase {
*
* @dataProvider providerLongPasswords
*/
- public function testLongPassword($password, $allowed) {
+ public function testLongPassword($password, $allowed): void {
// cspell:disable
$bogusHash = '$S$5TOxWPdvJRs0P/xZBdrrPlGgzViOS0drHu3jaIjitesfttrp18bk';
// cspell:enable
diff --git a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php
index 760279f9a49..4cf107e6777 100644
--- a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php
+++ b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php
@@ -43,7 +43,7 @@ class ResponsiveImageAdminUITest extends BrowserTestBase {
/**
* Tests responsive image administration functionality.
*/
- public function testResponsiveImageAdmin() {
+ public function testResponsiveImageAdmin(): void {
// We start without any default styles.
$this->drupalGet('admin/config/media/responsive-image-style');
$this->assertSession()->pageTextContains('There are no responsive image styles yet.');
diff --git a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php
index 5347a1f34a4..3f2c1a2b83d 100644
--- a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php
+++ b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php
@@ -90,7 +90,7 @@ class ResponsiveImageFieldDisplayTest extends ImageFieldTestBase {
/**
* Tests responsive image formatters on node display for public files.
*/
- public function testResponsiveImageFieldFormattersPublic() {
+ public function testResponsiveImageFieldFormattersPublic(): void {
$this->addTestImageStyleMappings();
$this->doTestResponsiveImageFieldFormatters('public');
}
@@ -98,7 +98,7 @@ class ResponsiveImageFieldDisplayTest extends ImageFieldTestBase {
/**
* Tests responsive image formatters on node display for private files.
*/
- public function testResponsiveImageFieldFormattersPrivate() {
+ public function testResponsiveImageFieldFormattersPrivate(): void {
$this->addTestImageStyleMappings();
// Remove access content permission from anonymous users.
user_role_change_permissions(RoleInterface::ANONYMOUS_ID, ['access content' => FALSE]);
@@ -108,7 +108,7 @@ class ResponsiveImageFieldDisplayTest extends ImageFieldTestBase {
/**
* Tests responsive image formatters when image style is empty.
*/
- public function testResponsiveImageFieldFormattersEmptyStyle() {
+ public function testResponsiveImageFieldFormattersEmptyStyle(): void {
$this->addTestImageStyleMappings(TRUE);
$this->doTestResponsiveImageFieldFormatters('public', TRUE);
}
@@ -358,7 +358,7 @@ class ResponsiveImageFieldDisplayTest extends ImageFieldTestBase {
/**
* Tests responsive image formatters on node display linked to the file.
*/
- public function testResponsiveImageFieldFormattersLinkToFile() {
+ public function testResponsiveImageFieldFormattersLinkToFile(): void {
$this->addTestImageStyleMappings();
$this->assertResponsiveImageFieldFormattersLink('file');
}
@@ -366,7 +366,7 @@ class ResponsiveImageFieldDisplayTest extends ImageFieldTestBase {
/**
* Tests responsive image formatters on node display linked to the node.
*/
- public function testResponsiveImageFieldFormattersLinkToNode() {
+ public function testResponsiveImageFieldFormattersLinkToNode(): void {
$this->addTestImageStyleMappings();
$this->assertResponsiveImageFieldFormattersLink('content');
}
@@ -374,7 +374,7 @@ class ResponsiveImageFieldDisplayTest extends ImageFieldTestBase {
/**
* Tests responsive image formatter on node display with an empty media query.
*/
- public function testResponsiveImageFieldFormattersEmptyMediaQuery() {
+ public function testResponsiveImageFieldFormattersEmptyMediaQuery(): void {
$this->responsiveImgStyle
// Test the output of an empty media query.
->addImageStyleMapping('responsive_image_test_module.empty', '1x', [
@@ -424,7 +424,7 @@ class ResponsiveImageFieldDisplayTest extends ImageFieldTestBase {
/**
* Tests responsive image formatter on node display with one and two sources.
*/
- public function testResponsiveImageFieldFormattersMultipleSources() {
+ public function testResponsiveImageFieldFormattersMultipleSources(): void {
// Setup known image style sizes so the test can assert on known sizes.
$large_style = ImageStyle::load('large');
assert($large_style instanceof ImageStyleInterface);
diff --git a/core/modules/responsive_image/tests/src/Functional/ViewsIntegrationTest.php b/core/modules/responsive_image/tests/src/Functional/ViewsIntegrationTest.php
index 71c3f192149..0fc468107c7 100644
--- a/core/modules/responsive_image/tests/src/Functional/ViewsIntegrationTest.php
+++ b/core/modules/responsive_image/tests/src/Functional/ViewsIntegrationTest.php
@@ -95,7 +95,7 @@ class ViewsIntegrationTest extends ViewTestBase {
/**
* Tests integration with Views.
*/
- public function testViewsAddResponsiveImageField() {
+ public function testViewsAddResponsiveImageField(): void {
// Add the image field to the View.
$this->drupalGet('admin/structure/views/nojs/add-handler/entity_test_row/default/field');
$this->drupalGet('admin/structure/views/nojs/add-handler/entity_test_row/default/field');
diff --git a/core/modules/responsive_image/tests/src/FunctionalJavascript/ResponsiveImageFieldUiTest.php b/core/modules/responsive_image/tests/src/FunctionalJavascript/ResponsiveImageFieldUiTest.php
index 23d6ffe908f..6fe0829c473 100644
--- a/core/modules/responsive_image/tests/src/FunctionalJavascript/ResponsiveImageFieldUiTest.php
+++ b/core/modules/responsive_image/tests/src/FunctionalJavascript/ResponsiveImageFieldUiTest.php
@@ -72,7 +72,7 @@ class ResponsiveImageFieldUiTest extends WebDriverTestBase {
/**
* Tests formatter settings.
*/
- public function testResponsiveImageFormatterUi() {
+ public function testResponsiveImageFormatterUi(): void {
$manage = 'admin/structure/types/manage/' . $this->type;
$manage_display = $manage . '/display';
/** @var \Drupal\FunctionalJavascriptTests\JSWebAssert $assert_session */
diff --git a/core/modules/responsive_image/tests/src/Kernel/Migrate/d7/MigrateResponsiveImageStylesTest.php b/core/modules/responsive_image/tests/src/Kernel/Migrate/d7/MigrateResponsiveImageStylesTest.php
index 488a94b370d..77bec068f7f 100644
--- a/core/modules/responsive_image/tests/src/Kernel/Migrate/d7/MigrateResponsiveImageStylesTest.php
+++ b/core/modules/responsive_image/tests/src/Kernel/Migrate/d7/MigrateResponsiveImageStylesTest.php
@@ -35,7 +35,7 @@ class MigrateResponsiveImageStylesTest extends MigrateDrupal7TestBase {
/**
* Tests the Drupal 7 to Drupal 8 responsive image styles migration.
*/
- public function testResponsiveImageStyles() {
+ public function testResponsiveImageStyles(): void {
$expected_image_style_mappings = [
[
'image_mapping_type' => 'image_style',
diff --git a/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php b/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php
index 850add91e6c..fd453f79b00 100644
--- a/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php
+++ b/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php
@@ -42,7 +42,7 @@ class ResponsiveImageIntegrationTest extends KernelTestBase {
/**
* Tests integration with entity view display.
*/
- public function testEntityViewDisplayDependency() {
+ public function testEntityViewDisplayDependency(): void {
// Create a responsive image style.
ResponsiveImageStyle::create([
'id' => 'foo',
diff --git a/core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php b/core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php
index 5eaea98aacc..86537ed3f58 100644
--- a/core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php
+++ b/core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php
@@ -65,7 +65,7 @@ class ResponsiveImageStyleConfigEntityUnitTest extends UnitTestCase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependencies() {
+ public function testCalculateDependencies(): void {
// Set up image style loading mock.
$styles = [];
foreach (['fallback', 'small', 'medium', 'large'] as $style) {
@@ -124,7 +124,7 @@ class ResponsiveImageStyleConfigEntityUnitTest extends UnitTestCase {
* @covers ::addImageStyleMapping
* @covers ::hasImageStyleMappings
*/
- public function testHasImageStyleMappings() {
+ public function testHasImageStyleMappings(): void {
$entity = new ResponsiveImageStyle([]);
$this->assertFalse($entity->hasImageStyleMappings());
$entity->addImageStyleMapping('test_breakpoint', '1x', [
@@ -175,7 +175,7 @@ class ResponsiveImageStyleConfigEntityUnitTest extends UnitTestCase {
* @covers ::addImageStyleMapping
* @covers ::getImageStyleMapping
*/
- public function testGetImageStyleMapping() {
+ public function testGetImageStyleMapping(): void {
$entity = new ResponsiveImageStyle(['']);
$entity->addImageStyleMapping('test_breakpoint', '1x', [
'image_mapping_type' => 'image_style',
@@ -195,7 +195,7 @@ class ResponsiveImageStyleConfigEntityUnitTest extends UnitTestCase {
* @covers ::addImageStyleMapping
* @covers ::getKeyedImageStyleMappings
*/
- public function testGetKeyedImageStyleMappings() {
+ public function testGetKeyedImageStyleMappings(): void {
$entity = new ResponsiveImageStyle(['']);
$entity->addImageStyleMapping('test_breakpoint', '1x', [
'image_mapping_type' => 'image_style',
@@ -287,7 +287,7 @@ class ResponsiveImageStyleConfigEntityUnitTest extends UnitTestCase {
* @covers ::addImageStyleMapping
* @covers ::getImageStyleMappings
*/
- public function testGetImageStyleMappings() {
+ public function testGetImageStyleMappings(): void {
$entity = new ResponsiveImageStyle(['']);
$entity->addImageStyleMapping('test_breakpoint', '1x', [
'image_mapping_type' => 'image_style',
@@ -339,7 +339,7 @@ class ResponsiveImageStyleConfigEntityUnitTest extends UnitTestCase {
* @covers ::addImageStyleMapping
* @covers ::removeImageStyleMappings
*/
- public function testRemoveImageStyleMappings() {
+ public function testRemoveImageStyleMappings(): void {
$entity = new ResponsiveImageStyle(['']);
$entity->addImageStyleMapping('test_breakpoint', '1x', [
'image_mapping_type' => 'image_style',
@@ -370,7 +370,7 @@ class ResponsiveImageStyleConfigEntityUnitTest extends UnitTestCase {
* @covers ::setBreakpointGroup
* @covers ::getBreakpointGroup
*/
- public function testSetBreakpointGroup() {
+ public function testSetBreakpointGroup(): void {
$entity = new ResponsiveImageStyle(['breakpoint_group' => 'test_group']);
$entity->addImageStyleMapping('test_breakpoint', '1x', [
'image_mapping_type' => 'image_style',
diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
index cf8c3f38ee4..9ef8b61a453 100644
--- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
+++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
@@ -408,7 +408,7 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
/**
* Tests a GET request for an entity, plus edge cases to ensure good DX.
*/
- public function testGet() {
+ public function testGet(): void {
$this->initAuthentication();
$has_canonical_url = $this->entity->hasLinkTemplate('canonical');
@@ -696,7 +696,7 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
/**
* Tests a POST request for an entity, plus edge cases to ensure good DX.
*/
- public function testPost() {
+ public function testPost(): void {
// @todo Remove this in https://www.drupal.org/node/2300677.
if ($this->entity instanceof ConfigEntityInterface) {
$this->markTestSkipped('POSTing config entities is not yet supported.');
@@ -870,7 +870,7 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
/**
* Tests a PATCH request for an entity, plus edge cases to ensure good DX.
*/
- public function testPatch() {
+ public function testPatch(): void {
// @todo Remove this in https://www.drupal.org/node/2300677.
if ($this->entity instanceof ConfigEntityInterface) {
$this->markTestSkipped('PATCHing config entities is not yet supported.');
@@ -1108,7 +1108,7 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
/**
* Tests a DELETE request for an entity, plus edge cases to ensure good DX.
*/
- public function testDelete() {
+ public function testDelete(): void {
// @todo Remove this in https://www.drupal.org/node/2300677.
if ($this->entity instanceof ConfigEntityInterface) {
$this->markTestSkipped('DELETEing config entities is not yet supported.');
diff --git a/core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeXmlAnonTest.php b/core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeXmlAnonTest.php
index 7c13ad60aa0..71a2db986d9 100644
--- a/core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeXmlAnonTest.php
+++ b/core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeXmlAnonTest.php
@@ -33,7 +33,7 @@ class ModeratedNodeXmlAnonTest extends ModeratedNodeResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeXmlBasicAuthTest.php b/core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeXmlBasicAuthTest.php
index 90700a076d1..823bf23ad17 100644
--- a/core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeXmlBasicAuthTest.php
+++ b/core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeXmlBasicAuthTest.php
@@ -43,7 +43,7 @@ class ModeratedNodeXmlBasicAuthTest extends ModeratedNodeResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeXmlCookieTest.php b/core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeXmlCookieTest.php
index 821fe065b78..b8f0db39ac0 100644
--- a/core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeXmlCookieTest.php
+++ b/core/modules/rest/tests/src/Functional/EntityResource/ModeratedNode/ModeratedNodeXmlCookieTest.php
@@ -38,7 +38,7 @@ class ModeratedNodeXmlCookieTest extends ModeratedNodeResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/rest/tests/src/Functional/EntityResource/XmlEntityNormalizationQuirksTrait.php b/core/modules/rest/tests/src/Functional/EntityResource/XmlEntityNormalizationQuirksTrait.php
index 5769d7a5e74..9698e5d1c1e 100644
--- a/core/modules/rest/tests/src/Functional/EntityResource/XmlEntityNormalizationQuirksTrait.php
+++ b/core/modules/rest/tests/src/Functional/EntityResource/XmlEntityNormalizationQuirksTrait.php
@@ -151,7 +151,7 @@ trait XmlEntityNormalizationQuirksTrait {
/**
* {@inheritdoc}
*/
- public function testPost() {
+ public function testPost(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
@@ -159,7 +159,7 @@ trait XmlEntityNormalizationQuirksTrait {
/**
* {@inheritdoc}
*/
- public function testPatch() {
+ public function testPatch(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php b/core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php
index 965ef778a51..1dfe440577c 100644
--- a/core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php
+++ b/core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php
@@ -166,7 +166,7 @@ abstract class FileUploadResourceTestBase extends ResourceTestBase {
/**
* Tests using the file upload POST route.
*/
- public function testPostFileUpload() {
+ public function testPostFileUpload(): void {
$this->initAuthentication();
$this->provisionResource([static::$format], static::$auth ? [static::$auth] : [], ['POST']);
@@ -257,7 +257,7 @@ abstract class FileUploadResourceTestBase extends ResourceTestBase {
/**
* Tests using the file upload POST route with invalid headers.
*/
- public function testPostFileUploadInvalidHeaders() {
+ public function testPostFileUploadInvalidHeaders(): void {
$this->initAuthentication();
$this->provisionResource([static::$format], static::$auth ? [static::$auth] : [], ['POST']);
@@ -299,7 +299,7 @@ abstract class FileUploadResourceTestBase extends ResourceTestBase {
*
* A new file should be created with a suffixed name.
*/
- public function testPostFileUploadDuplicateFile() {
+ public function testPostFileUploadDuplicateFile(): void {
$this->initAuthentication();
$this->provisionResource([static::$format], static::$auth ? [static::$auth] : [], ['POST']);
@@ -332,7 +332,7 @@ abstract class FileUploadResourceTestBase extends ResourceTestBase {
*
* A validation error should occur when the filenames are not unique.
*/
- public function testPostFileUploadDuplicateFileRaceCondition() {
+ public function testPostFileUploadDuplicateFileRaceCondition(): void {
$this->initAuthentication();
$this->provisionResource([static::$format], static::$auth ? [static::$auth] : [], ['POST']);
@@ -363,7 +363,7 @@ abstract class FileUploadResourceTestBase extends ResourceTestBase {
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#Directives
*/
- public function testFileUploadStrippedFilePath() {
+ public function testFileUploadStrippedFilePath(): void {
$this->initAuthentication();
$this->provisionResource([static::$format], static::$auth ? [static::$auth] : [], ['POST']);
@@ -412,7 +412,7 @@ abstract class FileUploadResourceTestBase extends ResourceTestBase {
/**
* Tests using the file upload route with a unicode file name.
*/
- public function testFileUploadUnicodeFilename() {
+ public function testFileUploadUnicodeFilename(): void {
$this->initAuthentication();
$this->provisionResource([static::$format], static::$auth ? [static::$auth] : [], ['POST']);
@@ -433,7 +433,7 @@ abstract class FileUploadResourceTestBase extends ResourceTestBase {
/**
* Tests using the file upload route with a zero byte file.
*/
- public function testFileUploadZeroByteFile() {
+ public function testFileUploadZeroByteFile(): void {
$this->initAuthentication();
$this->provisionResource([static::$format], static::$auth ? [static::$auth] : [], ['POST']);
@@ -457,7 +457,7 @@ abstract class FileUploadResourceTestBase extends ResourceTestBase {
/**
* Tests using the file upload route with an invalid file type.
*/
- public function testFileUploadInvalidFileType() {
+ public function testFileUploadInvalidFileType(): void {
$this->initAuthentication();
$this->provisionResource([static::$format], static::$auth ? [static::$auth] : [], ['POST']);
@@ -478,7 +478,7 @@ abstract class FileUploadResourceTestBase extends ResourceTestBase {
/**
* Tests using the file upload route with a file size larger than allowed.
*/
- public function testFileUploadLargerFileSize() {
+ public function testFileUploadLargerFileSize(): void {
// Set a limit of 50 bytes.
$this->field->setSetting('max_filesize', 50)
->save();
@@ -504,7 +504,7 @@ abstract class FileUploadResourceTestBase extends ResourceTestBase {
/**
* Tests using the file upload POST route with malicious extensions.
*/
- public function testFileUploadMaliciousExtension() {
+ public function testFileUploadMaliciousExtension(): void {
$this->initAuthentication();
$this->provisionResource([static::$format], static::$auth ? [static::$auth] : [], ['POST']);
@@ -632,7 +632,7 @@ abstract class FileUploadResourceTestBase extends ResourceTestBase {
/**
* Tests using the file upload POST route no extension configured.
*/
- public function testFileUploadNoExtensionSetting() {
+ public function testFileUploadNoExtensionSetting(): void {
$this->initAuthentication();
$this->provisionResource([static::$format], static::$auth ? [static::$auth] : [], ['POST']);
diff --git a/core/modules/rest/tests/src/Functional/ResourceTest.php b/core/modules/rest/tests/src/Functional/ResourceTest.php
index 0d48efc6325..995ad409467 100644
--- a/core/modules/rest/tests/src/Functional/ResourceTest.php
+++ b/core/modules/rest/tests/src/Functional/ResourceTest.php
@@ -66,7 +66,7 @@ class ResourceTest extends BrowserTestBase {
/**
* Tests that a resource without formats cannot be enabled.
*/
- public function testFormats() {
+ public function testFormats(): void {
RestResourceConfig::create([
'id' => 'entity.entity_test',
'granularity' => RestResourceConfigInterface::METHOD_GRANULARITY,
@@ -92,7 +92,7 @@ class ResourceTest extends BrowserTestBase {
/**
* Tests that a resource without authentication cannot be enabled.
*/
- public function testAuthentication() {
+ public function testAuthentication(): void {
RestResourceConfig::create([
'id' => 'entity.entity_test',
'granularity' => RestResourceConfigInterface::METHOD_GRANULARITY,
@@ -118,7 +118,7 @@ class ResourceTest extends BrowserTestBase {
/**
* Tests that serialization_class is optional.
*/
- public function testSerializationClassIsOptional() {
+ public function testSerializationClassIsOptional(): void {
RestResourceConfig::create([
'id' => 'serialization_test',
'granularity' => RestResourceConfigInterface::METHOD_GRANULARITY,
@@ -154,7 +154,7 @@ class ResourceTest extends BrowserTestBase {
/**
* Tests that resource URI paths are formatted properly.
*/
- public function testUriPaths() {
+ public function testUriPaths(): void {
/** @var \Drupal\rest\Plugin\Type\ResourcePluginManager $manager */
$manager = \Drupal::service('plugin.manager.rest');
diff --git a/core/modules/rest/tests/src/Functional/Views/ExcludedFieldTokenTest.php b/core/modules/rest/tests/src/Functional/Views/ExcludedFieldTokenTest.php
index 36e214544f3..fb95cd8b203 100644
--- a/core/modules/rest/tests/src/Functional/Views/ExcludedFieldTokenTest.php
+++ b/core/modules/rest/tests/src/Functional/Views/ExcludedFieldTokenTest.php
@@ -69,7 +69,7 @@ class ExcludedFieldTokenTest extends ViewTestBase {
/**
* Tests the display of an excluded title field when used as a token.
*/
- public function testExcludedTitleTokenDisplay() {
+ public function testExcludedTitleTokenDisplay(): void {
$actual_json = $this->drupalGet($this->view->getPath(), ['query' => ['_format' => 'json']]);
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/rest/tests/src/Functional/Views/FieldCounterTest.php b/core/modules/rest/tests/src/Functional/Views/FieldCounterTest.php
index b27171ff04d..8c1e6781e49 100644
--- a/core/modules/rest/tests/src/Functional/Views/FieldCounterTest.php
+++ b/core/modules/rest/tests/src/Functional/Views/FieldCounterTest.php
@@ -69,7 +69,7 @@ class FieldCounterTest extends ViewTestBase {
/**
* Tests the display of an excluded title field when used as a token.
*/
- public function testExcludedTitleTokenDisplay() {
+ public function testExcludedTitleTokenDisplay(): void {
$actual_json = $this->drupalGet($this->view->getPath(), ['query' => ['_format' => 'json']]);
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/rest/tests/src/Functional/Views/RestExportAuthTest.php b/core/modules/rest/tests/src/Functional/Views/RestExportAuthTest.php
index 17ce69c425b..4e1ef2bd0dc 100644
--- a/core/modules/rest/tests/src/Functional/Views/RestExportAuthTest.php
+++ b/core/modules/rest/tests/src/Functional/Views/RestExportAuthTest.php
@@ -38,7 +38,7 @@ class RestExportAuthTest extends ViewTestBase {
*
* @link https://www.drupal.org/node/2825204
*/
- public function testAuthProvidersOptions() {
+ public function testAuthProvidersOptions(): void {
$view_id = 'test_view_rest_export';
$view_label = 'Test view (REST export)';
$view_display = 'rest_export_1';
diff --git a/core/modules/rest/tests/src/Functional/Views/StyleSerializerEntityTest.php b/core/modules/rest/tests/src/Functional/Views/StyleSerializerEntityTest.php
index 8013d9c0040..2a4005a510b 100644
--- a/core/modules/rest/tests/src/Functional/Views/StyleSerializerEntityTest.php
+++ b/core/modules/rest/tests/src/Functional/Views/StyleSerializerEntityTest.php
@@ -95,7 +95,7 @@ class StyleSerializerEntityTest extends ViewTestBase {
/**
* Checks the behavior of the Serializer callback paths and row plugins.
*/
- public function testSerializerResponses() {
+ public function testSerializerResponses(): void {
// Test the serialize callback.
$view = Views::getView('test_serializer_display_field');
$view->initDisplay();
@@ -217,7 +217,7 @@ class StyleSerializerEntityTest extends ViewTestBase {
/**
* Tests REST export with views render caching enabled.
*/
- public function testRestRenderCaching() {
+ public function testRestRenderCaching(): void {
$this->drupalLogin($this->adminUser);
/** @var \Drupal\Core\Render\RenderCacheInterface $render_cache */
$render_cache = \Drupal::service('render_cache');
@@ -308,7 +308,7 @@ class StyleSerializerEntityTest extends ViewTestBase {
/**
* Tests the response format configuration.
*/
- public function testResponseFormatConfiguration() {
+ public function testResponseFormatConfiguration(): void {
$this->drupalLogin($this->adminUser);
$style_options = 'admin/structure/views/nojs/display/test_serializer_display_field/rest_export_1/style_options';
@@ -383,7 +383,7 @@ class StyleSerializerEntityTest extends ViewTestBase {
/**
* Tests the field ID alias functionality of the DataFieldRow plugin.
*/
- public function testUIFieldAlias() {
+ public function testUIFieldAlias(): void {
$this->drupalLogin($this->adminUser);
// Test the UI settings for adding field ID aliases.
@@ -453,7 +453,7 @@ class StyleSerializerEntityTest extends ViewTestBase {
/**
* Tests the raw output options for row field rendering.
*/
- public function testFieldRawOutput() {
+ public function testFieldRawOutput(): void {
$this->drupalLogin($this->adminUser);
// Test the UI settings for adding field ID aliases.
@@ -520,7 +520,7 @@ class StyleSerializerEntityTest extends ViewTestBase {
/**
* Tests the live preview output for json output.
*/
- public function testLivePreview() {
+ public function testLivePreview(): void {
// We set up a request so it looks like a request in the live preview.
$request = new Request();
$request->query->add([MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_ajax']);
@@ -574,7 +574,7 @@ class StyleSerializerEntityTest extends ViewTestBase {
/**
* Tests the views interface for REST export displays.
*/
- public function testSerializerViewsUI() {
+ public function testSerializerViewsUI(): void {
$this->drupalLogin($this->adminUser);
// Click the "Update preview button".
$this->drupalGet('admin/structure/views/view/test_serializer_display_field/edit/rest_export_1');
diff --git a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
index 4fdbce90d98..ef0f22372f4 100644
--- a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
+++ b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
@@ -87,7 +87,7 @@ class StyleSerializerTest extends ViewTestBase {
/**
* Checks that the auth options restricts access to a REST views display.
*/
- public function testRestViewsAuthentication() {
+ public function testRestViewsAuthentication(): void {
// Assume the view is hidden behind a permission.
$this->drupalGet('test/serialize/auth_with_perm', ['query' => ['_format' => 'json']]);
$this->assertSession()->statusCodeEquals(401);
@@ -118,7 +118,7 @@ class StyleSerializerTest extends ViewTestBase {
/**
* Verifies REST export views work on the same path as a page display.
*/
- public function testSharedPagePath() {
+ public function testSharedPagePath(): void {
// Test with no format as well as html explicitly.
$this->drupalGet('test/serialize/shared');
$this->assertSession()->statusCodeEquals(200);
@@ -140,7 +140,7 @@ class StyleSerializerTest extends ViewTestBase {
/**
* Verifies site maintenance mode functionality.
*/
- public function testSiteMaintenance() {
+ public function testSiteMaintenance(): void {
$view = Views::getView('test_serializer_display_field');
$view->initDisplay();
$this->executeView($view);
@@ -170,7 +170,7 @@ class StyleSerializerTest extends ViewTestBase {
/**
* Tests the "Grouped rows" functionality.
*/
- public function testGroupRows() {
+ public function testGroupRows(): void {
$this->drupalCreateContentType(['type' => 'page']);
// Create a text field with cardinality set to unlimited.
$field_name = 'field_group_rows';
@@ -235,7 +235,7 @@ class StyleSerializerTest extends ViewTestBase {
* parameter. This is set to filter nodes by those whose title starts with
* the value provided.
*/
- public function testRestViewExposedFilter() {
+ public function testRestViewExposedFilter(): void {
$this->drupalCreateContentType(['type' => 'page']);
$node0 = $this->drupalCreateNode(['title' => 'Node 1']);
$node1 = $this->drupalCreateNode(['title' => 'Node 11']);
@@ -291,7 +291,7 @@ class StyleSerializerTest extends ViewTestBase {
/**
* Tests multilingual entity rows.
*/
- public function testMulEntityRows() {
+ public function testMulEntityRows(): void {
// Create some languages.
ConfigurableLanguage::createFromLangcode('l1')->save();
ConfigurableLanguage::createFromLangcode('l2')->save();
diff --git a/core/modules/rest/tests/src/Kernel/Entity/ConfigDependenciesTest.php b/core/modules/rest/tests/src/Kernel/Entity/ConfigDependenciesTest.php
index f5c4c2e32fe..57ec99bd49b 100644
--- a/core/modules/rest/tests/src/Kernel/Entity/ConfigDependenciesTest.php
+++ b/core/modules/rest/tests/src/Kernel/Entity/ConfigDependenciesTest.php
@@ -26,7 +26,7 @@ class ConfigDependenciesTest extends KernelTestBase {
*
* @dataProvider providerBasicDependencies
*/
- public function testCalculateDependencies(array $configuration) {
+ public function testCalculateDependencies(array $configuration): void {
$config_dependencies = new ConfigDependencies(['json' => 'serialization'], ['basic_auth' => 'basic_auth']);
$rest_config = RestResourceConfig::create($configuration);
@@ -44,7 +44,7 @@ class ConfigDependenciesTest extends KernelTestBase {
*
* @dataProvider providerBasicDependencies
*/
- public function testOnDependencyRemovalRemoveUnrelatedDependency(array $configuration) {
+ public function testOnDependencyRemovalRemoveUnrelatedDependency(array $configuration): void {
$config_dependencies = new ConfigDependencies(['json' => 'serialization'], ['basic_auth' => 'basic_auth']);
$rest_config = RestResourceConfig::create($configuration);
@@ -94,7 +94,7 @@ class ConfigDependenciesTest extends KernelTestBase {
* @covers ::onDependencyRemoval
* @covers ::onDependencyRemovalForMethodGranularity
*/
- public function testOnDependencyRemovalRemoveAuth() {
+ public function testOnDependencyRemovalRemoveAuth(): void {
$config_dependencies = new ConfigDependencies(['json' => 'serialization'], ['basic_auth' => 'basic_auth']);
$rest_config = RestResourceConfig::create([
@@ -132,7 +132,7 @@ class ConfigDependenciesTest extends KernelTestBase {
*
* @dataProvider providerOnDependencyRemovalForResourceGranularity
*/
- public function testOnDependencyRemovalForResourceGranularity(array $configuration, $module, $expected_configuration) {
+ public function testOnDependencyRemovalForResourceGranularity(array $configuration, $module, $expected_configuration): void {
assert(is_string($module));
assert($expected_configuration === FALSE || is_array($expected_configuration));
diff --git a/core/modules/rest/tests/src/Kernel/Entity/RestPermissionsTest.php b/core/modules/rest/tests/src/Kernel/Entity/RestPermissionsTest.php
index 44a6599ed12..47278149d89 100644
--- a/core/modules/rest/tests/src/Kernel/Entity/RestPermissionsTest.php
+++ b/core/modules/rest/tests/src/Kernel/Entity/RestPermissionsTest.php
@@ -29,7 +29,7 @@ class RestPermissionsTest extends KernelTestBase {
/**
* @covers ::permissions
*/
- public function testPermissions() {
+ public function testPermissions(): void {
RestResourceConfig::create([
'id' => 'dblog',
'plugin_id' => 'dblog',
diff --git a/core/modules/rest/tests/src/Kernel/Entity/RestResourceConfigTest.php b/core/modules/rest/tests/src/Kernel/Entity/RestResourceConfigTest.php
index 92c649e0cdc..d5d7d2a7727 100644
--- a/core/modules/rest/tests/src/Kernel/Entity/RestResourceConfigTest.php
+++ b/core/modules/rest/tests/src/Kernel/Entity/RestResourceConfigTest.php
@@ -29,7 +29,7 @@ class RestResourceConfigTest extends KernelTestBase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependencies() {
+ public function testCalculateDependencies(): void {
$rest_config = RestResourceConfig::create([
'plugin_id' => 'entity:entity_test',
'granularity' => RestResourceConfigInterface::METHOD_GRANULARITY,
diff --git a/core/modules/rest/tests/src/Kernel/EntityResource/EntityResourceRestTestCoverageTest.php b/core/modules/rest/tests/src/Kernel/EntityResource/EntityResourceRestTestCoverageTest.php
index 7a93905a140..60f65f990a5 100644
--- a/core/modules/rest/tests/src/Kernel/EntityResource/EntityResourceRestTestCoverageTest.php
+++ b/core/modules/rest/tests/src/Kernel/EntityResource/EntityResourceRestTestCoverageTest.php
@@ -67,7 +67,7 @@ class EntityResourceRestTestCoverageTest extends KernelTestBase {
/**
* Tests that all core content/config entity types have REST test coverage.
*/
- public function testEntityTypeRestTestCoverage() {
+ public function testEntityTypeRestTestCoverage(): void {
$tests = [
// Test coverage for formats provided by the 'serialization' module.
'serialization' => [
diff --git a/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php b/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php
index e142e6eaffb..81b9aba8817 100644
--- a/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php
+++ b/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php
@@ -54,7 +54,7 @@ class RequestHandlerTest extends KernelTestBase {
/**
* @covers ::handle
*/
- public function testHandle() {
+ public function testHandle(): void {
$request = new Request([], [], [], [], [], ['CONTENT_TYPE' => 'application/json'], Json::encode(['this is an array']));
$route_match = new RouteMatch('test', (new Route('/rest/test', ['_rest_resource_config' => 'rest_plugin', 'example' => ''], ['_format' => 'json']))->setMethods(['GET']));
diff --git a/core/modules/rest/tests/src/Kernel/Views/RestExportTest.php b/core/modules/rest/tests/src/Kernel/Views/RestExportTest.php
index 11f30185535..0222baf5765 100644
--- a/core/modules/rest/tests/src/Kernel/Views/RestExportTest.php
+++ b/core/modules/rest/tests/src/Kernel/Views/RestExportTest.php
@@ -46,7 +46,7 @@ class RestExportTest extends ViewsKernelTestBase {
/**
* @covers ::buildResponse
*/
- public function testBuildResponse() {
+ public function testBuildResponse(): void {
/** @var \Drupal\views\Entity\View $view */
$view = View::load('test_serializer_display_entity');
$display = &$view->getDisplay('rest_export_1');
diff --git a/core/modules/rest/tests/src/Kernel/Views/StyleSerializerKernelTest.php b/core/modules/rest/tests/src/Kernel/Views/StyleSerializerKernelTest.php
index db0499a7563..83c9a010ddd 100644
--- a/core/modules/rest/tests/src/Kernel/Views/StyleSerializerKernelTest.php
+++ b/core/modules/rest/tests/src/Kernel/Views/StyleSerializerKernelTest.php
@@ -36,7 +36,7 @@ class StyleSerializerKernelTest extends ViewsKernelTestBase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependencies() {
+ public function testCalculateDependencies(): void {
/** @var \Drupal\views\Entity\View $view */
$view = View::load('test_serializer_display_entity');
$display = &$view->getDisplay('rest_export_1');
diff --git a/core/modules/rest/tests/src/Unit/CollectRoutesTest.php b/core/modules/rest/tests/src/Unit/CollectRoutesTest.php
index 7ef03be1116..a6c0e88f3b2 100644
--- a/core/modules/rest/tests/src/Unit/CollectRoutesTest.php
+++ b/core/modules/rest/tests/src/Unit/CollectRoutesTest.php
@@ -143,7 +143,7 @@ class CollectRoutesTest extends UnitTestCase {
/**
* Tests if adding a requirement to a route only modify one route.
*/
- public function testRoutesRequirements() {
+ public function testRoutesRequirements(): void {
$this->restExport->collectRoutes($this->routes);
$requirements_1 = $this->routes->get('test_1')->getRequirements();
diff --git a/core/modules/rest/tests/src/Unit/Entity/RestResourceConfigTest.php b/core/modules/rest/tests/src/Unit/Entity/RestResourceConfigTest.php
index 50ad05eb9c8..e02339fa2db 100644
--- a/core/modules/rest/tests/src/Unit/Entity/RestResourceConfigTest.php
+++ b/core/modules/rest/tests/src/Unit/Entity/RestResourceConfigTest.php
@@ -21,7 +21,7 @@ class RestResourceConfigTest extends UnitTestCase {
* This also tests that no exceptions are thrown during that method so that
* alternate methods such as OPTIONS and PUT are supported.
*/
- public function testNormalizeRestMethod() {
+ public function testNormalizeRestMethod(): void {
$expected = ['GET', 'PUT', 'POST', 'PATCH', 'DELETE', 'OPTIONS', 'FOO'];
$methods = ['get', 'put', 'post', 'patch', 'delete', 'options', 'foo'];
$configuration = [];
diff --git a/core/modules/rest/tests/src/Unit/EntityResourceValidationTraitTest.php b/core/modules/rest/tests/src/Unit/EntityResourceValidationTraitTest.php
index e809f8eba00..8833ae22163 100644
--- a/core/modules/rest/tests/src/Unit/EntityResourceValidationTraitTest.php
+++ b/core/modules/rest/tests/src/Unit/EntityResourceValidationTraitTest.php
@@ -21,7 +21,7 @@ class EntityResourceValidationTraitTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidate() {
+ public function testValidate(): void {
$trait = new EntityResourceValidationTraitTestClass();
$method = new \ReflectionMethod($trait, 'validate');
@@ -39,7 +39,7 @@ class EntityResourceValidationTraitTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testFailedValidate() {
+ public function testFailedValidate(): void {
$violation1 = $this->prophesize(ConstraintViolationInterface::class);
$violation1->getPropertyPath()->willReturn('property_path');
$violation1->getMessage()->willReturn('message');
diff --git a/core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php b/core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php
index 85eb1820f58..fd7abd2198c 100644
--- a/core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php
+++ b/core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php
@@ -35,7 +35,7 @@ class ResourceResponseSubscriberTest extends UnitTestCase {
* @covers ::onResponse
* @dataProvider providerTestSerialization
*/
- public function testSerialization($data, $expected_response = FALSE) {
+ public function testSerialization($data, $expected_response = FALSE): void {
$request = new Request();
$route_match = new RouteMatch('test', new Route('/rest/test', ['_rest_resource_config' => 'rest_plugin'], ['_format' => 'json']));
@@ -79,7 +79,7 @@ class ResourceResponseSubscriberTest extends UnitTestCase {
* @covers ::getResponseFormat
* @dataProvider providerTestResponseFormat
*/
- public function testResponseFormat($methods, array $supported_response_formats, array $supported_request_formats, $request_format, array $request_headers, $request_body, $expected_response_format, $expected_response_content_type, $expected_response_content) {
+ public function testResponseFormat($methods, array $supported_response_formats, array $supported_request_formats, $request_format, array $request_headers, $request_body, $expected_response_format, $expected_response_content_type, $expected_response_content): void {
foreach ($request_headers as $key => $value) {
unset($request_headers[$key]);
$key = strtoupper(str_replace('-', '_', $key));
@@ -116,7 +116,7 @@ class ResourceResponseSubscriberTest extends UnitTestCase {
*
* @dataProvider providerTestResponseFormat
*/
- public function testOnResponseWithCacheableResponse($methods, array $supported_response_formats, array $supported_request_formats, $request_format, array $request_headers, $request_body, $expected_response_format, $expected_response_content_type, $expected_response_content) {
+ public function testOnResponseWithCacheableResponse($methods, array $supported_response_formats, array $supported_request_formats, $request_format, array $request_headers, $request_body, $expected_response_format, $expected_response_content_type, $expected_response_content): void {
foreach ($request_headers as $key => $value) {
unset($request_headers[$key]);
$key = strtoupper(str_replace('-', '_', $key));
@@ -166,7 +166,7 @@ class ResourceResponseSubscriberTest extends UnitTestCase {
*
* @dataProvider providerTestResponseFormat
*/
- public function testOnResponseWithUncacheableResponse($methods, array $supported_response_formats, array $supported_request_formats, $request_format, array $request_headers, $request_body, $expected_response_format, $expected_response_content_type, $expected_response_content) {
+ public function testOnResponseWithUncacheableResponse($methods, array $supported_response_formats, array $supported_request_formats, $request_format, array $request_headers, $request_body, $expected_response_format, $expected_response_content_type, $expected_response_content): void {
foreach ($request_headers as $key => $value) {
unset($request_headers[$key]);
$key = strtoupper(str_replace('-', '_', $key));
diff --git a/core/modules/rest/tests/src/Unit/Plugin/views/style/SerializerTest.php b/core/modules/rest/tests/src/Unit/Plugin/views/style/SerializerTest.php
index 0f3eee1a3a7..d01df6eb2d8 100644
--- a/core/modules/rest/tests/src/Unit/Plugin/views/style/SerializerTest.php
+++ b/core/modules/rest/tests/src/Unit/Plugin/views/style/SerializerTest.php
@@ -59,7 +59,7 @@ class SerializerTest extends UnitTestCase {
*
* @covers ::render
*/
- public function testSerializerReceivesOptions() {
+ public function testSerializerReceivesOptions(): void {
$mock_serializer = $this->prophesize(SerializerInterface::class);
// This is the main expectation of the test. We want to make sure the
diff --git a/core/modules/search/tests/src/Functional/SearchAdminThemeTest.php b/core/modules/search/tests/src/Functional/SearchAdminThemeTest.php
index 177d1ecae32..8460274298c 100644
--- a/core/modules/search/tests/src/Functional/SearchAdminThemeTest.php
+++ b/core/modules/search/tests/src/Functional/SearchAdminThemeTest.php
@@ -71,7 +71,7 @@ class SearchAdminThemeTest extends BrowserTestBase {
* @see \Drupal\search_extra_type\Plugin\Search\SearchExtraTypeSearch
* @see \Drupal\user\Plugin\Search\UserSearch
*/
- public function testSearchUsingAdminTheme() {
+ public function testSearchUsingAdminTheme(): void {
/** @var \Drupal\search\SearchPageRepositoryInterface $repository */
$repository = \Drupal::service('search.search_page_repository');
$pages = $repository->getActiveSearchPages();
diff --git a/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php b/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php
index d8d1cd7fd1f..f8fb1238329 100644
--- a/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php
+++ b/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php
@@ -58,7 +58,7 @@ class SearchAdvancedSearchFormTest extends BrowserTestBase {
/**
* Tests advanced search by node type.
*/
- public function testNodeType() {
+ public function testNodeType(): void {
// Verify some properties of the node that was created.
$this->assertSame('page', $this->node->getType(), 'Node type is Basic page.');
$dummy_title = 'Lorem ipsum';
@@ -91,7 +91,7 @@ class SearchAdvancedSearchFormTest extends BrowserTestBase {
/**
* Tests that after submitting the advanced search form, the form is refilled.
*/
- public function testFormRefill() {
+ public function testFormRefill(): void {
$edit = [
'keys' => 'cat',
'or' => 'dog gerbil',
diff --git a/core/modules/search/tests/src/Functional/SearchBlockTest.php b/core/modules/search/tests/src/Functional/SearchBlockTest.php
index 1fbda4bb7ee..44bd0783960 100644
--- a/core/modules/search/tests/src/Functional/SearchBlockTest.php
+++ b/core/modules/search/tests/src/Functional/SearchBlockTest.php
@@ -50,7 +50,7 @@ class SearchBlockTest extends BrowserTestBase {
/**
* Tests that the search form block can be placed and works.
*/
- public function testSearchFormBlock() {
+ public function testSearchFormBlock(): void {
// Test availability of the search block in the admin "Place blocks" list.
$this->drupalGet('admin/structure/block');
diff --git a/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php b/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php
index 2312b33edee..261df5bafea 100644
--- a/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php
+++ b/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php
@@ -92,7 +92,7 @@ class SearchCommentCountToggleTest extends BrowserTestBase {
/**
* Verify that comment count display toggles properly on comment status of node.
*/
- public function testSearchCommentCountToggle() {
+ public function testSearchCommentCountToggle(): void {
// Search for the nodes by string in the node body.
$edit = [
'keys' => "'SearchCommentToggleTestCase'",
diff --git a/core/modules/search/tests/src/Functional/SearchCommentTest.php b/core/modules/search/tests/src/Functional/SearchCommentTest.php
index 89928169ed5..60acdbb9411 100644
--- a/core/modules/search/tests/src/Functional/SearchCommentTest.php
+++ b/core/modules/search/tests/src/Functional/SearchCommentTest.php
@@ -98,7 +98,7 @@ class SearchCommentTest extends BrowserTestBase {
/**
* Verify that comments are rendered using proper format in search results.
*/
- public function testSearchResultsComment() {
+ public function testSearchResultsComment(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
// Create basic_html format that escapes all HTML.
$basic_html_format = FilterFormat::create([
@@ -240,7 +240,7 @@ class SearchCommentTest extends BrowserTestBase {
/**
* Verify access rules for comment indexing with different permissions.
*/
- public function testSearchResultsCommentAccess() {
+ public function testSearchResultsCommentAccess(): void {
$comment_body = 'Test comment body';
$this->commentSubject = 'Test comment subject';
$roles = $this->adminUser->getRoles(TRUE);
@@ -344,7 +344,7 @@ class SearchCommentTest extends BrowserTestBase {
/**
* Verify that 'add new comment' does not appear in search results or index.
*/
- public function testAddNewComment() {
+ public function testAddNewComment(): void {
// Create a node with a short body.
$settings = [
'type' => 'article',
diff --git a/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
index 76d15dd12b7..13f03b95ed4 100644
--- a/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
+++ b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
@@ -90,7 +90,7 @@ class SearchConfigSettingsFormTest extends BrowserTestBase {
/**
* Verifies the search settings form.
*/
- public function testSearchSettingsPage() {
+ public function testSearchSettingsPage(): void {
// Test that the settings form displays the correct count of items left to index.
$this->drupalGet('admin/config/search/pages');
@@ -142,7 +142,7 @@ class SearchConfigSettingsFormTest extends BrowserTestBase {
/**
* Verifies plugin-supplied settings form.
*/
- public function testSearchModuleSettingsPage() {
+ public function testSearchModuleSettingsPage(): void {
$this->drupalGet('admin/config/search/pages');
$this->clickLink('Edit', 1);
@@ -164,7 +164,7 @@ class SearchConfigSettingsFormTest extends BrowserTestBase {
/**
* Verifies that you can disable individual search plugins.
*/
- public function testSearchModuleDisabling() {
+ public function testSearchModuleDisabling(): void {
// Array of search plugins to test: 'keys' are the keywords to search for,
// and 'text' is the text to assert is on the results page.
$plugin_info = [
@@ -253,7 +253,7 @@ class SearchConfigSettingsFormTest extends BrowserTestBase {
/**
* Tests the ordering of search pages on a clean install.
*/
- public function testDefaultSearchPageOrdering() {
+ public function testDefaultSearchPageOrdering(): void {
$this->drupalGet('search');
$elements = $this->xpath('//div[@id="block-local-tasks"]//a');
$this->assertSame(Url::fromRoute('search.view_node_search')->toString(), $elements[0]->getAttribute('href'));
@@ -264,7 +264,7 @@ class SearchConfigSettingsFormTest extends BrowserTestBase {
/**
* Tests multiple search pages of the same type.
*/
- public function testMultipleSearchPages() {
+ public function testMultipleSearchPages(): void {
$this->assertDefaultSearch('node_search', 'The default page is set to the installer default.');
$search_storage = \Drupal::entityTypeManager()->getStorage('search_page');
$entities = $search_storage->loadMultiple();
@@ -361,7 +361,7 @@ class SearchConfigSettingsFormTest extends BrowserTestBase {
/**
* Tests that the enable/disable/default routes are protected from CSRF.
*/
- public function testRouteProtection() {
+ public function testRouteProtection(): void {
// Ensure that the enable and disable routes are protected.
$this->drupalGet('admin/config/search/pages/manage/node_search/enable');
$this->assertSession()->statusCodeEquals(403);
diff --git a/core/modules/search/tests/src/Functional/SearchDateIntervalTest.php b/core/modules/search/tests/src/Functional/SearchDateIntervalTest.php
index 8d0b7fb2944..8e16f5efc6c 100644
--- a/core/modules/search/tests/src/Functional/SearchDateIntervalTest.php
+++ b/core/modules/search/tests/src/Functional/SearchDateIntervalTest.php
@@ -84,7 +84,7 @@ class SearchDateIntervalTest extends BrowserTestBase {
/**
* Tests searching with date filters that exclude some translations.
*/
- public function testDateIntervalQueryAlter() {
+ public function testDateIntervalQueryAlter(): void {
// Search for keyword node.
$edit = ['keys' => 'node'];
$this->drupalGet('search/node');
diff --git a/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php b/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php
index ed39c428143..7052475e7fc 100644
--- a/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php
+++ b/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php
@@ -65,7 +65,7 @@ class SearchEmbedFormTest extends BrowserTestBase {
/**
* Tests that the embedded form appears and can be submitted.
*/
- public function testEmbeddedForm() {
+ public function testEmbeddedForm(): void {
// First verify we can submit the form from the module's page.
$this->drupalGet('search_embedded_form');
$this->submitForm(['name' => 'John'], 'Send away');
diff --git a/core/modules/search/tests/src/Functional/SearchExactTest.php b/core/modules/search/tests/src/Functional/SearchExactTest.php
index 32eda7ae1aa..33b6b8a72ef 100644
--- a/core/modules/search/tests/src/Functional/SearchExactTest.php
+++ b/core/modules/search/tests/src/Functional/SearchExactTest.php
@@ -26,7 +26,7 @@ class SearchExactTest extends BrowserTestBase {
/**
* Tests that the correct number of pager links are found for both keywords and phrases.
*/
- public function testExactQuery() {
+ public function testExactQuery(): void {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
// Log in with sufficient privileges.
diff --git a/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php b/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php
index be371c5ac7b..5f9895da1ab 100644
--- a/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php
+++ b/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php
@@ -60,7 +60,7 @@ class SearchKeywordsConditionsTest extends BrowserTestBase {
/**
* Verify the keywords are captured and conditions respected.
*/
- public function testSearchKeywordsConditions() {
+ public function testSearchKeywordsConditions(): void {
// No keys, not conditions - no results.
$this->drupalGet('search/dummy_path');
$this->assertSession()->pageTextNotContains('Dummy search snippet to display');
diff --git a/core/modules/search/tests/src/Functional/SearchLanguageTest.php b/core/modules/search/tests/src/Functional/SearchLanguageTest.php
index 448a2d2257c..784a953eb14 100644
--- a/core/modules/search/tests/src/Functional/SearchLanguageTest.php
+++ b/core/modules/search/tests/src/Functional/SearchLanguageTest.php
@@ -105,7 +105,7 @@ class SearchLanguageTest extends BrowserTestBase {
$plugin->updateIndex();
}
- public function testLanguages() {
+ public function testLanguages(): void {
// Add predefined language.
$edit = ['predefined_langcode' => 'fr'];
$this->drupalGet('admin/config/regional/language/add');
@@ -162,7 +162,7 @@ class SearchLanguageTest extends BrowserTestBase {
/**
* Test language attribute "lang" for the search results.
*/
- public function testLanguageAttributes() {
+ public function testLanguageAttributes(): void {
$this->drupalGet('search/node');
$this->submitForm(['keys' => 'the Spanish title'], 'Search');
diff --git a/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php b/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php
index 38d1e62aa77..9830e614953 100644
--- a/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php
+++ b/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php
@@ -140,7 +140,7 @@ class SearchMultilingualEntityTest extends BrowserTestBase {
/**
* Tests the indexing throttle and search results with multilingual nodes.
*/
- public function testMultilingualSearch() {
+ public function testMultilingualSearch(): void {
// Index only 2 nodes per cron run. We cannot do this setting in the UI,
// because it doesn't go this low.
$this->config('search.settings')->set('index.cron_limit', 2)->save();
diff --git a/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php b/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php
index 1712d43962b..972f47b6887 100644
--- a/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php
+++ b/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php
@@ -53,7 +53,7 @@ class SearchNodeDiacriticsTest extends BrowserTestBase {
/**
* Tests that search returns results with diacritics in the search phrase.
*/
- public function testPhraseSearchPunctuation() {
+ public function testPhraseSearchPunctuation(): void {
// cSpell:disable
$body_text = 'The Enricþment Center is cómmīŦŧęđ to the well BɆĬŇĜ of æll påŔťıçȉpǎǹţș. ';
$body_text .= 'Also meklēt (see #731298)';
diff --git a/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php b/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php
index 0b0848c612a..e56dd26c42e 100644
--- a/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php
+++ b/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php
@@ -52,7 +52,7 @@ class SearchNodePunctuationTest extends BrowserTestBase {
/**
* Tests that search works with punctuation and HTML entities.
*/
- public function testPhraseSearchPunctuation() {
+ public function testPhraseSearchPunctuation(): void {
$node = $this->drupalCreateNode(['body' => [['value' => "The bunny's ears were fluffy."]]]);
// cSpell:disable-next-line
$this->drupalCreateNode(['body' => [['value' => 'Dignissim Aliquam &amp; Quieligo meus natu quae quia te. Damnum&copy; erat&mdash; neo pneum. Facilisi feugiat ibidem ratis.']]]);
diff --git a/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php b/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php
index dec5ba93860..94a3b86850b 100644
--- a/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php
+++ b/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php
@@ -51,7 +51,7 @@ class SearchNodeUpdateAndDeletionTest extends BrowserTestBase {
/**
* Tests that the search index info is properly updated when a node changes.
*/
- public function testSearchIndexUpdateOnNodeChange() {
+ public function testSearchIndexUpdateOnNodeChange(): void {
// Create a node.
$node = $this->drupalCreateNode([
'title' => 'Someone who says Ni!',
@@ -88,7 +88,7 @@ class SearchNodeUpdateAndDeletionTest extends BrowserTestBase {
/**
* Tests that the search index info is updated when a node is deleted.
*/
- public function testSearchIndexUpdateOnNodeDeletion() {
+ public function testSearchIndexUpdateOnNodeDeletion(): void {
// Create a node.
$node = $this->drupalCreateNode([
'title' => 'No dragons here',
diff --git a/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php b/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php
index 8fc92c53777..8b4fcbcc40c 100644
--- a/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php
+++ b/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php
@@ -95,7 +95,7 @@ class SearchNumberMatchingTest extends BrowserTestBase {
/**
* Tests that all the numbers can be searched.
*/
- public function testNumberSearching() {
+ public function testNumberSearching(): void {
for ($i = 0; $i < count($this->numbers); $i++) {
$node = $this->nodes[$i];
diff --git a/core/modules/search/tests/src/Functional/SearchNumbersTest.php b/core/modules/search/tests/src/Functional/SearchNumbersTest.php
index 12882a98deb..7903a988518 100644
--- a/core/modules/search/tests/src/Functional/SearchNumbersTest.php
+++ b/core/modules/search/tests/src/Functional/SearchNumbersTest.php
@@ -102,7 +102,7 @@ class SearchNumbersTest extends BrowserTestBase {
/**
* Tests that all the numbers can be searched.
*/
- public function testNumberSearching() {
+ public function testNumberSearching(): void {
$types = array_keys($this->numbers);
foreach ($types as $type) {
diff --git a/core/modules/search/tests/src/Functional/SearchPageCacheTagsTest.php b/core/modules/search/tests/src/Functional/SearchPageCacheTagsTest.php
index 747d4a1741c..b977480dc89 100644
--- a/core/modules/search/tests/src/Functional/SearchPageCacheTagsTest.php
+++ b/core/modules/search/tests/src/Functional/SearchPageCacheTagsTest.php
@@ -67,7 +67,7 @@ class SearchPageCacheTagsTest extends BrowserTestBase {
/**
* Tests the presence of the expected cache tag in various situations.
*/
- public function testSearchText() {
+ public function testSearchText(): void {
$this->drupalLogin($this->searchingUser);
// Initial page for searching nodes.
@@ -137,7 +137,7 @@ class SearchPageCacheTagsTest extends BrowserTestBase {
/**
* Tests the presence of expected cache tags with referenced entities.
*/
- public function testSearchTagsBubbling() {
+ public function testSearchTagsBubbling(): void {
// Install field UI module.
$this->container->get('module_installer')->install(['field_ui']);
diff --git a/core/modules/search/tests/src/Functional/SearchPageOverrideTest.php b/core/modules/search/tests/src/Functional/SearchPageOverrideTest.php
index 238020fccd5..425874448a6 100644
--- a/core/modules/search/tests/src/Functional/SearchPageOverrideTest.php
+++ b/core/modules/search/tests/src/Functional/SearchPageOverrideTest.php
@@ -47,7 +47,7 @@ class SearchPageOverrideTest extends BrowserTestBase {
$this->drupalLogin($this->searchUser);
}
- public function testSearchPageHook() {
+ public function testSearchPageHook(): void {
$keys = 'bike shed ' . $this->randomMachineName();
$this->drupalGet("search/dummy_path", ['query' => ['keys' => $keys]]);
$this->assertSession()->pageTextContains('Dummy search snippet');
diff --git a/core/modules/search/tests/src/Functional/SearchPageTextTest.php b/core/modules/search/tests/src/Functional/SearchPageTextTest.php
index 66c41620732..f00dc4757e7 100644
--- a/core/modules/search/tests/src/Functional/SearchPageTextTest.php
+++ b/core/modules/search/tests/src/Functional/SearchPageTextTest.php
@@ -54,7 +54,7 @@ class SearchPageTextTest extends BrowserTestBase {
*
* This is a regression test for https://www.drupal.org/node/2338081
*/
- public function testSearchLabelXSS() {
+ public function testSearchLabelXSS(): void {
$this->drupalLogin($this->drupalCreateUser(['administer search']));
$keys['label'] = '<script>alert("Don\'t Panic");</script>';
@@ -69,7 +69,7 @@ class SearchPageTextTest extends BrowserTestBase {
/**
* Tests the failed search text, and various other text on the search page.
*/
- public function testSearchText() {
+ public function testSearchText(): void {
$this->drupalLogin($this->searchingUser);
$this->drupalGet('search/node');
$this->assertSession()->pageTextContains('Enter your keywords');
diff --git a/core/modules/search/tests/src/Functional/SearchPreprocessLangcodeTest.php b/core/modules/search/tests/src/Functional/SearchPreprocessLangcodeTest.php
index 1eedced6272..5362e8709b3 100644
--- a/core/modules/search/tests/src/Functional/SearchPreprocessLangcodeTest.php
+++ b/core/modules/search/tests/src/Functional/SearchPreprocessLangcodeTest.php
@@ -50,7 +50,7 @@ class SearchPreprocessLangcodeTest extends BrowserTestBase {
/**
* Tests that hook_search_preprocess() returns the correct langcode.
*/
- public function testPreprocessLangcode() {
+ public function testPreprocessLangcode(): void {
// Create a node.
$this->node = $this->drupalCreateNode(['body' => [[]], 'langcode' => 'en']);
@@ -71,7 +71,7 @@ class SearchPreprocessLangcodeTest extends BrowserTestBase {
/**
* Tests stemming for hook_search_preprocess().
*/
- public function testPreprocessStemming() {
+ public function testPreprocessStemming(): void {
// Create a node.
$this->node = $this->drupalCreateNode([
'title' => 'we are testing',
diff --git a/core/modules/search/tests/src/Functional/SearchQueryAlterTest.php b/core/modules/search/tests/src/Functional/SearchQueryAlterTest.php
index c27624fbccb..95a76fef97e 100644
--- a/core/modules/search/tests/src/Functional/SearchQueryAlterTest.php
+++ b/core/modules/search/tests/src/Functional/SearchQueryAlterTest.php
@@ -26,7 +26,7 @@ class SearchQueryAlterTest extends BrowserTestBase {
/**
* Tests that the query alter works.
*/
- public function testQueryAlter() {
+ public function testQueryAlter(): void {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
diff --git a/core/modules/search/tests/src/Functional/SearchRankingTest.php b/core/modules/search/tests/src/Functional/SearchRankingTest.php
index c7f34dc7355..767129dd0d8 100644
--- a/core/modules/search/tests/src/Functional/SearchRankingTest.php
+++ b/core/modules/search/tests/src/Functional/SearchRankingTest.php
@@ -61,7 +61,7 @@ class SearchRankingTest extends BrowserTestBase {
]));
}
- public function testRankings() {
+ public function testRankings(): void {
// Add a comment field.
$this->addDefaultCommentField('node', 'page');
@@ -211,7 +211,7 @@ class SearchRankingTest extends BrowserTestBase {
/**
* Tests rankings of HTML tags.
*/
- public function testHTMLRankings() {
+ public function testHTMLRankings(): void {
$full_html_format = FilterFormat::create([
'format' => 'full_html',
'name' => 'Full HTML',
diff --git a/core/modules/search/tests/src/Kernel/Migrate/d6/MigrateSearchPageTest.php b/core/modules/search/tests/src/Kernel/Migrate/d6/MigrateSearchPageTest.php
index 6f2f4265b92..9bbcd47353b 100644
--- a/core/modules/search/tests/src/Kernel/Migrate/d6/MigrateSearchPageTest.php
+++ b/core/modules/search/tests/src/Kernel/Migrate/d6/MigrateSearchPageTest.php
@@ -31,7 +31,7 @@ class MigrateSearchPageTest extends MigrateDrupal6TestBase {
/**
* Tests Drupal 6 search settings to Drupal 8 search page entity migration.
*/
- public function testSearchPage() {
+ public function testSearchPage(): void {
$id = 'node_search';
/** @var \Drupal\search\Entity\SearchPage $search_page */
$search_page = SearchPage::load($id);
diff --git a/core/modules/search/tests/src/Kernel/Migrate/d6/MigrateSearchSettingsTest.php b/core/modules/search/tests/src/Kernel/Migrate/d6/MigrateSearchSettingsTest.php
index 6e2eea99150..291a9f6b7e3 100644
--- a/core/modules/search/tests/src/Kernel/Migrate/d6/MigrateSearchSettingsTest.php
+++ b/core/modules/search/tests/src/Kernel/Migrate/d6/MigrateSearchSettingsTest.php
@@ -33,7 +33,7 @@ class MigrateSearchSettingsTest extends MigrateDrupal6TestBase {
/**
* Tests migration of search variables to search.settings.yml.
*/
- public function testSearchSettings() {
+ public function testSearchSettings(): void {
$config = $this->config('search.settings');
$this->assertSame(3, $config->get('index.minimum_word_size'));
$this->assertTrue($config->get('index.overlap_cjk'));
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 c5d4d5af3d2..033d03c425a 100644
--- a/core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php
+++ b/core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php
@@ -51,7 +51,7 @@ class MigrateSearchPageTest extends MigrateDrupal7TestBase {
/**
* Tests migration of search status and settings to search page entity.
*/
- public function testSearchPage() {
+ public function testSearchPage(): void {
$this->enableModules(['node']);
$this->installConfig(['search']);
$this->executeMigration('d7_search_page');
@@ -99,7 +99,7 @@ class MigrateSearchPageTest extends MigrateDrupal7TestBase {
/**
* Tests that search page is only migrated for modules enabled on D8 site.
*/
- public function testModuleExists() {
+ public function testModuleExists(): void {
$this->installConfig(['search']);
$this->executeMigration('d7_search_page');
@@ -110,7 +110,7 @@ class MigrateSearchPageTest extends MigrateDrupal7TestBase {
/**
* Tests that a search page will be created if it does not exist.
*/
- public function testUserSearchCreate() {
+ public function testUserSearchCreate(): void {
$this->enableModules(['node']);
$this->installConfig(['search']);
/** @var \Drupal\search\Entity\SearchPage $search_page */
diff --git a/core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchSettingsTest.php b/core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchSettingsTest.php
index c1fcc0b54b6..4b065fd11af 100644
--- a/core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchSettingsTest.php
+++ b/core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchSettingsTest.php
@@ -26,7 +26,7 @@ class MigrateSearchSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests the migration of Search's variables to configuration.
*/
- public function testSearchSettings() {
+ public function testSearchSettings(): void {
$config = $this->config('search.settings');
$this->assertSame('node_search', $config->get('default_page'));
$this->assertSame(4, $config->get('index.minimum_word_size'));
diff --git a/core/modules/search/tests/src/Kernel/SearchExcerptTest.php b/core/modules/search/tests/src/Kernel/SearchExcerptTest.php
index 7a3a782c5af..03ae44f4c9c 100644
--- a/core/modules/search/tests/src/Kernel/SearchExcerptTest.php
+++ b/core/modules/search/tests/src/Kernel/SearchExcerptTest.php
@@ -29,7 +29,7 @@ class SearchExcerptTest extends KernelTestBase {
* contains either highlighted keywords or the original marked
* up string if no keywords matched the string.
*/
- public function testSearchExcerpt() {
+ public function testSearchExcerpt(): void {
// Make some text with entities and tags.
$text = 'The <strong>quick</strong> <a href="#">brown</a> fox &amp; jumps <h2>over</h2> the lazy dog';
$expected = 'The quick brown fox &amp; jumps over the lazy dog';
@@ -77,7 +77,7 @@ class SearchExcerptTest extends KernelTestBase {
* and compares them with strings that contain the original un-simplified
* word.
*/
- public function testSearchExcerptSimplified() {
+ public function testSearchExcerptSimplified(): void {
$start_time = microtime(TRUE);
// cSpell:disable
diff --git a/core/modules/search/tests/src/Kernel/SearchIndexTest.php b/core/modules/search/tests/src/Kernel/SearchIndexTest.php
index b015fc922ea..5656ef23cc7 100644
--- a/core/modules/search/tests/src/Kernel/SearchIndexTest.php
+++ b/core/modules/search/tests/src/Kernel/SearchIndexTest.php
@@ -23,7 +23,7 @@ class SearchIndexTest extends KernelTestBase {
/**
* Test that the service "search.index" is backend overridable.
*/
- public function testSearchIndexServiceIsBackendOverridable() {
+ public function testSearchIndexServiceIsBackendOverridable(): void {
$definition = $this->container->getDefinition('search.index');
$this->assertTrue($definition->hasTag('backend_overridable'));
}
diff --git a/core/modules/search/tests/src/Kernel/SearchMatchTest.php b/core/modules/search/tests/src/Kernel/SearchMatchTest.php
index 260b9f81767..b1558b10432 100644
--- a/core/modules/search/tests/src/Kernel/SearchMatchTest.php
+++ b/core/modules/search/tests/src/Kernel/SearchMatchTest.php
@@ -44,7 +44,7 @@ class SearchMatchTest extends KernelTestBase {
/**
* Tests search indexing.
*/
- public function testMatching() {
+ public function testMatching(): void {
$this->_setup();
$this->_testQueries();
}
diff --git a/core/modules/search/tests/src/Kernel/SearchTextProcessorTest.php b/core/modules/search/tests/src/Kernel/SearchTextProcessorTest.php
index 1efc816f5e4..fb51dd406b9 100644
--- a/core/modules/search/tests/src/Kernel/SearchTextProcessorTest.php
+++ b/core/modules/search/tests/src/Kernel/SearchTextProcessorTest.php
@@ -24,7 +24,7 @@ class SearchTextProcessorTest extends KernelTestBase {
/**
* Tests that text processing handles Unicode characters correctly.
*/
- public function testSearchTextProcessorUnicode() {
+ public function testSearchTextProcessorUnicode(): void {
// This test uses a file that was constructed so that the even lines are
// boundary characters, and the odd lines are valid word characters. (It
// was generated as a sequence of all the Unicode characters, and then the
@@ -79,7 +79,7 @@ class SearchTextProcessorTest extends KernelTestBase {
/**
* Tests that text analysis does the right thing with punctuation.
*/
- public function testSearchTextProcessorPunctuation() {
+ public function testSearchTextProcessorPunctuation(): void {
$cases = [
['20.03/94-28,876', '20039428876', 'Punctuation removed from numbers'],
['great...drupal--module', 'great drupal module', 'Multiple dot and dashes are word boundaries'],
diff --git a/core/modules/search/tests/src/Kernel/SearchTokenizerTest.php b/core/modules/search/tests/src/Kernel/SearchTokenizerTest.php
index 622653e2089..06fdf4cccf3 100644
--- a/core/modules/search/tests/src/Kernel/SearchTokenizerTest.php
+++ b/core/modules/search/tests/src/Kernel/SearchTokenizerTest.php
@@ -37,7 +37,7 @@ class SearchTokenizerTest extends KernelTestBase {
* character classes are tokenized properly. See PREG_CLASS_CKJ for more
* information.
*/
- public function testTokenizer() {
+ public function testTokenizer(): void {
// Set the minimum word size to 1 (to split all CJK characters) and make
// sure CJK tokenizing is turned on.
$this->config('search.settings')
@@ -122,7 +122,7 @@ class SearchTokenizerTest extends KernelTestBase {
* This is just a sanity check - it verifies that strings of letters are
* not tokenized.
*/
- public function testNoTokenizer() {
+ public function testNoTokenizer(): void {
// Set the minimum word size to 1 (to split all CJK characters) and make
// sure CJK tokenizing is turned on.
$this->config('search.settings')
diff --git a/core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php b/core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php
index 4baecec35cc..df793281c4c 100644
--- a/core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php
+++ b/core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php
@@ -70,7 +70,7 @@ class SearchPageRepositoryTest extends UnitTestCase {
/**
* Tests the getActiveSearchPages() method.
*/
- public function testGetActiveSearchPages() {
+ public function testGetActiveSearchPages(): void {
$this->query->expects($this->once())
->method('condition')
->with('status', TRUE)
@@ -94,7 +94,7 @@ class SearchPageRepositoryTest extends UnitTestCase {
/**
* Tests the isSearchActive() method.
*/
- public function testIsSearchActive() {
+ public function testIsSearchActive(): void {
$this->query->expects($this->once())
->method('condition')
->with('status', TRUE)
@@ -113,7 +113,7 @@ class SearchPageRepositoryTest extends UnitTestCase {
/**
* Tests the getIndexableSearchPages() method.
*/
- public function testGetIndexableSearchPages() {
+ public function testGetIndexableSearchPages(): void {
$this->query->expects($this->once())
->method('condition')
->with('status', TRUE)
@@ -144,7 +144,7 @@ class SearchPageRepositoryTest extends UnitTestCase {
/**
* Tests the clearDefaultSearchPage() method.
*/
- public function testClearDefaultSearchPage() {
+ public function testClearDefaultSearchPage(): void {
$config = $this->getMockBuilder('Drupal\Core\Config\Config')
->disableOriginalConstructor()
->getMock();
@@ -162,7 +162,7 @@ class SearchPageRepositoryTest extends UnitTestCase {
/**
* Tests the getDefaultSearchPage() method when the default is active.
*/
- public function testGetDefaultSearchPageWithActiveDefault() {
+ public function testGetDefaultSearchPageWithActiveDefault(): void {
$this->query->expects($this->once())
->method('condition')
->with('status', TRUE)
@@ -189,7 +189,7 @@ class SearchPageRepositoryTest extends UnitTestCase {
/**
* Tests the getDefaultSearchPage() method when the default is inactive.
*/
- public function testGetDefaultSearchPageWithInactiveDefault() {
+ public function testGetDefaultSearchPageWithInactiveDefault(): void {
$this->query->expects($this->once())
->method('condition')
->with('status', TRUE)
@@ -216,7 +216,7 @@ class SearchPageRepositoryTest extends UnitTestCase {
/**
* Tests the setDefaultSearchPage() method.
*/
- public function testSetDefaultSearchPage() {
+ public function testSetDefaultSearchPage(): void {
$id = 'bananas';
$config = $this->getMockBuilder('Drupal\Core\Config\Config')
->disableOriginalConstructor()
@@ -249,7 +249,7 @@ class SearchPageRepositoryTest extends UnitTestCase {
/**
* Tests the sortSearchPages() method.
*/
- public function testSortSearchPages() {
+ public function testSortSearchPages(): void {
$entity_type = $this->createMock(EntityTypeInterface::class);
$entity_type
->method('getClass')
diff --git a/core/modules/search/tests/src/Unit/SearchPluginCollectionTest.php b/core/modules/search/tests/src/Unit/SearchPluginCollectionTest.php
index df643317630..80b043ea516 100644
--- a/core/modules/search/tests/src/Unit/SearchPluginCollectionTest.php
+++ b/core/modules/search/tests/src/Unit/SearchPluginCollectionTest.php
@@ -47,7 +47,7 @@ class SearchPluginCollectionTest extends UnitTestCase {
/**
* Tests the get() method.
*/
- public function testGet() {
+ public function testGet(): void {
$plugin = $this->createMock('Drupal\search\Plugin\SearchInterface');
$this->pluginManager->expects($this->once())
->method('createInstance')
@@ -58,7 +58,7 @@ class SearchPluginCollectionTest extends UnitTestCase {
/**
* Tests the get() method with a configurable plugin.
*/
- public function testGetWithConfigurablePlugin() {
+ public function testGetWithConfigurablePlugin(): void {
$plugin = $this->createMock('Drupal\search\Plugin\ConfigurableSearchPluginInterface');
$plugin->expects($this->once())
->method('setSearchPageId')
diff --git a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php
index 20f13bf47e2..b3658bffb2d 100644
--- a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php
+++ b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php
@@ -128,7 +128,7 @@ class EntitySerializationTest extends NormalizerTestBase {
/**
* Tests the normalize function.
*/
- public function testNormalize() {
+ public function testNormalize(): void {
$expected = [
'id' => [
['value' => 1],
@@ -193,7 +193,7 @@ class EntitySerializationTest extends NormalizerTestBase {
*
* @see entity_serialization_test.module
*/
- public function testUserNormalize() {
+ public function testUserNormalize(): void {
// Test password isn't available.
$normalized = $this->serializer->normalize($this->user);
@@ -212,7 +212,7 @@ class EntitySerializationTest extends NormalizerTestBase {
/**
* Tests entity serialization for core's formats by a registered Serializer.
*/
- public function testSerialize() {
+ public function testSerialize(): void {
// Test that Serializer responds using the ComplexDataNormalizer and
// JsonEncoder. The output of ComplexDataNormalizer::normalize() is tested
// elsewhere, so we can just assume that it works properly here.
@@ -268,7 +268,7 @@ class EntitySerializationTest extends NormalizerTestBase {
/**
* Tests denormalization of an entity.
*/
- public function testDenormalize() {
+ public function testDenormalize(): void {
$normalized = $this->serializer->normalize($this->entity);
foreach (['json', 'xml'] as $type) {
@@ -283,7 +283,7 @@ class EntitySerializationTest extends NormalizerTestBase {
/**
* Tests denormalizing serialized columns.
*/
- public function testDenormalizeSerializedItem() {
+ public function testDenormalizeSerializedItem(): void {
$this->expectException(\LogicException::class);
$this->expectExceptionMessage('The generic FieldItemNormalizer cannot denormalize string values for "value" properties of the "serialized" field (field item class: Drupal\entity_test\Plugin\Field\FieldType\SerializedItem).');
$this->serializer->denormalize([
@@ -299,7 +299,7 @@ class EntitySerializationTest extends NormalizerTestBase {
/**
* Tests normalizing/denormalizing custom serialized columns.
*/
- public function testDenormalizeCustomSerializedItem() {
+ public function testDenormalizeCustomSerializedItem(): void {
$entity = EntitySerializedField::create(['serialized_text' => serialize(['Hello world!'])]);
$normalized = $this->serializer->normalize($entity);
$this->assertEquals(['Hello world!'], $normalized['serialized_text'][0]['value']);
@@ -318,7 +318,7 @@ class EntitySerializationTest extends NormalizerTestBase {
/**
* Tests normalizing/denormalizing invalid custom serialized fields.
*/
- public function testDenormalizeInvalidCustomSerializedField() {
+ public function testDenormalizeInvalidCustomSerializedField(): void {
$entity = EntitySerializedField::create(['serialized_long' => serialize(['Hello world!'])]);
$normalized = $this->serializer->normalize($entity);
$this->assertEquals(['Hello world!'], $normalized['serialized_long'][0]['value']);
@@ -337,7 +337,7 @@ class EntitySerializationTest extends NormalizerTestBase {
/**
* Tests normalizing/denormalizing empty custom serialized fields.
*/
- public function testDenormalizeEmptyCustomSerializedField() {
+ public function testDenormalizeEmptyCustomSerializedField(): void {
$entity = EntitySerializedField::create(['serialized_long' => serialize([])]);
$normalized = $this->serializer->normalize($entity);
$this->assertEquals([], $normalized['serialized_long'][0]['value']);
@@ -350,7 +350,7 @@ class EntitySerializationTest extends NormalizerTestBase {
/**
* Tests normalizing/denormalizing valid custom serialized fields.
*/
- public function testDenormalizeValidCustomSerializedField() {
+ public function testDenormalizeValidCustomSerializedField(): void {
$entity = EntitySerializedField::create(['serialized_long' => serialize(['key' => 'value'])]);
$normalized = $this->serializer->normalize($entity);
$this->assertEquals(['key' => 'value'], $normalized['serialized_long'][0]['value']);
@@ -363,7 +363,7 @@ class EntitySerializationTest extends NormalizerTestBase {
/**
* Tests normalizing/denormalizing using string values.
*/
- public function testDenormalizeStringValue() {
+ public function testDenormalizeStringValue(): void {
$this->expectException(\LogicException::class);
$this->expectExceptionMessage('The generic FieldItemNormalizer cannot denormalize string values for "value" properties of the "serialized_long" field (field item class: Drupal\Core\Field\Plugin\Field\FieldType\StringLongItem).');
$this->serializer->denormalize([
@@ -375,7 +375,7 @@ class EntitySerializationTest extends NormalizerTestBase {
/**
* Tests normalizing cacheable computed field.
*/
- public function testCacheableComputedField() {
+ public function testCacheableComputedField(): void {
$context[CacheableNormalizerInterface::SERIALIZATION_CONTEXT_CACHEABILITY] = new CacheableMetadata();
$entity = EntityTestComputedField::create();
$normalized = $this->serializer->normalize($entity, NULL, $context);
diff --git a/core/modules/serialization/tests/src/Kernel/FieldItemSerializationTest.php b/core/modules/serialization/tests/src/Kernel/FieldItemSerializationTest.php
index 16d44f937c1..2f5a958054b 100644
--- a/core/modules/serialization/tests/src/Kernel/FieldItemSerializationTest.php
+++ b/core/modules/serialization/tests/src/Kernel/FieldItemSerializationTest.php
@@ -124,7 +124,7 @@ class FieldItemSerializationTest extends NormalizerTestBase {
/**
* Tests normalizing and denormalizing an entity with field item normalizer.
*/
- public function testFieldNormalizeDenormalize() {
+ public function testFieldNormalizeDenormalize(): void {
$normalized = $this->serializer->normalize($this->entity, 'json');
$expected_field_value = $this->entity->field_test_text[0]->getValue()['value'] . '::silly_suffix';
@@ -148,7 +148,7 @@ class FieldItemSerializationTest extends NormalizerTestBase {
/**
* Tests denormalizing using a scalar field value.
*/
- public function testFieldDenormalizeWithScalarValue() {
+ public function testFieldDenormalizeWithScalarValue(): void {
$this->expectException(UnexpectedValueException::class);
$this->expectExceptionMessage('Field values for "uuid" must use an array structure');
@@ -170,7 +170,7 @@ class FieldItemSerializationTest extends NormalizerTestBase {
*
* @dataProvider providerTestCustomBooleanNormalization
*/
- public function testCustomBooleanNormalization(array $test_modules, $format) {
+ public function testCustomBooleanNormalization(array $test_modules, $format): void {
// Asserts the entity contains the value we set.
$this->assertFalse($this->entity->field_test_boolean->value);
diff --git a/core/modules/serialization/tests/src/Kernel/MapDataNormalizerTest.php b/core/modules/serialization/tests/src/Kernel/MapDataNormalizerTest.php
index 516cc3b45c1..fed6e2ab081 100644
--- a/core/modules/serialization/tests/src/Kernel/MapDataNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Kernel/MapDataNormalizerTest.php
@@ -44,7 +44,7 @@ class MapDataNormalizerTest extends KernelTestBase {
/**
* Tests whether map data can be normalized.
*/
- public function testMapNormalize() {
+ public function testMapNormalize(): void {
$typed_data = $this->buildExampleTypedData();
$data = $this->serializer->normalize($typed_data, 'json');
$expect_value = [
@@ -63,7 +63,7 @@ class MapDataNormalizerTest extends KernelTestBase {
/**
* Tests whether map data with properties can be normalized.
*/
- public function testMapWithPropertiesNormalize() {
+ public function testMapWithPropertiesNormalize(): void {
$typed_data = $this->buildExampleTypedDataWithProperties();
$data = $this->serializer->normalize($typed_data, 'json');
$expect_value = [
diff --git a/core/modules/serialization/tests/src/Kernel/SerializationTest.php b/core/modules/serialization/tests/src/Kernel/SerializationTest.php
index 9b43853ad56..8d85786495a 100644
--- a/core/modules/serialization/tests/src/Kernel/SerializationTest.php
+++ b/core/modules/serialization/tests/src/Kernel/SerializationTest.php
@@ -39,7 +39,7 @@ class SerializationTest extends KernelTestBase {
/**
* Confirms that modules can register normalizers and encoders.
*/
- public function testSerializerComponentRegistration() {
+ public function testSerializerComponentRegistration(): void {
$object = new \stdClass();
$format = 'serialization_test';
$expected = 'Normalized by SerializationTestNormalizer, Encoded by SerializationTestEncoder';
diff --git a/core/modules/serialization/tests/src/Unit/CompilerPass/RegisterSerializationClassesCompilerPassTest.php b/core/modules/serialization/tests/src/Unit/CompilerPass/RegisterSerializationClassesCompilerPassTest.php
index 99bd8da87f0..873b6ee658e 100644
--- a/core/modules/serialization/tests/src/Unit/CompilerPass/RegisterSerializationClassesCompilerPassTest.php
+++ b/core/modules/serialization/tests/src/Unit/CompilerPass/RegisterSerializationClassesCompilerPassTest.php
@@ -19,7 +19,7 @@ class RegisterSerializationClassesCompilerPassTest extends UnitTestCase {
/**
* @covers ::process
*/
- public function testEncoders() {
+ public function testEncoders(): void {
$container = new ContainerBuilder();
$serializer_definition = new Definition(Serializer::class, [[], []]);
diff --git a/core/modules/serialization/tests/src/Unit/Encoder/JsonEncoderTest.php b/core/modules/serialization/tests/src/Unit/Encoder/JsonEncoderTest.php
index 82cb1768e9c..9f06fd07af6 100644
--- a/core/modules/serialization/tests/src/Unit/Encoder/JsonEncoderTest.php
+++ b/core/modules/serialization/tests/src/Unit/Encoder/JsonEncoderTest.php
@@ -16,7 +16,7 @@ class JsonEncoderTest extends UnitTestCase {
/**
* Tests the supportsEncoding() method.
*/
- public function testSupportsEncoding() {
+ public function testSupportsEncoding(): void {
$encoder = new JsonEncoder();
$this->assertTrue($encoder->supportsEncoding('json'));
diff --git a/core/modules/serialization/tests/src/Unit/Encoder/XmlEncoderTest.php b/core/modules/serialization/tests/src/Unit/Encoder/XmlEncoderTest.php
index 151413de3e0..37c8326d511 100644
--- a/core/modules/serialization/tests/src/Unit/Encoder/XmlEncoderTest.php
+++ b/core/modules/serialization/tests/src/Unit/Encoder/XmlEncoderTest.php
@@ -49,7 +49,7 @@ class XmlEncoderTest extends UnitTestCase {
/**
* Tests the supportsEncoding() method.
*/
- public function testSupportsEncoding() {
+ public function testSupportsEncoding(): void {
$this->assertTrue($this->encoder->supportsEncoding('xml'));
$this->assertFalse($this->encoder->supportsEncoding('json'));
}
@@ -57,7 +57,7 @@ class XmlEncoderTest extends UnitTestCase {
/**
* Tests the supportsDecoding() method.
*/
- public function testSupportsDecoding() {
+ public function testSupportsDecoding(): void {
$this->assertTrue($this->encoder->supportsDecoding('xml'));
$this->assertFalse($this->encoder->supportsDecoding('json'));
}
@@ -65,7 +65,7 @@ class XmlEncoderTest extends UnitTestCase {
/**
* Tests the encode() method.
*/
- public function testEncode() {
+ public function testEncode(): void {
$this->baseEncoder->expects($this->once())
->method('encode')
->with($this->testArray, 'test', [])
@@ -77,7 +77,7 @@ class XmlEncoderTest extends UnitTestCase {
/**
* Tests the decode() method.
*/
- public function testDecode() {
+ public function testDecode(): void {
$this->baseEncoder->expects($this->once())
->method('decode')
->with('test', 'test', [])
@@ -89,7 +89,7 @@ class XmlEncoderTest extends UnitTestCase {
/**
* @covers ::getBaseEncoder
*/
- public function testDefaultEncoderHasSerializer() {
+ public function testDefaultEncoderHasSerializer(): void {
// The serializer should be set on the Drupal encoder, which should then
// set it on our default encoder.
$encoder = new XmlEncoder();
diff --git a/core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php b/core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php
index 7e0c50c20f7..7889d4ad15b 100644
--- a/core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php
+++ b/core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php
@@ -50,7 +50,7 @@ class ChainEntityResolverTest extends UnitTestCase {
* @covers ::__construct
* @covers ::resolve
*/
- public function testResolverWithNoneResolved() {
+ public function testResolverWithNoneResolved(): void {
$resolvers = [
$this->createEntityResolverMock(),
$this->createEntityResolverMock(),
@@ -67,7 +67,7 @@ class ChainEntityResolverTest extends UnitTestCase {
* @covers ::addResolver
* @covers ::resolve
*/
- public function testResolverWithNoneResolvedUsingAddResolver() {
+ public function testResolverWithNoneResolvedUsingAddResolver(): void {
$resolver = new ChainEntityResolver();
$resolver->addResolver($this->createEntityResolverMock());
$resolver->addResolver($this->createEntityResolverMock());
@@ -81,7 +81,7 @@ class ChainEntityResolverTest extends UnitTestCase {
* @covers ::__construct
* @covers ::resolve
*/
- public function testResolverWithFirstResolved() {
+ public function testResolverWithFirstResolved(): void {
$resolvers = [
$this->createEntityResolverMock(10),
$this->createEntityResolverMock(NULL, FALSE),
@@ -98,7 +98,7 @@ class ChainEntityResolverTest extends UnitTestCase {
* @covers ::__construct
* @covers ::resolve
*/
- public function testResolverWithLastResolved() {
+ public function testResolverWithLastResolved(): void {
$resolvers = [
$this->createEntityResolverMock(),
$this->createEntityResolverMock(10),
@@ -115,7 +115,7 @@ class ChainEntityResolverTest extends UnitTestCase {
* @covers ::__construct
* @covers ::resolve
*/
- public function testResolverWithResolvedToZero() {
+ public function testResolverWithResolvedToZero(): void {
$resolvers = [
$this->createEntityResolverMock(0),
$this->createEntityResolverMock(NULL, FALSE),
diff --git a/core/modules/serialization/tests/src/Unit/EntityResolver/UuidResolverTest.php b/core/modules/serialization/tests/src/Unit/EntityResolver/UuidResolverTest.php
index 545c41c47d4..edec9d695f3 100644
--- a/core/modules/serialization/tests/src/Unit/EntityResolver/UuidResolverTest.php
+++ b/core/modules/serialization/tests/src/Unit/EntityResolver/UuidResolverTest.php
@@ -42,7 +42,7 @@ class UuidResolverTest extends UnitTestCase {
/**
* Tests resolve() with a class using the incorrect interface.
*/
- public function testResolveNotInInterface() {
+ public function testResolveNotInInterface(): void {
$this->entityRepository->expects($this->never())
->method('loadEntityByUuid');
@@ -53,7 +53,7 @@ class UuidResolverTest extends UnitTestCase {
/**
* Tests resolve() with a class using the correct interface but no UUID.
*/
- public function testResolveNoUuid() {
+ public function testResolveNoUuid(): void {
$this->entityRepository->expects($this->never())
->method('loadEntityByUuid');
@@ -68,7 +68,7 @@ class UuidResolverTest extends UnitTestCase {
/**
* Tests resolve() with correct interface but no matching entity for the UUID.
*/
- public function testResolveNoEntity() {
+ public function testResolveNoEntity(): void {
$uuid = '392eab92-35c2-4625-872d-a9dab4da008e';
$this->entityRepository->expects($this->once())
@@ -88,7 +88,7 @@ class UuidResolverTest extends UnitTestCase {
/**
* Tests resolve() when a UUID corresponds to an entity.
*/
- public function testResolveWithEntity() {
+ public function testResolveWithEntity(): void {
$uuid = '392eab92-35c2-4625-872d-a9dab4da008e';
$entity = $this->createMock('Drupal\Core\Entity\EntityInterface');
diff --git a/core/modules/serialization/tests/src/Unit/EventSubscriber/DefaultExceptionSubscriberTest.php b/core/modules/serialization/tests/src/Unit/EventSubscriber/DefaultExceptionSubscriberTest.php
index 59732c4b9b4..c3add6f1790 100644
--- a/core/modules/serialization/tests/src/Unit/EventSubscriber/DefaultExceptionSubscriberTest.php
+++ b/core/modules/serialization/tests/src/Unit/EventSubscriber/DefaultExceptionSubscriberTest.php
@@ -23,7 +23,7 @@ class DefaultExceptionSubscriberTest extends UnitTestCase {
/**
* @covers ::on4xx
*/
- public function testOn4xx() {
+ public function testOn4xx(): void {
$kernel = $this->prophesize(HttpKernelInterface::class);
$request = Request::create('/test');
$request->setRequestFormat('json');
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/ComplexDataNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/ComplexDataNormalizerTest.php
index 608fb369355..31ecaa4a37f 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/ComplexDataNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/ComplexDataNormalizerTest.php
@@ -43,7 +43,7 @@ class ComplexDataNormalizerTest extends UnitTestCase {
/**
* @covers ::supportsNormalization
*/
- public function testSupportsNormalization() {
+ public function testSupportsNormalization(): void {
$complex_data = $this->prophesize(ComplexDataInterface::class)->reveal();
$this->assertTrue($this->normalizer->supportsNormalization($complex_data));
// Also test that an object not implementing ComplexDataInterface fails.
@@ -55,7 +55,7 @@ class ComplexDataNormalizerTest extends UnitTestCase {
*
* @covers ::normalize
*/
- public function testNormalizeComplexData() {
+ public function testNormalizeComplexData(): void {
$serializer_prophecy = $this->prophesize(Serializer::class);
$non_internal_property = $this->getTypedDataProperty(FALSE);
@@ -86,7 +86,7 @@ class ComplexDataNormalizerTest extends UnitTestCase {
*
* @covers ::normalize
*/
- public function testNormalizeNonComplex() {
+ public function testNormalizeNonComplex(): void {
$normalizer = new TestExtendedNormalizer();
$serialization_context = ['test' => 'test'];
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/ConfigEntityNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/ConfigEntityNormalizerTest.php
index 65fc0c35e61..f8c4d11d3a8 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/ConfigEntityNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/ConfigEntityNormalizerTest.php
@@ -23,7 +23,7 @@ class ConfigEntityNormalizerTest extends UnitTestCase {
*
* @covers ::normalize
*/
- public function testNormalize() {
+ public function testNormalize(): void {
$test_export_properties = [
'test' => 'test',
'_core' => [
@@ -52,7 +52,7 @@ class ConfigEntityNormalizerTest extends UnitTestCase {
/**
* @covers ::denormalize
*/
- public function testDenormalize() {
+ public function testDenormalize(): void {
$test_value = $this->randomMachineName();
$data = [
'test' => $test_value,
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php
index ee6e9463436..819d91383be 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php
@@ -56,7 +56,7 @@ class ContentEntityNormalizerTest extends UnitTestCase {
/**
* @covers ::supportsNormalization
*/
- public function testSupportsNormalization() {
+ public function testSupportsNormalization(): void {
$content_mock = $this->createMock('Drupal\Core\Entity\ContentEntityInterface');
$config_mock = $this->createMock('Drupal\Core\Config\Entity\ConfigEntityInterface');
$this->assertTrue($this->contentEntityNormalizer->supportsNormalization($content_mock));
@@ -68,7 +68,7 @@ class ContentEntityNormalizerTest extends UnitTestCase {
*
* @covers ::normalize
*/
- public function testNormalize() {
+ public function testNormalize(): void {
$this->serializer->normalize(Argument::type(FieldItemListInterface::class),
'test_format', ['account' => NULL])->willReturn('test');
@@ -94,7 +94,7 @@ class ContentEntityNormalizerTest extends UnitTestCase {
*
* @covers ::normalize
*/
- public function testNormalizeWithAccountContext() {
+ public function testNormalizeWithAccountContext(): void {
$mock_account = $this->createMock('Drupal\Core\Session\AccountInterface');
$context = [
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php
index a3e41b71a0f..a6089b3a31a 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php
@@ -64,7 +64,7 @@ class DateTimeIso8601NormalizerTest extends UnitTestCase {
/**
* @covers ::supportsNormalization
*/
- public function testSupportsNormalization() {
+ public function testSupportsNormalization(): void {
$this->assertTrue($this->normalizer->supportsNormalization($this->data->reveal()));
$datetime = $this->prophesize(DateTimeInterface::class);
@@ -77,7 +77,7 @@ class DateTimeIso8601NormalizerTest extends UnitTestCase {
/**
* @covers ::supportsDenormalization
*/
- public function testSupportsDenormalization() {
+ public function testSupportsDenormalization(): void {
$this->assertTrue($this->normalizer->supportsDenormalization($this->data->reveal(), DateTimeIso8601::class));
}
@@ -85,7 +85,7 @@ class DateTimeIso8601NormalizerTest extends UnitTestCase {
* @covers ::normalize
* @dataProvider providerTestNormalize
*/
- public function testNormalize($parent_field_item_class, $datetime_type, $expected_format) {
+ public function testNormalize($parent_field_item_class, $datetime_type, $expected_format): void {
$formatted_string = $this->randomMachineName();
$field_item = $this->prophesize($parent_field_item_class);
@@ -122,7 +122,7 @@ class DateTimeIso8601NormalizerTest extends UnitTestCase {
* @covers ::normalize
* @dataProvider providerTestNormalize
*/
- public function testNormalizeWhenNull($parent_field_item_class, $datetime_type, $expected_format) {
+ public function testNormalizeWhenNull($parent_field_item_class, $datetime_type, $expected_format): void {
$field_item = $this->prophesize($parent_field_item_class);
if ($parent_field_item_class === DateTimeItem::class) {
$field_storage_definition = $this->prophesize(FieldStorageDefinitionInterface::class);
@@ -183,7 +183,7 @@ class DateTimeIso8601NormalizerTest extends UnitTestCase {
* @covers ::denormalize
* @dataProvider providerTestDenormalizeValidFormats
*/
- public function testDenormalizeValidFormats($type, $normalized, $expected) {
+ public function testDenormalizeValidFormats($type, $normalized, $expected): void {
$field_definition = $this->prophesize(FieldDefinitionInterface::class);
$field_definition->getSetting('datetime_type')->willReturn($type === 'date-only' ? DateTimeItem::DATETIME_TYPE_DATE : DateTimeItem::DATETIME_TYPE_DATETIME);
$denormalized = $this->normalizer->denormalize($normalized, DateTimeIso8601::class, NULL, [
@@ -217,7 +217,7 @@ class DateTimeIso8601NormalizerTest extends UnitTestCase {
*
* @covers ::denormalize
*/
- public function testDenormalizeDateOnlyException() {
+ public function testDenormalizeDateOnlyException(): void {
$this->expectException(UnexpectedValueException::class);
$this->expectExceptionMessage('The specified date "2016/11/06" is not in an accepted format: "Y-m-d" (date-only).');
@@ -233,7 +233,7 @@ class DateTimeIso8601NormalizerTest extends UnitTestCase {
*
* @covers ::denormalize
*/
- public function testDenormalizeDateAndTimeException() {
+ public function testDenormalizeDateAndTimeException(): void {
$this->expectException(UnexpectedValueException::class);
$this->expectExceptionMessage('The specified date "on a rainy day" is not in an accepted format: "Y-m-d\TH:i:sP" (RFC 3339), "Y-m-d\TH:i:sO" (ISO 8601).');
@@ -249,7 +249,7 @@ class DateTimeIso8601NormalizerTest extends UnitTestCase {
*
* @covers ::denormalize
*/
- public function testDenormalizeNoTargetInstanceOrFieldDefinitionException() {
+ public function testDenormalizeNoTargetInstanceOrFieldDefinitionException(): void {
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('$context[\'target_instance\'] or $context[\'field_definition\'] must be set to denormalize with the DateTimeIso8601Normalizer');
$this->normalizer->denormalize('', DateTimeIso8601::class, NULL, []);
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php
index 72cbcf1928b..2091f0279b6 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php
@@ -57,7 +57,7 @@ class DateTimeNormalizerTest extends UnitTestCase {
/**
* @covers ::supportsNormalization
*/
- public function testSupportsNormalization() {
+ public function testSupportsNormalization(): void {
$this->assertTrue($this->normalizer->supportsNormalization($this->data->reveal()));
$datetimeiso8601 = $this->prophesize(DateTimeIso8601::class);
@@ -70,14 +70,14 @@ class DateTimeNormalizerTest extends UnitTestCase {
/**
* @covers ::supportsDenormalization
*/
- public function testSupportsDenormalization() {
+ public function testSupportsDenormalization(): void {
$this->assertTrue($this->normalizer->supportsDenormalization($this->data->reveal(), DateTimeInterface::class));
}
/**
* @covers ::normalize
*/
- public function testNormalize() {
+ public function testNormalize(): void {
$random_rfc_3339_string = $this->randomMachineName();
$drupal_date_time = $this->prophesize(DateTimeNormalizerTestDrupalDateTime::class);
@@ -96,7 +96,7 @@ class DateTimeNormalizerTest extends UnitTestCase {
/**
* @covers ::normalize
*/
- public function testNormalizeWhenNull() {
+ public function testNormalizeWhenNull(): void {
$this->data->getDateTime()
->willReturn(NULL);
@@ -110,7 +110,7 @@ class DateTimeNormalizerTest extends UnitTestCase {
* @covers ::denormalize
* @dataProvider providerTestDenormalizeValidFormats
*/
- public function testDenormalizeValidFormats($normalized, $expected) {
+ public function testDenormalizeValidFormats($normalized, $expected): void {
$denormalized = $this->normalizer->denormalize($normalized, DateTimeInterface::class, NULL, []);
$this->assertSame(0, $denormalized->getTimestamp() - $expected->getTimestamp());
$this->assertEquals($expected, $denormalized);
@@ -141,7 +141,7 @@ class DateTimeNormalizerTest extends UnitTestCase {
* @covers ::denormalize
* @dataProvider providerTestDenormalizeUserFormats
*/
- public function testDenormalizeUserFormats($normalized, $format, $expected) {
+ public function testDenormalizeUserFormats($normalized, $format, $expected): void {
$denormalized = $this->normalizer->denormalize($normalized, DateTimeInterface::class, NULL, ['datetime_allowed_formats' => [$format]]);
$this->assertSame(0, $denormalized->getTimestamp() - $expected->getTimestamp());
$this->assertEquals($expected, $denormalized);
@@ -167,7 +167,7 @@ class DateTimeNormalizerTest extends UnitTestCase {
*
* @covers ::denormalize
*/
- public function testDenormalizeException() {
+ public function testDenormalizeException(): void {
$this->expectException(UnexpectedValueException::class);
$this->expectExceptionMessage('The specified date "2016/11/06 09:02am GMT" is not in an accepted format: "Y-m-d\TH:i:sP" (RFC 3339), "Y-m-d\TH:i:sO" (ISO 8601).');
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php
index cd79efaff99..1db10b224d9 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php
@@ -77,7 +77,7 @@ class EntityNormalizerTest extends UnitTestCase {
*
* @covers ::normalize
*/
- public function testNormalize() {
+ public function testNormalize(): void {
$list_item_1 = $this->createMock('Drupal\Core\TypedData\TypedDataInterface');
$list_item_2 = $this->createMock('Drupal\Core\TypedData\TypedDataInterface');
@@ -108,7 +108,7 @@ class EntityNormalizerTest extends UnitTestCase {
*
* @covers ::denormalize
*/
- public function testDenormalizeWithNoEntityType() {
+ public function testDenormalizeWithNoEntityType(): void {
$this->expectException(UnexpectedValueException::class);
$this->entityNormalizer->denormalize([], ContentEntityBaseMockableClass::class);
}
@@ -118,7 +118,7 @@ class EntityNormalizerTest extends UnitTestCase {
*
* @covers ::denormalize
*/
- public function testDenormalizeWithValidBundle() {
+ public function testDenormalizeWithValidBundle(): void {
$test_data = [
'key_1' => 'value_1',
'key_2' => 'value_2',
@@ -235,7 +235,7 @@ class EntityNormalizerTest extends UnitTestCase {
*
* @covers ::denormalize
*/
- public function testDenormalizeWithInvalidBundle() {
+ public function testDenormalizeWithInvalidBundle(): void {
$test_data = [
'key_1' => 'value_1',
'key_2' => 'value_2',
@@ -317,7 +317,7 @@ class EntityNormalizerTest extends UnitTestCase {
*
* @covers ::denormalize
*/
- public function testDenormalizeWithNoBundle() {
+ public function testDenormalizeWithNoBundle(): void {
$test_data = [
'key_1' => 'value_1',
'key_2' => 'value_2',
@@ -385,7 +385,7 @@ class EntityNormalizerTest extends UnitTestCase {
*
* @covers ::denormalize
*/
- public function testDenormalizeWithNoFieldableEntityType() {
+ public function testDenormalizeWithNoFieldableEntityType(): void {
$test_data = [
'key_1' => 'value_1',
'key_2' => 'value_2',
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php
index f48fe477d8c..905598fea78 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php
@@ -97,7 +97,7 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
/**
* @covers ::supportsNormalization
*/
- public function testSupportsNormalization() {
+ public function testSupportsNormalization(): void {
$this->assertTrue($this->normalizer->supportsNormalization($this->fieldItem->reveal()));
$this->assertFalse($this->normalizer->supportsNormalization(new \stdClass()));
}
@@ -105,7 +105,7 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
/**
* @covers ::supportsDenormalization
*/
- public function testSupportsDenormalization() {
+ public function testSupportsDenormalization(): void {
$this->assertTrue($this->normalizer->supportsDenormalization([], EntityReferenceItem::class));
$this->assertFalse($this->normalizer->supportsDenormalization([], FieldItemInterface::class));
}
@@ -113,7 +113,7 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
/**
* @covers ::normalize
*/
- public function testNormalize() {
+ public function testNormalize(): void {
$test_url = '/test/100';
$generated_url = (new GeneratedUrl())->setGeneratedUrl($test_url);
@@ -169,7 +169,7 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
$this->assertSame($expected, $normalized);
}
- public function testNormalizeWithNewEntityReference() {
+ public function testNormalizeWithNewEntityReference(): void {
$test_url = '/test/100';
$generated_url = (new GeneratedUrl())->setGeneratedUrl($test_url);
@@ -227,7 +227,7 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
/**
* @covers ::normalize
*/
- public function testNormalizeWithEmptyTaxonomyTermReference() {
+ public function testNormalizeWithEmptyTaxonomyTermReference(): void {
// Override the serializer prophecy from setUp() to return a zero value.
$this->serializer = $this->prophesize(Serializer::class);
// Set up the serializer to return an entity property.
@@ -267,7 +267,7 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
/**
* @covers ::normalize
*/
- public function testNormalizeWithNoEntity() {
+ public function testNormalizeWithNoEntity(): void {
$entity_reference = $this->prophesize(TypedDataInterface::class);
$entity_reference->getValue()
->willReturn(NULL)
@@ -299,7 +299,7 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
/**
* @covers ::denormalize
*/
- public function testDenormalizeWithTypeAndUuid() {
+ public function testDenormalizeWithTypeAndUuid(): void {
$data = [
'target_id' => 'test',
'target_type' => 'test_type',
@@ -326,7 +326,7 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
/**
* @covers ::denormalize
*/
- public function testDenormalizeWithUuidWithoutType() {
+ public function testDenormalizeWithUuidWithoutType(): void {
$data = [
'target_id' => 'test',
'target_uuid' => '080e3add-f9d5-41ac-9821-eea55b7b42fb',
@@ -352,7 +352,7 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
/**
* @covers ::denormalize
*/
- public function testDenormalizeWithUuidWithIncorrectType() {
+ public function testDenormalizeWithUuidWithIncorrectType(): void {
$this->expectException(UnexpectedValueException::class);
$this->expectExceptionMessage('The field "field_reference" property "target_type" must be set to "test_type" or omitted.');
@@ -373,7 +373,7 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
/**
* @covers ::denormalize
*/
- public function testDenormalizeWithTypeWithIncorrectUuid() {
+ public function testDenormalizeWithTypeWithIncorrectUuid(): void {
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('No "test_type" entity found with UUID "unique-but-none-non-existent" for field "field_reference"');
@@ -397,7 +397,7 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
/**
* @covers ::denormalize
*/
- public function testDenormalizeWithEmptyUuid() {
+ public function testDenormalizeWithEmptyUuid(): void {
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('If provided "target_uuid" cannot be empty for field "field_reference".');
@@ -417,7 +417,7 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
/**
* @covers ::denormalize
*/
- public function testDenormalizeWithId() {
+ public function testDenormalizeWithId(): void {
$data = [
'target_id' => 'test',
];
@@ -480,7 +480,7 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
/**
* @covers ::constructValue
*/
- public function testConstructValueProperties() {
+ public function testConstructValueProperties(): void {
$data = [
'target_id' => 'test',
'target_type' => 'test_type',
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/ListNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/ListNormalizerTest.php
index 823f4166311..749cb785916 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/ListNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/ListNormalizerTest.php
@@ -79,7 +79,7 @@ class ListNormalizerTest extends UnitTestCase {
/**
* Tests the supportsNormalization() method.
*/
- public function testSupportsNormalization() {
+ public function testSupportsNormalization(): void {
$this->assertTrue($this->normalizer->supportsNormalization($this->list));
$this->assertFalse($this->normalizer->supportsNormalization(new \stdClass()));
}
@@ -87,7 +87,7 @@ class ListNormalizerTest extends UnitTestCase {
/**
* Tests the normalize() method.
*/
- public function testNormalize() {
+ public function testNormalize(): void {
$serializer = $this->prophesize(Serializer::class);
$serializer->normalize($this->typedData, 'json', ['mu' => 'nu'])
->shouldBeCalledTimes(3)
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/NormalizerBaseTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/NormalizerBaseTest.php
index f4ed459598c..8fe665113e2 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/NormalizerBaseTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/NormalizerBaseTest.php
@@ -25,7 +25,7 @@ class NormalizerBaseTest extends UnitTestCase {
* @param string $supported_types
* (optional) The supported interface or class to set on the normalizer.
*/
- public function testSupportsNormalization($expected_return, $data, $supported_types = NULL) {
+ public function testSupportsNormalization($expected_return, $data, $supported_types = NULL): void {
$normalizer_base = $this->getMockForAbstractClass('Drupal\Tests\serialization\Unit\Normalizer\TestNormalizerBase');
if (isset($supported_types)) {
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/NullNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/NullNormalizerTest.php
index c26417520e6..288a4935457 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/NullNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/NullNormalizerTest.php
@@ -40,7 +40,7 @@ class NullNormalizerTest extends UnitTestCase {
* @covers ::__construct
* @covers ::supportsNormalization
*/
- public function testSupportsNormalization() {
+ public function testSupportsNormalization(): void {
$mock = $this->createMock('Drupal\Core\TypedData\TypedDataInterface');
$this->assertTrue($this->normalizer->supportsNormalization($mock));
// Also test that an object not implementing TypedDataInterface fails.
@@ -50,7 +50,7 @@ class NullNormalizerTest extends UnitTestCase {
/**
* @covers ::normalize
*/
- public function testNormalize() {
+ public function testNormalize(): void {
$mock = $this->createMock('Drupal\Core\TypedData\TypedDataInterface');
$this->assertNull($this->normalizer->normalize($mock));
}
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/PrimitiveDataNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/PrimitiveDataNormalizerTest.php
index f7107fecfcf..3d55447e823 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/PrimitiveDataNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/PrimitiveDataNormalizerTest.php
@@ -37,14 +37,14 @@ class PrimitiveDataNormalizerTest extends UnitTestCase {
* @covers ::supportsNormalization
* @dataProvider dataProviderPrimitiveData
*/
- public function testSupportsNormalization($primitive_data, $expected) {
+ public function testSupportsNormalization($primitive_data, $expected): void {
$this->assertTrue($this->normalizer->supportsNormalization($primitive_data));
}
/**
* @covers ::supportsNormalization
*/
- public function testSupportsNormalizationFail() {
+ public function testSupportsNormalizationFail(): void {
// Test that an object not implementing PrimitiveInterface fails.
$this->assertFalse($this->normalizer->supportsNormalization(new \stdClass()));
}
@@ -53,7 +53,7 @@ class PrimitiveDataNormalizerTest extends UnitTestCase {
* @covers ::normalize
* @dataProvider dataProviderPrimitiveData
*/
- public function testNormalize($primitive_data, $expected) {
+ public function testNormalize($primitive_data, $expected): void {
$this->assertSame($expected, $this->normalizer->normalize($primitive_data));
}
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/TimestampItemNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/TimestampItemNormalizerTest.php
index 0bc9e6b3de4..931fbe1aa01 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/TimestampItemNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/TimestampItemNormalizerTest.php
@@ -49,7 +49,7 @@ class TimestampItemNormalizerTest extends UnitTestCase {
/**
* @covers ::supportsNormalization
*/
- public function testSupportsNormalization() {
+ public function testSupportsNormalization(): void {
$timestamp_item = $this->createTimestampItemProphecy();
$this->assertTrue($this->normalizer->supportsNormalization($timestamp_item->reveal()));
@@ -60,7 +60,7 @@ class TimestampItemNormalizerTest extends UnitTestCase {
/**
* @covers ::supportsDenormalization
*/
- public function testSupportsDenormalization() {
+ public function testSupportsDenormalization(): void {
$timestamp_item = $this->createTimestampItemProphecy();
$this->assertTrue($this->normalizer->supportsDenormalization($timestamp_item->reveal(), TimestampItem::class));
@@ -76,7 +76,7 @@ class TimestampItemNormalizerTest extends UnitTestCase {
* @covers ::normalize
* @see \Drupal\Tests\serialization\Unit\Normalizer\TimestampNormalizerTest
*/
- public function testNormalize() {
+ public function testNormalize(): void {
// Mock TimestampItem @FieldType, which contains a Timestamp @DataType,
// which has a DataDefinition.
$data_definition = $this->prophesize(DataDefinitionInterface::class);
@@ -112,7 +112,7 @@ class TimestampItemNormalizerTest extends UnitTestCase {
/**
* @covers ::denormalize
*/
- public function testDenormalize() {
+ public function testDenormalize(): void {
$timestamp_item_normalization = [
'value' => $this->randomMachineName(),
'format' => \DateTime::RFC3339,
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/TimestampNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/TimestampNormalizerTest.php
index f64f9c8e010..f5a172096dd 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/TimestampNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/TimestampNormalizerTest.php
@@ -49,7 +49,7 @@ class TimestampNormalizerTest extends UnitTestCase {
/**
* @covers ::supportsNormalization
*/
- public function testSupportsNormalization() {
+ public function testSupportsNormalization(): void {
$this->assertTrue($this->normalizer->supportsNormalization($this->data->reveal()));
$integer = $this->prophesize(IntegerData::class);
@@ -62,14 +62,14 @@ class TimestampNormalizerTest extends UnitTestCase {
/**
* @covers ::supportsDenormalization
*/
- public function testSupportsDenormalization() {
+ public function testSupportsDenormalization(): void {
$this->assertTrue($this->normalizer->supportsDenormalization($this->data->reveal(), Timestamp::class));
}
/**
* @covers ::normalize
*/
- public function testNormalize() {
+ public function testNormalize(): void {
$random_rfc_3339_string = $this->randomMachineName();
$drupal_date_time = $this->prophesize(TimestampNormalizerTestDrupalDateTime::class);
@@ -91,7 +91,7 @@ class TimestampNormalizerTest extends UnitTestCase {
* @covers ::denormalize
* @dataProvider providerTestDenormalizeValidFormats
*/
- public function testDenormalizeValidFormats($normalized, $expected) {
+ public function testDenormalizeValidFormats($normalized, $expected): void {
$denormalized = $this->normalizer->denormalize($normalized, Timestamp::class, NULL, []);
$this->assertSame($expected, $denormalized);
}
@@ -123,7 +123,7 @@ class TimestampNormalizerTest extends UnitTestCase {
*
* @covers ::denormalize
*/
- public function testDenormalizeException() {
+ public function testDenormalizeException(): void {
$this->expectException(UnexpectedValueException::class);
$this->expectExceptionMessage('The specified date "2016/11/06 09:02am GMT" is not in an accepted format: "U" (UNIX timestamp), "Y-m-d\TH:i:sO" (ISO 8601), "Y-m-d\TH:i:sP" (RFC 3339).');
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/TypedDataNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/TypedDataNormalizerTest.php
index 4bd2140ead6..004d70d0379 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/TypedDataNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/TypedDataNormalizerTest.php
@@ -40,7 +40,7 @@ class TypedDataNormalizerTest extends UnitTestCase {
/**
* Tests the supportsNormalization() method.
*/
- public function testSupportsNormalization() {
+ public function testSupportsNormalization(): void {
$this->assertTrue($this->normalizer->supportsNormalization($this->typedData));
// Also test that an object not implementing TypedDataInterface fails.
$this->assertFalse($this->normalizer->supportsNormalization(new \stdClass()));
@@ -49,7 +49,7 @@ class TypedDataNormalizerTest extends UnitTestCase {
/**
* Tests the normalize() method.
*/
- public function testNormalize() {
+ public function testNormalize(): void {
$this->typedData->expects($this->once())
->method('getValue')
->willReturn('test');
diff --git a/core/modules/settings_tray/tests/src/Functional/SettingsTrayTest.php b/core/modules/settings_tray/tests/src/Functional/SettingsTrayTest.php
index 510afa6ff1b..d759696e9ea 100644
--- a/core/modules/settings_tray/tests/src/Functional/SettingsTrayTest.php
+++ b/core/modules/settings_tray/tests/src/Functional/SettingsTrayTest.php
@@ -49,7 +49,7 @@ class SettingsTrayTest extends BrowserTestBase {
*
* @see SettingsTrayBlockFormTest::testBlocks()
*/
- public function testPossibleAnnotations() {
+ public function testPossibleAnnotations(): void {
$test_block_plugin_ids = [
// Block that explicitly provides an "settings_tray" form class.
'settings_tray_test_class',
@@ -87,7 +87,7 @@ class SettingsTrayTest extends BrowserTestBase {
/**
* Tests that certain blocks opt out from Settings Tray.
*/
- public function testOptOut() {
+ public function testOptOut(): void {
$web_assert = $this->assertSession();
$non_excluded_block = $this->placeBlock('system_powered_by_block');
diff --git a/core/modules/settings_tray/tests/src/FunctionalJavascript/ConfigAccessTest.php b/core/modules/settings_tray/tests/src/FunctionalJavascript/ConfigAccessTest.php
index 47d35f3ec1d..023d3f3a367 100644
--- a/core/modules/settings_tray/tests/src/FunctionalJavascript/ConfigAccessTest.php
+++ b/core/modules/settings_tray/tests/src/FunctionalJavascript/ConfigAccessTest.php
@@ -44,7 +44,7 @@ class ConfigAccessTest extends SettingsTrayTestBase {
/**
* Tests access to block forms with related configuration is correct.
*/
- public function testBlockConfigAccess() {
+ public function testBlockConfigAccess(): void {
$page = $this->getSession()->getPage();
$web_assert = $this->assertSession();
diff --git a/core/modules/settings_tray/tests/src/FunctionalJavascript/OverriddenConfigurationTest.php b/core/modules/settings_tray/tests/src/FunctionalJavascript/OverriddenConfigurationTest.php
index 86d4a25f07b..085b9d6def1 100644
--- a/core/modules/settings_tray/tests/src/FunctionalJavascript/OverriddenConfigurationTest.php
+++ b/core/modules/settings_tray/tests/src/FunctionalJavascript/OverriddenConfigurationTest.php
@@ -46,7 +46,7 @@ class OverriddenConfigurationTest extends SettingsTrayTestBase {
/**
* Tests blocks with overridden related configuration removed when overridden.
*/
- public function testOverriddenConfigurationRemoved() {
+ public function testOverriddenConfigurationRemoved(): void {
$web_assert = $this->assertSession();
$page = $this->getSession()->getPage();
$this->grantPermissions(Role::load(Role::AUTHENTICATED_ID), ['administer site configuration', 'administer menu']);
@@ -119,7 +119,7 @@ class OverriddenConfigurationTest extends SettingsTrayTestBase {
/**
* Tests that blocks with configuration overrides are disabled.
*/
- public function testOverriddenBlock() {
+ public function testOverriddenBlock(): void {
$web_assert = $this->assertSession();
$page = $this->getSession()->getPage();
$overridden_block = $this->placeBlock('system_powered_by_block', [
diff --git a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
index 68f29bb8de6..cecace7ee32 100644
--- a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
+++ b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
@@ -50,7 +50,7 @@ class SettingsTrayBlockFormTest extends SettingsTrayTestBase {
/**
* Tests opening off-canvas dialog by click blocks and elements in the blocks.
*/
- public function testBlocks() {
+ public function testBlocks(): void {
foreach ($this->getBlockTests() as $test) {
call_user_func_array([$this, 'doTestBlocks'], array_values($test));
}
@@ -231,7 +231,7 @@ class SettingsTrayBlockFormTest extends SettingsTrayTestBase {
/**
* Tests enabling and disabling Edit Mode.
*/
- public function testEditModeEnableDisable() {
+ public function testEditModeEnableDisable(): void {
$this->markTestSkipped("Skipped due to frequent random test failures. See https://www.drupal.org/project/drupal/issues/3317520");
foreach (static::getTestThemes() as $theme) {
$this->enableTheme($theme);
@@ -267,7 +267,7 @@ class SettingsTrayBlockFormTest extends SettingsTrayTestBase {
/**
* Tests that validation errors appear in the off-canvas dialog.
*/
- public function testValidationMessages() {
+ public function testValidationMessages(): void {
$page = $this->getSession()->getPage();
$web_assert = $this->assertSession();
foreach (static::getTestThemes() as $theme) {
diff --git a/core/modules/settings_tray/tests/src/Unit/Access/BlockPluginHasSettingsTrayFormAccessCheckTest.php b/core/modules/settings_tray/tests/src/Unit/Access/BlockPluginHasSettingsTrayFormAccessCheckTest.php
index 3c9e1903106..7228eec0da6 100644
--- a/core/modules/settings_tray/tests/src/Unit/Access/BlockPluginHasSettingsTrayFormAccessCheckTest.php
+++ b/core/modules/settings_tray/tests/src/Unit/Access/BlockPluginHasSettingsTrayFormAccessCheckTest.php
@@ -26,7 +26,7 @@ class BlockPluginHasSettingsTrayFormAccessCheckTest extends UnitTestCase {
* @covers ::accessBlockPlugin
* @dataProvider providerTestAccess
*/
- public function testAccess($with_forms, array $plugin_definition, AccessResultInterface $expected_access_result) {
+ public function testAccess($with_forms, array $plugin_definition, AccessResultInterface $expected_access_result): void {
$block_plugin = $this->prophesize()->willImplement(BlockPluginInterface::class);
if ($with_forms) {
diff --git a/core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php b/core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php
index b343215fd07..cb7c30968a2 100644
--- a/core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php
+++ b/core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php
@@ -85,7 +85,7 @@ class ShortcutCacheTagsTest extends EntityCacheTagsTestBase {
/**
* Tests that when creating a shortcut, the shortcut set tag is invalidated.
*/
- public function testEntityCreation() {
+ public function testEntityCreation(): void {
$cache_bin = $this->getRenderCacheBackend();
// Create a cache entry that is tagged with a shortcut set cache tag.
@@ -108,7 +108,7 @@ class ShortcutCacheTagsTest extends EntityCacheTagsTestBase {
/**
* Tests visibility and cacheability of shortcuts in the toolbar.
*/
- public function testToolbar() {
+ public function testToolbar(): void {
$this->drupalPlaceBlock('page_title_block', ['id' => 'title']);
$test_page_url = Url::fromRoute('test_page_test.test_page');
diff --git a/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php b/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
index dc9f9909296..ebdd545db09 100644
--- a/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
+++ b/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
@@ -69,7 +69,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
/**
* Tests that creating a shortcut works properly.
*/
- public function testShortcutLinkAdd() {
+ public function testShortcutLinkAdd(): void {
$set = $this->set;
// Create an alias for the node so we can test aliases.
@@ -171,7 +171,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
/**
* Tests that the "add to shortcut" and "remove from shortcut" links work.
*/
- public function testShortcutQuickLink() {
+ public function testShortcutQuickLink(): void {
\Drupal::service('theme_installer')->install(['claro']);
$this->config('system.theme')->set('admin', 'claro')->save();
$this->config('node.settings')->set('use_admin_theme', '1')->save();
@@ -255,7 +255,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
/**
* Tests that shortcut links can be renamed.
*/
- public function testShortcutLinkRename() {
+ public function testShortcutLinkRename(): void {
$set = $this->set;
// Attempt to rename shortcut link.
@@ -275,7 +275,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
/**
* Tests that changing the path of a shortcut link works.
*/
- public function testShortcutLinkChangePath() {
+ public function testShortcutLinkChangePath(): void {
$set = $this->set;
// Tests changing a shortcut path.
@@ -298,7 +298,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
/**
* Tests that changing the route of a shortcut link works.
*/
- public function testShortcutLinkChangeRoute() {
+ public function testShortcutLinkChangeRoute(): void {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/content');
$this->assertSession()->statusCodeEquals(200);
@@ -314,7 +314,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
/**
* Tests deleting a shortcut link.
*/
- public function testShortcutLinkDelete() {
+ public function testShortcutLinkDelete(): void {
$set = $this->set;
$shortcuts = $set->getShortcuts();
@@ -339,7 +339,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
* Tests that the "Add to shortcuts" link is not displayed on a page not
* found or a page the user does not have access to.
*/
- public function testNoShortcutLink() {
+ public function testNoShortcutLink(): void {
// Change to a theme that displays shortcuts.
\Drupal::service('theme_installer')->install(['claro']);
$this->config('system.theme')
@@ -367,7 +367,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
/**
* Tests that the 'access shortcuts' permissions works properly.
*/
- public function testAccessShortcutsPermission() {
+ public function testAccessShortcutsPermission(): void {
// Change to a theme that displays shortcuts.
\Drupal::service('theme_installer')->install(['claro']);
$this->config('system.theme')
@@ -407,7 +407,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
/**
* Tests the shortcuts are correctly ordered by weight in the toolbar.
*/
- public function testShortcutLinkOrder() {
+ public function testShortcutLinkOrder(): void {
// Ensure to give permissions to access the shortcuts.
$this->drupalLogin($this->drupalCreateUser([
'access toolbar',
@@ -454,7 +454,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
/**
* Tests the 'access shortcuts' permission with the shortcut block.
*/
- public function testShortcutBlockAccess() {
+ public function testShortcutBlockAccess(): void {
// Creates a block instance and place in a region through api.
$block = $this->drupalPlaceBlock('shortcuts');
diff --git a/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php b/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php
index cf6e2893a48..e426d8fffbe 100644
--- a/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php
+++ b/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php
@@ -37,7 +37,7 @@ class ShortcutSetsTest extends ShortcutTestBase {
/**
* Tests creating a shortcut set.
*/
- public function testShortcutSetAdd() {
+ public function testShortcutSetAdd(): void {
$this->drupalGet('admin/config/user-interface/shortcut');
$this->clickLink('Add shortcut set');
$edit = [
@@ -56,7 +56,7 @@ class ShortcutSetsTest extends ShortcutTestBase {
/**
* Tests editing a shortcut set.
*/
- public function testShortcutSetEdit() {
+ public function testShortcutSetEdit(): void {
$set = $this->set;
$shortcuts = $set->getShortcuts();
@@ -106,7 +106,7 @@ class ShortcutSetsTest extends ShortcutTestBase {
/**
* Tests switching a user's own shortcut set.
*/
- public function testShortcutSetSwitchOwn() {
+ public function testShortcutSetSwitchOwn(): void {
$new_set = $this->generateShortcutSet($this->randomMachineName());
// Attempt to switch the default shortcut set to the newly created shortcut
@@ -122,7 +122,7 @@ class ShortcutSetsTest extends ShortcutTestBase {
/**
* Tests switching another user's shortcut set.
*/
- public function testShortcutSetAssign() {
+ public function testShortcutSetAssign(): void {
$new_set = $this->generateShortcutSet($this->randomMachineName());
$shortcut_set_storage = \Drupal::entityTypeManager()->getStorage('shortcut_set');
@@ -134,7 +134,7 @@ class ShortcutSetsTest extends ShortcutTestBase {
/**
* Tests switching a user's shortcut set and creating one at the same time.
*/
- public function testShortcutSetSwitchCreate() {
+ public function testShortcutSetSwitchCreate(): void {
$edit = [
'set' => 'new',
'id' => $this->randomMachineName(),
@@ -151,7 +151,7 @@ class ShortcutSetsTest extends ShortcutTestBase {
/**
* Tests switching a user's shortcut set without providing a new set name.
*/
- public function testShortcutSetSwitchNoSetName() {
+ public function testShortcutSetSwitchNoSetName(): void {
$edit = ['set' => 'new'];
$this->drupalGet('user/' . $this->adminUser->id() . '/shortcuts');
$this->submitForm($edit, 'Change set');
@@ -166,7 +166,7 @@ class ShortcutSetsTest extends ShortcutTestBase {
/**
* Tests renaming a shortcut set.
*/
- public function testShortcutSetRename() {
+ public function testShortcutSetRename(): void {
$set = $this->set;
$new_label = $this->randomMachineName();
@@ -180,7 +180,7 @@ class ShortcutSetsTest extends ShortcutTestBase {
/**
* Tests un-assigning a shortcut set.
*/
- public function testShortcutSetUnassign() {
+ public function testShortcutSetUnassign(): void {
$new_set = $this->generateShortcutSet($this->randomMachineName());
$shortcut_set_storage = \Drupal::entityTypeManager()->getStorage('shortcut_set');
@@ -194,7 +194,7 @@ class ShortcutSetsTest extends ShortcutTestBase {
/**
* Tests assign clearing on user removal.
*/
- public function testShortcutSetUnassignOnUserRemoval() {
+ public function testShortcutSetUnassignOnUserRemoval(): void {
$new_set = $this->generateShortcutSet($this->randomMachineName());
$shortcut_set_storage = \Drupal::entityTypeManager()->getStorage('shortcut_set');
@@ -208,7 +208,7 @@ class ShortcutSetsTest extends ShortcutTestBase {
/**
* Tests deleting a shortcut set.
*/
- public function testShortcutSetDelete() {
+ public function testShortcutSetDelete(): void {
$new_set = $this->generateShortcutSet($this->randomMachineName());
$this->drupalGet('admin/config/user-interface/shortcut/manage/' . $new_set->id() . '/delete');
@@ -220,7 +220,7 @@ class ShortcutSetsTest extends ShortcutTestBase {
/**
* Tests deleting the default shortcut set.
*/
- public function testShortcutSetDeleteDefault() {
+ public function testShortcutSetDeleteDefault(): void {
$this->drupalGet('admin/config/user-interface/shortcut/manage/default/delete');
$this->assertSession()->statusCodeEquals(403);
}
@@ -228,7 +228,7 @@ class ShortcutSetsTest extends ShortcutTestBase {
/**
* Tests creating a new shortcut set with a defined set name.
*/
- public function testShortcutSetCreateWithSetName() {
+ public function testShortcutSetCreateWithSetName(): void {
$random_name = $this->randomMachineName();
$new_set = $this->generateShortcutSet($random_name, $random_name);
$sets = ShortcutSet::loadMultiple();
diff --git a/core/modules/shortcut/tests/src/Kernel/Migrate/MigrateShortcutStubTest.php b/core/modules/shortcut/tests/src/Kernel/Migrate/MigrateShortcutStubTest.php
index 794c07a6d91..9bdf7005e2a 100644
--- a/core/modules/shortcut/tests/src/Kernel/Migrate/MigrateShortcutStubTest.php
+++ b/core/modules/shortcut/tests/src/Kernel/Migrate/MigrateShortcutStubTest.php
@@ -34,7 +34,7 @@ class MigrateShortcutStubTest extends MigrateDrupalTestBase {
/**
* Tests creation of shortcut stubs.
*/
- public function testStub() {
+ public function testStub(): void {
$this->performStubTest('shortcut');
}
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 ee77154bf7d..a889c853a8d 100644
--- a/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetTest.php
+++ b/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetTest.php
@@ -42,7 +42,7 @@ class MigrateShortcutSetTest extends MigrateDrupal7TestBase {
/**
* Tests the shortcut set migration.
*/
- public function testShortcutSetMigration() {
+ public function testShortcutSetMigration(): void {
$this->assertEntity('default', 'Default', 2);
$this->assertEntity('shortcut-set-2', 'Alternative shortcut set', 2);
}
diff --git a/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetUsersTest.php b/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetUsersTest.php
index 284d100cace..8a9d1209b9b 100644
--- a/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetUsersTest.php
+++ b/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetUsersTest.php
@@ -44,7 +44,7 @@ class MigrateShortcutSetUsersTest extends MigrateDrupal7TestBase {
/**
* Tests the shortcut set migration.
*/
- public function testShortcutSetUsersMigration() {
+ public function testShortcutSetUsersMigration(): void {
// Check if migrated user has correct migrated shortcut set assigned.
$account = User::load(2);
$shortcut_set_storage = \Drupal::entityTypeManager()->getStorage('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 bf659112cb1..65294fc2b6b 100644
--- a/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutTest.php
+++ b/core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutTest.php
@@ -65,7 +65,7 @@ class MigrateShortcutTest extends MigrateDrupal7TestBase {
/**
* Tests the shortcut migration.
*/
- public function testShortcutMigration() {
+ public function testShortcutMigration(): void {
// Check if the 4 shortcuts were migrated correctly.
$this->assertEntity(1, 'Add content', -20, '/node/add');
$this->assertEntity(2, 'Find content', -19, '/admin/content');
diff --git a/core/modules/shortcut/tests/src/Kernel/ShortcutClaroIntegrationTest.php b/core/modules/shortcut/tests/src/Kernel/ShortcutClaroIntegrationTest.php
index 0f024604463..086f464b8d9 100644
--- a/core/modules/shortcut/tests/src/Kernel/ShortcutClaroIntegrationTest.php
+++ b/core/modules/shortcut/tests/src/Kernel/ShortcutClaroIntegrationTest.php
@@ -18,7 +18,7 @@ class ShortcutClaroIntegrationTest extends KernelTestBase {
/**
* Tests shortcut_install() and shortcut_uninstall().
*/
- public function testInstallUninstall() {
+ public function testInstallUninstall(): void {
// Install claro.
\Drupal::service('theme_installer')->install(['claro']);
$this->assertNull($this->config('claro.settings')->get('third_party_settings.shortcut'), 'There are no shortcut settings in claro.settings.');
diff --git a/core/modules/shortcut/tests/src/Unit/Menu/ShortcutLocalTasksTest.php b/core/modules/shortcut/tests/src/Unit/Menu/ShortcutLocalTasksTest.php
index a95d723f798..79f15dffda6 100644
--- a/core/modules/shortcut/tests/src/Unit/Menu/ShortcutLocalTasksTest.php
+++ b/core/modules/shortcut/tests/src/Unit/Menu/ShortcutLocalTasksTest.php
@@ -38,7 +38,7 @@ class ShortcutLocalTasksTest extends LocalTaskIntegrationTestBase {
*
* @dataProvider getShortcutPageRoutes
*/
- public function testShortcutPageLocalTasks($route) {
+ public function testShortcutPageLocalTasks($route): void {
$tasks = [
0 => ['shortcut.set_switch', 'entity.user.canonical', 'entity.user.edit_form'],
];
diff --git a/core/modules/sqlite/tests/src/Kernel/sqlite/DatabaseExceptionWrapperTest.php b/core/modules/sqlite/tests/src/Kernel/sqlite/DatabaseExceptionWrapperTest.php
index 57afccbf2f6..110efc13941 100644
--- a/core/modules/sqlite/tests/src/Kernel/sqlite/DatabaseExceptionWrapperTest.php
+++ b/core/modules/sqlite/tests/src/Kernel/sqlite/DatabaseExceptionWrapperTest.php
@@ -16,7 +16,7 @@ class DatabaseExceptionWrapperTest extends DriverSpecificKernelTestBase {
/**
* Tests Connection::prepareStatement exception on execution.
*/
- public function testPrepareStatementFailOnExecution() {
+ public function testPrepareStatementFailOnExecution(): void {
$this->expectException(\PDOException::class);
$stmt = $this->connection->prepareStatement('bananas', []);
$stmt->execute();
diff --git a/core/modules/sqlite/tests/src/Kernel/sqlite/TemporaryQueryTest.php b/core/modules/sqlite/tests/src/Kernel/sqlite/TemporaryQueryTest.php
index 6a6a0d0f100..bd9eb97b28c 100644
--- a/core/modules/sqlite/tests/src/Kernel/sqlite/TemporaryQueryTest.php
+++ b/core/modules/sqlite/tests/src/Kernel/sqlite/TemporaryQueryTest.php
@@ -16,7 +16,7 @@ class TemporaryQueryTest extends TemporaryQueryTestBase {
/**
* Confirms that temporary tables work.
*/
- public function testTemporaryQuery() {
+ public function testTemporaryQuery(): void {
parent::testTemporaryQuery();
$connection = $this->getConnection();
diff --git a/core/modules/sqlite/tests/src/Unit/ConnectionTest.php b/core/modules/sqlite/tests/src/Unit/ConnectionTest.php
index 28ae34ab925..b1f1290a98e 100644
--- a/core/modules/sqlite/tests/src/Unit/ConnectionTest.php
+++ b/core/modules/sqlite/tests/src/Unit/ConnectionTest.php
@@ -23,7 +23,7 @@ class ConnectionTest extends UnitTestCase {
* @param string $expected
* Expected connection option.
*/
- public function testCreateConnectionOptionsFromUrl(string $url, string $expected) {
+ public function testCreateConnectionOptionsFromUrl(string $url, string $expected): void {
$root = dirname(__DIR__, 8);
$sqlite_connection = new Connection($this->createMock(StubPDO::class), []);
$database = $sqlite_connection->createConnectionOptionsFromUrl($url, $root);
diff --git a/core/modules/syslog/tests/src/Functional/SyslogTest.php b/core/modules/syslog/tests/src/Functional/SyslogTest.php
index 4ae5e4d4ed1..875de498b68 100644
--- a/core/modules/syslog/tests/src/Functional/SyslogTest.php
+++ b/core/modules/syslog/tests/src/Functional/SyslogTest.php
@@ -28,7 +28,7 @@ class SyslogTest extends BrowserTestBase {
/**
* Tests the syslog settings page.
*/
- public function testSettings() {
+ public function testSettings(): void {
$admin_user = $this->drupalCreateUser(['administer site configuration']);
$this->drupalLogin($admin_user);
diff --git a/core/modules/syslog/tests/src/Kernel/Migrate/d6/MigrateSyslogConfigsTest.php b/core/modules/syslog/tests/src/Kernel/Migrate/d6/MigrateSyslogConfigsTest.php
index 0047c3674d3..2d596182fe0 100644
--- a/core/modules/syslog/tests/src/Kernel/Migrate/d6/MigrateSyslogConfigsTest.php
+++ b/core/modules/syslog/tests/src/Kernel/Migrate/d6/MigrateSyslogConfigsTest.php
@@ -37,7 +37,7 @@ class MigrateSyslogConfigsTest extends MigrateDrupal6TestBase {
/**
* Tests migration of syslog variables to syslog.settings.yml.
*/
- public function testSyslogSettings() {
+ public function testSyslogSettings(): void {
$config = $this->config('syslog.settings');
$this->assertSame('drupal', $config->get('identity'));
$this->assertSame(128, $config->get('facility'));
diff --git a/core/modules/syslog/tests/src/Kernel/Migrate/d7/MigrateSyslogConfigsTest.php b/core/modules/syslog/tests/src/Kernel/Migrate/d7/MigrateSyslogConfigsTest.php
index ea016ab0b21..8e02ebca750 100644
--- a/core/modules/syslog/tests/src/Kernel/Migrate/d7/MigrateSyslogConfigsTest.php
+++ b/core/modules/syslog/tests/src/Kernel/Migrate/d7/MigrateSyslogConfigsTest.php
@@ -35,7 +35,7 @@ class MigrateSyslogConfigsTest extends MigrateDrupal7TestBase {
/**
* Tests migration of syslog variables to syslog.settings.yml.
*/
- public function testSyslogSettings() {
+ public function testSyslogSettings(): void {
$config = $this->config('syslog.settings');
// 8 == LOG_USER
$this->assertSame(8, $config->get('facility'));
diff --git a/core/modules/syslog/tests/src/Kernel/SyslogTest.php b/core/modules/syslog/tests/src/Kernel/SyslogTest.php
index 0dad129c6a1..15ff370d96e 100644
--- a/core/modules/syslog/tests/src/Kernel/SyslogTest.php
+++ b/core/modules/syslog/tests/src/Kernel/SyslogTest.php
@@ -30,7 +30,7 @@ class SyslogTest extends KernelTestBase {
/**
* @covers ::log
*/
- public function testSyslogWriting() {
+ public function testSyslogWriting(): void {
$request = Request::create('/page-not-found', 'GET', [], [], [], ['REMOTE_ADDR' => '1.2.3.4']);
$request->headers->set('Referer', 'other-site');
@@ -72,7 +72,7 @@ class SyslogTest extends KernelTestBase {
*
* @covers ::openConnection
*/
- public function testSyslogMissingFacility() {
+ public function testSyslogMissingFacility(): void {
$config = $this->container->get('config.factory')->getEditable('syslog.settings');
$config->clear('facility');
$config->save();
@@ -86,7 +86,7 @@ class SyslogTest extends KernelTestBase {
*
* @covers ::log
*/
- public function testSyslogSeverity() {
+ public function testSyslogSeverity(): void {
/** @var \Drupal\Core\Config\Config $config */
$config = $this->container->get('config.factory')->getEditable('syslog.settings');
$config->set('format', '!type|!message|!severity');
diff --git a/core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestComputedFieldNormalizerTest.php b/core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestComputedFieldNormalizerTest.php
index bfc2d25386d..8b854c3befb 100644
--- a/core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestComputedFieldNormalizerTest.php
+++ b/core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestComputedFieldNormalizerTest.php
@@ -91,7 +91,7 @@ class EntityTestComputedFieldNormalizerTest extends EntityTestResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPost() {
+ public function testPost(): void {
// Post test not required.
$this->markTestSkipped();
}
@@ -99,7 +99,7 @@ class EntityTestComputedFieldNormalizerTest extends EntityTestResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatch() {
+ public function testPatch(): void {
// Patch test not required.
$this->markTestSkipped();
}
@@ -107,7 +107,7 @@ class EntityTestComputedFieldNormalizerTest extends EntityTestResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testDelete() {
+ public function testDelete(): void {
// Delete test not required.
$this->markTestSkipped();
}
diff --git a/core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestTextItemNormalizerTest.php b/core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestTextItemNormalizerTest.php
index 130649f0321..49f48c009b1 100644
--- a/core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestTextItemNormalizerTest.php
+++ b/core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestTextItemNormalizerTest.php
@@ -157,7 +157,7 @@ class EntityTestTextItemNormalizerTest extends EntityTestResourceTestBase {
*
* @dataProvider providerTestGetWithFormat
*/
- public function testGetWithFormat($text_format_id, array $expected_cache_tags) {
+ public function testGetWithFormat($text_format_id, array $expected_cache_tags): void {
FilterFormat::create([
'name' => 'Pablo Picasso',
'format' => 'pablo',
diff --git a/core/modules/system/tests/src/Functional/Ajax/FrameworkTest.php b/core/modules/system/tests/src/Functional/Ajax/FrameworkTest.php
index c8d68ad0ef1..037e0de5115 100644
--- a/core/modules/system/tests/src/Functional/Ajax/FrameworkTest.php
+++ b/core/modules/system/tests/src/Functional/Ajax/FrameworkTest.php
@@ -34,7 +34,7 @@ class FrameworkTest extends BrowserTestBase {
/**
* Verifies the Ajax rendering of a command in the settings.
*/
- public function testAJAXRender() {
+ public function testAJAXRender(): void {
// Verify that settings command is generated if JavaScript settings exist.
$commands = $this->drupalGetAjax('ajax-test/render');
$expected = new SettingsCommand(['ajax' => 'test'], TRUE);
@@ -44,7 +44,7 @@ class FrameworkTest extends BrowserTestBase {
/**
* Tests AjaxResponse::prepare() AJAX commands ordering.
*/
- public function testOrder() {
+ public function testOrder(): void {
$expected_commands = [];
// Expected commands, in a very specific order.
@@ -81,7 +81,7 @@ class FrameworkTest extends BrowserTestBase {
/**
* Tests the behavior of an error alert command.
*/
- public function testAJAXRenderError() {
+ public function testAJAXRenderError(): void {
// Verify custom error message.
$edit = [
'message' => 'Custom error message.',
diff --git a/core/modules/system/tests/src/Functional/Ajax/OffCanvasDialogTest.php b/core/modules/system/tests/src/Functional/Ajax/OffCanvasDialogTest.php
index 5b20009d2c4..217576602e2 100644
--- a/core/modules/system/tests/src/Functional/Ajax/OffCanvasDialogTest.php
+++ b/core/modules/system/tests/src/Functional/Ajax/OffCanvasDialogTest.php
@@ -33,7 +33,7 @@ class OffCanvasDialogTest extends BrowserTestBase {
*
* @dataProvider dialogPosition
*/
- public function testDialog($position) {
+ public function testDialog($position): void {
// Ensure the elements render without notices or exceptions.
$this->drupalGet('ajax-test/dialog');
diff --git a/core/modules/system/tests/src/Functional/Batch/PageTest.php b/core/modules/system/tests/src/Functional/Batch/PageTest.php
index 052b2cd124d..f6fa8e68968 100644
--- a/core/modules/system/tests/src/Functional/Batch/PageTest.php
+++ b/core/modules/system/tests/src/Functional/Batch/PageTest.php
@@ -28,7 +28,7 @@ class PageTest extends BrowserTestBase {
/**
* Tests that the batch API progress page uses the correct theme.
*/
- public function testBatchProgressPageTheme() {
+ public function testBatchProgressPageTheme(): void {
// Make sure that the page which starts the batch (an administrative page)
// is using a different theme than would normally be used by the batch API.
$this->container->get('theme_installer')->install(['claro', 'olivero']);
@@ -53,7 +53,7 @@ class PageTest extends BrowserTestBase {
/**
* Tests that the batch API progress page shows the title correctly.
*/
- public function testBatchProgressPageTitle() {
+ public function testBatchProgressPageTitle(): void {
// Visit an administrative page that runs a test batch, and check that the
// title shown during batch execution (which the batch callback function
// saved as a variable) matches the theme used on the administrative page.
@@ -74,7 +74,7 @@ class PageTest extends BrowserTestBase {
/**
* Tests that the progress messages are correct.
*/
- public function testBatchProgressMessages() {
+ public function testBatchProgressMessages(): void {
// Go to the initial step only.
$this->maximumMetaRefreshCount = 0;
$this->drupalGet('batch-test/test-title');
diff --git a/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php b/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php
index d510548d34b..29786931d92 100644
--- a/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php
+++ b/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php
@@ -29,7 +29,7 @@ class ProcessingTest extends BrowserTestBase {
/**
* Tests batches triggered outside of form submission.
*/
- public function testBatchNoForm() {
+ public function testBatchNoForm(): void {
// Displaying the page triggers batch 1.
$this->drupalGet('batch-test/no-form');
$this->assertBatchMessages($this->_resultMessages('batch_1'));
@@ -40,7 +40,7 @@ class ProcessingTest extends BrowserTestBase {
/**
* Tests batches that redirect in the batch finished callback.
*/
- public function testBatchRedirectFinishedCallback() {
+ public function testBatchRedirectFinishedCallback(): void {
// Displaying the page triggers batch 1.
$this->drupalGet('batch-test/finish-redirect');
$this->assertBatchMessages($this->_resultMessages('batch_1'));
@@ -54,7 +54,7 @@ class ProcessingTest extends BrowserTestBase {
/**
* Tests batches defined in a form submit handler.
*/
- public function testBatchForm() {
+ public function testBatchForm(): void {
// Batch 0: no operation.
$edit = ['batch' => 'batch_0'];
$this->drupalGet('batch-test');
@@ -132,7 +132,7 @@ class ProcessingTest extends BrowserTestBase {
/**
* Tests batches defined in a multistep form.
*/
- public function testBatchFormMultistep() {
+ public function testBatchFormMultistep(): void {
$this->drupalGet('batch-test/multistep');
$this->assertSession()->assertNoEscaped('<');
$this->assertSession()->pageTextContains('step 1');
@@ -162,7 +162,7 @@ class ProcessingTest extends BrowserTestBase {
/**
* Tests batches defined in different submit handlers on the same form.
*/
- public function testBatchFormMultipleBatches() {
+ public function testBatchFormMultipleBatches(): void {
// Batches 1, 2 and 3 are triggered in sequence by different submit
// handlers. Each submit handler modify the submitted 'value'.
$value = rand(0, 255);
@@ -182,7 +182,7 @@ class ProcessingTest extends BrowserTestBase {
*
* Same as above, but the form is submitted through drupal_form_execute().
*/
- public function testBatchFormProgrammatic() {
+ public function testBatchFormProgrammatic(): void {
// Batches 1, 2 and 3 are triggered in sequence by different submit
// handlers. Each submit handler modify the submitted 'value'.
$value = rand(0, 255);
@@ -198,7 +198,7 @@ class ProcessingTest extends BrowserTestBase {
/**
* Tests form submission during a batch operation.
*/
- public function testDrupalFormSubmitInBatch() {
+ public function testDrupalFormSubmitInBatch(): void {
// Displaying the page triggers a batch that programmatically submits a
// form.
$value = rand(0, 255);
@@ -211,7 +211,7 @@ class ProcessingTest extends BrowserTestBase {
*
* @see https://www.drupal.org/node/600836
*/
- public function testBatchLargePercentage() {
+ public function testBatchLargePercentage(): void {
// Displaying the page triggers batch 5.
$this->drupalGet('batch-test/large-percentage');
$this->assertBatchMessages($this->_resultMessages('batch_5'));
diff --git a/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php b/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php
index 8fdc4500a32..d27a7018504 100644
--- a/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php
+++ b/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php
@@ -30,7 +30,7 @@ class DrupalMessengerServiceTest extends BrowserTestBase {
/**
* Tests Messenger service.
*/
- public function testDrupalMessengerService() {
+ public function testDrupalMessengerService(): void {
// The page at system_test.messenger_service route sets two messages and
// then removes the first before it is displayed.
$this->drupalGet(Url::fromRoute('system_test.messenger_service'));
diff --git a/core/modules/system/tests/src/Functional/Cache/ClearTest.php b/core/modules/system/tests/src/Functional/Cache/ClearTest.php
index dc82558d7c5..3466bba0788 100644
--- a/core/modules/system/tests/src/Functional/Cache/ClearTest.php
+++ b/core/modules/system/tests/src/Functional/Cache/ClearTest.php
@@ -31,7 +31,7 @@ class ClearTest extends CacheTestBase {
/**
* Tests drupal_flush_all_caches().
*/
- public function testFlushAllCaches() {
+ public function testFlushAllCaches(): void {
// Create cache entries for each flushed cache bin.
$bins = Cache::getBins();
$this->assertNotEmpty($bins, 'Cache::getBins() returned bins to flush.');
diff --git a/core/modules/system/tests/src/Functional/Cache/SessionExistsCacheContextTest.php b/core/modules/system/tests/src/Functional/Cache/SessionExistsCacheContextTest.php
index a762788fded..0e1ce27af49 100644
--- a/core/modules/system/tests/src/Functional/Cache/SessionExistsCacheContextTest.php
+++ b/core/modules/system/tests/src/Functional/Cache/SessionExistsCacheContextTest.php
@@ -29,7 +29,7 @@ class SessionExistsCacheContextTest extends BrowserTestBase {
/**
* Tests \Drupal\Core\Cache\Context\SessionExistsCacheContext::getContext().
*/
- public function testCacheContext() {
+ public function testCacheContext(): void {
// 1. No session (anonymous).
$this->assertSessionCookieOnClient(FALSE);
$this->drupalGet(Url::fromRoute('<front>'));
diff --git a/core/modules/system/tests/src/Functional/Common/EarlyRenderingControllerTest.php b/core/modules/system/tests/src/Functional/Common/EarlyRenderingControllerTest.php
index f55453e288e..ad7e5903001 100644
--- a/core/modules/system/tests/src/Functional/Common/EarlyRenderingControllerTest.php
+++ b/core/modules/system/tests/src/Functional/Common/EarlyRenderingControllerTest.php
@@ -27,7 +27,7 @@ class EarlyRenderingControllerTest extends BrowserTestBase {
/**
* Tests theme preprocess functions being able to attach assets.
*/
- public function testEarlyRendering() {
+ public function testEarlyRendering(): void {
// Render array: non-early & early.
$this->drupalGet(Url::fromRoute('early_rendering_controller_test.render_array'));
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/system/tests/src/Functional/Common/FormatDateTest.php b/core/modules/system/tests/src/Functional/Common/FormatDateTest.php
index 1664a8822c0..79978e2adb5 100644
--- a/core/modules/system/tests/src/Functional/Common/FormatDateTest.php
+++ b/core/modules/system/tests/src/Functional/Common/FormatDateTest.php
@@ -21,7 +21,7 @@ class FormatDateTest extends BrowserTestBase {
/**
* Tests admin-defined formats in DateFormatterInterface::format().
*/
- public function testAdminDefinedFormatDate() {
+ public function testAdminDefinedFormatDate(): void {
// Create and log in an admin user.
$this->drupalLogin($this->drupalCreateUser([
'administer site configuration',
diff --git a/core/modules/system/tests/src/Functional/Common/RenderWebTest.php b/core/modules/system/tests/src/Functional/Common/RenderWebTest.php
index 7abc2132806..e130023142a 100644
--- a/core/modules/system/tests/src/Functional/Common/RenderWebTest.php
+++ b/core/modules/system/tests/src/Functional/Common/RenderWebTest.php
@@ -33,7 +33,7 @@ class RenderWebTest extends BrowserTestBase {
/**
* Asserts the cache context for the wrapper format is always present.
*/
- public function testWrapperFormatCacheContext() {
+ public function testWrapperFormatCacheContext(): void {
$this->drupalGet('common-test/type-link-active-class');
$this->assertStringStartsWith("<!DOCTYPE html>\n<html", $this->getSession()->getPage()->getContent());
$this->assertSession()->responseHeaderEquals('Content-Type', 'text/html; charset=UTF-8');
diff --git a/core/modules/system/tests/src/Functional/Common/UrlTest.php b/core/modules/system/tests/src/Functional/Common/UrlTest.php
index 506236bf85b..8e22d2a03bd 100644
--- a/core/modules/system/tests/src/Functional/Common/UrlTest.php
+++ b/core/modules/system/tests/src/Functional/Common/UrlTest.php
@@ -24,7 +24,7 @@ class UrlTest extends BrowserTestBase {
/**
* Tests the active class in links.
*/
- public function testActiveLinkAttributes() {
+ public function testActiveLinkAttributes(): void {
$options_no_query = [];
$options_query = [
'query' => [
diff --git a/core/modules/system/tests/src/Functional/Condition/ConditionFormTest.php b/core/modules/system/tests/src/Functional/Condition/ConditionFormTest.php
index b4e1e229ee6..932f4d5fd7c 100644
--- a/core/modules/system/tests/src/Functional/Condition/ConditionFormTest.php
+++ b/core/modules/system/tests/src/Functional/Condition/ConditionFormTest.php
@@ -28,7 +28,7 @@ class ConditionFormTest extends BrowserTestBase {
/**
* Submit the condition_node_type_test_form to test condition forms.
*/
- public function testConfigForm() {
+ public function testConfigForm(): void {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Page']);
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
diff --git a/core/modules/system/tests/src/Functional/CsrfRequestHeaderTest.php b/core/modules/system/tests/src/Functional/CsrfRequestHeaderTest.php
index 9947b556ac6..89da05c6fa6 100644
--- a/core/modules/system/tests/src/Functional/CsrfRequestHeaderTest.php
+++ b/core/modules/system/tests/src/Functional/CsrfRequestHeaderTest.php
@@ -31,7 +31,7 @@ class CsrfRequestHeaderTest extends BrowserTestBase {
*
* This checks one route that uses _csrf_request_header_token.
*/
- public function testRouteAccess() {
+ public function testRouteAccess(): void {
$client = $this->getHttpClient();
$csrf_token_path = 'session/token';
// Test using the current path.
diff --git a/core/modules/system/tests/src/Functional/Database/SelectPagerDefaultTest.php b/core/modules/system/tests/src/Functional/Database/SelectPagerDefaultTest.php
index d229200e76d..eb28f684c8d 100644
--- a/core/modules/system/tests/src/Functional/Database/SelectPagerDefaultTest.php
+++ b/core/modules/system/tests/src/Functional/Database/SelectPagerDefaultTest.php
@@ -28,7 +28,7 @@ class SelectPagerDefaultTest extends DatabaseTestBase {
* Note that we have to make an HTTP request to a test page handler
* because the pager depends on GET parameters.
*/
- public function testEvenPagerQuery() {
+ public function testEvenPagerQuery(): void {
// To keep the test from being too brittle, we determine up front
// what the page count should be dynamically, and pass the control
// information forward to the actual query on the other side of the
@@ -62,7 +62,7 @@ class SelectPagerDefaultTest extends DatabaseTestBase {
* Note that we have to make an HTTP request to a test page handler
* because the pager depends on GET parameters.
*/
- public function testOddPagerQuery() {
+ public function testOddPagerQuery(): void {
// To keep the test from being too brittle, we determine up front
// what the page count should be dynamically, and pass the control
// information forward to the actual query on the other side of the
@@ -95,7 +95,7 @@ class SelectPagerDefaultTest extends DatabaseTestBase {
*
* This is a regression test for #467984.
*/
- public function testInnerPagerQuery() {
+ public function testInnerPagerQuery(): void {
$connection = Database::getConnection();
$query = $connection->select('test', 't')
->extend(PagerSelectExtender::class);
@@ -119,7 +119,7 @@ class SelectPagerDefaultTest extends DatabaseTestBase {
*
* This is a regression test for #467984.
*/
- public function testHavingPagerQuery() {
+ public function testHavingPagerQuery(): void {
$query = Database::getConnection()->select('test', 't')
->extend(PagerSelectExtender::class);
$query
@@ -138,7 +138,7 @@ class SelectPagerDefaultTest extends DatabaseTestBase {
/**
* Confirms that every pager gets a valid, non-overlapping element ID.
*/
- public function testElementNumbers() {
+ public function testElementNumbers(): void {
$request = Request::createFromGlobals();
$request->query->replace([
diff --git a/core/modules/system/tests/src/Functional/Database/SelectTableSortDefaultTest.php b/core/modules/system/tests/src/Functional/Database/SelectTableSortDefaultTest.php
index edf2a0734fe..e720eafbfae 100644
--- a/core/modules/system/tests/src/Functional/Database/SelectTableSortDefaultTest.php
+++ b/core/modules/system/tests/src/Functional/Database/SelectTableSortDefaultTest.php
@@ -22,7 +22,7 @@ class SelectTableSortDefaultTest extends DatabaseTestBase {
* Note that we have to make an HTTP request to a test page handler
* because the pager depends on GET parameters.
*/
- public function testTableSortQuery() {
+ public function testTableSortQuery(): void {
$sorts = [
['field' => 'Task ID', 'sort' => 'desc', 'first' => 'perform at superbowl', 'last' => 'eat'],
['field' => 'Task ID', 'sort' => 'asc', 'first' => 'eat', 'last' => 'perform at superbowl'],
@@ -50,7 +50,7 @@ class SelectTableSortDefaultTest extends DatabaseTestBase {
* If a tablesort's orderByHeader is called before another orderBy, then its
* header happens first.
*/
- public function testTableSortQueryFirst() {
+ public function testTableSortQueryFirst(): void {
$sorts = [
['field' => 'Task ID', 'sort' => 'desc', 'first' => 'perform at superbowl', 'last' => 'eat'],
['field' => 'Task ID', 'sort' => 'asc', 'first' => 'eat', 'last' => 'perform at superbowl'],
@@ -78,7 +78,7 @@ class SelectTableSortDefaultTest extends DatabaseTestBase {
* Specifically that no sort is set in a tableselect, and that header links
* are correct.
*/
- public function testTableSortDefaultSort() {
+ public function testTableSortDefaultSort(): void {
$assert = $this->assertSession();
$this->drupalGet('database_test/tablesort_default_sort');
diff --git a/core/modules/system/tests/src/Functional/Datetime/DrupalDateTimeTest.php b/core/modules/system/tests/src/Functional/Datetime/DrupalDateTimeTest.php
index 87349b74fe1..52d57eacee6 100644
--- a/core/modules/system/tests/src/Functional/Datetime/DrupalDateTimeTest.php
+++ b/core/modules/system/tests/src/Functional/Datetime/DrupalDateTimeTest.php
@@ -40,7 +40,7 @@ class DrupalDateTimeTest extends BrowserTestBase {
* help ensure that the system timezone will be different than the
* stated timezones.
*/
- public function testDateTimezone() {
+ public function testDateTimezone(): void {
$date_string = '2007-01-31 21:00:00';
// Make sure no site timezone has been set.
@@ -96,7 +96,7 @@ class DrupalDateTimeTest extends BrowserTestBase {
/**
* Tests the ability to override the time zone in the format method.
*/
- public function testTimezoneFormat() {
+ public function testTimezoneFormat(): void {
// Create a date in UTC
$date = DrupalDateTime::createFromTimestamp(87654321, 'UTC');
diff --git a/core/modules/system/tests/src/Functional/Datetime/TimeZoneAbbreviationRouteTest.php b/core/modules/system/tests/src/Functional/Datetime/TimeZoneAbbreviationRouteTest.php
index 01e25e33f03..acd7a944920 100644
--- a/core/modules/system/tests/src/Functional/Datetime/TimeZoneAbbreviationRouteTest.php
+++ b/core/modules/system/tests/src/Functional/Datetime/TimeZoneAbbreviationRouteTest.php
@@ -29,7 +29,7 @@ class TimeZoneAbbreviationRouteTest extends BrowserTestBase {
/**
* Test that the AJAX Timezone Callback can deal with various formats.
*/
- public function testSystemTimezone() {
+ public function testSystemTimezone(): void {
$options = [
'query' => [
'date' => 'Tue+Sep+17+2013+21%3A35%3A31+GMT%2B0100+(BST)#',
@@ -52,7 +52,7 @@ class TimeZoneAbbreviationRouteTest extends BrowserTestBase {
*
* @dataProvider providerAbbreviationConversion
*/
- public function testAbbreviationConversion($path, $expectedResponse = NULL, $expectInvalidRequest = FALSE) {
+ public function testAbbreviationConversion($path, $expectedResponse = NULL, $expectInvalidRequest = FALSE): void {
$response = $this->drupalGet('system/timezone/' . $path);
if (isset($expectedResponse)) {
$this->assertEquals($response, $expectedResponse);
diff --git a/core/modules/system/tests/src/Functional/DrupalKernel/ContainerRebuildWebTest.php b/core/modules/system/tests/src/Functional/DrupalKernel/ContainerRebuildWebTest.php
index 52786de6afb..b1a80ff5628 100644
--- a/core/modules/system/tests/src/Functional/DrupalKernel/ContainerRebuildWebTest.php
+++ b/core/modules/system/tests/src/Functional/DrupalKernel/ContainerRebuildWebTest.php
@@ -26,7 +26,7 @@ class ContainerRebuildWebTest extends BrowserTestBase {
/**
* Sets a different deployment identifier.
*/
- public function testSetContainerRebuildWithDifferentDeploymentIdentifier() {
+ public function testSetContainerRebuildWithDifferentDeploymentIdentifier(): void {
$assert = $this->assertSession();
// Ensure the parameter is not set.
@@ -43,7 +43,7 @@ class ContainerRebuildWebTest extends BrowserTestBase {
/**
* Tests container invalidation.
*/
- public function testContainerInvalidation() {
+ public function testContainerInvalidation(): void {
$assert = $this->assertSession();
// Ensure that parameter is not set.
diff --git a/core/modules/system/tests/src/Functional/DrupalKernel/ContainerResetWebTest.php b/core/modules/system/tests/src/Functional/DrupalKernel/ContainerResetWebTest.php
index 575e5edc74a..6c6bd5eb5f0 100644
--- a/core/modules/system/tests/src/Functional/DrupalKernel/ContainerResetWebTest.php
+++ b/core/modules/system/tests/src/Functional/DrupalKernel/ContainerResetWebTest.php
@@ -49,7 +49,7 @@ class ContainerResetWebTest extends BrowserTestBase {
/**
* Sets a different deployment identifier.
*/
- public function testContainerRebuild() {
+ public function testContainerRebuild(): void {
$this->drupalLogin($this->drupalCreateUser());
$this->drupalGet('container_rebuild_test/container_reset');
diff --git a/core/modules/system/tests/src/Functional/DrupalKernel/ContentNegotiationTest.php b/core/modules/system/tests/src/Functional/DrupalKernel/ContentNegotiationTest.php
index 84db05197d8..3e49149c53f 100644
--- a/core/modules/system/tests/src/Functional/DrupalKernel/ContentNegotiationTest.php
+++ b/core/modules/system/tests/src/Functional/DrupalKernel/ContentNegotiationTest.php
@@ -28,7 +28,7 @@ class ContentNegotiationTest extends BrowserTestBase {
*
* @see https://www.drupal.org/node/1716790
*/
- public function testBogusAcceptHeader() {
+ public function testBogusAcceptHeader(): void {
$tests = [
// See https://bugs.webkit.org/show_bug.cgi?id=27267.
'Firefox 3.5 (2009)' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityAddUITest.php b/core/modules/system/tests/src/Functional/Entity/EntityAddUITest.php
index eb880a49208..0728dc112d0 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityAddUITest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityAddUITest.php
@@ -29,7 +29,7 @@ class EntityAddUITest extends BrowserTestBase {
/**
* Tests the add page for an entity type using bundle entities.
*/
- public function testAddPageWithBundleEntities() {
+ public function testAddPageWithBundleEntities(): void {
$admin_user = $this->drupalCreateUser([
'administer entity_test_with_bundle content',
]);
@@ -136,7 +136,7 @@ class EntityAddUITest extends BrowserTestBase {
/**
* Tests the add page for an entity type not using bundle entities.
*/
- public function testAddPageWithoutBundleEntities() {
+ public function testAddPageWithoutBundleEntities(): void {
$admin_user = $this->drupalCreateUser([
'administer entity_test content',
]);
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php b/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php
index 2d4a5bdb85e..941f047a0f8 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php
@@ -309,7 +309,7 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
* - referencing entity type view cache tag: "<referencing entity type>_view"
* - referencing entity type cache tag: "<referencing entity type>:<referencing entity ID>"
*/
- public function testReferencedEntity() {
+ public function testReferencedEntity(): void {
$entity_type = $this->entity->getEntityTypeId();
$referencing_entity_url = $this->referencingEntity->toUrl('canonical');
$non_referencing_entity_url = $this->nonReferencingEntity->toUrl('canonical');
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityComputedFieldTest.php b/core/modules/system/tests/src/Functional/Entity/EntityComputedFieldTest.php
index ec2b1cb516c..f94945636a9 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityComputedFieldTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityComputedFieldTest.php
@@ -44,7 +44,7 @@ class EntityComputedFieldTest extends BrowserTestBase {
/**
* Tests that formatters bubble the cacheable metadata of computed fields.
*/
- public function testFormatterComputedFieldCacheableMetadata() {
+ public function testFormatterComputedFieldCacheableMetadata(): void {
$this->drupalLogin($this->drupalCreateUser(['administer entity_test content']));
$entity = EntityTestComputedField::create([
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php b/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php
index 04dd2a5f36c..f2cb1c13ef4 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php
@@ -55,7 +55,7 @@ class EntityFormTest extends BrowserTestBase {
/**
* Tests basic form CRUD functionality.
*/
- public function testFormCRUD() {
+ public function testFormCRUD(): void {
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->doTestFormCRUD($entity_type);
@@ -65,7 +65,7 @@ class EntityFormTest extends BrowserTestBase {
/**
* Tests basic multilingual form CRUD functionality.
*/
- public function testMultilingualFormCRUD() {
+ public function testMultilingualFormCRUD(): void {
// All entity variations have to have the same results.
foreach (entity_test_entity_types(ENTITY_TEST_TYPES_MULTILINGUAL) as $entity_type) {
$this->doTestMultilingualFormCRUD($entity_type);
@@ -78,7 +78,7 @@ class EntityFormTest extends BrowserTestBase {
* @see entity_test_entity_form_mode_alter()
* @see entity_test_entity_test_form_mode_alter()
*/
- public function testEntityFormModeAlter() {
+ public function testEntityFormModeAlter(): void {
// Create compact entity display.
EntityFormMode::create([
'id' => 'entity_test.compact',
@@ -124,7 +124,7 @@ class EntityFormTest extends BrowserTestBase {
*
* @see entity_test_entity_form_display_alter()
*/
- public function testEntityFormDisplayAlter() {
+ public function testEntityFormDisplayAlter(): void {
$this->drupalGet('entity_test/add');
$altered_field = $this->assertSession()->fieldExists('field_test_text[0][value]');
$this->assertEquals(42, $altered_field->getAttribute('size'));
@@ -223,7 +223,7 @@ class EntityFormTest extends BrowserTestBase {
/**
* Checks that validation handlers works as expected.
*/
- public function testValidationHandlers() {
+ public function testValidationHandlers(): void {
/** @var \Drupal\Core\State\StateInterface $state */
$state = $this->container->get('state');
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityListBuilderTest.php b/core/modules/system/tests/src/Functional/Entity/EntityListBuilderTest.php
index f63b7f8f571..5dfc7d040ea 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityListBuilderTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityListBuilderTest.php
@@ -40,7 +40,7 @@ class EntityListBuilderTest extends BrowserTestBase {
/**
* Tests paging.
*/
- public function testPager() {
+ public function testPager(): void {
// Create 51 test entities.
for ($i = 1; $i < 52; $i++) {
EntityTest::create(['name' => 'Test entity ' . $i])->save();
@@ -62,7 +62,7 @@ class EntityListBuilderTest extends BrowserTestBase {
/**
* Tests that the correct cache contexts are set.
*/
- public function testCacheContexts() {
+ public function testCacheContexts(): void {
/** @var \Drupal\Core\Entity\EntityListBuilderInterface $list_builder */
$list_builder = $this->container->get('entity_type.manager')->getListBuilder('entity_test');
@@ -75,7 +75,7 @@ class EntityListBuilderTest extends BrowserTestBase {
/**
* Tests if the list cache tags are set.
*/
- public function testCacheTags() {
+ public function testCacheTags(): void {
$this->drupalGet('entity_test/list');
$this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'entity_test_list');
}
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php b/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php
index 39edb19b87f..a9835a25fcc 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php
@@ -42,7 +42,7 @@ class EntityOperationsTest extends BrowserTestBase {
*
* @see entity_test_entity_operation_alter()
*/
- public function testEntityOperationAlter() {
+ public function testEntityOperationAlter(): void {
// Check that role listing contain our test_operation operation.
$this->drupalGet('admin/people/roles');
$roles = Role::loadMultiple();
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityReferenceFieldCreationTest.php b/core/modules/system/tests/src/Functional/Entity/EntityReferenceFieldCreationTest.php
index c2fb6ccc96e..9ab92852887 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityReferenceFieldCreationTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityReferenceFieldCreationTest.php
@@ -31,7 +31,7 @@ class EntityReferenceFieldCreationTest extends BrowserTestBase {
/**
* Tests that entity reference fields cannot target entity types without IDs.
*/
- public function testAddReferenceFieldTargetingEntityTypeWithoutId() {
+ public function testAddReferenceFieldTargetingEntityTypeWithoutId(): void {
$node_type = $this->drupalCreateContentType()->id();
$this->drupalLogin($this->drupalCreateUser([
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php b/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php
index 4f4c18b46c3..08506632db3 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php
@@ -56,7 +56,7 @@ class EntityRevisionsTest extends BrowserTestBase {
/**
* Check node revision related operations.
*/
- public function testRevisions() {
+ public function testRevisions(): void {
// All revisable entity variations have to have the same results.
foreach (entity_test_entity_types(ENTITY_TEST_TYPES_REVISABLE) as $entity_type) {
@@ -188,7 +188,7 @@ class EntityRevisionsTest extends BrowserTestBase {
/**
* Tests that an entity revision is upcasted in the correct language.
*/
- public function testEntityRevisionParamConverter() {
+ public function testEntityRevisionParamConverter(): void {
// Create a test entity with multiple revisions and translations for them.
$entity = EntityTestMulRev::create([
'name' => 'default revision - en',
@@ -230,7 +230,7 @@ class EntityRevisionsTest extends BrowserTestBase {
* @covers \Drupal\Core\Entity\ContentEntityBase::setNewRevision
* @covers \Drupal\Core\Entity\ContentEntityBase::isNewRevision
*/
- public function testNewRevisionRevert() {
+ public function testNewRevisionRevert(): void {
$entity = EntityTestMulRev::create(['name' => 'EntityLoadedRevisionTest']);
$entity->save();
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityTranslationFormTest.php b/core/modules/system/tests/src/Functional/Entity/EntityTranslationFormTest.php
index cb595f2d262..adbda286972 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityTranslationFormTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityTranslationFormTest.php
@@ -54,7 +54,7 @@ class EntityTranslationFormTest extends BrowserTestBase {
/**
* Tests entity form language.
*/
- public function testEntityFormLanguage() {
+ public function testEntityFormLanguage(): void {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
$web_user = $this->drupalCreateUser([
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php b/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php
index 82a51f35ea1..608cdd9ceaa 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php
@@ -51,7 +51,7 @@ class EntityViewControllerTest extends BrowserTestBase {
/**
* Tests EntityViewController.
*/
- public function testEntityViewController() {
+ public function testEntityViewController(): void {
$get_label_markup = function ($label) {
return '<h1 class="page-title">
<div class="field field--name-name field--type-string field--label-hidden field__item">' . $label . '</div>
@@ -93,7 +93,7 @@ class EntityViewControllerTest extends BrowserTestBase {
/**
* Tests field item attributes.
*/
- public function testFieldItemAttributes() {
+ public function testFieldItemAttributes(): void {
// Make sure the test field will be rendered.
\Drupal::service('entity_display.repository')
->getViewDisplay('entity_test', 'entity_test')
@@ -115,7 +115,7 @@ class EntityViewControllerTest extends BrowserTestBase {
/**
* Tests that a view builder can successfully override the view builder.
*/
- public function testEntityViewControllerViewBuilder() {
+ public function testEntityViewControllerViewBuilder(): void {
$entity_test = $this->createTestEntity('entity_test_view_builder');
$entity_test->save();
$this->drupalGet('entity_test_view_builder/' . $entity_test->id());
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityWithUriCacheTagsTestBase.php b/core/modules/system/tests/src/Functional/Entity/EntityWithUriCacheTagsTestBase.php
index 39d87dc889e..04e21dac178 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityWithUriCacheTagsTestBase.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityWithUriCacheTagsTestBase.php
@@ -22,7 +22,7 @@ abstract class EntityWithUriCacheTagsTestBase extends EntityCacheTagsTestBase {
* - "<entity type>_view"
* - "<entity_type>:<entity ID>"
*/
- public function testEntityUri() {
+ public function testEntityUri(): void {
$entity_url = $this->entity->toUrl();
$entity_type = $this->entity->getEntityTypeId();
diff --git a/core/modules/system/tests/src/Functional/File/ConfigTest.php b/core/modules/system/tests/src/Functional/File/ConfigTest.php
index ab086c31d4f..7202cc90970 100644
--- a/core/modules/system/tests/src/Functional/File/ConfigTest.php
+++ b/core/modules/system/tests/src/Functional/File/ConfigTest.php
@@ -31,7 +31,7 @@ class ConfigTest extends BrowserTestBase {
/**
* Tests file configuration page.
*/
- public function testFileConfigurationPage() {
+ public function testFileConfigurationPage(): void {
$this->drupalGet('admin/config/media/file-system');
// Set the file paths to non-default values.
diff --git a/core/modules/system/tests/src/Functional/File/FileSaveHtaccessLoggingTest.php b/core/modules/system/tests/src/Functional/File/FileSaveHtaccessLoggingTest.php
index 41a105e9613..d901a7701cb 100644
--- a/core/modules/system/tests/src/Functional/File/FileSaveHtaccessLoggingTest.php
+++ b/core/modules/system/tests/src/Functional/File/FileSaveHtaccessLoggingTest.php
@@ -27,7 +27,7 @@ class FileSaveHtaccessLoggingTest extends BrowserTestBase {
/**
* Tests file_save_htaccess().
*/
- public function testHtaccessSave() {
+ public function testHtaccessSave(): void {
// Prepare test directories.
$private = $this->publicFilesDirectory . '/test/private';
diff --git a/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php b/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php
index a1315a0fea3..5fe28a2e807 100644
--- a/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php
+++ b/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php
@@ -76,7 +76,7 @@ class FileTransferTest extends BrowserTestBase {
}
}
- public function testJail() {
+ public function testJail(): void {
$source = $this->_buildFakeModule();
// This convoluted piece of code is here because our testing framework does
diff --git a/core/modules/system/tests/src/Functional/Form/AlterTest.php b/core/modules/system/tests/src/Functional/Form/AlterTest.php
index 4233d3633f9..3371821a2e2 100644
--- a/core/modules/system/tests/src/Functional/Form/AlterTest.php
+++ b/core/modules/system/tests/src/Functional/Form/AlterTest.php
@@ -29,7 +29,7 @@ class AlterTest extends BrowserTestBase {
/**
* Tests execution order of hook_form_alter() and hook_form_FORM_ID_alter().
*/
- public function testExecutionOrder() {
+ public function testExecutionOrder(): void {
$this->drupalGet('form-test/alter');
// Ensure that the order is first by module, then for a given module, the
// id-specific one after the generic one.
diff --git a/core/modules/system/tests/src/Functional/Form/ArbitraryRebuildTest.php b/core/modules/system/tests/src/Functional/Form/ArbitraryRebuildTest.php
index 20a28a25d5e..d20665c3d3e 100644
--- a/core/modules/system/tests/src/Functional/Form/ArbitraryRebuildTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ArbitraryRebuildTest.php
@@ -59,7 +59,7 @@ class ArbitraryRebuildTest extends BrowserTestBase {
/**
* Tests a basic rebuild with the user registration form.
*/
- public function testUserRegistrationRebuild() {
+ public function testUserRegistrationRebuild(): void {
$edit = [
'name' => 'foo',
'mail' => 'bar@example.com',
@@ -74,7 +74,7 @@ class ArbitraryRebuildTest extends BrowserTestBase {
/**
* Tests a rebuild caused by a multiple value field.
*/
- public function testUserRegistrationMultipleField() {
+ public function testUserRegistrationMultipleField(): void {
$edit = [
'name' => 'foo',
'mail' => 'bar@example.com',
diff --git a/core/modules/system/tests/src/Functional/Form/CheckboxTest.php b/core/modules/system/tests/src/Functional/Form/CheckboxTest.php
index aaaba68ba98..c202588c785 100644
--- a/core/modules/system/tests/src/Functional/Form/CheckboxTest.php
+++ b/core/modules/system/tests/src/Functional/Form/CheckboxTest.php
@@ -27,7 +27,7 @@ class CheckboxTest extends BrowserTestBase {
*/
protected $defaultTheme = 'stark';
- public function testFormCheckbox() {
+ public function testFormCheckbox(): void {
// Ensure that the checked state is determined and rendered correctly for
// tricky combinations of default and return values.
foreach ([FALSE, NULL, TRUE, 0, '0', '', 1, '1', 'foobar', '1foobar'] as $default_value) {
diff --git a/core/modules/system/tests/src/Functional/Form/ConfirmFormTest.php b/core/modules/system/tests/src/Functional/Form/ConfirmFormTest.php
index 65cb8c3ce7d..c1d7cc220d2 100644
--- a/core/modules/system/tests/src/Functional/Form/ConfirmFormTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ConfirmFormTest.php
@@ -26,7 +26,7 @@ class ConfirmFormTest extends BrowserTestBase {
*/
protected $defaultTheme = 'stark';
- public function testConfirmForm() {
+ public function testConfirmForm(): void {
// Test the building of the form.
$this->drupalGet('form-test/confirm-form');
$site_name = $this->config('system.site')->get('name');
@@ -59,7 +59,7 @@ class ConfirmFormTest extends BrowserTestBase {
/**
* Tests that the confirm form does not use external destinations.
*/
- public function testConfirmFormWithExternalDestination() {
+ public function testConfirmFormWithExternalDestination(): void {
$this->drupalGet('form-test/confirm-form');
$this->assertSession()->linkByHrefExists(Url::fromRoute('form_test.route8')->toString());
$this->drupalGet('form-test/confirm-form', ['query' => ['destination' => 'node']]);
diff --git a/core/modules/system/tests/src/Functional/Form/ElementTest.php b/core/modules/system/tests/src/Functional/Form/ElementTest.php
index cbeb84b3e37..613cf6dfe05 100644
--- a/core/modules/system/tests/src/Functional/Form/ElementTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ElementTest.php
@@ -29,7 +29,7 @@ class ElementTest extends BrowserTestBase {
/**
* Tests placeholder text for elements that support placeholders.
*/
- public function testPlaceHolderText() {
+ public function testPlaceHolderText(): void {
$this->drupalGet('form-test/placeholder-text');
foreach (['textfield', 'tel', 'url', 'password', 'email', 'number', 'textarea'] as $type) {
$field = $this->assertSession()->fieldExists("edit-$type");
@@ -40,7 +40,7 @@ class ElementTest extends BrowserTestBase {
/**
* Tests expansion of #options for #type checkboxes and radios.
*/
- public function testOptions() {
+ public function testOptions(): void {
$this->drupalGet('form-test/checkboxes-radios');
// Verify that all options appear in their defined order.
@@ -81,7 +81,7 @@ class ElementTest extends BrowserTestBase {
/**
* Tests correct checked attribute for radios element.
*/
- public function testRadiosChecked() {
+ public function testRadiosChecked(): void {
// Verify that there is only one radio option checked.
$this->drupalGet('form-test/radios-checked');
$this->assertSession()->elementsCount('xpath', '//input[@name="radios" and @checked]', 1);
@@ -110,7 +110,7 @@ class ElementTest extends BrowserTestBase {
/**
* Tests wrapper ids for checkboxes and radios.
*/
- public function testWrapperIds() {
+ public function testWrapperIds(): void {
$this->drupalGet('form-test/checkboxes-radios');
// Verify that wrapper id is different from element id.
@@ -124,7 +124,7 @@ class ElementTest extends BrowserTestBase {
/**
* Tests button classes.
*/
- public function testButtonClasses() {
+ public function testButtonClasses(): void {
$this->drupalGet('form-test/button-class');
// Just contains(@class, "button") won't do because then
// "button--foo" would contain "button". Instead, check
@@ -138,7 +138,7 @@ class ElementTest extends BrowserTestBase {
/**
* Tests the #group property.
*/
- public function testGroupElements() {
+ public function testGroupElements(): void {
$this->drupalGet('form-test/group-details');
$this->assertSession()->elementsCount('xpath', '//div[@class="details-wrapper"]//div[@class="details-wrapper"]//label', 1);
$this->drupalGet('form-test/group-container');
@@ -154,7 +154,7 @@ class ElementTest extends BrowserTestBase {
/**
* Tests the #required property on details and fieldset elements.
*/
- public function testRequiredFieldsetsAndDetails() {
+ public function testRequiredFieldsetsAndDetails(): void {
$this->drupalGet('form-test/group-details');
$this->assertEmpty($this->cssSelect('summary.form-required'));
$this->drupalGet('form-test/group-details/1');
@@ -168,7 +168,7 @@ class ElementTest extends BrowserTestBase {
/**
* Tests a form with an autocomplete setting..
*/
- public function testFormAutocomplete() {
+ public function testFormAutocomplete(): void {
$this->drupalGet('form-test/autocomplete');
// Ensure that the user does not have access to the autocompletion.
@@ -190,7 +190,7 @@ class ElementTest extends BrowserTestBase {
/**
* Tests form element error messages.
*/
- public function testFormElementErrors() {
+ public function testFormElementErrors(): void {
$this->drupalGet('form_test/details-form');
$this->submitForm([], 'Submit');
$this->assertSession()->pageTextContains('I am an error on the details element.');
@@ -199,7 +199,7 @@ class ElementTest extends BrowserTestBase {
/**
* Tests summary attributes of details.
*/
- public function testDetailsSummaryAttributes() {
+ public function testDetailsSummaryAttributes(): void {
$this->drupalGet('form-test/group-details');
$this->assertSession()->elementExists('css', 'summary[data-summary-attribute="test"]');
}
diff --git a/core/modules/system/tests/src/Functional/Form/ElementsAccessTest.php b/core/modules/system/tests/src/Functional/Form/ElementsAccessTest.php
index 2103ba80afc..7a49b2bea97 100644
--- a/core/modules/system/tests/src/Functional/Form/ElementsAccessTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ElementsAccessTest.php
@@ -28,7 +28,7 @@ class ElementsAccessTest extends BrowserTestBase {
/**
* Ensures that child values are still processed when #access = FALSE.
*/
- public function testAccessFalse() {
+ public function testAccessFalse(): void {
$this->drupalGet('form_test/vertical-tabs-access');
$this->submitForm([], 'Submit');
$this->assertSession()->pageTextNotContains('This checkbox inside a vertical tab does not have its default value.');
diff --git a/core/modules/system/tests/src/Functional/Form/ElementsContainerTest.php b/core/modules/system/tests/src/Functional/Form/ElementsContainerTest.php
index 7d26b78aa56..561295eeba0 100644
--- a/core/modules/system/tests/src/Functional/Form/ElementsContainerTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ElementsContainerTest.php
@@ -28,7 +28,7 @@ class ElementsContainerTest extends BrowserTestBase {
/**
* Tests the #optional container property.
*/
- public function testOptionalContainerElements() {
+ public function testOptionalContainerElements(): void {
$this->drupalGet('form-test/optional-container');
$assertSession = $this->assertSession();
$assertSession->elementNotExists('css', 'div.empty_optional');
diff --git a/core/modules/system/tests/src/Functional/Form/ElementsLabelsTest.php b/core/modules/system/tests/src/Functional/Form/ElementsLabelsTest.php
index 663e69b67a4..c63a03050d1 100644
--- a/core/modules/system/tests/src/Functional/Form/ElementsLabelsTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ElementsLabelsTest.php
@@ -35,7 +35,7 @@ class ElementsLabelsTest extends BrowserTestBase {
* - Prefix and suffix render element placement.
* - Form element title attributes.
*/
- public function testFormLabels() {
+ public function testFormLabels(): void {
$this->drupalGet('form_test/form-labels');
// Check that the checkbox/radio processing is not interfering with
@@ -104,7 +104,7 @@ class ElementsLabelsTest extends BrowserTestBase {
/**
* Tests XSS-protection of element labels.
*/
- public function testTitleEscaping() {
+ public function testTitleEscaping(): void {
$this->drupalGet('form_test/form-labels');
foreach (FormTestLabelForm::$typesWithTitle as $type) {
$this->assertSession()->responseContains("$type alert('XSS') is XSS filtered!");
@@ -115,7 +115,7 @@ class ElementsLabelsTest extends BrowserTestBase {
/**
* Tests different display options for form element descriptions.
*/
- public function testFormDescriptions() {
+ public function testFormDescriptions(): void {
$this->drupalGet('form_test/form-descriptions');
// Check #description placement with #description_display='after'.
@@ -142,7 +142,7 @@ class ElementsLabelsTest extends BrowserTestBase {
/**
* Tests forms in theme-less environments.
*/
- public function testFormsInThemeLessEnvironments() {
+ public function testFormsInThemeLessEnvironments(): void {
$form = $this->getFormWithLimitedProperties();
$render_service = $this->container->get('renderer');
// This should not throw any notices.
diff --git a/core/modules/system/tests/src/Functional/Form/ElementsTableSelectTest.php b/core/modules/system/tests/src/Functional/Form/ElementsTableSelectTest.php
index f021029450e..864183d0ab7 100644
--- a/core/modules/system/tests/src/Functional/Form/ElementsTableSelectTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ElementsTableSelectTest.php
@@ -30,7 +30,7 @@ class ElementsTableSelectTest extends BrowserTestBase {
/**
* Tests the display of checkboxes when #multiple is TRUE.
*/
- public function testMultipleTrue() {
+ public function testMultipleTrue(): void {
$this->drupalGet('form_test/tableselect/multiple-true');
@@ -48,7 +48,7 @@ class ElementsTableSelectTest extends BrowserTestBase {
/**
* Tests the display of radios when #multiple is FALSE.
*/
- public function testMultipleFalse() {
+ public function testMultipleFalse(): void {
$this->drupalGet('form_test/tableselect/multiple-false');
$this->assertSession()->pageTextNotContains('Empty text.');
@@ -65,7 +65,7 @@ class ElementsTableSelectTest extends BrowserTestBase {
/**
* Tests the display when #colspan is set.
*/
- public function testTableSelectColSpan() {
+ public function testTableSelectColSpan(): void {
$this->drupalGet('form_test/tableselect/colspan');
// Verify presence of column three and absence of column four.
@@ -89,7 +89,7 @@ class ElementsTableSelectTest extends BrowserTestBase {
/**
* Tests the display of the #empty text when #options is an empty array.
*/
- public function testEmptyText() {
+ public function testEmptyText(): void {
$this->drupalGet('form_test/tableselect/empty-text');
$this->assertSession()->pageTextContains('Empty text.');
}
@@ -97,7 +97,7 @@ class ElementsTableSelectTest extends BrowserTestBase {
/**
* Tests the submission of single and multiple values when #multiple is TRUE.
*/
- public function testMultipleTrueSubmit() {
+ public function testMultipleTrueSubmit(): void {
// Test a submission with one checkbox checked.
$edit = [];
@@ -125,7 +125,7 @@ class ElementsTableSelectTest extends BrowserTestBase {
/**
* Tests submission of values when #multiple is FALSE.
*/
- public function testMultipleFalseSubmit() {
+ public function testMultipleFalseSubmit(): void {
$edit['tableselect'] = 'row1';
$this->drupalGet('form_test/tableselect/multiple-false');
$this->submitForm($edit, 'Submit');
@@ -135,7 +135,7 @@ class ElementsTableSelectTest extends BrowserTestBase {
/**
* Tests the #js_select property.
*/
- public function testAdvancedSelect() {
+ public function testAdvancedSelect(): void {
// When #multiple = TRUE a Select all checkbox should be displayed by default.
$this->drupalGet('form_test/tableselect/advanced-select/multiple-true-default');
$this->assertSession()->elementExists('xpath', '//th[@class="select-all"]');
@@ -155,7 +155,7 @@ class ElementsTableSelectTest extends BrowserTestBase {
/**
* Tests error handling for invalid tableselect values with checkboxes.
*/
- public function testMultipleTrueOptionChecker() {
+ public function testMultipleTrueOptionChecker(): void {
[$header, $options] = _form_test_tableselect_get_data();
@@ -178,7 +178,7 @@ class ElementsTableSelectTest extends BrowserTestBase {
/**
* Tests error handling for invalid tableselect values with radio buttons.
*/
- public function testMultipleFalseOptionChecker() {
+ public function testMultipleFalseOptionChecker(): void {
[$header, $options] = _form_test_tableselect_get_data();
diff --git a/core/modules/system/tests/src/Functional/Form/ElementsVerticalTabsTest.php b/core/modules/system/tests/src/Functional/Form/ElementsVerticalTabsTest.php
index 7ab935952af..c11fad1b6ca 100644
--- a/core/modules/system/tests/src/Functional/Form/ElementsVerticalTabsTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ElementsVerticalTabsTest.php
@@ -56,7 +56,7 @@ class ElementsVerticalTabsTest extends BrowserTestBase {
/**
* Ensures that vertical tab markup is not shown if user has no tab access.
*/
- public function testWrapperNotShownWhenEmpty() {
+ public function testWrapperNotShownWhenEmpty(): void {
// Test admin user can see vertical tabs and wrapper.
$this->drupalGet('form_test/vertical-tabs');
$this->assertSession()->elementExists('xpath', "//div[@data-vertical-tabs-panes]");
@@ -70,7 +70,7 @@ class ElementsVerticalTabsTest extends BrowserTestBase {
/**
* Ensures that default vertical tab is correctly selected.
*/
- public function testDefaultTab() {
+ public function testDefaultTab(): void {
$this->drupalGet('form_test/vertical-tabs');
$this->assertSession()->elementAttributeContains('css', 'input[name="vertical_tabs__active_tab"]', 'value', 'edit-tab3');
}
@@ -78,7 +78,7 @@ class ElementsVerticalTabsTest extends BrowserTestBase {
/**
* Ensures that vertical tab form values are cleaned.
*/
- public function testDefaultTabCleaned() {
+ public function testDefaultTabCleaned(): void {
$this->drupalGet('form_test/form-state-values-clean');
$this->submitForm([], 'Submit');
$values = Json::decode($this->getSession()->getPage()->getContent());
diff --git a/core/modules/system/tests/src/Functional/Form/EmailTest.php b/core/modules/system/tests/src/Functional/Form/EmailTest.php
index 169abf43203..a2b24b0170e 100644
--- a/core/modules/system/tests/src/Functional/Form/EmailTest.php
+++ b/core/modules/system/tests/src/Functional/Form/EmailTest.php
@@ -29,7 +29,7 @@ class EmailTest extends BrowserTestBase {
/**
* Tests that #type 'email' fields are properly validated.
*/
- public function testFormEmail() {
+ public function testFormEmail(): void {
$edit = [];
$edit['email'] = 'invalid';
$edit['email_required'] = ' ';
diff --git a/core/modules/system/tests/src/Functional/Form/FormObjectTest.php b/core/modules/system/tests/src/Functional/Form/FormObjectTest.php
index 3b8a2e343d8..b6487d2ae42 100644
--- a/core/modules/system/tests/src/Functional/Form/FormObjectTest.php
+++ b/core/modules/system/tests/src/Functional/Form/FormObjectTest.php
@@ -30,7 +30,7 @@ class FormObjectTest extends BrowserTestBase {
*
* @see \Drupal\form_test\EventSubscriber\FormTestEventSubscriber::onKernelRequest()
*/
- public function testObjectFormCallback() {
+ public function testObjectFormCallback(): void {
$config_factory = $this->container->get('config.factory');
$this->drupalGet('form-test/object-builder');
diff --git a/core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php b/core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php
index 708f1aed884..c3d617976ef 100644
--- a/core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php
+++ b/core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php
@@ -46,7 +46,7 @@ class FormStoragePageCacheTest extends BrowserTestBase {
/**
* Build-id is regenerated when validating cached form.
*/
- public function testValidateFormStorageOnCachedPage() {
+ public function testValidateFormStorageOnCachedPage(): void {
$this->drupalGet('form-test/form-storage-page-cache');
$this->assertSession()->responseHeaderEquals('X-Drupal-Cache', 'MISS');
$this->assertSession()->pageTextContains('No old build id');
@@ -92,7 +92,7 @@ class FormStoragePageCacheTest extends BrowserTestBase {
/**
* Build-id is regenerated when rebuilding cached form.
*/
- public function testRebuildFormStorageOnCachedPage() {
+ public function testRebuildFormStorageOnCachedPage(): void {
$this->drupalGet('form-test/form-storage-page-cache');
$this->assertSession()->responseHeaderEquals('X-Drupal-Cache', 'MISS');
$this->assertSession()->pageTextContains('No old build id');
diff --git a/core/modules/system/tests/src/Functional/Form/FormTest.php b/core/modules/system/tests/src/Functional/Form/FormTest.php
index 89834a28a52..e827620c708 100644
--- a/core/modules/system/tests/src/Functional/Form/FormTest.php
+++ b/core/modules/system/tests/src/Functional/Form/FormTest.php
@@ -60,7 +60,7 @@ class FormTest extends BrowserTestBase {
*
* If the form field is found in $form_state->getErrors() then the test pass.
*/
- public function testRequiredFields() {
+ public function testRequiredFields(): void {
// Originates from https://www.drupal.org/node/117748.
// Sets of empty strings and arrays.
$empty_strings = ['""' => "", '"\n"' => "\n", '" "' => " ", '"\t"' => "\t", '" \n\t "' => " \n\t ", '"\n\n\n\n\n"' => "\n\n\n\n\n"];
@@ -172,7 +172,7 @@ class FormTest extends BrowserTestBase {
*
* @see \Drupal\form_test\Form\FormTestValidateRequiredForm
*/
- public function testRequiredCheckboxesRadio() {
+ public function testRequiredCheckboxesRadio(): void {
$form = \Drupal::formBuilder()->getForm('\Drupal\form_test\Form\FormTestValidateRequiredForm');
// Attempt to submit the form with no required fields set.
@@ -246,7 +246,7 @@ class FormTest extends BrowserTestBase {
*
* Submits a test form containing several types of form elements.
*/
- public function testInputWithInvalidToken() {
+ public function testInputWithInvalidToken(): void {
// We need to be logged in to have CSRF tokens.
$account = $this->createUser();
$this->drupalLogin($account);
@@ -333,7 +333,7 @@ class FormTest extends BrowserTestBase {
/**
* CSRF tokens for GET forms should not be added by default.
*/
- public function testGetFormsCsrfToken() {
+ public function testGetFormsCsrfToken(): void {
// We need to be logged in to have CSRF tokens.
$account = $this->createUser();
$this->drupalLogin($account);
@@ -352,7 +352,7 @@ class FormTest extends BrowserTestBase {
*
* @see \Drupal\form_test\Form\FormTestValidateRequiredNoTitleForm
*/
- public function testRequiredTextfieldNoTitle() {
+ public function testRequiredTextfieldNoTitle(): void {
// Attempt to submit the form with no required field set.
$edit = [];
$this->drupalGet('form-test/validate-required-no-title');
@@ -381,7 +381,7 @@ class FormTest extends BrowserTestBase {
*
* @see _form_test_checkbox()
*/
- public function testCheckboxProcessing() {
+ public function testCheckboxProcessing(): void {
// First, try to submit without the required checkbox.
$edit = [];
$this->drupalGet('form-test/checkbox');
@@ -407,7 +407,7 @@ class FormTest extends BrowserTestBase {
/**
* Tests validation of #type 'select' elements.
*/
- public function testSelect() {
+ public function testSelect(): void {
$form = \Drupal::formBuilder()->getForm('Drupal\form_test\Form\FormTestSelectForm');
$this->drupalGet('form-test/select');
@@ -480,7 +480,7 @@ class FormTest extends BrowserTestBase {
/**
* Tests a select element when #options is not set.
*/
- public function testEmptySelect() {
+ public function testEmptySelect(): void {
$this->drupalGet('form-test/empty-select');
$this->assertSession()->elementExists('xpath', "//select[1]");
$this->assertSession()->elementNotExists('xpath', "//select[1]/option");
@@ -489,7 +489,7 @@ class FormTest extends BrowserTestBase {
/**
* Tests sorting and not sorting of options in a select element.
*/
- public function testSelectSorting() {
+ public function testSelectSorting(): void {
$this->drupalGet('form-test/select');
// Verify the order of the select options.
@@ -609,7 +609,7 @@ class FormTest extends BrowserTestBase {
/**
* Tests validation of #type 'number' and 'range' elements.
*/
- public function testNumber() {
+ public function testNumber(): void {
$form = \Drupal::formBuilder()->getForm('\Drupal\form_test\Form\FormTestNumberForm');
// Array with all the error messages to be checked.
@@ -674,7 +674,7 @@ class FormTest extends BrowserTestBase {
/**
* Tests default value handling of #type 'range' elements.
*/
- public function testRange() {
+ public function testRange(): void {
$this->drupalGet('form-test/range');
$this->submitForm([], 'Submit');
$values = json_decode($this->getSession()->getPage()->getContent());
@@ -692,7 +692,7 @@ class FormTest extends BrowserTestBase {
/**
* Tests validation of #type 'color' elements.
*/
- public function testColorValidation() {
+ public function testColorValidation(): void {
// Keys are inputs, values are expected results.
$values = [
'' => '#000000',
@@ -733,7 +733,7 @@ class FormTest extends BrowserTestBase {
*
* @see _form_test_disabled_elements()
*/
- public function testDisabledElements() {
+ public function testDisabledElements(): void {
// Get the raw form in its original state.
$form_state = new FormState();
$form = (new FormTestDisabledElementsForm())->buildForm([], $form_state);
@@ -823,7 +823,7 @@ class FormTest extends BrowserTestBase {
*
* @see _form_test_disabled_elements()
*/
- public function testDisabledMarkup() {
+ public function testDisabledMarkup(): void {
$this->drupalGet('form-test/disabled-elements');
$form = \Drupal::formBuilder()->getForm('\Drupal\form_test\Form\FormTestDisabledElementsForm');
$type_map = [
@@ -879,7 +879,7 @@ class FormTest extends BrowserTestBase {
*
* @see \Drupal\form_test\Form\FormTestInputForgeryForm
*/
- public function testInputForgery() {
+ public function testInputForgery(): void {
$this->drupalGet('form-test/input-forgery');
// The value for checkboxes[two] was changed using post render to simulate
// an input forgery.
@@ -891,7 +891,7 @@ class FormTest extends BrowserTestBase {
/**
* Tests required attribute.
*/
- public function testRequiredAttribute() {
+ public function testRequiredAttribute(): void {
$this->drupalGet('form-test/required-attribute');
foreach (['textfield', 'password', 'textarea'] as $type) {
$field = $this->assertSession()->fieldExists("edit-$type");
diff --git a/core/modules/system/tests/src/Functional/Form/LanguageSelectElementTest.php b/core/modules/system/tests/src/Functional/Form/LanguageSelectElementTest.php
index df04caac9c9..ae530b53484 100644
--- a/core/modules/system/tests/src/Functional/Form/LanguageSelectElementTest.php
+++ b/core/modules/system/tests/src/Functional/Form/LanguageSelectElementTest.php
@@ -31,7 +31,7 @@ class LanguageSelectElementTest extends BrowserTestBase {
/**
* Tests that the options printed by the language select element are correct.
*/
- public function testLanguageSelectElementOptions() {
+ public function testLanguageSelectElementOptions(): void {
// Add some languages.
ConfigurableLanguage::create([
'id' => 'aaa',
@@ -74,7 +74,7 @@ class LanguageSelectElementTest extends BrowserTestBase {
*
* This happens when the language module is disabled.
*/
- public function testHiddenLanguageSelectElement() {
+ public function testHiddenLanguageSelectElement(): void {
// Disable the language module, so that the language select field will not
// be rendered.
$this->container->get('module_installer')->uninstall(['language']);
diff --git a/core/modules/system/tests/src/Functional/Form/MenuLinksetSettingsFormTest.php b/core/modules/system/tests/src/Functional/Form/MenuLinksetSettingsFormTest.php
index 46f7106c9f0..b34a5966491 100644
--- a/core/modules/system/tests/src/Functional/Form/MenuLinksetSettingsFormTest.php
+++ b/core/modules/system/tests/src/Functional/Form/MenuLinksetSettingsFormTest.php
@@ -40,7 +40,7 @@ class MenuLinksetSettingsFormTest extends BrowserTestBase {
/**
* Tests the menu_linkset_settings form.
*/
- public function testMenuLinksetSettingsForm() {
+ public function testMenuLinksetSettingsForm(): void {
// Users without the appropriate permissions should not be able to access.
$this->drupalGet('admin/config/services/linkset');
$this->assertSession()->pageTextContains('Access denied');
diff --git a/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php b/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php
index c64a6c74e64..dd1c438babd 100644
--- a/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php
@@ -41,7 +41,7 @@ class ModulesListFormWebTest extends BrowserTestBase {
/**
* Tests the module list form.
*/
- public function testModuleListForm() {
+ public function testModuleListForm(): void {
$this->drupalGet('admin/modules');
// Check that system_test's configure link was rendered correctly.
@@ -69,7 +69,7 @@ class ModulesListFormWebTest extends BrowserTestBase {
/**
* Tests the status message when enabling one or more modules.
*/
- public function testModulesListFormStatusMessage() {
+ public function testModulesListFormStatusMessage(): void {
$this->drupalGet('admin/modules');
// Enable a module that does not define permissions.
@@ -95,7 +95,7 @@ class ModulesListFormWebTest extends BrowserTestBase {
/**
* Tests the module form with a module with an invalid info.yml file.
*/
- public function testModulesListFormWithInvalidInfoFile() {
+ public function testModulesListFormWithInvalidInfoFile(): void {
$path = \Drupal::getContainer()->getParameter('site.path') . "/modules/broken";
mkdir($path, 0777, TRUE);
$file_path = "$path/broken.info.yml";
@@ -128,7 +128,7 @@ BROKEN;
/**
* Tests the module form with a module with an empty description in info.yml.
*/
- public function testModulesListFormWithEmptyDescriptionInfoFile() {
+ public function testModulesListFormWithEmptyDescriptionInfoFile(): void {
$path = \Drupal::getContainer()
->getParameter('site.path') . "/modules/missing_description";
mkdir($path, 0777, TRUE);
@@ -156,7 +156,7 @@ BROKEN;
/**
* Confirm that module 'Required By' descriptions include dependent themes.
*/
- public function testRequiredByThemeMessage() {
+ public function testRequiredByThemeMessage(): void {
$this->drupalGet('admin/modules');
$module_theme_depends_on_description = $this->getSession()->getPage()->findAll('css', '#edit-modules-test-module-required-by-theme-enable-description .admin-requirements li:contains("Test Theme Depending on Modules (theme) (disabled)")');
// Confirm that 'Test Theme Depending on Modules' is listed as being
@@ -169,7 +169,7 @@ BROKEN;
/**
* Tests that incompatible modules message is shown.
*/
- public function testInstalledIncompatibleModule() {
+ public function testInstalledIncompatibleModule(): void {
$incompatible_modules_message = 'There are errors with some installed modules. Visit the status report page for more information.';
$path = \Drupal::getContainer()->getParameter('site.path') . "/modules/changing_module";
mkdir($path, 0777, TRUE);
diff --git a/core/modules/system/tests/src/Functional/Form/RebuildTest.php b/core/modules/system/tests/src/Functional/Form/RebuildTest.php
index fcf71093679..39a47edf9be 100644
--- a/core/modules/system/tests/src/Functional/Form/RebuildTest.php
+++ b/core/modules/system/tests/src/Functional/Form/RebuildTest.php
@@ -47,7 +47,7 @@ class RebuildTest extends BrowserTestBase {
/**
* Tests preservation of values.
*/
- public function testRebuildPreservesValues() {
+ public function testRebuildPreservesValues(): void {
$edit = [
'checkbox_1_default_off' => TRUE,
'checkbox_1_default_on' => FALSE,
diff --git a/core/modules/system/tests/src/Functional/Form/RedirectTest.php b/core/modules/system/tests/src/Functional/Form/RedirectTest.php
index 5ad762ede0e..ddcf7b86e7e 100644
--- a/core/modules/system/tests/src/Functional/Form/RedirectTest.php
+++ b/core/modules/system/tests/src/Functional/Form/RedirectTest.php
@@ -29,7 +29,7 @@ class RedirectTest extends BrowserTestBase {
/**
* Tests form redirection.
*/
- public function testRedirect() {
+ public function testRedirect(): void {
$path = 'form-test/redirect';
$options = ['query' => ['foo' => 'bar']];
$options['absolute'] = TRUE;
@@ -113,7 +113,7 @@ class RedirectTest extends BrowserTestBase {
/**
* Tests form redirection from 404/403 pages with the Block form.
*/
- public function testRedirectFromErrorPages() {
+ public function testRedirectFromErrorPages(): void {
// Make sure the block containing the redirect form is placed.
$this->drupalPlaceBlock('redirect_form_block');
diff --git a/core/modules/system/tests/src/Functional/Form/ResponseTest.php b/core/modules/system/tests/src/Functional/Form/ResponseTest.php
index 6546b245436..11fdaa575da 100644
--- a/core/modules/system/tests/src/Functional/Form/ResponseTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ResponseTest.php
@@ -29,7 +29,7 @@ class ResponseTest extends BrowserTestBase {
/**
* Tests that enforced responses propagate through subscribers and middleware.
*/
- public function testFormResponse() {
+ public function testFormResponse(): void {
$edit = [
'content' => $this->randomString(),
'status' => 200,
diff --git a/core/modules/system/tests/src/Functional/Form/StateValuesCleanAdvancedTest.php b/core/modules/system/tests/src/Functional/Form/StateValuesCleanAdvancedTest.php
index 4f1cad0c1ea..2b7d21dd445 100644
--- a/core/modules/system/tests/src/Functional/Form/StateValuesCleanAdvancedTest.php
+++ b/core/modules/system/tests/src/Functional/Form/StateValuesCleanAdvancedTest.php
@@ -40,7 +40,7 @@ class StateValuesCleanAdvancedTest extends BrowserTestBase {
/**
* Tests \Drupal\Core\Form\FormState::cleanValues().
*/
- public function testFormStateValuesCleanAdvanced() {
+ public function testFormStateValuesCleanAdvanced(): void {
// Get an image for uploading.
$image_files = $this->drupalGetTestFiles('image');
diff --git a/core/modules/system/tests/src/Functional/Form/StateValuesCleanTest.php b/core/modules/system/tests/src/Functional/Form/StateValuesCleanTest.php
index 85dc104ee9a..2c13643c7f9 100644
--- a/core/modules/system/tests/src/Functional/Form/StateValuesCleanTest.php
+++ b/core/modules/system/tests/src/Functional/Form/StateValuesCleanTest.php
@@ -31,7 +31,7 @@ class StateValuesCleanTest extends BrowserTestBase {
/**
* Tests \Drupal\Core\Form\FormState::cleanValues().
*/
- public function testFormStateValuesClean() {
+ public function testFormStateValuesClean(): void {
$this->drupalGet('form_test/form-state-values-clean');
$this->submitForm([], 'Submit');
$values = Json::decode($this->getSession()->getPage()->getContent());
diff --git a/core/modules/system/tests/src/Functional/Form/StorageTest.php b/core/modules/system/tests/src/Functional/Form/StorageTest.php
index d023aa9c1f0..9b3997c2b23 100644
--- a/core/modules/system/tests/src/Functional/Form/StorageTest.php
+++ b/core/modules/system/tests/src/Functional/Form/StorageTest.php
@@ -46,7 +46,7 @@ class StorageTest extends BrowserTestBase {
/**
* Tests using the form in a usual way.
*/
- public function testForm() {
+ public function testForm(): void {
$this->drupalGet('form_test/form-storage');
$assert_session = $this->assertSession();
@@ -75,7 +75,7 @@ class StorageTest extends BrowserTestBase {
/**
* Tests using the form after calling $form_state->setCached().
*/
- public function testFormCached() {
+ public function testFormCached(): void {
$this->drupalGet('form_test/form-storage', ['query' => ['cache' => 1]]);
$this->assertSession()->pageTextContains('Form constructions: 1');
@@ -103,7 +103,7 @@ class StorageTest extends BrowserTestBase {
/**
* Tests validation when form storage is used.
*/
- public function testValidation() {
+ public function testValidation(): void {
$this->drupalGet('form_test/form-storage');
$this->submitForm([
'title' => '',
@@ -123,7 +123,7 @@ class StorageTest extends BrowserTestBase {
* during form validation, while another, required element in the form
* triggers a form validation error.
*/
- public function testCachedFormStorageValidation() {
+ public function testCachedFormStorageValidation(): void {
// Request the form with 'cache' query parameter to enable form caching.
$this->drupalGet('form_test/form-storage', ['query' => ['cache' => 1]]);
@@ -151,7 +151,7 @@ class StorageTest extends BrowserTestBase {
/**
* Tests form build ID regeneration when loading a cached immutable form.
*/
- public function testImmutableForm() {
+ public function testImmutableForm(): void {
// Request the form with 'cache' query parameter to enable form caching.
$this->drupalGet('form_test/form-storage', ['query' => ['cache' => 1, 'immutable' => 1]]);
@@ -184,7 +184,7 @@ class StorageTest extends BrowserTestBase {
/**
* Verify that existing contrib code cannot overwrite immutable form state.
*/
- public function testImmutableFormLegacyProtection() {
+ public function testImmutableFormLegacyProtection(): void {
$this->drupalGet('form_test/form-storage', ['query' => ['cache' => 1, 'immutable' => 1]]);
// Ensure the hidden 'form_build_id' field is unique.
$this->assertSession()->elementsCount('xpath', '//input[@name="form_build_id"]', 1);
diff --git a/core/modules/system/tests/src/Functional/Form/SystemConfigFormTest.php b/core/modules/system/tests/src/Functional/Form/SystemConfigFormTest.php
index 7c8707e19a6..411bc53b1d7 100644
--- a/core/modules/system/tests/src/Functional/Form/SystemConfigFormTest.php
+++ b/core/modules/system/tests/src/Functional/Form/SystemConfigFormTest.php
@@ -28,7 +28,7 @@ class SystemConfigFormTest extends BrowserTestBase {
/**
* Tests the SystemConfigFormTestBase class.
*/
- public function testSystemConfigForm() {
+ public function testSystemConfigForm(): void {
$this->drupalGet('form-test/system-config-form');
// Verify the primary action submit button is found.
$this->assertSession()->elementExists('xpath', "//div[@id = 'edit-actions']/input[contains(@class, 'button--primary')]");
diff --git a/core/modules/system/tests/src/Functional/Form/UrlTest.php b/core/modules/system/tests/src/Functional/Form/UrlTest.php
index dae96f16c99..cf3e9fe6977 100644
--- a/core/modules/system/tests/src/Functional/Form/UrlTest.php
+++ b/core/modules/system/tests/src/Functional/Form/UrlTest.php
@@ -31,7 +31,7 @@ class UrlTest extends BrowserTestBase {
/**
* Tests that #type 'url' fields are properly validated and trimmed.
*/
- public function testFormUrl() {
+ public function testFormUrl(): void {
$edit = [];
$edit['url'] = 'http://';
$edit['url_required'] = ' ';
diff --git a/core/modules/system/tests/src/Functional/Form/ValidationTest.php b/core/modules/system/tests/src/Functional/Form/ValidationTest.php
index 6f959f05206..66f590c6b0b 100644
--- a/core/modules/system/tests/src/Functional/Form/ValidationTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ValidationTest.php
@@ -30,7 +30,7 @@ class ValidationTest extends BrowserTestBase {
/**
* Tests #element_validate and #validate.
*/
- public function testValidate() {
+ public function testValidate(): void {
$this->drupalGet('form-test/validate');
// Verify that #element_validate handlers can alter the form and submitted
// form values.
@@ -82,7 +82,7 @@ class ValidationTest extends BrowserTestBase {
/**
* Tests that a form with a disabled CSRF token can be validated.
*/
- public function testDisabledToken() {
+ public function testDisabledToken(): void {
$this->drupalGet('form-test/validate-no-token');
$this->submitForm([], 'Save');
$this->assertSession()->pageTextContains('The form_test_validate_no_token form has been submitted successfully.');
@@ -91,7 +91,7 @@ class ValidationTest extends BrowserTestBase {
/**
* Tests partial form validation through #limit_validation_errors.
*/
- public function testValidateLimitErrors() {
+ public function testValidateLimitErrors(): void {
$edit = [
'test' => 'invalid',
'test_numeric_index[0]' => 'invalid',
@@ -154,7 +154,7 @@ class ValidationTest extends BrowserTestBase {
/**
* Tests #pattern validation.
*/
- public function testPatternValidation() {
+ public function testPatternValidation(): void {
$textfield_error = 'One digit followed by lowercase letters field is not in the right format.';
$tel_error = 'Everything except numbers field is not in the right format.';
$password_error = 'Password field is not in the right format.';
@@ -220,7 +220,7 @@ class ValidationTest extends BrowserTestBase {
*
* @see \Drupal\form_test\Form\FormTestValidateRequiredForm
*/
- public function testCustomRequiredError() {
+ public function testCustomRequiredError(): void {
$form = \Drupal::formBuilder()->getForm('\Drupal\form_test\Form\FormTestValidateRequiredForm');
// Verify that a custom #required error can be set.
diff --git a/core/modules/system/tests/src/Functional/Lock/LockFunctionalTest.php b/core/modules/system/tests/src/Functional/Lock/LockFunctionalTest.php
index 2277421e439..1c63d1f256c 100644
--- a/core/modules/system/tests/src/Functional/Lock/LockFunctionalTest.php
+++ b/core/modules/system/tests/src/Functional/Lock/LockFunctionalTest.php
@@ -28,7 +28,7 @@ class LockFunctionalTest extends BrowserTestBase {
/**
* Confirms that we can acquire and release locks in two parallel requests.
*/
- public function testLockAcquire() {
+ public function testLockAcquire(): void {
$lock = $this->container->get('lock');
$lock_acquired = 'TRUE: Lock successfully acquired in \Drupal\system_test\Controller\SystemTestController::lockAcquire()';
$lock_not_acquired = 'FALSE: Lock not acquired in \Drupal\system_test\Controller\SystemTestController::lockAcquire()';
@@ -65,7 +65,7 @@ class LockFunctionalTest extends BrowserTestBase {
/**
* Tests that the persistent lock is persisted between requests.
*/
- public function testPersistentLock() {
+ public function testPersistentLock(): void {
$persistent_lock = $this->container->get('lock.persistent');
// Get a persistent lock.
$this->drupalGet('system-test/lock-persist/lock1');
diff --git a/core/modules/system/tests/src/Functional/Menu/BreadcrumbFrontCacheContextsTest.php b/core/modules/system/tests/src/Functional/Menu/BreadcrumbFrontCacheContextsTest.php
index 0ec184f2a61..b0eba62a943 100644
--- a/core/modules/system/tests/src/Functional/Menu/BreadcrumbFrontCacheContextsTest.php
+++ b/core/modules/system/tests/src/Functional/Menu/BreadcrumbFrontCacheContextsTest.php
@@ -79,7 +79,7 @@ class BreadcrumbFrontCacheContextsTest extends BrowserTestBase {
* Checking that the breadcrumb will be printed on node canonical routes even
* if it was rendered for the <front> page first.
*/
- public function testBreadcrumbsFrontPageCache() {
+ public function testBreadcrumbsFrontPageCache(): void {
// Hit front page first as anonymous user with 'cold' render cache.
$this->drupalGet('<front>');
$web_assert = $this->assertSession();
diff --git a/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php b/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php
index 9eee2022ecb..c2a2d60a1f9 100644
--- a/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php
+++ b/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php
@@ -84,7 +84,7 @@ class BreadcrumbTest extends BrowserTestBase {
/**
* Tests breadcrumbs on node and administrative paths.
*/
- public function testBreadCrumbs() {
+ public function testBreadCrumbs(): void {
// Prepare common base breadcrumb elements.
$home = ['' => 'Home'];
$admin = $home + ['admin' => 'Administration'];
@@ -395,7 +395,7 @@ class BreadcrumbTest extends BrowserTestBase {
/**
* Tests AssertBreadcrumbTrait works as expected.
*/
- public function testAssertBreadcrumbTrait() {
+ public function testAssertBreadcrumbTrait(): void {
// Ensure the test trait works as expected using menu_test routes.
$home = ['' => 'Home'];
$trail = $home + ['menu-test' => 'Menu test root'];
diff --git a/core/modules/system/tests/src/Functional/Menu/LinksetControllerMultiLingualTest.php b/core/modules/system/tests/src/Functional/Menu/LinksetControllerMultiLingualTest.php
index af765efb7a1..d6b44d4bb9d 100644
--- a/core/modules/system/tests/src/Functional/Menu/LinksetControllerMultiLingualTest.php
+++ b/core/modules/system/tests/src/Functional/Menu/LinksetControllerMultiLingualTest.php
@@ -201,7 +201,7 @@ final class LinksetControllerMultiLingualTest extends LinksetControllerTestBase
*
* @throws \Exception
*/
- public function testBasicMultilingualFunctions() {
+ public function testBasicMultilingualFunctions(): void {
foreach (['aa', 'bb', 'cc', 'dd'] as $language_code) {
$expected_linkset = $this->getReferenceLinksetDataFromFile(__DIR__ . '/../../../fixtures/linkset/linkset-menu-main-multilingual-' . $language_code . '.json');
$response = $this->doRequest('GET', Url::fromUri('base:/' . $language_code . '/system/menu/main/linkset'));
@@ -214,7 +214,7 @@ final class LinksetControllerMultiLingualTest extends LinksetControllerTestBase
*
* @throws \Exception
*/
- public function testDefaultMultilingualFunctions() {
+ public function testDefaultMultilingualFunctions(): void {
$expected_linkset = $this->getReferenceLinksetDataFromFile(__DIR__ . '/../../../fixtures/linkset/linkset-menu-main-multilingual-default.json');
$response = $this->doRequest('GET', Url::fromUri('base:/system/menu/main/linkset'));
$this->assertSame($expected_linkset, Json::decode((string) $response->getBody()));
diff --git a/core/modules/system/tests/src/Functional/Menu/LinksetControllerTest.php b/core/modules/system/tests/src/Functional/Menu/LinksetControllerTest.php
index 05a1bc4e1a0..52ce7ad6ce7 100644
--- a/core/modules/system/tests/src/Functional/Menu/LinksetControllerTest.php
+++ b/core/modules/system/tests/src/Functional/Menu/LinksetControllerTest.php
@@ -157,7 +157,7 @@ final class LinksetControllerTest extends LinksetControllerTestBase {
*
* @throws \Exception
*/
- public function testBasicFunctions() {
+ public function testBasicFunctions(): void {
$this->enableEndpoint(TRUE);
$expected_linkset = $this->getReferenceLinksetDataFromFile(__DIR__ . '/../../../fixtures/linkset/linkset-menu-main.json');
$response = $this->doRequest('GET', Url::fromUri('base:/system/menu/main/linkset'));
@@ -175,7 +175,7 @@ final class LinksetControllerTest extends LinksetControllerTestBase {
* assert a cache hit. Finally, a new menu item is created to ensure that the
* cached response is properly invalidated.
*/
- public function testCacheability() {
+ public function testCacheability(): void {
$this->enableEndpoint(TRUE);
$expected_cacheability = new CacheableMetadata();
$expected_cacheability->addCacheContexts([
@@ -219,7 +219,7 @@ final class LinksetControllerTest extends LinksetControllerTestBase {
* access controls. E.g. it does not output links to which the current user
* does not have access (if it can be determined).
*/
- public function testAccess() {
+ public function testAccess(): void {
$this->enableEndpoint(TRUE);
$expected_cacheability = new CacheableMetadata();
$expected_cacheability->addCacheContexts(['user.permissions']);
@@ -276,7 +276,7 @@ final class LinksetControllerTest extends LinksetControllerTestBase {
* YAML-defined link ("My account") and a dynamic code-defined link
* ("Log in/out")
*/
- public function testUserAccountMenu() {
+ public function testUserAccountMenu(): void {
$this->enableEndpoint(TRUE);
$expected_cacheability = new CacheableMetadata();
$expected_cacheability->addCacheContexts([
@@ -313,7 +313,7 @@ final class LinksetControllerTest extends LinksetControllerTestBase {
/**
* Tests that menu items can use a custom link relation.
*/
- public function testCustomLinkRelation() {
+ public function testCustomLinkRelation(): void {
$this->enableEndpoint(TRUE);
$this->assertTrue($this->container->get('module_installer')->install(['decoupled_menus_test'], TRUE), 'Installed modules.');
$response = $this->doRequest('GET', Url::fromUri('base:/system/menu/account/linkset'), 200, $this->authorAccount);
@@ -326,7 +326,7 @@ final class LinksetControllerTest extends LinksetControllerTestBase {
/**
* Test that api route does not exist if the config option is disabled.
*/
- public function testDisabledEndpoint() {
+ public function testDisabledEndpoint(): void {
$this->doRequest('GET', Url::fromUri('base:/system/menu/main/linkset'), 404);
}
diff --git a/core/modules/system/tests/src/Functional/Menu/LocalActionTest.php b/core/modules/system/tests/src/Functional/Menu/LocalActionTest.php
index 5ab8a296433..5e51524dd92 100644
--- a/core/modules/system/tests/src/Functional/Menu/LocalActionTest.php
+++ b/core/modules/system/tests/src/Functional/Menu/LocalActionTest.php
@@ -39,7 +39,7 @@ class LocalActionTest extends BrowserTestBase {
/**
* Tests appearance of local actions.
*/
- public function testLocalAction() {
+ public function testLocalAction(): void {
$this->drupalGet('menu-test-local-action');
// Ensure that both menu and route based actions are shown.
$this->assertLocalAction([
diff --git a/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php b/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php
index 5883788edbc..965872e921d 100644
--- a/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php
+++ b/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php
@@ -106,7 +106,7 @@ class LocalTasksTest extends BrowserTestBase {
/**
* Tests the plugin based local tasks.
*/
- public function testPluginLocalTask() {
+ public function testPluginLocalTask(): void {
// Verify local tasks defined in the hook.
$this->drupalGet(Url::fromRoute('menu_test.tasks_default'));
$this->assertLocalTasks([
@@ -213,7 +213,7 @@ class LocalTasksTest extends BrowserTestBase {
/**
* Tests that local task blocks are configurable to show a specific level.
*/
- public function testLocalTaskBlock() {
+ public function testLocalTaskBlock(): void {
// Remove the default block and create a new one.
$this->sut->delete();
@@ -262,7 +262,7 @@ class LocalTasksTest extends BrowserTestBase {
/**
* Tests that local tasks blocks cache is invalidated correctly.
*/
- public function testLocalTaskBlockCache() {
+ public function testLocalTaskBlockCache(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer content types',
'administer permissions',
diff --git a/core/modules/system/tests/src/Functional/Menu/MenuAccessTest.php b/core/modules/system/tests/src/Functional/Menu/MenuAccessTest.php
index 7706b354f46..9c094e7277f 100644
--- a/core/modules/system/tests/src/Functional/Menu/MenuAccessTest.php
+++ b/core/modules/system/tests/src/Functional/Menu/MenuAccessTest.php
@@ -41,7 +41,7 @@ class MenuAccessTest extends BrowserTestBase {
*
* @see \Drupal\menu_test\Access\AccessCheck::access()
*/
- public function testMenuBlockLinksAccessCheck() {
+ public function testMenuBlockLinksAccessCheck(): void {
$this->container->get('module_installer')->install(['menu_test']);
$this->drupalPlaceBlock('system_menu_block:account');
// Test that there's link rendered on the route.
diff --git a/core/modules/system/tests/src/Functional/Menu/MenuLinkSecurityTest.php b/core/modules/system/tests/src/Functional/Menu/MenuLinkSecurityTest.php
index 76b2e4c0482..c1701cf78fa 100644
--- a/core/modules/system/tests/src/Functional/Menu/MenuLinkSecurityTest.php
+++ b/core/modules/system/tests/src/Functional/Menu/MenuLinkSecurityTest.php
@@ -27,7 +27,7 @@ class MenuLinkSecurityTest extends BrowserTestBase {
/**
* Ensures that a menu link does not cause an XSS issue.
*/
- public function testMenuLink() {
+ public function testMenuLink(): void {
$menu_link_content = MenuLinkContent::create([
'title' => '<script>alert("Wild animals")</script>',
'menu_name' => 'tools',
diff --git a/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php b/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php
index fb8352c9044..a6db8453564 100644
--- a/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php
+++ b/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php
@@ -48,7 +48,7 @@ class MenuRouterTest extends BrowserTestBase {
/**
* Tests menu integration.
*/
- public function testMenuIntegration() {
+ public function testMenuIntegration(): void {
$this->doTestTitleMenuCallback();
$this->doTestMenuOptionalPlaceholders();
$this->doTestMenuHierarchy();
@@ -213,7 +213,7 @@ class MenuRouterTest extends BrowserTestBase {
*
* @see \Drupal\menu_test\EventSubscriber\MaintenanceModeSubscriber::onKernelRequestMaintenance()
*/
- public function testMaintenanceModeLoginPaths() {
+ public function testMaintenanceModeLoginPaths(): void {
$this->container->get('state')->set('system.maintenance_mode', TRUE);
$offline_message = $this->config('system.site')->get('name') . ' is currently under maintenance. We should be back shortly. Thank you for your patience.';
@@ -231,7 +231,7 @@ class MenuRouterTest extends BrowserTestBase {
* An authenticated user hitting 'user/login' should be redirected to 'user',
* and 'user/register' should be redirected to the user edit page.
*/
- public function testAuthUserUserLogin() {
+ public function testAuthUserUserLogin(): void {
$web_user = $this->drupalCreateUser([]);
$this->drupalLogin($web_user);
@@ -247,7 +247,7 @@ class MenuRouterTest extends BrowserTestBase {
/**
* Tests theme integration.
*/
- public function testThemeIntegration() {
+ public function testThemeIntegration(): void {
$this->defaultTheme = 'olivero';
$this->adminTheme = 'claro';
diff --git a/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php b/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php
index 122bbc1598d..a0d2d2fe801 100644
--- a/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php
+++ b/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php
@@ -36,7 +36,7 @@ class ClassLoaderTest extends BrowserTestBase {
*
* @see \Drupal\module_autoload_test\SomeClass
*/
- public function testClassLoading() {
+ public function testClassLoading(): void {
// Enable the module_test and module_autoload_test modules.
\Drupal::service('module_installer')->install(['module_test', 'module_autoload_test'], FALSE);
$this->resetAll();
@@ -53,7 +53,7 @@ class ClassLoaderTest extends BrowserTestBase {
*
* @see \Drupal\module_autoload_test\SomeClass
*/
- public function testClassLoadingNotInstalledModules() {
+ public function testClassLoadingNotInstalledModules(): void {
// Enable the module_test module.
\Drupal::service('module_installer')->install(['module_test'], FALSE);
$this->resetAll();
@@ -70,7 +70,7 @@ class ClassLoaderTest extends BrowserTestBase {
*
* @see \Drupal\module_autoload_test\SomeClass
*/
- public function testClassLoadingDisabledModules() {
+ public function testClassLoadingDisabledModules(): void {
// Enable the module_test and module_autoload_test modules.
\Drupal::service('module_installer')->install(['module_test', 'module_autoload_test'], FALSE);
$this->resetAll();
@@ -88,7 +88,7 @@ class ClassLoaderTest extends BrowserTestBase {
/**
* Ensures the negative caches in the class loader don't result in crashes.
*/
- public function testMultipleModules() {
+ public function testMultipleModules(): void {
$this->drupalLogin($this->drupalCreateUser(['administer modules']));
$edit = [
@@ -104,7 +104,7 @@ class ClassLoaderTest extends BrowserTestBase {
/**
* Tests that .module files can use class constants in main section.
*/
- public function testAutoloadFromModuleFile() {
+ public function testAutoloadFromModuleFile(): void {
$this->assertFalse(defined('MODULE_AUTOLOAD_TEST_CONSTANT'));
// Create use with required permissions.
$this->drupalLogin($this->drupalCreateUser(['administer modules']));
diff --git a/core/modules/system/tests/src/Functional/Module/DependencyTest.php b/core/modules/system/tests/src/Functional/Module/DependencyTest.php
index e176855055d..70bcabb9121 100644
--- a/core/modules/system/tests/src/Functional/Module/DependencyTest.php
+++ b/core/modules/system/tests/src/Functional/Module/DependencyTest.php
@@ -23,7 +23,7 @@ class DependencyTest extends ModuleTestBase {
/**
* Checks functionality of project namespaces for dependencies.
*/
- public function testProjectNamespaceForDependencies() {
+ public function testProjectNamespaceForDependencies(): void {
$edit = [
'modules[filter][enable]' => TRUE,
];
@@ -41,7 +41,7 @@ class DependencyTest extends ModuleTestBase {
/**
* Attempts to enable the Content Translation module without Language enabled.
*/
- public function testEnableWithoutDependency() {
+ public function testEnableWithoutDependency(): void {
// Attempt to enable Content Translation without Language enabled.
$edit = [];
$edit['modules[content_translation][enable]'] = 'content_translation';
@@ -66,7 +66,7 @@ class DependencyTest extends ModuleTestBase {
/**
* Attempts to enable a module with a missing dependency.
*/
- public function testMissingModules() {
+ public function testMissingModules(): void {
// Test that the system_dependencies_test module is marked
// as missing a dependency.
$this->drupalGet('admin/modules');
@@ -78,7 +78,7 @@ class DependencyTest extends ModuleTestBase {
/**
* Tests enabling a module with an incompatible dependency version.
*/
- public function testIncompatibleModuleVersionDependency() {
+ public function testIncompatibleModuleVersionDependency(): void {
// Test that the system_incompatible_module_version_dependencies_test is
// marked as having an incompatible dependency.
$this->drupalGet('admin/modules');
@@ -90,7 +90,7 @@ class DependencyTest extends ModuleTestBase {
/**
* Tests enabling a module that depends on a module with an incompatible core version.
*/
- public function testIncompatibleCoreVersionDependency() {
+ public function testIncompatibleCoreVersionDependency(): void {
// Test that the system_incompatible_core_version_dependencies_test is
// marked as having an incompatible dependency.
$this->drupalGet('admin/modules');
@@ -102,7 +102,7 @@ class DependencyTest extends ModuleTestBase {
/**
* Tests visiting admin/modules when a module outside of core has no version.
*/
- public function testNoVersionInfo() {
+ public function testNoVersionInfo(): void {
// Create a module for testing. We set core_version_requirement to '*' for
// the test so that it does not need to be updated between major versions.
$info = [
@@ -164,7 +164,7 @@ class DependencyTest extends ModuleTestBase {
/**
* Tests failing PHP version requirements.
*/
- public function testIncompatiblePhpVersionDependency() {
+ public function testIncompatiblePhpVersionDependency(): void {
$this->drupalGet('admin/modules');
$this->assertSession()->pageTextContains('This module requires PHP version 6502.* and is incompatible with PHP version ' . phpversion() . '.');
$this->assertSession()->fieldDisabled('modules[system_incompatible_php_version_test][enable]');
@@ -173,7 +173,7 @@ class DependencyTest extends ModuleTestBase {
/**
* Tests enabling modules with different core version specifications.
*/
- public function testCoreCompatibility() {
+ public function testCoreCompatibility(): void {
$this->markTestSkipped('Skipped due to major version-specific logic. See https://www.drupal.org/project/drupal/issues/3359322');
$assert_session = $this->assertSession();
@@ -197,7 +197,7 @@ class DependencyTest extends ModuleTestBase {
/**
* Tests the dependency checks when core version contains '8.x' within it.
*/
- public function testCoreVersionContains8X() {
+ public function testCoreVersionContains8X(): void {
// Enable the helper module that alters the version and dependencies.
\Drupal::service('module_installer')->install(['dependency_version_test']);
@@ -212,7 +212,7 @@ class DependencyTest extends ModuleTestBase {
/**
* Tests enabling a module that depends on a module which fails hook_requirements().
*/
- public function testEnableRequirementsFailureDependency() {
+ public function testEnableRequirementsFailureDependency(): void {
\Drupal::service('module_installer')->install(['comment']);
$this->assertModules(['requirements1_test'], FALSE);
@@ -240,7 +240,7 @@ class DependencyTest extends ModuleTestBase {
*
* Dependencies should be enabled before their dependents.
*/
- public function testModuleEnableOrder() {
+ public function testModuleEnableOrder(): void {
\Drupal::service('module_installer')->install(['module_test'], FALSE);
$this->resetAll();
$this->assertModules(['module_test'], TRUE);
diff --git a/core/modules/system/tests/src/Functional/Module/DeprecatedTemplateTest.php b/core/modules/system/tests/src/Functional/Module/DeprecatedTemplateTest.php
index f162b95e4a9..c2bf5aabf3d 100644
--- a/core/modules/system/tests/src/Functional/Module/DeprecatedTemplateTest.php
+++ b/core/modules/system/tests/src/Functional/Module/DeprecatedTemplateTest.php
@@ -30,7 +30,7 @@ class DeprecatedTemplateTest extends BrowserTestBase {
*
* @group legacy
*/
- public function testDeprecatedTemplate() {
+ public function testDeprecatedTemplate(): void {
$this->expectDeprecation('The "deprecated-template.html.twig" template is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another template instead. See https://www.example.com');
$this->drupalGet('/deprecated-twig-template');
}
diff --git a/core/modules/system/tests/src/Functional/Module/HookRequirementsTest.php b/core/modules/system/tests/src/Functional/Module/HookRequirementsTest.php
index 9738698f800..cfa631ffcbe 100644
--- a/core/modules/system/tests/src/Functional/Module/HookRequirementsTest.php
+++ b/core/modules/system/tests/src/Functional/Module/HookRequirementsTest.php
@@ -19,7 +19,7 @@ class HookRequirementsTest extends ModuleTestBase {
/**
* Assert that a module cannot be installed if it fails hook_requirements().
*/
- public function testHookRequirementsFailure() {
+ public function testHookRequirementsFailure(): void {
$this->assertModules(['requirements1_test'], FALSE);
// Attempt to install the requirements1_test module.
diff --git a/core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php b/core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php
index ac24f9b9421..a38a4d26e6a 100644
--- a/core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php
+++ b/core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php
@@ -78,7 +78,7 @@ class PrepareUninstallTest extends BrowserTestBase {
/**
* Tests that Node and Taxonomy can be uninstalled.
*/
- public function testUninstall() {
+ public function testUninstall(): void {
// Check that Taxonomy cannot be uninstalled yet.
$this->drupalGet('admin/modules/uninstall');
$this->assertSession()->pageTextContains('Remove content items');
diff --git a/core/modules/system/tests/src/Functional/Module/UninstallTest.php b/core/modules/system/tests/src/Functional/Module/UninstallTest.php
index f7a126a2ad0..8059d850c42 100644
--- a/core/modules/system/tests/src/Functional/Module/UninstallTest.php
+++ b/core/modules/system/tests/src/Functional/Module/UninstallTest.php
@@ -34,7 +34,7 @@ class UninstallTest extends BrowserTestBase {
/**
* Tests the hook_modules_uninstalled() of the user module.
*/
- public function testUserPermsUninstalled() {
+ public function testUserPermsUninstalled(): void {
// Uninstalls the module_test module, so hook_modules_uninstalled()
// is executed.
$this->container->get('module_installer')->uninstall(['module_test']);
@@ -47,7 +47,7 @@ class UninstallTest extends BrowserTestBase {
/**
* Tests the Uninstall page and Uninstall confirmation page.
*/
- public function testUninstallPage() {
+ public function testUninstallPage(): void {
$account = $this->drupalCreateUser(['administer modules']);
$this->drupalLogin($account);
@@ -189,7 +189,7 @@ class UninstallTest extends BrowserTestBase {
/**
* Tests that a module which fails to install can still be uninstalled.
*/
- public function testFailedInstallStatus() {
+ public function testFailedInstallStatus(): void {
$account = $this->drupalCreateUser(['administer modules']);
$this->drupalLogin($account);
diff --git a/core/modules/system/tests/src/Functional/Module/VersionTest.php b/core/modules/system/tests/src/Functional/Module/VersionTest.php
index ea0da836247..ffe38adc8d5 100644
--- a/core/modules/system/tests/src/Functional/Module/VersionTest.php
+++ b/core/modules/system/tests/src/Functional/Module/VersionTest.php
@@ -19,7 +19,7 @@ class VersionTest extends ModuleTestBase {
/**
* Tests version dependencies.
*/
- public function testModuleVersions() {
+ public function testModuleVersions(): void {
$dependencies = [
// Alternating between being compatible and incompatible with 8.x-2.4-beta3.
// The first is always a compatible.
diff --git a/core/modules/system/tests/src/Functional/Page/DefaultMetatagsTest.php b/core/modules/system/tests/src/Functional/Page/DefaultMetatagsTest.php
index c23b28872c2..6de2fa183b0 100644
--- a/core/modules/system/tests/src/Functional/Page/DefaultMetatagsTest.php
+++ b/core/modules/system/tests/src/Functional/Page/DefaultMetatagsTest.php
@@ -21,7 +21,7 @@ class DefaultMetatagsTest extends BrowserTestBase {
/**
* Tests meta tags.
*/
- public function testMetaTag() {
+ public function testMetaTag(): void {
$this->drupalGet('');
// Ensures that the charset metatag is on the page.
$this->assertSession()->elementsCount('xpath', '//meta[@charset="utf-8"]', 1);
diff --git a/core/modules/system/tests/src/Functional/Pager/PagerTest.php b/core/modules/system/tests/src/Functional/Pager/PagerTest.php
index 573a0dad442..e24a751378d 100644
--- a/core/modules/system/tests/src/Functional/Pager/PagerTest.php
+++ b/core/modules/system/tests/src/Functional/Pager/PagerTest.php
@@ -60,7 +60,7 @@ class PagerTest extends BrowserTestBase {
/**
* Tests markup and CSS classes of pager links.
*/
- public function testActiveClass() {
+ public function testActiveClass(): void {
// Verify first page.
$this->drupalGet('admin/reports/dblog');
$current_page = 0;
@@ -86,7 +86,7 @@ class PagerTest extends BrowserTestBase {
/**
* Tests pager query parameters and cache context.
*/
- public function testPagerQueryParametersAndCacheContext() {
+ public function testPagerQueryParametersAndCacheContext(): void {
// First page.
$this->drupalGet('pager-test/query-parameters');
$this->assertSession()->pageTextContains('Pager calls: 0');
@@ -112,7 +112,7 @@ class PagerTest extends BrowserTestBase {
/**
* Tests proper functioning of multiple pagers.
*/
- public function testMultiplePagers() {
+ public function testMultiplePagers(): void {
// First page.
$this->drupalGet('pager-test/multiple-pagers');
@@ -195,7 +195,7 @@ class PagerTest extends BrowserTestBase {
/**
* Tests proper functioning of the ellipsis.
*/
- public function testPagerEllipsis() {
+ public function testPagerEllipsis(): void {
// Insert 100 extra log messages to get 9 pages.
$logger = $this->container->get('logger.factory')->get('pager_test');
for ($i = 0; $i < 100; $i++) {
diff --git a/core/modules/system/tests/src/Functional/ParamConverter/UpcastingTest.php b/core/modules/system/tests/src/Functional/ParamConverter/UpcastingTest.php
index b9242b936e4..be1587153d1 100644
--- a/core/modules/system/tests/src/Functional/ParamConverter/UpcastingTest.php
+++ b/core/modules/system/tests/src/Functional/ParamConverter/UpcastingTest.php
@@ -33,7 +33,7 @@ class UpcastingTest extends BrowserTestBase {
* The test shuffles the parameters around and checks if the right thing is
* happening.
*/
- public function testUpcasting() {
+ public function testUpcasting(): void {
$node = $this->drupalCreateNode(['title' => $this->randomMachineName(8)]);
$user = $this->drupalCreateUser(['access content']);
$foo = 'bar';
@@ -59,7 +59,7 @@ class UpcastingTest extends BrowserTestBase {
/**
* Confirms we can upcast to controller arguments of the same type.
*/
- public function testSameTypes() {
+ public function testSameTypes(): void {
$node = $this->drupalCreateNode(['title' => $this->randomMachineName(8)]);
$parent = $this->drupalCreateNode(['title' => $this->randomMachineName(8)]);
// paramconverter_test/node/{node}/set/parent/{parent}
@@ -71,7 +71,7 @@ class UpcastingTest extends BrowserTestBase {
/**
* Confirms entity is shown in user's language by default.
*/
- public function testEntityLanguage() {
+ public function testEntityLanguage(): void {
$language = ConfigurableLanguage::createFromLangcode('de');
$language->save();
\Drupal::configFactory()->getEditable('language.negotiation')
diff --git a/core/modules/system/tests/src/Functional/Render/AjaxPageStateTest.php b/core/modules/system/tests/src/Functional/Render/AjaxPageStateTest.php
index 5a6624acf6a..13c0e030639 100644
--- a/core/modules/system/tests/src/Functional/Render/AjaxPageStateTest.php
+++ b/core/modules/system/tests/src/Functional/Render/AjaxPageStateTest.php
@@ -52,7 +52,7 @@ class AjaxPageStateTest extends BrowserTestBase {
* The libraries active-link and drupalSettings are loaded default from core
* and available in code as scripts. Do this as the base test.
*/
- public function testLibrariesAvailable() {
+ public function testLibrariesAvailable(): void {
$this->drupalGet('node', []);
// The active link library from core should be loaded.
$this->assertSession()->responseContains('/core/misc/active-link.js');
@@ -67,7 +67,7 @@ class AjaxPageStateTest extends BrowserTestBase {
* should be excluded as it is already loaded. This should not affect other
* libraries so test if active-link is still available.
*/
- public function testDrupalSettingsIsNotLoaded() {
+ public function testDrupalSettingsIsNotLoaded(): void {
$this->drupalGet('node',
[
'query' =>
@@ -91,7 +91,7 @@ class AjaxPageStateTest extends BrowserTestBase {
* The ajax_page_state[libraries] should be able to support multiple libraries
* comma separated.
*/
- public function testMultipleLibrariesAreNotLoaded() {
+ public function testMultipleLibrariesAreNotLoaded(): void {
$this->drupalGet('node', [
'query' => [
'ajax_page_state' => [
diff --git a/core/modules/system/tests/src/Functional/Render/DisplayVariantTest.php b/core/modules/system/tests/src/Functional/Render/DisplayVariantTest.php
index 2cda418cea0..98c80fcb6e6 100644
--- a/core/modules/system/tests/src/Functional/Render/DisplayVariantTest.php
+++ b/core/modules/system/tests/src/Functional/Render/DisplayVariantTest.php
@@ -28,7 +28,7 @@ class DisplayVariantTest extends BrowserTestBase {
/**
* Tests selecting the variant and passing configuration.
*/
- public function testPageDisplayVariantSelectionEvent() {
+ public function testPageDisplayVariantSelectionEvent(): void {
// Tests that our display variant was selected, and that its configuration
// was passed correctly. If the configuration wasn't passed, we'd get an
// error page here.
diff --git a/core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php b/core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php
index 002cc507a55..a6c41617cf0 100644
--- a/core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php
+++ b/core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php
@@ -28,7 +28,7 @@ class HtmlResponseAttachmentsTest extends BrowserTestBase {
/**
* Tests rendering of ['#attached'].
*/
- public function testAttachments() {
+ public function testAttachments(): void {
// Test ['#attached']['http_header] = ['Status', $code].
$this->drupalGet('/render_attached_test/teapot');
$this->assertSession()->statusCodeEquals(418);
@@ -79,7 +79,7 @@ class HtmlResponseAttachmentsTest extends BrowserTestBase {
/**
* Tests caching of ['#attached'].
*/
- public function testRenderCachedBlock() {
+ public function testRenderCachedBlock(): void {
// Make sure our test block is visible.
$this->drupalPlaceBlock('attached_rendering_block', ['region' => 'content']);
diff --git a/core/modules/system/tests/src/Functional/Render/PlaceholderMessageTest.php b/core/modules/system/tests/src/Functional/Render/PlaceholderMessageTest.php
index 7debcc26d72..cf55e7fc8f0 100644
--- a/core/modules/system/tests/src/Functional/Render/PlaceholderMessageTest.php
+++ b/core/modules/system/tests/src/Functional/Render/PlaceholderMessageTest.php
@@ -29,7 +29,7 @@ class PlaceholderMessageTest extends BrowserTestBase {
/**
* Tests rendering of message placeholder.
*/
- public function testMessagePlaceholder() {
+ public function testMessagePlaceholder(): void {
$messages_markup = '<div role="contentinfo" aria-label="Status message"';
$test_routes = [
diff --git a/core/modules/system/tests/src/Functional/Render/RenderArrayNonHtmlSubscriberTest.php b/core/modules/system/tests/src/Functional/Render/RenderArrayNonHtmlSubscriberTest.php
index 58238ef3aef..b578e82fd71 100644
--- a/core/modules/system/tests/src/Functional/Render/RenderArrayNonHtmlSubscriberTest.php
+++ b/core/modules/system/tests/src/Functional/Render/RenderArrayNonHtmlSubscriberTest.php
@@ -29,7 +29,7 @@ class RenderArrayNonHtmlSubscriberTest extends BrowserTestBase {
/**
* Tests handling of responses by events subscriber.
*/
- public function testResponses() {
+ public function testResponses(): void {
// Test that event subscriber does not interfere with normal requests.
$url = Url::fromRoute('render_array_non_html_subscriber_test.render_array');
diff --git a/core/modules/system/tests/src/Functional/Render/UrlBubbleableMetadataBubblingTest.php b/core/modules/system/tests/src/Functional/Render/UrlBubbleableMetadataBubblingTest.php
index a33fb8f72ac..5b37b8ff810 100644
--- a/core/modules/system/tests/src/Functional/Render/UrlBubbleableMetadataBubblingTest.php
+++ b/core/modules/system/tests/src/Functional/Render/UrlBubbleableMetadataBubblingTest.php
@@ -39,7 +39,7 @@ class UrlBubbleableMetadataBubblingTest extends BrowserTestBase {
/**
* Tests that URL bubbleable metadata is correctly bubbled.
*/
- public function testUrlBubbleableMetadataBubbling() {
+ public function testUrlBubbleableMetadataBubbling(): void {
// Test that regular URLs bubble up bubbleable metadata when converted to
// string.
$url = Url::fromRoute('cache_test.url_bubbling');
diff --git a/core/modules/system/tests/src/Functional/Routing/DestinationTest.php b/core/modules/system/tests/src/Functional/Routing/DestinationTest.php
index bb76ed9d9e2..b9c2a015686 100644
--- a/core/modules/system/tests/src/Functional/Routing/DestinationTest.php
+++ b/core/modules/system/tests/src/Functional/Routing/DestinationTest.php
@@ -32,7 +32,7 @@ class DestinationTest extends BrowserTestBase {
/**
* Tests that $_GET/$_REQUEST['destination'] only contain internal URLs.
*/
- public function testDestination() {
+ public function testDestination(): void {
$http_client = $this->getHttpClient();
$session = $this->getSession();
diff --git a/core/modules/system/tests/src/Functional/Routing/RouterPermissionTest.php b/core/modules/system/tests/src/Functional/Routing/RouterPermissionTest.php
index 55b13d1a781..8eb3189982f 100644
--- a/core/modules/system/tests/src/Functional/Routing/RouterPermissionTest.php
+++ b/core/modules/system/tests/src/Functional/Routing/RouterPermissionTest.php
@@ -28,7 +28,7 @@ class RouterPermissionTest extends BrowserTestBase {
/**
* Tests permission requirements on routes.
*/
- public function testPermissionAccess() {
+ public function testPermissionAccess(): void {
// Ensure 403 Access Denied for a route without permission.
$this->drupalGet('router_test/test7');
$this->assertSession()->statusCodeEquals(403);
diff --git a/core/modules/system/tests/src/Functional/Routing/RouterTest.php b/core/modules/system/tests/src/Functional/Routing/RouterTest.php
index 87f22b971e4..ead1cd8956a 100644
--- a/core/modules/system/tests/src/Functional/Routing/RouterTest.php
+++ b/core/modules/system/tests/src/Functional/Routing/RouterTest.php
@@ -35,7 +35,7 @@ class RouterTest extends BrowserTestBase {
/**
* Confirms that our FinishResponseSubscriber logic works properly.
*/
- public function testFinishResponseSubscriber() {
+ public function testFinishResponseSubscriber(): void {
$renderer_required_cache_contexts = ['languages:' . LanguageInterface::TYPE_INTERFACE, 'theme', 'user.permissions'];
$expected_cache_contexts = Cache::mergeContexts($renderer_required_cache_contexts, ['url.query_args:' . MainContentViewSubscriber::WRAPPER_FORMAT, 'user.roles:authenticated']);
sort($expected_cache_contexts);
@@ -122,7 +122,7 @@ class RouterTest extends BrowserTestBase {
/**
* Confirms that multiple routes with the same path do not cause an error.
*/
- public function testDuplicateRoutePaths() {
+ public function testDuplicateRoutePaths(): void {
// Tests two routes with exactly the same path. The route with the maximum
// fit and lowest sorting route name will match, regardless of the order the
// routes are declared.
@@ -150,7 +150,7 @@ class RouterTest extends BrowserTestBase {
/**
* Confirms that placeholders in paths work correctly.
*/
- public function testControllerPlaceholders() {
+ public function testControllerPlaceholders(): void {
// Test with 0 and a random value.
$values = ["0", $this->randomMachineName()];
foreach ($values as $value) {
@@ -171,7 +171,7 @@ class RouterTest extends BrowserTestBase {
/**
* Confirms that default placeholders in paths work correctly.
*/
- public function testControllerPlaceholdersDefaultValues() {
+ public function testControllerPlaceholdersDefaultValues(): void {
$this->drupalGet('router_test/test4');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains('Lassie');
@@ -188,7 +188,7 @@ class RouterTest extends BrowserTestBase {
/**
* Confirms that default placeholders in paths work correctly.
*/
- public function testControllerPlaceholdersDefaultValuesProvided() {
+ public function testControllerPlaceholdersDefaultValuesProvided(): void {
$this->drupalGet('router_test/test4/barf');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains('barf');
@@ -207,7 +207,7 @@ class RouterTest extends BrowserTestBase {
*
* @see \Drupal\router_test\RouteSubscriber
*/
- public function testDynamicRoutes() {
+ public function testDynamicRoutes(): void {
// Test the altered route.
$this->drupalGet('router_test/test6');
$this->assertSession()->statusCodeEquals(200);
@@ -217,7 +217,7 @@ class RouterTest extends BrowserTestBase {
/**
* Checks that a request with text/html response gets rendered as a page.
*/
- public function testControllerResolutionPage() {
+ public function testControllerResolutionPage(): void {
$this->drupalGet('/router_test/test10');
$this->assertSession()->pageTextContains('abcde');
@@ -234,7 +234,7 @@ class RouterTest extends BrowserTestBase {
/**
* Checks the generate method on the URL generator using the front router.
*/
- public function testUrlGeneratorFront() {
+ public function testUrlGeneratorFront(): void {
$front_url = Url::fromRoute('<front>', [], ['absolute' => TRUE]);
// Compare to the site base URL.
$base_url = Url::fromUri('base:/', ['absolute' => TRUE]);
@@ -244,7 +244,7 @@ class RouterTest extends BrowserTestBase {
/**
* Tests that a page trying to match a path will succeed.
*/
- public function testRouterMatching() {
+ public function testRouterMatching(): void {
$this->drupalGet('router_test/test14/1');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains('User route "entity.user.canonical" was matched.');
@@ -267,7 +267,7 @@ class RouterTest extends BrowserTestBase {
/**
* Tests that a PSR-7 response works.
*/
- public function testRouterResponsePsr7() {
+ public function testRouterResponsePsr7(): void {
$this->drupalGet('/router_test/test23');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains('test23');
@@ -276,7 +276,7 @@ class RouterTest extends BrowserTestBase {
/**
* Tests the user account on the DIC.
*/
- public function testUserAccount() {
+ public function testUserAccount(): void {
$account = $this->drupalCreateUser();
$this->drupalLogin($account);
@@ -294,7 +294,7 @@ class RouterTest extends BrowserTestBase {
/**
* Checks that an ajax request gets rendered as an Ajax response, by mime.
*/
- public function testControllerResolutionAjax() {
+ public function testControllerResolutionAjax(): void {
// This will fail with a JSON parse error if the request is not routed to
// The correct controller.
$options['query'][MainContentViewSubscriber::WRAPPER_FORMAT] = 'drupal_ajax';
@@ -309,7 +309,7 @@ class RouterTest extends BrowserTestBase {
/**
* Tests that routes no longer exist for a module that has been uninstalled.
*/
- public function testRouterUninstallInstall() {
+ public function testRouterUninstallInstall(): void {
\Drupal::service('module_installer')->uninstall(['router_test']);
try {
\Drupal::service('router.route_provider')->getRouteByName('router_test.1');
@@ -327,7 +327,7 @@ class RouterTest extends BrowserTestBase {
/**
* Ensure that multiple successive slashes are redirected.
*/
- public function testSuccessiveSlashes() {
+ public function testSuccessiveSlashes(): void {
$request = $this->container->get('request_stack')->getCurrentRequest();
// Test a simple path with successive leading slashes.
diff --git a/core/modules/system/tests/src/Functional/ServiceProvider/ServiceProviderWebTest.php b/core/modules/system/tests/src/Functional/ServiceProvider/ServiceProviderWebTest.php
index 007e2692662..9c16dab148e 100644
--- a/core/modules/system/tests/src/Functional/ServiceProvider/ServiceProviderWebTest.php
+++ b/core/modules/system/tests/src/Functional/ServiceProvider/ServiceProviderWebTest.php
@@ -31,7 +31,7 @@ class ServiceProviderWebTest extends BrowserTestBase {
* Also tests that services provided by module service providers get
* registered to the DIC.
*/
- public function testServiceProviderRegistrationIntegration() {
+ public function testServiceProviderRegistrationIntegration(): void {
$this->assertTrue(\Drupal::hasService('service_provider_test_class'), 'The service_provider_test_class service has been registered to the DIC');
// The event subscriber method in the test class calls
// \Drupal\Core\Messenger\MessengerInterface::addStatus() with a message
diff --git a/core/modules/system/tests/src/Functional/Session/SessionAuthenticationTest.php b/core/modules/system/tests/src/Functional/Session/SessionAuthenticationTest.php
index 6d2a8f4a6fb..54267fb2238 100644
--- a/core/modules/system/tests/src/Functional/Session/SessionAuthenticationTest.php
+++ b/core/modules/system/tests/src/Functional/Session/SessionAuthenticationTest.php
@@ -50,7 +50,7 @@ class SessionAuthenticationTest extends BrowserTestBase {
* Regression test for a bug that caused a session initiated by basic
* authentication to persist over subsequent unauthorized requests.
*/
- public function testSessionFromBasicAuthenticationDoesNotLeak() {
+ public function testSessionFromBasicAuthenticationDoesNotLeak(): void {
// This route is authorized through basic_auth only, not cookie.
$protected_url = Url::fromRoute('session_test.get_session_basic_auth');
@@ -85,7 +85,7 @@ class SessionAuthenticationTest extends BrowserTestBase {
/**
* Tests if a session can be initiated through basic authentication.
*/
- public function testBasicAuthSession() {
+ public function testBasicAuthSession(): void {
// Set a session value on a request through basic auth.
$test_value = 'alpaca';
$response = $this->basicAuthGet('session-test/set-session/' . $test_value, $this->user->getAccountName(), $this->user->pass_raw);
@@ -119,7 +119,7 @@ class SessionAuthenticationTest extends BrowserTestBase {
/**
* Tests that a session is not started automatically by basic authentication.
*/
- public function testBasicAuthNoSession() {
+ public function testBasicAuthNoSession(): void {
// A route that is authorized through basic_auth only, not cookie.
$no_cookie_url = Url::fromRoute('session_test.get_session_basic_auth');
diff --git a/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php b/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php
index 976a6dd3f58..12dade7f209 100644
--- a/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php
+++ b/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php
@@ -65,7 +65,7 @@ class SessionHttpsTest extends BrowserTestBase {
/**
* Tests HTTPS sessions.
*/
- public function testHttpsSession() {
+ public function testHttpsSession(): void {
$user = $this->drupalCreateUser(['access administration pages', 'administer site configuration']);
/** @var \Symfony\Component\BrowserKit\CookieJar $browser_kit_cookie_jar */
diff --git a/core/modules/system/tests/src/Functional/Session/SessionTest.php b/core/modules/system/tests/src/Functional/Session/SessionTest.php
index fa3ad041985..499ba7a5006 100644
--- a/core/modules/system/tests/src/Functional/Session/SessionTest.php
+++ b/core/modules/system/tests/src/Functional/Session/SessionTest.php
@@ -34,7 +34,7 @@ class SessionTest extends BrowserTestBase {
* @covers \Drupal\Core\Session\WriteSafeSessionHandler::isSessionWritable
* @covers \Drupal\Core\Session\SessionManager::regenerate
*/
- public function testSessionSaveRegenerate() {
+ public function testSessionSaveRegenerate(): void {
$session_handler = $this->container->get('session_handler.write_safe');
$this->assertTrue($session_handler->isSessionWritable(), 'session_handler->isSessionWritable() initially returns TRUE.');
$session_handler->setSessionWritable(FALSE);
@@ -88,7 +88,7 @@ class SessionTest extends BrowserTestBase {
/**
* Tests data persistence via the session_test module callbacks.
*/
- public function testDataPersistence() {
+ public function testDataPersistence(): void {
$user = $this->drupalCreateUser([]);
// Enable sessions.
$this->sessionReset();
@@ -172,7 +172,7 @@ class SessionTest extends BrowserTestBase {
/**
* Tests storing data in Session() object.
*/
- public function testSessionPersistenceOnLogin() {
+ public function testSessionPersistenceOnLogin(): void {
// Store information via hook_user_login().
$user = $this->drupalCreateUser();
$this->drupalLogin($user);
@@ -184,7 +184,7 @@ class SessionTest extends BrowserTestBase {
/**
* Tests that empty anonymous sessions are destroyed.
*/
- public function testEmptyAnonymousSession() {
+ public function testEmptyAnonymousSession(): void {
// Disable the dynamic_page_cache module; it'd cause session_test's debug
// output (that is added in
// SessionTestSubscriber::onKernelResponseSessionTest()) to not be added.
@@ -249,7 +249,7 @@ class SessionTest extends BrowserTestBase {
/**
* Tests that sessions are only saved when necessary.
*/
- public function testSessionWrite() {
+ public function testSessionWrite(): void {
$user = $this->drupalCreateUser([]);
$this->drupalLogin($user);
$connection = Database::getConnection();
@@ -300,7 +300,7 @@ class SessionTest extends BrowserTestBase {
/**
* Tests that empty session IDs are not allowed.
*/
- public function testEmptySessionID() {
+ public function testEmptySessionID(): void {
$user = $this->drupalCreateUser([]);
$this->drupalLogin($user);
$this->drupalGet('session-test/is-logged-in');
@@ -329,7 +329,7 @@ class SessionTest extends BrowserTestBase {
/**
* Tests session bag.
*/
- public function testSessionBag() {
+ public function testSessionBag(): void {
// Ensure the flag is absent to start with.
$this->drupalGet('/session-test/has-bag-flag');
$this->assertSessionCookie(FALSE);
@@ -364,7 +364,7 @@ class SessionTest extends BrowserTestBase {
/**
* Test exception thrown during session write close.
*/
- public function testSessionWriteError() {
+ public function testSessionWriteError(): void {
// Login to ensure a session exists.
$user = $this->drupalCreateUser([]);
$this->drupalLogin($user);
diff --git a/core/modules/system/tests/src/Functional/Session/StackSessionHandlerIntegrationTest.php b/core/modules/system/tests/src/Functional/Session/StackSessionHandlerIntegrationTest.php
index eafdd89dc74..61cb40d64a4 100644
--- a/core/modules/system/tests/src/Functional/Session/StackSessionHandlerIntegrationTest.php
+++ b/core/modules/system/tests/src/Functional/Session/StackSessionHandlerIntegrationTest.php
@@ -27,7 +27,7 @@ class StackSessionHandlerIntegrationTest extends BrowserTestBase {
/**
* Tests a request.
*/
- public function testRequest() {
+ public function testRequest(): void {
$options['query'][MainContentViewSubscriber::WRAPPER_FORMAT] = 'drupal_ajax';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$actual_trace = json_decode($this->drupalGet('session-test/trace-handler', $options, $headers));
diff --git a/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php b/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php
index 77e6b9d1109..1196ccbf57e 100644
--- a/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php
+++ b/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php
@@ -53,7 +53,7 @@ class AccessDeniedTest extends BrowserTestBase {
user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['access user profiles']);
}
- public function testAccessDenied() {
+ public function testAccessDenied(): void {
$this->drupalGet('admin');
$this->assertSession()->pageTextContains('Access denied');
$this->assertSession()->statusCodeEquals(403);
@@ -130,7 +130,7 @@ class AccessDeniedTest extends BrowserTestBase {
/**
* Tests that an inaccessible custom 403 page falls back to the default.
*/
- public function testAccessDeniedCustomPageWithAccessDenied() {
+ public function testAccessDeniedCustomPageWithAccessDenied(): void {
// Sets up a 403 page not accessible by the anonymous user.
$this->config('system.site')->set('page.403', '/system-test/custom-4xx')->save();
diff --git a/core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php b/core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php
index e96dd0f774d..be1ccbdb1a6 100644
--- a/core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php
+++ b/core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php
@@ -21,7 +21,7 @@ class AdminMetaTagTest extends BrowserTestBase {
/**
* Verify that the meta tag HTML is generated correctly.
*/
- public function testMetaTag() {
+ public function testMetaTag(): void {
[$version] = explode('.', \Drupal::VERSION);
$string = '<meta name="Generator" content="Drupal ' . $version . ' (https://www.drupal.org)" />';
$this->drupalGet('node');
diff --git a/core/modules/system/tests/src/Functional/System/AdminTest.php b/core/modules/system/tests/src/Functional/System/AdminTest.php
index f30384a3b61..46bda15eeda 100644
--- a/core/modules/system/tests/src/Functional/System/AdminTest.php
+++ b/core/modules/system/tests/src/Functional/System/AdminTest.php
@@ -61,7 +61,7 @@ class AdminTest extends BrowserTestBase {
/**
* Tests output on administrative listing pages.
*/
- public function testAdminPages() {
+ public function testAdminPages(): void {
// Go to Administration.
$this->drupalGet('admin');
@@ -152,7 +152,7 @@ class AdminTest extends BrowserTestBase {
/**
* Tests compact mode.
*/
- public function testCompactMode() {
+ public function testCompactMode(): void {
$session = $this->getSession();
// The front page defaults to 'user/login', which redirects to 'user/{user}'
diff --git a/core/modules/system/tests/src/Functional/System/CronRunTest.php b/core/modules/system/tests/src/Functional/System/CronRunTest.php
index edec54e0f89..8820b992cfb 100644
--- a/core/modules/system/tests/src/Functional/System/CronRunTest.php
+++ b/core/modules/system/tests/src/Functional/System/CronRunTest.php
@@ -37,7 +37,7 @@ class CronRunTest extends BrowserTestBase {
/**
* Tests cron runs.
*/
- public function testCronRun() {
+ public function testCronRun(): void {
// Run cron anonymously without any cron key.
$this->drupalGet('cron');
$this->assertSession()->statusCodeEquals(404);
@@ -59,7 +59,7 @@ class CronRunTest extends BrowserTestBase {
* In these tests we do not use \Drupal::time()->getRequestTime() to track start time, because we
* need the exact time when cron is triggered.
*/
- public function testAutomatedCron() {
+ public function testAutomatedCron(): void {
// To prevent race conditions between the admin_user login triggering cron
// and updating its state, and this test doing the same thing, we use
// \Drupal\Tests\WaitTerminateTestTrait::setWaitForTerminate.
@@ -106,7 +106,7 @@ class CronRunTest extends BrowserTestBase {
/**
* Make sure exceptions thrown on hook_cron() don't affect other modules.
*/
- public function testCronExceptions() {
+ public function testCronExceptions(): void {
\Drupal::state()->delete('common_test.cron');
// The common_test module throws an exception. If it isn't caught, the tests
// won't finish successfully.
@@ -119,7 +119,7 @@ class CronRunTest extends BrowserTestBase {
/**
* Make sure the cron UI reads from the state storage.
*/
- public function testCronUI() {
+ public function testCronUI(): void {
$admin_user = $this->drupalCreateUser(['administer site configuration']);
$this->drupalLogin($admin_user);
$this->drupalGet('admin/config/system/cron');
@@ -147,7 +147,7 @@ class CronRunTest extends BrowserTestBase {
/**
* Ensure that the manual cron run is working.
*/
- public function testManualCron() {
+ public function testManualCron(): void {
$admin_user = $this->drupalCreateUser(['administer site configuration']);
$this->drupalLogin($admin_user);
diff --git a/core/modules/system/tests/src/Functional/System/DateFormatsLockedTest.php b/core/modules/system/tests/src/Functional/System/DateFormatsLockedTest.php
index f061534ba72..81bfc5ead82 100644
--- a/core/modules/system/tests/src/Functional/System/DateFormatsLockedTest.php
+++ b/core/modules/system/tests/src/Functional/System/DateFormatsLockedTest.php
@@ -21,7 +21,7 @@ class DateFormatsLockedTest extends BrowserTestBase {
/**
* Tests attempts at listing, editing, and deleting locked date formats.
*/
- public function testDateLocking() {
+ public function testDateLocking(): void {
$this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
// Locked date formats are not linked on the listing page, locked date
diff --git a/core/modules/system/tests/src/Functional/System/DateFormatsMachineNameTest.php b/core/modules/system/tests/src/Functional/System/DateFormatsMachineNameTest.php
index da925b9f1a7..0b2abcdae54 100644
--- a/core/modules/system/tests/src/Functional/System/DateFormatsMachineNameTest.php
+++ b/core/modules/system/tests/src/Functional/System/DateFormatsMachineNameTest.php
@@ -31,7 +31,7 @@ class DateFormatsMachineNameTest extends BrowserTestBase {
/**
* Tests that date formats cannot be created with invalid machine names.
*/
- public function testDateFormatsMachineNameAllowedValues() {
+ public function testDateFormatsMachineNameAllowedValues(): void {
// Try to create a date format with a not allowed character to test the date
// format specific machine name replace pattern.
$edit = [
diff --git a/core/modules/system/tests/src/Functional/System/DateTimeTest.php b/core/modules/system/tests/src/Functional/System/DateTimeTest.php
index 96107ceee27..54f2f468ef5 100644
--- a/core/modules/system/tests/src/Functional/System/DateTimeTest.php
+++ b/core/modules/system/tests/src/Functional/System/DateTimeTest.php
@@ -59,7 +59,7 @@ class DateTimeTest extends BrowserTestBase {
/**
* Tests time zones and DST handling.
*/
- public function testTimeZoneHandling() {
+ public function testTimeZoneHandling(): void {
// Setup date/time settings for Honolulu time.
$config = $this->config('system.date')
->set('timezone.default', 'Pacific/Honolulu')
@@ -100,7 +100,7 @@ class DateTimeTest extends BrowserTestBase {
/**
* Tests date format configuration.
*/
- public function testDateFormatConfiguration() {
+ public function testDateFormatConfiguration(): void {
// Confirm 'no custom date formats available' message appears.
$this->drupalGet('admin/config/regional/date-time');
@@ -209,7 +209,7 @@ class DateTimeTest extends BrowserTestBase {
/**
* Tests handling case with invalid data in selectors (like February, 31st).
*/
- public function testEnteringDateTimeViaSelectors() {
+ public function testEnteringDateTimeViaSelectors(): void {
$this->drupalCreateContentType(['type' => 'page_with_date', 'name' => 'Page with date']);
diff --git a/core/modules/system/tests/src/Functional/System/DefaultMobileMetaTagsTest.php b/core/modules/system/tests/src/Functional/System/DefaultMobileMetaTagsTest.php
index 4c1482bdcd1..e599884c2d2 100644
--- a/core/modules/system/tests/src/Functional/System/DefaultMobileMetaTagsTest.php
+++ b/core/modules/system/tests/src/Functional/System/DefaultMobileMetaTagsTest.php
@@ -38,7 +38,7 @@ class DefaultMobileMetaTagsTest extends BrowserTestBase {
/**
* Verifies that the default mobile meta tags are added.
*/
- public function testDefaultMetaTagsExist() {
+ public function testDefaultMetaTagsExist(): void {
$this->drupalGet('');
foreach ($this->defaultMetaTags as $name => $metatag) {
$this->assertSession()->responseContains($metatag);
@@ -48,7 +48,7 @@ class DefaultMobileMetaTagsTest extends BrowserTestBase {
/**
* Verifies that the default mobile meta tags can be removed.
*/
- public function testRemovingDefaultMetaTags() {
+ public function testRemovingDefaultMetaTags(): void {
\Drupal::service('module_installer')->install(['system_module_test']);
$this->drupalGet('');
foreach ($this->defaultMetaTags as $name => $metatag) {
diff --git a/core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php b/core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php
index ee51a944f4c..9c86c29ea2e 100644
--- a/core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php
+++ b/core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php
@@ -29,7 +29,7 @@ class ErrorHandlerTest extends BrowserTestBase {
/**
* Tests the error handler.
*/
- public function testErrorHandler() {
+ public function testErrorHandler(): void {
$config = $this->config('system.logging');
$error_notice = [
'%type' => 'Notice',
@@ -97,7 +97,7 @@ class ErrorHandlerTest extends BrowserTestBase {
/**
* Tests a custom error handler set in settings.php.
*/
- public function testCustomErrorHandler() {
+ public function testCustomErrorHandler(): void {
$settings_filename = $this->siteDirectory . '/settings.php';
chmod($settings_filename, 0777);
$settings_php = file_get_contents($settings_filename);
@@ -121,7 +121,7 @@ class ErrorHandlerTest extends BrowserTestBase {
/**
* Tests the exception handler.
*/
- public function testExceptionHandler() {
+ public function testExceptionHandler(): void {
$error_exception = [
'%type' => 'Exception',
'@message' => 'Drupal & awesome',
diff --git a/core/modules/system/tests/src/Functional/System/FrontPageTest.php b/core/modules/system/tests/src/Functional/System/FrontPageTest.php
index abb645a5451..8786ba5913f 100644
--- a/core/modules/system/tests/src/Functional/System/FrontPageTest.php
+++ b/core/modules/system/tests/src/Functional/System/FrontPageTest.php
@@ -55,7 +55,7 @@ class FrontPageTest extends BrowserTestBase {
/**
* Tests front page functionality.
*/
- public function testDrupalFrontPage() {
+ public function testDrupalFrontPage(): void {
// Create a promoted node to test the <title> tag on the front page view.
$settings = [
'title' => $this->randomMachineName(8),
diff --git a/core/modules/system/tests/src/Functional/System/HtaccessTest.php b/core/modules/system/tests/src/Functional/System/HtaccessTest.php
index 81fe8e15f5d..8f57acb9f66 100644
--- a/core/modules/system/tests/src/Functional/System/HtaccessTest.php
+++ b/core/modules/system/tests/src/Functional/System/HtaccessTest.php
@@ -106,7 +106,7 @@ class HtaccessTest extends BrowserTestBase {
/**
* Iterates over protected files and calls assertNoFileAccess().
*/
- public function testFileAccess() {
+ public function testFileAccess(): void {
foreach ($this->getProtectedFiles() as $file => $response_code) {
$this->assertFileAccess($file, $response_code);
}
@@ -156,7 +156,7 @@ class HtaccessTest extends BrowserTestBase {
/**
* Tests that SVGZ files are served with Content-Encoding: gzip.
*/
- public function testSvgzContentEncoding() {
+ public function testSvgzContentEncoding(): void {
$this->drupalGet('core/modules/system/tests/logo.svgz');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/system/tests/src/Functional/System/IndexPhpTest.php b/core/modules/system/tests/src/Functional/System/IndexPhpTest.php
index 470f7fe1f25..ae94b015850 100644
--- a/core/modules/system/tests/src/Functional/System/IndexPhpTest.php
+++ b/core/modules/system/tests/src/Functional/System/IndexPhpTest.php
@@ -28,7 +28,7 @@ class IndexPhpTest extends BrowserTestBase {
/**
* Tests index.php handling.
*/
- public function testIndexPhpHandling() {
+ public function testIndexPhpHandling(): void {
$index_php = $GLOBALS['base_url'] . '/index.php';
$this->drupalGet($index_php, ['external' => TRUE]);
diff --git a/core/modules/system/tests/src/Functional/System/MainContentFallbackTest.php b/core/modules/system/tests/src/Functional/System/MainContentFallbackTest.php
index c1331ad0a8d..149547a5734 100644
--- a/core/modules/system/tests/src/Functional/System/MainContentFallbackTest.php
+++ b/core/modules/system/tests/src/Functional/System/MainContentFallbackTest.php
@@ -49,7 +49,7 @@ class MainContentFallbackTest extends BrowserTestBase {
/**
* Tests availability of main content: Drupal falls back to SimplePageVariant.
*/
- public function testMainContentFallback() {
+ public function testMainContentFallback(): void {
$edit = [];
// Uninstall the block module.
$edit['uninstall[block]'] = 'block';
diff --git a/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php b/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php
index ed34bf7333f..21f81b2defc 100644
--- a/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php
+++ b/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php
@@ -49,7 +49,7 @@ class PageNotFoundTest extends BrowserTestBase {
user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['access user profiles']);
}
- public function testPageNotFound() {
+ public function testPageNotFound(): void {
$this->drupalLogin($this->adminUser);
$this->drupalGet($this->randomMachineName(10));
$this->assertSession()->pageTextContains('Page not found');
@@ -76,7 +76,7 @@ class PageNotFoundTest extends BrowserTestBase {
/**
* Tests that an inaccessible custom 404 page falls back to the default.
*/
- public function testPageNotFoundCustomPageWithAccessDenied() {
+ public function testPageNotFoundCustomPageWithAccessDenied(): void {
// Sets up a 404 page not accessible by the anonymous user.
$this->config('system.site')->set('page.404', '/system-test/custom-4xx')->save();
diff --git a/core/modules/system/tests/src/Functional/System/PageTitleTest.php b/core/modules/system/tests/src/Functional/System/PageTitleTest.php
index b0b71e37353..119f1e84fc0 100644
--- a/core/modules/system/tests/src/Functional/System/PageTitleTest.php
+++ b/core/modules/system/tests/src/Functional/System/PageTitleTest.php
@@ -54,7 +54,7 @@ class PageTitleTest extends BrowserTestBase {
/**
* Tests the handling of HTML in node titles.
*/
- public function testTitleTags() {
+ public function testTitleTags(): void {
$title = "string with <em>HTML</em>";
// Generate node content.
$edit = [
@@ -76,7 +76,7 @@ class PageTitleTest extends BrowserTestBase {
/**
* Tests if the title of the site is XSS proof.
*/
- public function testTitleXSS() {
+ public function testTitleXSS(): void {
// Set some title with JavaScript and HTML chars to escape.
$title = '</title><script type="text/javascript">alert("Title XSS!");</script> & < > " \' ';
$title_filtered = Html::escape($title);
@@ -117,7 +117,7 @@ class PageTitleTest extends BrowserTestBase {
*
* @see \Drupal\test_page_test\Controller\Test
*/
- public function testRoutingTitle() {
+ public function testRoutingTitle(): void {
// Test the '#title' render array attribute.
$this->drupalGet('test-render-title');
diff --git a/core/modules/system/tests/src/Functional/System/PhpRequirementTest.php b/core/modules/system/tests/src/Functional/System/PhpRequirementTest.php
index 497d6d2a1a6..f7447b8d418 100644
--- a/core/modules/system/tests/src/Functional/System/PhpRequirementTest.php
+++ b/core/modules/system/tests/src/Functional/System/PhpRequirementTest.php
@@ -49,7 +49,7 @@ class PhpRequirementTest extends BrowserTestBase {
/**
* Tests status report messages regarding the PHP version.
*/
- public function testStatusPage() {
+ public function testStatusPage(): void {
$minimum_php_version = PhpRequirements::getMinimumSupportedPhp();
// Go to Administration.
$this->drupalGet('admin/reports/status');
diff --git a/core/modules/system/tests/src/Functional/System/ResponseGeneratorTest.php b/core/modules/system/tests/src/Functional/System/ResponseGeneratorTest.php
index 128586c8994..4d7b6a888a1 100644
--- a/core/modules/system/tests/src/Functional/System/ResponseGeneratorTest.php
+++ b/core/modules/system/tests/src/Functional/System/ResponseGeneratorTest.php
@@ -40,7 +40,7 @@ class ResponseGeneratorTest extends BrowserTestBase {
/**
* Tests to see if generator header is added.
*/
- public function testGeneratorHeaderAdded() {
+ public function testGeneratorHeaderAdded(): void {
$node = $this->drupalCreateNode();
diff --git a/core/modules/system/tests/src/Functional/System/ShutdownFunctionsTest.php b/core/modules/system/tests/src/Functional/System/ShutdownFunctionsTest.php
index d9bd9c980bd..eaf71465daf 100644
--- a/core/modules/system/tests/src/Functional/System/ShutdownFunctionsTest.php
+++ b/core/modules/system/tests/src/Functional/System/ShutdownFunctionsTest.php
@@ -39,7 +39,7 @@ class ShutdownFunctionsTest extends BrowserTestBase {
/**
* Tests shutdown functions.
*/
- public function testShutdownFunctions() {
+ public function testShutdownFunctions(): void {
$arg1 = $this->randomMachineName();
$arg2 = $this->randomMachineName();
$this->drupalGet('system-test/shutdown-functions/' . $arg1 . '/' . $arg2);
diff --git a/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php b/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php
index 46c6aaba135..239ca0b7a0b 100644
--- a/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php
+++ b/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php
@@ -67,7 +67,7 @@ class SiteMaintenanceTest extends BrowserTestBase {
/**
* Verifies site maintenance mode functionality.
*/
- public function testSiteMaintenance() {
+ public function testSiteMaintenance(): void {
// Verify that permission message is displayed.
$this->drupalGet(Url::fromRoute('system.site_maintenance_mode'));
@@ -177,7 +177,7 @@ class SiteMaintenanceTest extends BrowserTestBase {
/**
* Tests responses to non-HTML requests when in maintenance mode.
*/
- public function testNonHtmlRequest() {
+ public function testNonHtmlRequest(): void {
$this->drupalLogout();
\Drupal::state()->set('system.maintenance_mode', TRUE);
$formats = ['json', 'xml', 'non-existing'];
diff --git a/core/modules/system/tests/src/Functional/System/SitesDirectoryHardeningTest.php b/core/modules/system/tests/src/Functional/System/SitesDirectoryHardeningTest.php
index 9962df6672f..09bb7143667 100644
--- a/core/modules/system/tests/src/Functional/System/SitesDirectoryHardeningTest.php
+++ b/core/modules/system/tests/src/Functional/System/SitesDirectoryHardeningTest.php
@@ -24,7 +24,7 @@ class SitesDirectoryHardeningTest extends BrowserTestBase {
*
* Checks both the current sites directory and settings.php.
*/
- public function testSitesDirectoryHardening() {
+ public function testSitesDirectoryHardening(): void {
$site_path = $this->kernel->getSitePath();
$settings_file = $this->settingsFile($site_path);
@@ -45,7 +45,7 @@ class SitesDirectoryHardeningTest extends BrowserTestBase {
/**
* Tests writable files remain writable when directory hardening is disabled.
*/
- public function testSitesDirectoryHardeningConfig() {
+ public function testSitesDirectoryHardeningConfig(): void {
$site_path = $this->kernel->getSitePath();
$settings_file = $this->settingsFile($site_path);
diff --git a/core/modules/system/tests/src/Functional/System/StatusTest.php b/core/modules/system/tests/src/Functional/System/StatusTest.php
index e7be4f9ef04..aaf6fb18570 100644
--- a/core/modules/system/tests/src/Functional/System/StatusTest.php
+++ b/core/modules/system/tests/src/Functional/System/StatusTest.php
@@ -50,7 +50,7 @@ class StatusTest extends BrowserTestBase {
*
* @group legacy
*/
- public function testStatusPage() {
+ public function testStatusPage(): void {
// Verify if the 'Status report' is the first item link.
$this->drupalGet('admin/reports');
$this->assertEquals('Status report', $this->cssSelect('.list-group :first-child')[0]->getText());
@@ -193,7 +193,7 @@ class StatusTest extends BrowserTestBase {
/**
* Tests that the Error counter matches the displayed number of errors.
*/
- public function testErrorElementCount() {
+ public function testErrorElementCount(): void {
// Trigger "cron has not run recently" error:
$cron_config = \Drupal::config('system.cron');
$time = \Drupal::time()->getRequestTime();
@@ -213,7 +213,7 @@ class StatusTest extends BrowserTestBase {
/**
* Tests that the Warning counter matches the displayed number of warnings.
*/
- public function testWarningElementCount() {
+ public function testWarningElementCount(): void {
// Trigger "cron has not run recently" with warning threshold:
$cron_config = \Drupal::config('system.cron');
$time = \Drupal::time()->getRequestTime();
diff --git a/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php b/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php
index 9a44b78fbb4..98dde216c2e 100644
--- a/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php
+++ b/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php
@@ -55,7 +55,7 @@ class SystemAuthorizeTest extends BrowserTestBase {
/**
* Tests the FileTransfer hooks.
*/
- public function testFileTransferHooks() {
+ public function testFileTransferHooks(): void {
$page_title = $this->randomMachineName(16);
$this->drupalGetAuthorizePHP($page_title);
$this->assertSession()->titleEquals("$page_title | Drupal");
diff --git a/core/modules/system/tests/src/Functional/System/ThemeTest.php b/core/modules/system/tests/src/Functional/System/ThemeTest.php
index 19f7f117043..ec6e6a4d358 100644
--- a/core/modules/system/tests/src/Functional/System/ThemeTest.php
+++ b/core/modules/system/tests/src/Functional/System/ThemeTest.php
@@ -70,7 +70,7 @@ class ThemeTest extends BrowserTestBase {
/**
* Tests the theme settings form.
*/
- public function testThemeSettings() {
+ public function testThemeSettings(): void {
// Ensure a disabled theme settings form URL returns 404.
$this->drupalGet('admin/appearance/settings/olivero');
$this->assertSession()->statusCodeEquals(404);
@@ -255,7 +255,7 @@ class ThemeTest extends BrowserTestBase {
/**
* Tests the theme settings logo form.
*/
- public function testThemeSettingsLogo() {
+ public function testThemeSettingsLogo(): void {
// Visit Olivero's theme settings page to replace the logo.
$this->container->get('theme_installer')->install(['olivero']);
$this->drupalGet('admin/appearance/settings/olivero');
@@ -321,7 +321,7 @@ class ThemeTest extends BrowserTestBase {
/**
* Tests the 'rendered' cache tag is cleared when saving theme settings.
*/
- public function testThemeSettingsRenderCacheClear() {
+ public function testThemeSettingsRenderCacheClear(): void {
$this->container->get('theme_installer')->install(['olivero']);
// Ensure the frontpage is cached for anonymous users. The render cache will
// cleared by installing a theme.
@@ -344,7 +344,7 @@ class ThemeTest extends BrowserTestBase {
/**
* Tests the administration theme functionality.
*/
- public function testAdministrationTheme() {
+ public function testAdministrationTheme(): void {
$this->container->get('theme_installer')->install(['claro']);
// Install an administration theme and show it on the node admin pages.
@@ -428,7 +428,7 @@ class ThemeTest extends BrowserTestBase {
/**
* Tests switching the default theme.
*/
- public function testSwitchDefaultTheme() {
+ public function testSwitchDefaultTheme(): void {
/** @var \Drupal\Core\Extension\ThemeInstallerInterface $theme_installer */
$theme_installer = \Drupal::service('theme_installer');
// First, install Stark and set it as the default theme programmatically.
@@ -459,7 +459,7 @@ class ThemeTest extends BrowserTestBase {
* Include test for themes that have a missing base theme somewhere further up
* the chain than the immediate base theme.
*/
- public function testInvalidTheme() {
+ public function testInvalidTheme(): void {
// theme_page_test_system_info_alter() un-hides all hidden themes.
$this->container->get('module_installer')->install(['theme_page_test']);
// Clear the system_list() and theme listing cache to pick up the change.
@@ -479,7 +479,7 @@ class ThemeTest extends BrowserTestBase {
/**
* Tests uninstalling of themes works.
*/
- public function testUninstallingThemes() {
+ public function testUninstallingThemes(): void {
// Install olivero.
\Drupal::service('theme_installer')->install(['olivero']);
// Set up Claro as the admin theme.
@@ -527,7 +527,7 @@ class ThemeTest extends BrowserTestBase {
/**
* Tests installing a theme and setting it as default.
*/
- public function testInstallAndSetAsDefault() {
+ public function testInstallAndSetAsDefault(): void {
$this->markTestSkipped('Skipped due to major version-specific logic. See https://www.drupal.org/project/drupal/issues/3359322');
$themes = [
'olivero' => 'Olivero',
@@ -557,7 +557,7 @@ class ThemeTest extends BrowserTestBase {
/**
* Tests the theme settings form when logo and favicon features are disabled.
*/
- public function testThemeSettingsNoLogoNoFavicon() {
+ public function testThemeSettingsNoLogoNoFavicon(): void {
// Install theme with no logo and no favicon feature.
$this->container->get('theme_installer')->install(['test_theme_settings_features']);
// Visit this theme's settings page.
diff --git a/core/modules/system/tests/src/Functional/System/TokenReplaceWebTest.php b/core/modules/system/tests/src/Functional/System/TokenReplaceWebTest.php
index 45f7a3f0649..65456eac918 100644
--- a/core/modules/system/tests/src/Functional/System/TokenReplaceWebTest.php
+++ b/core/modules/system/tests/src/Functional/System/TokenReplaceWebTest.php
@@ -30,7 +30,7 @@ class TokenReplaceWebTest extends BrowserTestBase {
/**
* Tests a token replacement on an actual website.
*/
- public function testTokens() {
+ public function testTokens(): void {
$node = $this->drupalCreateNode();
$account = $this->drupalCreateUser();
$this->drupalLogin($account);
diff --git a/core/modules/system/tests/src/Functional/System/TrustedHostsTest.php b/core/modules/system/tests/src/Functional/System/TrustedHostsTest.php
index c714925754f..a1ae5b76107 100644
--- a/core/modules/system/tests/src/Functional/System/TrustedHostsTest.php
+++ b/core/modules/system/tests/src/Functional/System/TrustedHostsTest.php
@@ -36,7 +36,7 @@ class TrustedHostsTest extends BrowserTestBase {
* Checks that an error is shown when the trusted host setting is missing from
* settings.php
*/
- public function testStatusPageWithoutConfiguration() {
+ public function testStatusPageWithoutConfiguration(): void {
$this->drupalGet('admin/reports/status');
$this->assertSession()->statusCodeEquals(200);
@@ -47,7 +47,7 @@ class TrustedHostsTest extends BrowserTestBase {
/**
* Tests that the status page shows the trusted patterns from settings.php.
*/
- public function testStatusPageWithConfiguration() {
+ public function testStatusPageWithConfiguration(): void {
$settings['settings']['trusted_host_patterns'] = (object) [
'value' => ['^' . preg_quote(\Drupal::request()->getHost()) . '$'],
'required' => TRUE,
@@ -67,7 +67,7 @@ class TrustedHostsTest extends BrowserTestBase {
*
* @see \Drupal\Core\Http\TrustedHostsRequestFactory
*/
- public function testFakeRequests() {
+ public function testFakeRequests(): void {
$this->container->get('module_installer')->install(['trusted_hosts_test']);
$host = $this->container->get('request_stack')->getCurrentRequest()->getHost();
@@ -85,7 +85,7 @@ class TrustedHostsTest extends BrowserTestBase {
/**
* Tests that shortcut module works together with host verification.
*/
- public function testShortcut() {
+ public function testShortcut(): void {
$this->container->get('module_installer')->install(['block', 'shortcut']);
$this->rebuildContainer();
@@ -120,7 +120,7 @@ class TrustedHostsTest extends BrowserTestBase {
*
* @see \Drupal\Core\Http\TrustedHostsRequestFactory
*/
- public function testRequestBags() {
+ public function testRequestBags(): void {
$this->container->get('module_installer')->install(['trusted_hosts_test']);
$host = $this->container->get('request_stack')->getCurrentRequest()->getHost();
diff --git a/core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php b/core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php
index aa107b63cfc..c3fae622efa 100644
--- a/core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php
@@ -36,7 +36,7 @@ class EngineNyanCatTest extends BrowserTestBase {
/**
* Ensures a theme's template is overridable based on the 'template' filename.
*/
- public function testTemplateOverride() {
+ public function testTemplateOverride(): void {
$this->config('system.theme')
->set('default', 'test_theme_nyan_cat_engine')
->save();
diff --git a/core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php b/core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php
index 4db8ecd517b..65380e5721b 100644
--- a/core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php
@@ -41,7 +41,7 @@ class EngineTwigTest extends BrowserTestBase {
/**
* Tests that the Twig engine handles PHP data correctly.
*/
- public function testTwigVariableDataTypes() {
+ public function testTwigVariableDataTypes(): void {
$this->config('system.theme')
->set('default', 'test_theme')
->save();
@@ -54,7 +54,7 @@ class EngineTwigTest extends BrowserTestBase {
/**
* Tests the url and url_generate Twig functions.
*/
- public function testTwigUrlGenerator() {
+ public function testTwigUrlGenerator(): void {
$this->drupalGet('twig-theme-test/url-generator');
// Find the absolute URL of the current site.
$url_generator = $this->container->get('url_generator');
@@ -83,7 +83,7 @@ class EngineTwigTest extends BrowserTestBase {
/**
* Tests the link_generator Twig functions.
*/
- public function testTwigLinkGenerator() {
+ public function testTwigLinkGenerator(): void {
$this->drupalGet('twig-theme-test/link-generator');
/** @var \Drupal\Core\Utility\LinkGenerator $link_generator */
@@ -119,7 +119,7 @@ class EngineTwigTest extends BrowserTestBase {
*
* @see \Drupal\Core\Url
*/
- public function testTwigUrlToString() {
+ public function testTwigUrlToString(): void {
$this->drupalGet('twig-theme-test/url-to-string');
$expected = [
@@ -136,7 +136,7 @@ class EngineTwigTest extends BrowserTestBase {
/**
* Tests the automatic/magic calling of toString() on objects, if exists.
*/
- public function testTwigFileUrls() {
+ public function testTwigFileUrls(): void {
$this->drupalGet('/twig-theme-test/file-url');
/** @var \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator */
$file_url_generator = \Drupal::service('file_url_generator');
@@ -147,7 +147,7 @@ class EngineTwigTest extends BrowserTestBase {
/**
* Tests the attach of asset libraries.
*/
- public function testTwigAttachLibrary() {
+ public function testTwigAttachLibrary(): void {
$this->drupalGet('/twig-theme-test/attach-library');
$this->assertSession()->responseContains('ckeditor5-dll.js');
}
@@ -155,7 +155,7 @@ class EngineTwigTest extends BrowserTestBase {
/**
* Tests the rendering of renderables.
*/
- public function testRenderable() {
+ public function testRenderable(): void {
$this->drupalGet('/twig-theme-test/renderable');
$this->assertSession()->responseContains('<div>Example markup</div>');
}
diff --git a/core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php b/core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php
index 825bc5ffd83..e6c9fb73bb4 100644
--- a/core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php
@@ -140,7 +140,7 @@ class EntityFilteringThemeTest extends BrowserTestBase {
/**
* Checks each themed entity for XSS filtering in available themes.
*/
- public function testThemedEntity() {
+ public function testThemedEntity(): void {
// Check paths where various view modes of the entities are rendered.
$paths = [
'user',
diff --git a/core/modules/system/tests/src/Functional/Theme/FastTest.php b/core/modules/system/tests/src/Functional/Theme/FastTest.php
index e14be894952..dd2621cdf65 100644
--- a/core/modules/system/tests/src/Functional/Theme/FastTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/FastTest.php
@@ -44,7 +44,7 @@ class FastTest extends BrowserTestBase {
/**
* Tests access to user autocompletion and verify the correct results.
*/
- public function testUserAutocomplete() {
+ public function testUserAutocomplete(): void {
$this->drupalLogin($this->account);
$this->drupalGet('user/autocomplete', ['query' => ['q' => $this->account->getAccountName()]]);
$this->assertSession()->responseContains($this->account->getAccountName());
diff --git a/core/modules/system/tests/src/Functional/Theme/HtmlAttributesTest.php b/core/modules/system/tests/src/Functional/Theme/HtmlAttributesTest.php
index dd0c67f7717..c39ce5ee334 100644
--- a/core/modules/system/tests/src/Functional/Theme/HtmlAttributesTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/HtmlAttributesTest.php
@@ -28,7 +28,7 @@ class HtmlAttributesTest extends BrowserTestBase {
/**
* Tests that attributes in the 'html' and 'body' elements can be altered.
*/
- public function testThemeHtmlAttributes() {
+ public function testThemeHtmlAttributes(): void {
$this->drupalGet('');
$this->assertSession()->responseContains('<html lang="en" dir="ltr" theme_test_html_attribute="theme test html attribute value">');
$this->assertSession()->elementsCount('xpath', '/body[@theme_test_body_attribute="theme test body attribute value"]', 1);
diff --git a/core/modules/system/tests/src/Functional/Theme/ImageLoadingAttributeTest.php b/core/modules/system/tests/src/Functional/Theme/ImageLoadingAttributeTest.php
index 9c3ee42a107..c77cf2aaefb 100644
--- a/core/modules/system/tests/src/Functional/Theme/ImageLoadingAttributeTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/ImageLoadingAttributeTest.php
@@ -28,7 +28,7 @@ class ImageLoadingAttributeTest extends BrowserTestBase {
/**
* Tests that loading attribute is enabled for images.
*/
- public function testImageLoadingAttribute() {
+ public function testImageLoadingAttribute(): void {
$assert = $this->assertSession();
// Get page under test.
diff --git a/core/modules/system/tests/src/Functional/Theme/MaintenanceThemeUpdateRegistryTest.php b/core/modules/system/tests/src/Functional/Theme/MaintenanceThemeUpdateRegistryTest.php
index 3a15c1c9cba..e3aeb3cb81a 100644
--- a/core/modules/system/tests/src/Functional/Theme/MaintenanceThemeUpdateRegistryTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/MaintenanceThemeUpdateRegistryTest.php
@@ -65,7 +65,7 @@ class MaintenanceThemeUpdateRegistryTest extends BrowserTestBase {
/**
* Tests that after installing the profile there are no outstanding updates.
*/
- public function testMaintenanceThemeUpdateRegistration() {
+ public function testMaintenanceThemeUpdateRegistration(): void {
$this->drupalLogin($this->drupalCreateUser(['administer software updates']));
$this->drupalGet('update.php/selection');
diff --git a/core/modules/system/tests/src/Functional/Theme/ThemeEarlyInitializationTest.php b/core/modules/system/tests/src/Functional/Theme/ThemeEarlyInitializationTest.php
index 83498774d45..5edbf2cf46a 100644
--- a/core/modules/system/tests/src/Functional/Theme/ThemeEarlyInitializationTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/ThemeEarlyInitializationTest.php
@@ -28,7 +28,7 @@ class ThemeEarlyInitializationTest extends BrowserTestBase {
/**
* Tests that the theme system can generate output in a request listener.
*/
- public function testRequestListener() {
+ public function testRequestListener(): void {
$this->drupalGet('theme-test/request-listener');
// Verify that themed output generated in the request listener appears.
$this->assertSession()->responseContains('Themed output generated in a KernelEvents::REQUEST listener');
diff --git a/core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php b/core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php
index c9174975e5f..f8ec258a207 100644
--- a/core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php
@@ -60,7 +60,7 @@ class ThemeInfoTest extends BrowserTestBase {
/**
* Tests libraries-override.
*/
- public function testStylesheets() {
+ public function testStylesheets(): void {
$this->themeInstaller->install(['test_basetheme', 'test_subtheme']);
$this->config('system.theme')
->set('default', 'test_subtheme')
@@ -89,7 +89,7 @@ class ThemeInfoTest extends BrowserTestBase {
/**
* Tests that changes to the info file are picked up.
*/
- public function testChanges() {
+ public function testChanges(): void {
$this->themeInstaller->install(['test_theme']);
$this->config('system.theme')->set('default', 'test_theme')->save();
$this->themeManager->resetActiveTheme();
diff --git a/core/modules/system/tests/src/Functional/Theme/ThemeSuggestionsAlterTest.php b/core/modules/system/tests/src/Functional/Theme/ThemeSuggestionsAlterTest.php
index fce7b042d1a..4f6efef77eb 100644
--- a/core/modules/system/tests/src/Functional/Theme/ThemeSuggestionsAlterTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/ThemeSuggestionsAlterTest.php
@@ -37,7 +37,7 @@ class ThemeSuggestionsAlterTest extends BrowserTestBase {
/**
* Tests that hooks to provide theme suggestions work.
*/
- public function testTemplateSuggestions() {
+ public function testTemplateSuggestions(): void {
$this->drupalGet('theme-test/suggestion-provided');
$this->assertSession()->pageTextContains('Template for testing suggestions provided by the module declaring the theme hook.');
@@ -54,7 +54,7 @@ class ThemeSuggestionsAlterTest extends BrowserTestBase {
/**
* Tests hook_theme_suggestions_alter().
*/
- public function testGeneralSuggestionsAlter() {
+ public function testGeneralSuggestionsAlter(): void {
$this->drupalGet('theme-test/general-suggestion-alter');
$this->assertSession()->pageTextContains('Original template for testing hook_theme_suggestions_alter().');
$this->assertSession()->pageTextContains('Hooks: theme_test_theme none');
@@ -79,7 +79,7 @@ class ThemeSuggestionsAlterTest extends BrowserTestBase {
/**
* Tests that theme suggestion alter hooks work for templates.
*/
- public function testTemplateSuggestionsAlter() {
+ public function testTemplateSuggestionsAlter(): void {
$this->drupalGet('theme-test/suggestion-alter');
$this->assertSession()->pageTextContains('Original template for testing hook_theme_suggestions_HOOK_alter().');
@@ -101,7 +101,7 @@ class ThemeSuggestionsAlterTest extends BrowserTestBase {
/**
* Tests that theme suggestion alter hooks work for specific theme calls.
*/
- public function testSpecificSuggestionsAlter() {
+ public function testSpecificSuggestionsAlter(): void {
// Test that the default template is rendered.
$this->drupalGet('theme-test/specific-suggestion-alter');
$this->assertSession()->pageTextContains('Template for testing specific theme calls.');
@@ -132,7 +132,7 @@ class ThemeSuggestionsAlterTest extends BrowserTestBase {
* Hook hook_theme_suggestions_alter() should fire before
* hook_theme_suggestions_HOOK_alter() within an extension (module or theme).
*/
- public function testExecutionOrder() {
+ public function testExecutionOrder(): void {
// Install our test theme and module.
$this->config('system.theme')
->set('default', 'test_theme')
diff --git a/core/modules/system/tests/src/Functional/Theme/ThemeTest.php b/core/modules/system/tests/src/Functional/Theme/ThemeTest.php
index 396c253ed3d..344f4d78a3e 100644
--- a/core/modules/system/tests/src/Functional/Theme/ThemeTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/ThemeTest.php
@@ -43,7 +43,7 @@ class ThemeTest extends BrowserTestBase {
* separate file, so this test also ensures that the file is correctly loaded
* when needed.
*/
- public function testPreprocessForSuggestions() {
+ public function testPreprocessForSuggestions(): void {
// Test with both an unprimed and primed theme registry.
\Drupal::service('theme.registry')->reset();
for ($i = 0; $i < 2; $i++) {
@@ -55,7 +55,7 @@ class ThemeTest extends BrowserTestBase {
/**
* Tests the priority of some theme negotiators.
*/
- public function testNegotiatorPriorities() {
+ public function testNegotiatorPriorities(): void {
$this->drupalGet('theme-test/priority');
// Ensure that the custom theme negotiator was not able to set the theme.
@@ -65,7 +65,7 @@ class ThemeTest extends BrowserTestBase {
/**
* Ensures that non-HTML requests never initialize themes.
*/
- public function testThemeOnNonHtmlRequest() {
+ public function testThemeOnNonHtmlRequest(): void {
$this->drupalGet('theme-test/non-html');
$json = Json::decode($this->getSession()->getPage()->getContent());
$this->assertFalse($json['theme_initialized']);
@@ -74,7 +74,7 @@ class ThemeTest extends BrowserTestBase {
/**
* Ensure page-front template suggestion is added when on front page.
*/
- public function testFrontPageThemeSuggestion() {
+ public function testFrontPageThemeSuggestion(): void {
// Set the current route to user.login because theme_get_suggestions() will
// query it to see if we are on the front page.
$request = Request::create('/user/login');
@@ -91,7 +91,7 @@ class ThemeTest extends BrowserTestBase {
/**
* Tests theme can provide classes.
*/
- public function testClassLoading() {
+ public function testClassLoading(): void {
// Install test theme and set it as default.
$this->config('system.theme')
->set('default', 'test_theme')
@@ -107,7 +107,7 @@ class ThemeTest extends BrowserTestBase {
*
* @see test_theme.info.yml
*/
- public function testCSSOverride() {
+ public function testCSSOverride(): void {
// Reuse the same page as in testPreprocessForSuggestions(). We're testing
// what is output to the HTML HEAD based on what is in a theme's .info.yml
// file, so it doesn't matter what page we get, as long as it is themed with
@@ -136,7 +136,7 @@ class ThemeTest extends BrowserTestBase {
/**
* Ensures a themes template is overridable based on the 'template' filename.
*/
- public function testTemplateOverride() {
+ public function testTemplateOverride(): void {
$this->config('system.theme')
->set('default', 'test_theme')
->save();
@@ -150,7 +150,7 @@ class ThemeTest extends BrowserTestBase {
* Some modules check the page array in template_preprocess_html(), so we
* ensure that it has not been rendered prematurely.
*/
- public function testPreprocessHtml() {
+ public function testPreprocessHtml(): void {
$this->drupalGet('');
$this->assertSession()->elementsCount('xpath', '/body[@theme_test_page_variable="Page variable is an array."]', 1);
$this->assertSession()->pageTextContains('theme test page bottom markup');
@@ -159,7 +159,7 @@ class ThemeTest extends BrowserTestBase {
/**
* Tests that region attributes can be manipulated via preprocess functions.
*/
- public function testRegionClass() {
+ public function testRegionClass(): void {
\Drupal::service('module_installer')->install(['block', 'theme_region_test']);
// Place a block.
@@ -178,7 +178,7 @@ class ThemeTest extends BrowserTestBase {
* separate file, so this test also ensures that the file is correctly loaded
* when needed.
*/
- public function testSuggestionPreprocessForDefaults() {
+ public function testSuggestionPreprocessForDefaults(): void {
$this->config('system.theme')->set('default', 'test_theme')->save();
// Test with both an unprimed and primed theme registry.
\Drupal::service('theme.registry')->reset();
@@ -201,7 +201,7 @@ class ThemeTest extends BrowserTestBase {
/**
* Ensures that preprocess callbacks can be defined.
*/
- public function testPreprocessCallback() {
+ public function testPreprocessCallback(): void {
$this->drupalGet('theme-test/preprocess-callback');
$this->assertSession()->pageTextContains('Make Drupal full of kittens again!');
}
diff --git a/core/modules/system/tests/src/Functional/Theme/ThemeTokenTest.php b/core/modules/system/tests/src/Functional/Theme/ThemeTokenTest.php
index 1fc4cb15087..9549e8d1bd7 100644
--- a/core/modules/system/tests/src/Functional/Theme/ThemeTokenTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/ThemeTokenTest.php
@@ -40,7 +40,7 @@ class ThemeTokenTest extends BrowserTestBase {
/**
* Tests if the 'theme_token' key of 'ajaxPageState' is computed.
*/
- public function testThemeToken() {
+ public function testThemeToken(): void {
// Visit the block administrative page with default theme. We use that page
// because 'misc/ajax.js' is loaded there and we can test the token
// generation.
diff --git a/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php b/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php
index b5bc6e3fa7f..2619cac8452 100644
--- a/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php
@@ -47,7 +47,7 @@ class ThemeUiTest extends BrowserTestBase {
/**
* Tests permissions for enabling themes depending on disabled modules.
*/
- public function testModulePermissions() {
+ public function testModulePermissions(): void {
// Log in as a user without permission to enable modules.
$this->drupalLogin($this->drupalCreateUser([
'administer themes',
@@ -88,7 +88,7 @@ class ThemeUiTest extends BrowserTestBase {
*
* @dataProvider providerTestThemeInstallWithModuleDependencies
*/
- public function testThemeInstallWithModuleDependencies($theme_name, array $first_modules, array $second_modules, array $required_by_messages, $base_theme_to_uninstall, array $base_theme_module_names) {
+ public function testThemeInstallWithModuleDependencies($theme_name, array $first_modules, array $second_modules, array $required_by_messages, $base_theme_to_uninstall, array $base_theme_module_names): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
$all_dependent_modules = array_merge($first_modules, $second_modules);
@@ -310,7 +310,7 @@ class ThemeUiTest extends BrowserTestBase {
/**
* Tests installing a theme with missing module dependencies.
*/
- public function testInstallModuleWithMissingDependencies() {
+ public function testInstallModuleWithMissingDependencies(): void {
$this->drupalGet('admin/appearance');
$theme_container = $this->getSession()->getPage()->find('css', 'h3:contains("Test Theme Depending on Nonexisting Module")')->getParent();
$this->assertStringContainsString('Requires: test_module_non_existing (missing)', $theme_container->getText());
@@ -320,7 +320,7 @@ class ThemeUiTest extends BrowserTestBase {
/**
* Tests installing a theme with incompatible module dependencies.
*/
- public function testInstallModuleWithIncompatibleDependencies() {
+ public function testInstallModuleWithIncompatibleDependencies(): void {
$this->container->get('module_installer')->install(['test_module_compatible_constraint', 'test_module_incompatible_constraint']);
$this->drupalGet('admin/appearance');
$theme_container = $this->getSession()->getPage()->find('css', 'h3:contains("Test Theme Depending on Version Constrained Modules")')->getParent();
@@ -331,7 +331,7 @@ class ThemeUiTest extends BrowserTestBase {
/**
* Tests that incompatible themes message is shown.
*/
- public function testInstalledIncompatibleTheme() {
+ public function testInstalledIncompatibleTheme(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
$incompatible_themes_message = 'There are errors with some installed themes. Visit the status report page for more information.';
diff --git a/core/modules/system/tests/src/Functional/Theme/ThemeUpdateTest.php b/core/modules/system/tests/src/Functional/Theme/ThemeUpdateTest.php
index c38aa4cc937..d847abb559e 100644
--- a/core/modules/system/tests/src/Functional/Theme/ThemeUpdateTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/ThemeUpdateTest.php
@@ -27,7 +27,7 @@ class ThemeUpdateTest extends BrowserTestBase {
* separate file, so this test also ensures that the file is correctly loaded
* when needed.
*/
- public function testThemeUpdates() {
+ public function testThemeUpdates(): void {
\Drupal::service('module_installer')->install(['test_module_required_by_theme']);
$this->rebuildAll();
\Drupal::state()->set('test_theme_depending_on_modules.system_info_alter', ['dependencies' => ['test_module_required_by_theme', 'stark']]);
diff --git a/core/modules/system/tests/src/Functional/Theme/ToolbarClaroOverridesTest.php b/core/modules/system/tests/src/Functional/Theme/ToolbarClaroOverridesTest.php
index 4b25f92cfbc..ec113eeab86 100644
--- a/core/modules/system/tests/src/Functional/Theme/ToolbarClaroOverridesTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/ToolbarClaroOverridesTest.php
@@ -61,7 +61,7 @@ class ToolbarClaroOverridesTest extends BrowserTestBase {
/**
* Confirm Claro assets load on a non-Claro default theme.
*/
- public function testClaroAssets() {
+ public function testClaroAssets(): void {
$default_stylesheets = [
'core/modules/toolbar/css/toolbar.module.css',
'core/modules/toolbar/css/toolbar.menu.css',
diff --git a/core/modules/system/tests/src/Functional/Theme/TwigDebugMarkupTest.php b/core/modules/system/tests/src/Functional/Theme/TwigDebugMarkupTest.php
index 53fdfdf3f52..ac2e45b4ca7 100644
--- a/core/modules/system/tests/src/Functional/Theme/TwigDebugMarkupTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/TwigDebugMarkupTest.php
@@ -29,7 +29,7 @@ class TwigDebugMarkupTest extends BrowserTestBase {
/**
* Tests debug markup added to Twig template output.
*/
- public function testTwigDebugMarkup() {
+ public function testTwigDebugMarkup(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$extension = twig_extension();
diff --git a/core/modules/system/tests/src/Functional/Theme/TwigEnvironmentTest.php b/core/modules/system/tests/src/Functional/Theme/TwigEnvironmentTest.php
index 352e288c27c..d9fd7883572 100644
--- a/core/modules/system/tests/src/Functional/Theme/TwigEnvironmentTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/TwigEnvironmentTest.php
@@ -26,7 +26,7 @@ class TwigEnvironmentTest extends BrowserTestBase {
/**
* Tests template class loading with Twig embed.
*/
- public function testTwigEmbed() {
+ public function testTwigEmbed(): void {
$assert_session = $this->assertSession();
// Test the Twig embed tag.
$this->drupalGet('twig-theme-test/embed-tag');
diff --git a/core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php b/core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php
index 43c4318ea73..a597d7e5052 100644
--- a/core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php
@@ -37,7 +37,7 @@ class TwigExtensionTest extends BrowserTestBase {
/**
* Tests that the provided Twig extension loads the service appropriately.
*/
- public function testTwigExtensionLoaded() {
+ public function testTwigExtensionLoaded(): void {
$twigService = \Drupal::service('twig');
$ext = $twigService->getExtension(TestExtension::class);
$this->assertInstanceOf(TestExtension::class, $ext);
@@ -46,7 +46,7 @@ class TwigExtensionTest extends BrowserTestBase {
/**
* Tests that the Twig extension's filter produces expected output.
*/
- public function testTwigExtensionFilter() {
+ public function testTwigExtensionFilter(): void {
$this->config('system.theme')
->set('default', 'test_theme')
->save();
@@ -60,7 +60,7 @@ class TwigExtensionTest extends BrowserTestBase {
/**
* Tests that the Twig extension's function produces expected output.
*/
- public function testTwigExtensionFunction() {
+ public function testTwigExtensionFunction(): void {
$this->config('system.theme')
->set('default', 'test_theme')
->save();
@@ -76,7 +76,7 @@ class TwigExtensionTest extends BrowserTestBase {
*
* @see https://www.drupal.org/node/2417733
*/
- public function testsRenderEscapedZeroValue() {
+ public function testsRenderEscapedZeroValue(): void {
/** @var \Drupal\Core\Template\TwigExtension $extension */
$extension = \Drupal::service('twig.extension');
/** @var \Drupal\Core\Template\TwigEnvironment $twig */
@@ -90,7 +90,7 @@ class TwigExtensionTest extends BrowserTestBase {
*
* @see https://www.drupal.org/node/2417733
*/
- public function testsRenderZeroValue() {
+ public function testsRenderZeroValue(): void {
/** @var \Drupal\Core\Template\TwigExtension $extension */
$extension = \Drupal::service('twig.extension');
$this->assertSame(0, $extension->renderVar(0), 'TwigExtension::renderVar() renders zero correctly when provided as an integer.');
@@ -100,7 +100,7 @@ class TwigExtensionTest extends BrowserTestBase {
/**
* Tests the dump function.
*/
- public function testDump() {
+ public function testDump(): void {
// Test Twig Debug disabled.
$this->drupalGet('/twig-theme-test/dump');
$this->assertSession()->elementsCount('css', '.sf-dump', 0);
diff --git a/core/modules/system/tests/src/Functional/Theme/TwigRegistryLoaderTest.php b/core/modules/system/tests/src/Functional/Theme/TwigRegistryLoaderTest.php
index b1da0d13345..6bc426e6843 100644
--- a/core/modules/system/tests/src/Functional/Theme/TwigRegistryLoaderTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/TwigRegistryLoaderTest.php
@@ -52,14 +52,14 @@ class TwigRegistryLoaderTest extends BrowserTestBase {
/**
* Tests template discovery using the Drupal theme registry.
*/
- public function testTemplateDiscovery() {
+ public function testTemplateDiscovery(): void {
$this->assertTwigTemplate($this->twig->load('block.html.twig'), 'Found block.html.twig in block module.');
}
/**
* Tests template extension and includes using the Drupal theme registry.
*/
- public function testTwigNamespaces() {
+ public function testTwigNamespaces(): void {
// Test the module-provided extend and insert templates.
$this->drupalGet('twig-theme-test/registry-loader');
$this->assertSession()->pageTextContains('This line is from twig_theme_test/templates/twig-registry-loader-test-extend.html.twig');
diff --git a/core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php b/core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php
index 7ed4fc35174..e77cb68dd27 100644
--- a/core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php
@@ -29,7 +29,7 @@ class TwigSettingsTest extends BrowserTestBase {
/**
* Ensures Twig template auto reload setting can be overridden.
*/
- public function testTwigAutoReloadOverride() {
+ public function testTwigAutoReloadOverride(): void {
// Enable auto reload and rebuild the service container.
$parameters = $this->container->getParameter('twig.config');
$parameters['auto_reload'] = TRUE;
@@ -51,7 +51,7 @@ class TwigSettingsTest extends BrowserTestBase {
/**
* Ensures Twig engine debug setting can be overridden.
*/
- public function testTwigDebugOverride() {
+ public function testTwigDebugOverride(): void {
// Enable debug and rebuild the service container.
$parameters = $this->container->getParameter('twig.config');
$parameters['debug'] = TRUE;
@@ -81,7 +81,7 @@ class TwigSettingsTest extends BrowserTestBase {
/**
* Ensures Twig template cache setting can be overridden.
*/
- public function testTwigCacheOverride() {
+ public function testTwigCacheOverride(): void {
$extension = twig_extension();
$theme_installer = $this->container->get('theme_installer');
$theme_installer->install(['test_theme']);
@@ -126,7 +126,7 @@ class TwigSettingsTest extends BrowserTestBase {
/**
* Tests twig inline templates with auto_reload.
*/
- public function testTwigInlineWithAutoReload() {
+ public function testTwigInlineWithAutoReload(): void {
$parameters = $this->container->getParameter('twig.config');
$parameters['auto_reload'] = TRUE;
$parameters['debug'] = TRUE;
diff --git a/core/modules/system/tests/src/Functional/Theme/TwigTransTest.php b/core/modules/system/tests/src/Functional/Theme/TwigTransTest.php
index 18dd85822c7..301661b7ea3 100644
--- a/core/modules/system/tests/src/Functional/Theme/TwigTransTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/TwigTransTest.php
@@ -85,7 +85,7 @@ class TwigTransTest extends BrowserTestBase {
/**
* Tests Twig "trans" tags.
*/
- public function testTwigTransTags() {
+ public function testTwigTransTags(): void {
// Run this once without and once with Twig debug because trans can work
// differently depending on that setting.
$this->drupalGet('twig-theme-test/trans', ['language' => \Drupal::languageManager()->getLanguage('xx')]);
@@ -105,7 +105,7 @@ class TwigTransTest extends BrowserTestBase {
/**
* Tests empty Twig "trans" tags.
*/
- public function testEmptyTwigTransTags() {
+ public function testEmptyTwigTransTags(): void {
$elements = [
'#type' => 'inline_template',
'#template' => '{% trans %}{% endtrans %}',
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/BrokenCacheUpdateTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/BrokenCacheUpdateTest.php
index 746dfd4e959..9aa889d52b0 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/BrokenCacheUpdateTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/BrokenCacheUpdateTest.php
@@ -32,7 +32,7 @@ class BrokenCacheUpdateTest extends BrowserTestBase {
/**
* Ensures that a broken or out-of-date element info cache is not used.
*/
- public function testUpdate() {
+ public function testUpdate(): void {
$connection = Database::getConnection();
// Create broken element info caches entries.
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/DependencyHookInvocationTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/DependencyHookInvocationTest.php
index 0fe869a11b6..f62b932ee0d 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/DependencyHookInvocationTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/DependencyHookInvocationTest.php
@@ -40,7 +40,7 @@ class DependencyHookInvocationTest extends BrowserTestBase {
/**
* Tests the structure of the array returned by hook_update_dependencies().
*/
- public function testHookUpdateDependencies() {
+ public function testHookUpdateDependencies(): void {
$update_dependencies = update_retrieve_dependencies();
$this->assertSame(8001, $update_dependencies['update_test_0'][8001]['update_test_1'], 'An update function that has a dependency on two separate modules has the first dependency recorded correctly.');
$this->assertSame(8002, $update_dependencies['update_test_0'][8001]['update_test_2'], 'An update function that has a dependency on two separate modules has the second dependency recorded correctly.');
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/DependencyMissingTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/DependencyMissingTest.php
index e9fe9d5254d..f1e52e7472c 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/DependencyMissingTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/DependencyMissingTest.php
@@ -35,7 +35,7 @@ class DependencyMissingTest extends BrowserTestBase {
require_once $this->root . '/core/includes/update.inc';
}
- public function testMissingUpdate() {
+ public function testMissingUpdate(): void {
$starting_updates = [
'update_test_2' => 8001,
];
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/DependencyOrderingTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/DependencyOrderingTest.php
index a1e22be743c..1dcc6120e57 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/DependencyOrderingTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/DependencyOrderingTest.php
@@ -41,7 +41,7 @@ class DependencyOrderingTest extends BrowserTestBase {
/**
* Tests that updates within a single module run in the correct order.
*/
- public function testUpdateOrderingSingleModule() {
+ public function testUpdateOrderingSingleModule(): void {
$starting_updates = [
'update_test_1' => 8001,
];
@@ -57,7 +57,7 @@ class DependencyOrderingTest extends BrowserTestBase {
/**
* Tests that dependencies between modules are resolved correctly.
*/
- public function testUpdateOrderingModuleInterdependency() {
+ public function testUpdateOrderingModuleInterdependency(): void {
$starting_updates = [
'update_test_2' => 8001,
'update_test_3' => 8001,
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/EntityUpdateInitialTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/EntityUpdateInitialTest.php
index f66645ba553..fa8868ee997 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/EntityUpdateInitialTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/EntityUpdateInitialTest.php
@@ -58,7 +58,7 @@ class EntityUpdateInitialTest extends BrowserTestBase {
/**
* Tests that a pre-existing initial key in the field schema is not a change.
*/
- public function testInitialIsIgnored() {
+ public function testInitialIsIgnored(): void {
$this->runUpdates();
}
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/InvalidUpdateHookTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/InvalidUpdateHookTest.php
index 003fe1458a6..c1121813419 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/InvalidUpdateHookTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/InvalidUpdateHookTest.php
@@ -60,7 +60,7 @@ class InvalidUpdateHookTest extends BrowserTestBase {
]);
}
- public function testInvalidUpdateHook() {
+ public function testInvalidUpdateHook(): void {
// Confirm that a module with hook_update_8000() cannot be updated.
$this->drupalLogin($this->updateUser);
$this->drupalGet($this->updateUrl);
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/NoPreExistingSchemaUpdateTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/NoPreExistingSchemaUpdateTest.php
index 4e2cd254d1c..957200a969a 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/NoPreExistingSchemaUpdateTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/NoPreExistingSchemaUpdateTest.php
@@ -49,7 +49,7 @@ class NoPreExistingSchemaUpdateTest extends BrowserTestBase {
/**
* Tests the system module updates with no dependencies installed.
*/
- public function testNoPreExistingSchema() {
+ public function testNoPreExistingSchema(): void {
$schema = \Drupal::service('update.update_hook_registry')->getAllInstalledVersions();
$this->assertArrayNotHasKey('update_test_no_preexisting', $schema);
$this->assertFalse(\Drupal::state()->get('update_test_no_preexisting_update_8001', FALSE));
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/RebuildScriptTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/RebuildScriptTest.php
index 8d8a541e84a..77d15a813e5 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/RebuildScriptTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/RebuildScriptTest.php
@@ -28,7 +28,7 @@ class RebuildScriptTest extends BrowserTestBase {
/**
* Tests redirect in rebuild.php.
*/
- public function testRebuild() {
+ public function testRebuild(): void {
$cache = $this->container->get('cache.default');
$cache->set('rebuild_test', TRUE);
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateCacheTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateCacheTest.php
index e1f5f728294..1c1e0255603 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateCacheTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateCacheTest.php
@@ -27,7 +27,7 @@ class UpdateCacheTest extends BrowserTestBase {
* @see \Drupal\Core\Update\UpdateServiceProvider
* @see \Drupal\Core\Update\UpdateBackend
*/
- public function testCaches() {
+ public function testCaches(): void {
\Drupal::cache()->set('will_not_exist_after_update', TRUE);
// The site might be broken at the time so logging in using the UI might
// not work, so we use the API itself.
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathLastRemovedTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathLastRemovedTest.php
index ad819b7c2d9..a03525479f7 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathLastRemovedTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathLastRemovedTest.php
@@ -56,7 +56,7 @@ class UpdatePathLastRemovedTest extends BrowserTestBase {
/**
* Tests that a module with a too old schema version can not be updated.
*/
- public function testLastRemovedVersion() {
+ public function testLastRemovedVersion(): void {
/** @var \Drupal\Core\Update\UpdateHookRegistry $update_registry */
$update_registry = \Drupal::service('update.update_hook_registry');
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathNewDependencyTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathNewDependencyTest.php
index 6c9505050af..c657d311a08 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathNewDependencyTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathNewDependencyTest.php
@@ -24,7 +24,7 @@ class UpdatePathNewDependencyTest extends BrowserTestBase {
/**
* Tests that a module can add services that depend on new modules.
*/
- public function testUpdateNewDependency() {
+ public function testUpdateNewDependency(): void {
// The new_dependency_test before the update is just an empty info.yml file.
// The code of the new_dependency_test module is after the update and
// contains the dependency on the new_dependency_test_with_service module.
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestBaseFilledTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestBaseFilledTest.php
index 87bd43f3c79..47c93e107e6 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestBaseFilledTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestBaseFilledTest.php
@@ -36,7 +36,7 @@ class UpdatePathTestBaseFilledTest extends UpdatePathTestBase {
/**
* Tests that the content and configuration were properly updated.
*/
- public function testUpdatedSite() {
+ public function testUpdatedSite(): void {
$assert_session = $this->assertSession();
$this->runUpdates();
@@ -408,7 +408,7 @@ class UpdatePathTestBaseFilledTest extends UpdatePathTestBase {
/**
* Tests that the database was properly loaded.
*/
- public function testDatabaseProperlyLoaded() {
+ public function testDatabaseProperlyLoaded(): void {
$this->testDatabaseLoaded();
}
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestJavaScriptTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestJavaScriptTest.php
index 0b561800ea6..18e9adbefad 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestJavaScriptTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestJavaScriptTest.php
@@ -33,7 +33,7 @@ class UpdatePathTestJavaScriptTest extends BrowserTestBase {
*
* @see ::doPreUpdateTests
*/
- public function testJavaScriptLoading() {
+ public function testJavaScriptLoading(): void {
$this->runUpdates();
}
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathWithBrokenRoutingTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathWithBrokenRoutingTest.php
index fa82541d5d2..e61dad75c7c 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathWithBrokenRoutingTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathWithBrokenRoutingTest.php
@@ -32,7 +32,7 @@ class UpdatePathWithBrokenRoutingTest extends BrowserTestBase {
/**
* Tests running update.php with some form of broken routing.
*/
- public function testWithBrokenRouting() {
+ public function testWithBrokenRouting(): void {
// Simulate a broken router, and make sure the front page is
// inaccessible.
\Drupal::state()->set('update_script_test_broken_inbound', TRUE);
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateExceptionTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateExceptionTest.php
index 4102243c6be..814c02b9920 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateExceptionTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateExceptionTest.php
@@ -52,7 +52,7 @@ class UpdatePostUpdateExceptionTest extends BrowserTestBase {
/**
* Tests hook_post_update_NAME().
*/
- public function testPostUpdate() {
+ public function testPostUpdate(): void {
// There are expected to be failed updates.
$this->checkFailedUpdates = FALSE;
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateFailingTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateFailingTest.php
index 8c0dc5fd8dd..7eca9da31fd 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateFailingTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateFailingTest.php
@@ -52,7 +52,7 @@ class UpdatePostUpdateFailingTest extends BrowserTestBase {
/**
* Tests hook_post_update_NAME().
*/
- public function testPostUpdate() {
+ public function testPostUpdate(): void {
// There are expected to be failed updates.
$this->checkFailedUpdates = FALSE;
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateTest.php
index 70a353f0bbd..73aaabc8d65 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateTest.php
@@ -74,7 +74,7 @@ class UpdatePostUpdateTest extends BrowserTestBase {
/**
* Tests hook_post_update_NAME().
*/
- public function testPostUpdate() {
+ public function testPostUpdate(): void {
$this->runUpdates();
$this->assertSession()->responseContains('<h3>Update first</h3>');
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateRemovedPostUpdateTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateRemovedPostUpdateTest.php
index d4b35181d68..f4f3ca4ec37 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateRemovedPostUpdateTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateRemovedPostUpdateTest.php
@@ -73,7 +73,7 @@ class UpdateRemovedPostUpdateTest extends BrowserTestBase {
/**
* Tests hook_post_update_NAME().
*/
- public function testRemovedPostUpdate() {
+ public function testRemovedPostUpdate(): void {
// Mimic the behavior of ModuleInstaller::install().
$key_value = \Drupal::service('keyvalue');
$existing_updates = $key_value->get('post_update')->get('existing_updates', []);
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php
index 74ecc99e8b0..dd21a3dbe14 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php
@@ -57,7 +57,7 @@ class UpdateSchemaTest extends BrowserTestBase {
/**
* Tests that update hooks are properly run.
*/
- public function testUpdateHooks() {
+ public function testUpdateHooks(): void {
$connection = Database::getConnection();
/** @var \Drupal\Core\Update\UpdateHookRegistry $update_registry */
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php
index d0a10206585..430eb4fbe21 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php
@@ -79,7 +79,7 @@ class UpdateScriptTest extends BrowserTestBase {
/**
* Tests access to the update script.
*/
- public function testUpdateAccess() {
+ public function testUpdateAccess(): void {
// Try accessing update.php without the proper permission.
$regular_user = $this->drupalCreateUser();
$this->drupalLogin($regular_user);
@@ -128,7 +128,7 @@ class UpdateScriptTest extends BrowserTestBase {
/**
* Tests that requirements warnings and errors are correctly displayed.
*/
- public function testRequirements() {
+ public function testRequirements(): void {
$update_script_test_config = $this->config('update_script_test.settings');
$this->drupalLogin($this->updateUser);
@@ -507,7 +507,7 @@ class UpdateScriptTest extends BrowserTestBase {
/**
* Tests that orphan schemas are handled properly.
*/
- public function testOrphanedSchemaEntries() {
+ public function testOrphanedSchemaEntries(): void {
$this->drupalLogin($this->updateUser);
// Insert a bogus value into the system.schema key/value storage for a
@@ -654,7 +654,7 @@ class UpdateScriptTest extends BrowserTestBase {
/**
* Tests the effect of using the update script on the theme system.
*/
- public function testThemeSystem() {
+ public function testThemeSystem(): void {
// Since visiting update.php triggers a rebuild of the theme system from an
// unusual maintenance mode environment, we check that this rebuild did not
// put any incorrect information about the themes into the database.
@@ -668,7 +668,7 @@ class UpdateScriptTest extends BrowserTestBase {
/**
* Tests update.php when there are no updates to apply.
*/
- public function testNoUpdateFunctionality() {
+ public function testNoUpdateFunctionality(): void {
// Click through update.php with 'administer software updates' permission.
$this->drupalLogin($this->updateUser);
$this->drupalGet($this->updateUrl, ['external' => TRUE]);
@@ -699,7 +699,7 @@ class UpdateScriptTest extends BrowserTestBase {
/**
* Tests update.php after performing a successful update.
*/
- public function testSuccessfulUpdateFunctionality() {
+ public function testSuccessfulUpdateFunctionality(): void {
$initial_maintenance_mode = $this->container->get('state')->get('system.maintenance_mode');
$this->assertNull($initial_maintenance_mode, 'Site is not in maintenance mode.');
$this->runUpdates($initial_maintenance_mode);
@@ -743,7 +743,7 @@ class UpdateScriptTest extends BrowserTestBase {
/**
* Tests update.php while in maintenance mode.
*/
- public function testMaintenanceModeUpdateFunctionality() {
+ public function testMaintenanceModeUpdateFunctionality(): void {
$this->container->get('state')
->set('system.maintenance_mode', TRUE);
$initial_maintenance_mode = $this->container->get('state')
@@ -758,7 +758,7 @@ class UpdateScriptTest extends BrowserTestBase {
/**
* Tests performing updates with update.php in a multilingual environment.
*/
- public function testSuccessfulMultilingualUpdateFunctionality() {
+ public function testSuccessfulMultilingualUpdateFunctionality(): void {
// Add some custom languages.
foreach (['aa', 'bb'] as $language_code) {
ConfigurableLanguage::create([
@@ -819,7 +819,7 @@ class UpdateScriptTest extends BrowserTestBase {
/**
* Tests maintenance mode link on update.php.
*/
- public function testMaintenanceModeLink() {
+ public function testMaintenanceModeLink(): void {
$full_admin_user = $this->drupalCreateUser([
'administer software updates',
'access administration pages',
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php
index 0f740b078bf..2e6163c7e4e 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php
@@ -53,7 +53,7 @@ class UpdatesWith7xTest extends BrowserTestBase {
]);
}
- public function testWith7x() {
+ public function testWith7x(): void {
/** @var \Drupal\Core\Update\UpdateHookRegistry $update_registry */
$update_registry = \Drupal::service('update.update_hook_registry');
diff --git a/core/modules/system/tests/src/FunctionalJavascript/CopyFieldValueTest.php b/core/modules/system/tests/src/FunctionalJavascript/CopyFieldValueTest.php
index 1e524de1d02..38728c38455 100644
--- a/core/modules/system/tests/src/FunctionalJavascript/CopyFieldValueTest.php
+++ b/core/modules/system/tests/src/FunctionalJavascript/CopyFieldValueTest.php
@@ -28,7 +28,7 @@ class CopyFieldValueTest extends WebDriverTestBase {
/**
* Tests copy field value JavaScript functionality.
*/
- public function testCopyFieldValue() {
+ public function testCopyFieldValue(): void {
$this->drupalGet('/system-test/copy-field-value-test-form');
$page = $this->getSession()->getPage();
$source_field_selector = 'edit-source-field';
diff --git a/core/modules/system/tests/src/FunctionalJavascript/Form/ElementsTableSelectTest.php b/core/modules/system/tests/src/FunctionalJavascript/Form/ElementsTableSelectTest.php
index b395e562859..379856a5a1b 100644
--- a/core/modules/system/tests/src/FunctionalJavascript/Form/ElementsTableSelectTest.php
+++ b/core/modules/system/tests/src/FunctionalJavascript/Form/ElementsTableSelectTest.php
@@ -26,7 +26,7 @@ class ElementsTableSelectTest extends WebDriverTestBase {
/**
* Tests the presence of ajax functionality for all options.
*/
- public function testAjax() {
+ public function testAjax(): void {
// Test checkboxes (#multiple == TRUE).
$this->drupalGet('form_test/tableselect/multiple-true');
$session = $this->getSession();
@@ -65,7 +65,7 @@ class ElementsTableSelectTest extends WebDriverTestBase {
/**
* Tests table select with disabled rows.
*/
- public function testDisabledRows() {
+ public function testDisabledRows(): void {
// Asserts that a row number (1 based) is enabled.
$assert_row_enabled = function ($delta) {
$row = $this->assertSession()->elementExists('xpath', "//table/tbody/tr[$delta]");
diff --git a/core/modules/system/tests/src/FunctionalJavascript/Form/RebuildTest.php b/core/modules/system/tests/src/FunctionalJavascript/Form/RebuildTest.php
index 4fd1acb9dae..3858006154c 100644
--- a/core/modules/system/tests/src/FunctionalJavascript/Form/RebuildTest.php
+++ b/core/modules/system/tests/src/FunctionalJavascript/Form/RebuildTest.php
@@ -53,7 +53,7 @@ class RebuildTest extends WebDriverTestBase {
* The 'action' attribute of a form should not change after an Ajax submission
* followed by a non-Ajax submission, which triggers a validation error.
*/
- public function testPreserveFormActionAfterAJAX() {
+ public function testPreserveFormActionAfterAJAX(): void {
$page = $this->getSession()->getPage();
// Create a multi-valued field for 'page' nodes to use for Ajax testing.
$field_name = 'field_ajax_test';
diff --git a/core/modules/system/tests/src/FunctionalJavascript/Form/TriggeringElementTest.php b/core/modules/system/tests/src/FunctionalJavascript/Form/TriggeringElementTest.php
index 01db4e524f8..d07aea57549 100644
--- a/core/modules/system/tests/src/FunctionalJavascript/Form/TriggeringElementTest.php
+++ b/core/modules/system/tests/src/FunctionalJavascript/Form/TriggeringElementTest.php
@@ -30,7 +30,7 @@ class TriggeringElementTest extends WebDriverTestBase {
* information is included in the POST data, as is sometimes the case when
* the ENTER key is pressed in a textfield in Internet Explorer.
*/
- public function testNoButtonInfoInPost() {
+ public function testNoButtonInfoInPost(): void {
$path = '/form-test/clicked-button';
$form_html_id = 'form-test-clicked-button';
@@ -88,7 +88,7 @@ class TriggeringElementTest extends WebDriverTestBase {
* Test that the triggering element does not get set to a button with
* #access=FALSE.
*/
- public function testAttemptAccessControlBypass() {
+ public function testAttemptAccessControlBypass(): void {
$path = 'form-test/clicked-button';
$form_html_id = 'form-test-clicked-button';
diff --git a/core/modules/system/tests/src/FunctionalJavascript/FrameworkTest.php b/core/modules/system/tests/src/FunctionalJavascript/FrameworkTest.php
index 1f03dcb0114..0fd5f468fb1 100644
--- a/core/modules/system/tests/src/FunctionalJavascript/FrameworkTest.php
+++ b/core/modules/system/tests/src/FunctionalJavascript/FrameworkTest.php
@@ -26,7 +26,7 @@ class FrameworkTest extends WebDriverTestBase {
/**
* Tests that new JavaScript and CSS files are lazy-loaded on an AJAX request.
*/
- public function testLazyLoad() {
+ public function testLazyLoad(): void {
$expected = [
'setting_name' => 'ajax_forms_test_lazy_load_form_submit',
'setting_value' => 'executed',
@@ -86,7 +86,7 @@ class FrameworkTest extends WebDriverTestBase {
/**
* Tests that drupalSettings.currentPath is not updated on AJAX requests.
*/
- public function testCurrentPathChange() {
+ public function testCurrentPathChange(): void {
$this->drupalGet('ajax_forms_test_lazy_load_form');
$page = $this->getSession()->getPage();
$assert = $this->assertSession();
@@ -101,7 +101,7 @@ class FrameworkTest extends WebDriverTestBase {
/**
* Tests that overridden CSS files are not added during lazy load.
*/
- public function testLazyLoadOverriddenCSS() {
+ public function testLazyLoadOverriddenCSS(): void {
// The test_theme throws a few JavaScript errors. Since we're only
// interested in CSS for this test, we're not letting this test fail on
// those.
diff --git a/core/modules/system/tests/src/FunctionalJavascript/ModalRendererTest.php b/core/modules/system/tests/src/FunctionalJavascript/ModalRendererTest.php
index a5e609fd5b5..ab5735efc57 100644
--- a/core/modules/system/tests/src/FunctionalJavascript/ModalRendererTest.php
+++ b/core/modules/system/tests/src/FunctionalJavascript/ModalRendererTest.php
@@ -26,7 +26,7 @@ class ModalRendererTest extends WebDriverTestBase {
/**
* Tests that links respect 'data-dialog-renderer' attribute.
*/
- public function testModalRenderer() {
+ public function testModalRenderer(): void {
$session_assert = $this->assertSession();
$this->drupalGet('/dialog_renderer-test-links');
$this->clickLink('Normal Modal!');
@@ -103,7 +103,7 @@ class ModalRendererTest extends WebDriverTestBase {
/**
* Confirm focus management of a dialog openers in a dropbutton.
*/
- public function testOpenerInDropbutton() {
+ public function testOpenerInDropbutton(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/modules/system/tests/src/FunctionalJavascript/ModuleFilterTest.php b/core/modules/system/tests/src/FunctionalJavascript/ModuleFilterTest.php
index 308fa70a84c..96f877179e3 100644
--- a/core/modules/system/tests/src/FunctionalJavascript/ModuleFilterTest.php
+++ b/core/modules/system/tests/src/FunctionalJavascript/ModuleFilterTest.php
@@ -39,7 +39,7 @@ class ModuleFilterTest extends WebDriverTestBase {
/**
* Tests that filter results announcement has correct pluralization.
*/
- public function testModuleFilter() {
+ public function testModuleFilter(): void {
// Find the module filter field.
$this->drupalGet('admin/modules');
diff --git a/core/modules/system/tests/src/FunctionalJavascript/ModuleUninstallFilterTest.php b/core/modules/system/tests/src/FunctionalJavascript/ModuleUninstallFilterTest.php
index b4bb3718d44..e89ac08ec83 100644
--- a/core/modules/system/tests/src/FunctionalJavascript/ModuleUninstallFilterTest.php
+++ b/core/modules/system/tests/src/FunctionalJavascript/ModuleUninstallFilterTest.php
@@ -38,7 +38,7 @@ class ModuleUninstallFilterTest extends WebDriverTestBase {
/**
* Tests that correct module count is returned when list filtered.
*/
- public function testModuleUninstallFilter() {
+ public function testModuleUninstallFilter(): void {
// Find the module filter field.
$this->drupalGet('admin/modules/uninstall');
diff --git a/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php b/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php
index 959b42bea4c..aef99eb3901 100644
--- a/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php
+++ b/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php
@@ -37,7 +37,7 @@ class OffCanvasTest extends OffCanvasTestBase {
*
* @dataProvider themeDataProvider
*/
- public function testOffCanvasLinks($theme) {
+ public function testOffCanvasLinks($theme): void {
$this->enableTheme($theme);
$this->drupalGet('/off-canvas-test-links');
@@ -117,7 +117,7 @@ class OffCanvasTest extends OffCanvasTestBase {
/**
* Tests the body displacement behaves differently at a narrow width.
*/
- public function testNarrowWidth() {
+ public function testNarrowWidth(): void {
$narrow_width_breakpoint = 768;
$offset = 20;
$height = 800;
diff --git a/core/modules/system/tests/src/FunctionalJavascript/System/DateFormatTest.php b/core/modules/system/tests/src/FunctionalJavascript/System/DateFormatTest.php
index 0bc84181d10..d2ab2f4a744 100644
--- a/core/modules/system/tests/src/FunctionalJavascript/System/DateFormatTest.php
+++ b/core/modules/system/tests/src/FunctionalJavascript/System/DateFormatTest.php
@@ -40,7 +40,7 @@ class DateFormatTest extends WebDriverTestBase {
/**
* Tests XSS via date format configuration.
*/
- public function testDateFormatXss() {
+ public function testDateFormatXss(): void {
$page = $this->getSession()->getPage();
$assert = $this->assertSession();
diff --git a/core/modules/system/tests/src/FunctionalJavascript/ThemeSettingsFormTest.php b/core/modules/system/tests/src/FunctionalJavascript/ThemeSettingsFormTest.php
index 0b8da7ad444..41fc94d4f1e 100644
--- a/core/modules/system/tests/src/FunctionalJavascript/ThemeSettingsFormTest.php
+++ b/core/modules/system/tests/src/FunctionalJavascript/ThemeSettingsFormTest.php
@@ -42,7 +42,7 @@ class ThemeSettingsFormTest extends WebDriverTestBase {
*
* @dataProvider providerTestFormSettingsSubmissionHandler
*/
- public function testFormSettingsSubmissionHandler($theme) {
+ public function testFormSettingsSubmissionHandler($theme): void {
\Drupal::service('theme_installer')->install([$theme]);
diff --git a/core/modules/system/tests/src/Kernel/Action/ActionTest.php b/core/modules/system/tests/src/Kernel/Action/ActionTest.php
index 9a941fb5067..43e24cce4f1 100644
--- a/core/modules/system/tests/src/Kernel/Action/ActionTest.php
+++ b/core/modules/system/tests/src/Kernel/Action/ActionTest.php
@@ -42,7 +42,7 @@ class ActionTest extends KernelTestBase {
/**
* Tests the functionality of test actions.
*/
- public function testOperations() {
+ public function testOperations(): void {
// Test that actions can be discovered.
$definitions = $this->actionManager->getDefinitions();
// Verify that the action definitions are found.
@@ -77,7 +77,7 @@ class ActionTest extends KernelTestBase {
/**
* Tests the dependency calculation of actions.
*/
- public function testDependencies() {
+ public function testDependencies(): void {
// Create a new action that depends on a user role.
$action = Action::create([
'id' => 'user_add_role_action.' . RoleInterface::ANONYMOUS_ID,
diff --git a/core/modules/system/tests/src/Kernel/Block/SystemMenuBlockTest.php b/core/modules/system/tests/src/Kernel/Block/SystemMenuBlockTest.php
index 20efaa45270..af4d0ba8a2e 100644
--- a/core/modules/system/tests/src/Kernel/Block/SystemMenuBlockTest.php
+++ b/core/modules/system/tests/src/Kernel/Block/SystemMenuBlockTest.php
@@ -153,7 +153,7 @@ class SystemMenuBlockTest extends KernelTestBase {
/**
* Tests calculation of a system menu block's configuration dependencies.
*/
- public function testSystemMenuBlockConfigDependencies() {
+ public function testSystemMenuBlockConfigDependencies(): void {
$block = Block::create([
'plugin' => 'system_menu_block:' . $this->menu->id(),
@@ -180,7 +180,7 @@ class SystemMenuBlockTest extends KernelTestBase {
/**
* Tests the config start level and depth.
*/
- public function testConfigLevelDepth() {
+ public function testConfigLevelDepth(): void {
// Helper function to generate a configured block instance.
$place_block = function ($level, $depth) {
return $this->blockManager->createInstance('system_menu_block:' . $this->menu->id(), [
@@ -291,7 +291,7 @@ class SystemMenuBlockTest extends KernelTestBase {
*
* @dataProvider configExpandedTestCases
*/
- public function testConfigExpanded($active_route, $menu_block_level, $expected_items) {
+ public function testConfigExpanded($active_route, $menu_block_level, $expected_items): void {
$block = $this->blockManager->createInstance('system_menu_block:' . $this->menu->id(), [
'region' => 'footer',
'id' => 'machine_name',
diff --git a/core/modules/system/tests/src/Kernel/Common/AddFeedTest.php b/core/modules/system/tests/src/Kernel/Common/AddFeedTest.php
index f4ab0e8bf39..98bd03714d5 100644
--- a/core/modules/system/tests/src/Kernel/Common/AddFeedTest.php
+++ b/core/modules/system/tests/src/Kernel/Common/AddFeedTest.php
@@ -22,7 +22,7 @@ class AddFeedTest extends KernelTestBase {
/**
* Tests attaching feeds with paths, URLs, and titles.
*/
- public function testBasicFeedAddNoTitle() {
+ public function testBasicFeedAddNoTitle(): void {
$path = $this->randomMachineName(12);
$external_url = 'http://' . $this->randomMachineName(12) . '/' . $this->randomMachineName(12);
$fully_qualified_local_url = Url::fromUri('base:' . $this->randomMachineName(12), ['absolute' => TRUE])->toString();
@@ -89,7 +89,7 @@ class AddFeedTest extends KernelTestBase {
*
* @see https://www.drupal.org/node/1211668
*/
- public function testFeedIconEscaping() {
+ public function testFeedIconEscaping(): void {
$variables = [
'#theme' => 'feed_icon',
'#url' => 'node',
diff --git a/core/modules/system/tests/src/Kernel/Common/FormElementsRenderTest.php b/core/modules/system/tests/src/Kernel/Common/FormElementsRenderTest.php
index 3563199bf87..a0fb74c0167 100644
--- a/core/modules/system/tests/src/Kernel/Common/FormElementsRenderTest.php
+++ b/core/modules/system/tests/src/Kernel/Common/FormElementsRenderTest.php
@@ -25,7 +25,7 @@ class FormElementsRenderTest extends KernelTestBase {
*
* @see \Drupal\Core\Form\FormBuilderInterface::doBuildForm()
*/
- public function testDrupalRenderFormElements() {
+ public function testDrupalRenderFormElements(): void {
// Define a series of form elements.
$element = [
'#type' => 'button',
diff --git a/core/modules/system/tests/src/Kernel/Common/PageRenderTest.php b/core/modules/system/tests/src/Kernel/Common/PageRenderTest.php
index 16bcbff03c6..95f0d7f139c 100644
--- a/core/modules/system/tests/src/Kernel/Common/PageRenderTest.php
+++ b/core/modules/system/tests/src/Kernel/Common/PageRenderTest.php
@@ -18,7 +18,7 @@ class PageRenderTest extends KernelTestBase {
/**
* Tests hook_page_attachments() exceptions.
*/
- public function testHookPageAttachmentsExceptions() {
+ public function testHookPageAttachmentsExceptions(): void {
$this->enableModules(['common_test', 'system']);
$this->assertPageRenderHookExceptions('common_test', 'hook_page_attachments');
@@ -27,7 +27,7 @@ class PageRenderTest extends KernelTestBase {
/**
* Tests hook_page_attachments_alter() exceptions.
*/
- public function testHookPageAlter() {
+ public function testHookPageAlter(): void {
$this->enableModules(['common_test', 'system']);
$this->assertPageRenderHookExceptions('common_test', 'hook_page_attachments_alter');
diff --git a/core/modules/system/tests/src/Kernel/Common/SystemListingTest.php b/core/modules/system/tests/src/Kernel/Common/SystemListingTest.php
index d236d5417c4..f7b1e192d02 100644
--- a/core/modules/system/tests/src/Kernel/Common/SystemListingTest.php
+++ b/core/modules/system/tests/src/Kernel/Common/SystemListingTest.php
@@ -17,7 +17,7 @@ class SystemListingTest extends KernelTestBase {
/**
* Tests that files in different directories take precedence as expected.
*/
- public function testDirectoryPrecedence() {
+ public function testDirectoryPrecedence(): void {
// Define the module files we will search for, and the directory precedence
// we expect.
$expected_directories = [
@@ -55,7 +55,7 @@ class SystemListingTest extends KernelTestBase {
/**
* Tests that directories matching file_scan_ignore_directories are ignored.
*/
- public function testFileScanIgnoreDirectory() {
+ public function testFileScanIgnoreDirectory(): void {
$listing = new ExtensionDiscovery($this->root, FALSE);
$listing->setProfileDirectories(['core/profiles/testing']);
$files = $listing->scan('module');
diff --git a/core/modules/system/tests/src/Kernel/Common/UrlTest.php b/core/modules/system/tests/src/Kernel/Common/UrlTest.php
index 291ea6e3a39..43644fac54a 100644
--- a/core/modules/system/tests/src/Kernel/Common/UrlTest.php
+++ b/core/modules/system/tests/src/Kernel/Common/UrlTest.php
@@ -27,7 +27,7 @@ class UrlTest extends KernelTestBase {
/**
* Confirms that invalid URLs are filtered in link generating functions.
*/
- public function testLinkXSS() {
+ public function testLinkXSS(): void {
// Test link generator.
$text = $this->randomMachineName();
$path = "<SCRIPT>alert('XSS')</SCRIPT>";
@@ -46,7 +46,7 @@ class UrlTest extends KernelTestBase {
/**
* Tests that #type=link bubbles outbound route/path processors' metadata.
*/
- public function testLinkBubbleableMetadata() {
+ public function testLinkBubbleableMetadata(): void {
\Drupal::service('module_installer')->install(['user']);
$cases = [
@@ -76,7 +76,7 @@ class UrlTest extends KernelTestBase {
/**
* Tests that default and custom attributes are handled correctly on links.
*/
- public function testLinkAttributes() {
+ public function testLinkAttributes(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
@@ -129,7 +129,7 @@ class UrlTest extends KernelTestBase {
/**
* Tests that link functions support render arrays as 'text'.
*/
- public function testLinkRenderArrayText() {
+ public function testLinkRenderArrayText(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
@@ -182,7 +182,7 @@ class UrlTest extends KernelTestBase {
/**
* Tests UrlHelper::filterQueryParameters().
*/
- public function testDrupalGetQueryParameters() {
+ public function testDrupalGetQueryParameters(): void {
$original = [
'a' => 1,
'b' => [
@@ -218,7 +218,7 @@ class UrlTest extends KernelTestBase {
/**
* Tests UrlHelper::parse().
*/
- public function testDrupalParseUrl() {
+ public function testDrupalParseUrl(): void {
// Relative, absolute, and external URLs, without/with explicit script path,
// without/with Drupal path.
foreach (['', '/', 'https://www.drupal.org/'] as $absolute) {
@@ -256,7 +256,7 @@ class UrlTest extends KernelTestBase {
/**
* Tests external URL handling.
*/
- public function testExternalUrls() {
+ public function testExternalUrls(): void {
$test_url = 'https://www.drupal.org/';
// Verify external URL can contain a fragment.
diff --git a/core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php b/core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php
index 2259e64b8e6..d737fe01017 100644
--- a/core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php
+++ b/core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php
@@ -53,7 +53,7 @@ class DateFormatAccessControlHandlerTest extends KernelTestBase {
* @covers ::checkCreateAccess
* @dataProvider testAccessProvider
*/
- public function testAccess($permissions, $which_entity, $view_label_access_result, $view_access_result, $update_access_result, $delete_access_result, $create_access_result) {
+ public function testAccess($permissions, $which_entity, $view_label_access_result, $view_access_result, $update_access_result, $delete_access_result, $create_access_result): void {
$user = $this->drupalCreateUser($permissions);
diff --git a/core/modules/system/tests/src/Kernel/DecoratedServiceTest.php b/core/modules/system/tests/src/Kernel/DecoratedServiceTest.php
index fbff3b83a0e..6df2d23e522 100644
--- a/core/modules/system/tests/src/Kernel/DecoratedServiceTest.php
+++ b/core/modules/system/tests/src/Kernel/DecoratedServiceTest.php
@@ -22,7 +22,7 @@ class DecoratedServiceTest extends KernelTestBase {
/**
* Check that decorated services keep their original service ID.
*/
- public function testDecoratedServiceId() {
+ public function testDecoratedServiceId(): void {
// Service decorated once.
$test_service = $this->container->get('test_service');
$this->assertEquals('test_service', $this->container->get(ReverseContainer::class)->getId($test_service));
diff --git a/core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php b/core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php
index 7666503a81a..d3405e5279a 100644
--- a/core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php
+++ b/core/modules/system/tests/src/Kernel/Entity/ConfigEntityImportTest.php
@@ -38,7 +38,7 @@ class ConfigEntityImportTest extends KernelTestBase {
/**
* Runs test methods for each module within a single test run.
*/
- public function testConfigUpdateImport() {
+ public function testConfigUpdateImport(): void {
$this->installConfig(['block', 'filter', 'image']);
$this->container->get('theme_installer')->install(['olivero']);
$config_storage = $this->container->get('config.storage');
diff --git a/core/modules/system/tests/src/Kernel/Entity/EntityLabelTest.php b/core/modules/system/tests/src/Kernel/Entity/EntityLabelTest.php
index e3f84c1ee82..3f29865ac95 100644
--- a/core/modules/system/tests/src/Kernel/Entity/EntityLabelTest.php
+++ b/core/modules/system/tests/src/Kernel/Entity/EntityLabelTest.php
@@ -17,7 +17,7 @@ class EntityLabelTest extends KernelTestBase {
/**
* Tests that entity type labels use sentence-case.
*/
- public function testEntityLabelCasing() {
+ public function testEntityLabelCasing(): void {
$base_directory = $this->root . '/core/modules/';
$modules = scandir($base_directory);
$paths = [];
diff --git a/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php b/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php
index b8ef9a7c43c..de8f1b0ac69 100644
--- a/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php
+++ b/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php
@@ -113,7 +113,7 @@ class EntityReferenceSelectionReferenceableTest extends KernelTestBase {
*
* @dataProvider providerTestCases
*/
- public function testReferenceablesWithNoLabelKey($match, $match_operator, $limit, $count_limited, array $items, $count_all) {
+ public function testReferenceablesWithNoLabelKey($match, $match_operator, $limit, $count_limited, array $items, $count_all): void {
// Test ::getReferenceableEntities().
$referenceables = $this->selectionHandler->getReferenceableEntities($match, $match_operator, $limit);
diff --git a/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php b/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
index 864c9a1a7a2..53f9b662fb9 100644
--- a/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
+++ b/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
@@ -26,7 +26,7 @@ class ModuleHandlerTest extends KernelTestBase {
/**
* The basic functionality of retrieving enabled modules.
*/
- public function testModuleList() {
+ public function testModuleList(): void {
$module_list = ['system'];
$database_module = \Drupal::database()->getProvider();
if ($database_module !== 'core') {
@@ -87,7 +87,7 @@ class ModuleHandlerTest extends KernelTestBase {
* @see module_test_system_info_alter()
* @see https://www.drupal.org/files/issues/dep.gv__0.png
*/
- public function testDependencyResolution() {
+ public function testDependencyResolution(): void {
$this->enableModules(['module_test']);
$this->assertTrue($this->moduleHandler()->moduleExists('module_test'), 'Test module is enabled.');
@@ -167,7 +167,7 @@ class ModuleHandlerTest extends KernelTestBase {
/**
* Tests uninstalling a module installed by a profile.
*/
- public function testUninstallProfileDependency() {
+ public function testUninstallProfileDependency(): void {
$profile = 'testing_install_profile_dependencies';
$dependency = 'dblog';
$non_dependency = 'ban';
@@ -227,7 +227,7 @@ class ModuleHandlerTest extends KernelTestBase {
/**
* Tests that a profile can supply only real dependencies.
*/
- public function testProfileAllDependencies() {
+ public function testProfileAllDependencies(): void {
$profile = 'testing_install_profile_all_dependencies';
$dependencies = ['dblog', 'ban'];
$this->setInstallProfile($profile);
@@ -260,7 +260,7 @@ class ModuleHandlerTest extends KernelTestBase {
/**
* Tests uninstalling a module that has content.
*/
- public function testUninstallContentDependency() {
+ public function testUninstallContentDependency(): void {
$this->enableModules(['module_test', 'entity_test', 'text', 'user', 'help']);
$this->assertTrue($this->moduleHandler()->moduleExists('entity_test'), 'Test module is enabled.');
$this->assertTrue($this->moduleHandler()->moduleExists('module_test'), 'Test module is enabled.');
@@ -315,7 +315,7 @@ class ModuleHandlerTest extends KernelTestBase {
/**
* Tests whether the correct module metadata is returned.
*/
- public function testModuleMetaData() {
+ public function testModuleMetaData(): void {
// Generate the list of available modules.
$modules = $this->container->get('extension.list.module')->getList();
// Check that the mtime field exists for the system module.
@@ -330,7 +330,7 @@ class ModuleHandlerTest extends KernelTestBase {
/**
* Tests whether module-provided stream wrappers are registered properly.
*/
- public function testModuleStreamWrappers() {
+ public function testModuleStreamWrappers(): void {
// file_test.module provides (among others) a 'dummy' stream wrapper.
// Verify that it is not registered yet to prevent false positives.
$stream_wrappers = \Drupal::service('stream_wrapper_manager')->getWrappers();
@@ -349,7 +349,7 @@ class ModuleHandlerTest extends KernelTestBase {
/**
* Tests whether the correct theme metadata is returned.
*/
- public function testThemeMetaData() {
+ public function testThemeMetaData(): void {
// Generate the list of available themes.
$themes = \Drupal::service('extension.list.theme')->reset()->getList();
// Check that the mtime field exists for the olivero theme.
diff --git a/core/modules/system/tests/src/Kernel/Form/ElementsFieldsetTest.php b/core/modules/system/tests/src/Kernel/Form/ElementsFieldsetTest.php
index 5de078c15fe..732268ccb9d 100644
--- a/core/modules/system/tests/src/Kernel/Form/ElementsFieldsetTest.php
+++ b/core/modules/system/tests/src/Kernel/Form/ElementsFieldsetTest.php
@@ -111,7 +111,7 @@ class ElementsFieldsetTest extends KernelTestBase implements FormInterface {
/**
* Tests different display options for fieldset element descriptions.
*/
- public function testFieldsetDescriptions() {
+ public function testFieldsetDescriptions(): void {
$form_state = new FormState();
$form = \Drupal::formBuilder()->getForm($this);
$this->render($form);
diff --git a/core/modules/system/tests/src/Kernel/Form/FileElementTest.php b/core/modules/system/tests/src/Kernel/Form/FileElementTest.php
index 522c03fec02..b4b16f9f3e2 100644
--- a/core/modules/system/tests/src/Kernel/Form/FileElementTest.php
+++ b/core/modules/system/tests/src/Kernel/Form/FileElementTest.php
@@ -22,7 +22,7 @@ class FileElementTest extends KernelTestBase {
/**
* Tests that file elements are built and processed correctly.
*/
- public function testFileElement() {
+ public function testFileElement(): void {
$form = $this->container->get('form_builder')
->getForm(FormTestFileForm::class);
diff --git a/core/modules/system/tests/src/Kernel/Form/FormElementLabelTest.php b/core/modules/system/tests/src/Kernel/Form/FormElementLabelTest.php
index 56315d685c4..e8f3d1f68f8 100644
--- a/core/modules/system/tests/src/Kernel/Form/FormElementLabelTest.php
+++ b/core/modules/system/tests/src/Kernel/Form/FormElementLabelTest.php
@@ -22,7 +22,7 @@ class FormElementLabelTest extends KernelTestBase {
/**
* Ensures that attributes can be placed for form element label.
*/
- public function testAttributes() {
+ public function testAttributes(): void {
$render_array = [
'#type' => 'label',
'#attributes' => ['class' => ['kitten']],
diff --git a/core/modules/system/tests/src/Kernel/Form/FormElementMaxlengthTest.php b/core/modules/system/tests/src/Kernel/Form/FormElementMaxlengthTest.php
index 95e6ceec948..ef0fcea6fed 100644
--- a/core/modules/system/tests/src/Kernel/Form/FormElementMaxlengthTest.php
+++ b/core/modules/system/tests/src/Kernel/Form/FormElementMaxlengthTest.php
@@ -64,7 +64,7 @@ class FormElementMaxlengthTest extends KernelTestBase implements FormInterface {
/**
* Ensures maxlength attribute can be used in compatible elements.
*/
- public function testAttributes() {
+ public function testAttributes(): void {
/** @var \Drupal\Core\Form\FormBuilderInterface $form_builder */
$form_builder = $this->container->get('form_builder');
diff --git a/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php b/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php
index dcda4519e10..a203f0fbf9c 100644
--- a/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php
+++ b/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php
@@ -24,7 +24,7 @@ class ProgrammaticTest extends KernelTestBase {
/**
* Tests the programmatic form submission workflow.
*/
- public function testSubmissionWorkflow() {
+ public function testSubmissionWorkflow(): void {
// Backup the current batch status and reset it to avoid conflicts while
// processing the dummy form submit handler.
$current_batch = $batch =& batch_get();
@@ -91,7 +91,7 @@ class ProgrammaticTest extends KernelTestBase {
/**
* Tests the programmed_bypass_access_check flag.
*/
- public function testProgrammaticAccessBypass() {
+ public function testProgrammaticAccessBypass(): void {
$form_state = (new FormState())->setValues([
'textfield' => 'dummy value',
'field_restricted' => 'dummy value',
diff --git a/core/modules/system/tests/src/Kernel/Installer/InstallTranslationFilePatternTest.php b/core/modules/system/tests/src/Kernel/Installer/InstallTranslationFilePatternTest.php
index 9ac46ee2a2b..619f7744ec1 100644
--- a/core/modules/system/tests/src/Kernel/Installer/InstallTranslationFilePatternTest.php
+++ b/core/modules/system/tests/src/Kernel/Installer/InstallTranslationFilePatternTest.php
@@ -42,7 +42,7 @@ class InstallTranslationFilePatternTest extends KernelTestBase {
/**
* @dataProvider providerValidTranslationFiles
*/
- public function testFilesPatternValid($langcode, $filename) {
+ public function testFilesPatternValid($langcode, $filename): void {
$pattern = $this->filePatternMethod->invoke($this->fileTranslation, $langcode);
$this->assertNotEmpty(preg_match($pattern, $filename));
}
@@ -61,7 +61,7 @@ class InstallTranslationFilePatternTest extends KernelTestBase {
/**
* @dataProvider providerInvalidTranslationFiles
*/
- public function testFilesPatternInvalid($langcode, $filename) {
+ public function testFilesPatternInvalid($langcode, $filename): void {
$pattern = $this->filePatternMethod->invoke($this->fileTranslation, $langcode);
$this->assertEmpty(preg_match($pattern, $filename));
}
diff --git a/core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php b/core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php
index 97dd7a683e0..8f385c45e48 100644
--- a/core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php
+++ b/core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php
@@ -22,7 +22,7 @@ class InstallerDependenciesResolutionTest extends KernelTestBase {
/**
* Verifies that the exception message in the profile step is correct.
*/
- public function testDependenciesResolution() {
+ public function testDependenciesResolution(): void {
// Prime the \Drupal\Core\Extension\ExtensionList::getPathname static cache
// with the location of the testing profile as it is not the currently
// active profile and we don't yet have any cached way to retrieve its
diff --git a/core/modules/system/tests/src/Kernel/Installer/UninstallKernelTest.php b/core/modules/system/tests/src/Kernel/Installer/UninstallKernelTest.php
index 38b860e6e18..37b4911a569 100644
--- a/core/modules/system/tests/src/Kernel/Installer/UninstallKernelTest.php
+++ b/core/modules/system/tests/src/Kernel/Installer/UninstallKernelTest.php
@@ -43,7 +43,7 @@ class UninstallKernelTest extends KernelTestBase {
/**
* Tests uninstalling media and file modules.
*/
- public function testUninstallMedia() {
+ public function testUninstallMedia(): void {
// Media creates a file field that is removed on uninstall, ensure that it
// is fully deleted (as it is empty) and that file then can be uninstalled
// as well.
@@ -54,7 +54,7 @@ class UninstallKernelTest extends KernelTestBase {
/**
* Tests uninstalling a module with a plugin cache clearer service.
*/
- public function testUninstallPluginCacheClear() {
+ public function testUninstallPluginCacheClear(): void {
\Drupal::service('module_installer')->install(['module_test']);
$this->assertFalse($this->container->get('state')->get(PluginManagerCacheClearer::class));
\Drupal::service('module_installer')->install(['dblog']);
diff --git a/core/modules/system/tests/src/Kernel/Mail/MailTest.php b/core/modules/system/tests/src/Kernel/Mail/MailTest.php
index e688d3fe4b2..5e6f1d2f519 100644
--- a/core/modules/system/tests/src/Kernel/Mail/MailTest.php
+++ b/core/modules/system/tests/src/Kernel/Mail/MailTest.php
@@ -56,7 +56,7 @@ class MailTest extends KernelTestBase {
/**
* Assert that the pluggable mail system is functional.
*/
- public function testPluggableFramework() {
+ public function testPluggableFramework(): void {
// Switch mail backends.
$this->configureDefaultMailInterface('test_php_mail_failure');
@@ -83,7 +83,7 @@ class MailTest extends KernelTestBase {
/**
* Assert that the pluggable mail system is functional.
*/
- public function testErrorMessageDisplay() {
+ public function testErrorMessageDisplay(): void {
// Switch mail backends.
$this->configureDefaultMailInterface('test_php_mail_failure');
@@ -103,7 +103,7 @@ class MailTest extends KernelTestBase {
*
* @see mail_cancel_test_mail_alter()
*/
- public function testCancelMessage() {
+ public function testCancelMessage(): void {
$language_interface = \Drupal::languageManager()->getCurrentLanguage();
// Reset the state variable that holds sent messages.
@@ -123,7 +123,7 @@ class MailTest extends KernelTestBase {
/**
* Checks the From: and Reply-to: headers.
*/
- public function testFromAndReplyToHeader() {
+ public function testFromAndReplyToHeader(): void {
$language = \Drupal::languageManager()->getCurrentLanguage();
// Reset the state variable that holds sent messages.
@@ -200,7 +200,7 @@ class MailTest extends KernelTestBase {
/**
* Checks that relative paths in mails are converted into absolute URLs.
*/
- public function testConvertRelativeUrlsIntoAbsolute() {
+ public function testConvertRelativeUrlsIntoAbsolute(): void {
$language_interface = \Drupal::languageManager()->getCurrentLanguage();
$this->configureDefaultMailInterface('test_html_mail_collector');
@@ -287,7 +287,7 @@ class MailTest extends KernelTestBase {
* By default Drupal uses relative paths for images and links. When sending
* emails, absolute paths should be used instead.
*/
- public function testRenderedElementsUseAbsolutePaths() {
+ public function testRenderedElementsUseAbsolutePaths(): void {
$language_interface = \Drupal::languageManager()->getCurrentLanguage();
$this->configureDefaultMailInterface('test_html_mail_collector');
diff --git a/core/modules/system/tests/src/Kernel/Menu/MenuStorageTest.php b/core/modules/system/tests/src/Kernel/Menu/MenuStorageTest.php
index b22983494fd..2d08283eb13 100644
--- a/core/modules/system/tests/src/Kernel/Menu/MenuStorageTest.php
+++ b/core/modules/system/tests/src/Kernel/Menu/MenuStorageTest.php
@@ -26,7 +26,7 @@ class MenuStorageTest extends KernelTestBase {
/**
* Tests MenuStorage::MAX_ID_LENGTH is enforced.
*/
- public function testMaxIdLengthException() {
+ public function testMaxIdLengthException(): void {
$id = $this->randomMachineName(MenuStorage::MAX_ID_LENGTH + 1);
$this->expectException(ConfigEntityIdLengthException::class);
$this->expectExceptionMessage(
diff --git a/core/modules/system/tests/src/Kernel/MenuAccessControlHandlerTest.php b/core/modules/system/tests/src/Kernel/MenuAccessControlHandlerTest.php
index e423f3ae220..797d97daeee 100644
--- a/core/modules/system/tests/src/Kernel/MenuAccessControlHandlerTest.php
+++ b/core/modules/system/tests/src/Kernel/MenuAccessControlHandlerTest.php
@@ -50,7 +50,7 @@ class MenuAccessControlHandlerTest extends KernelTestBase {
* @covers ::checkCreateAccess
* @dataProvider testAccessProvider
*/
- public function testAccess($permissions, $which_entity, $view_label_access_result, $view_access_result, $update_access_result, $delete_access_result, $create_access_result) {
+ public function testAccess($permissions, $which_entity, $view_label_access_result, $view_access_result, $update_access_result, $delete_access_result, $create_access_result): void {
$user = $this->drupalCreateUser($permissions);
$entity_values = ($which_entity === 'unlocked')
diff --git a/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateActionConfigsTest.php b/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateActionConfigsTest.php
index 29f69ddbd40..f8d51c46788 100644
--- a/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateActionConfigsTest.php
+++ b/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateActionConfigsTest.php
@@ -27,7 +27,7 @@ class MigrateActionConfigsTest extends MigrateDrupal6TestBase {
/**
* Tests migration of action variables to null.
*/
- public function testActionSettings() {
+ public function testActionSettings(): void {
$config = $this->config('action.settings');
$this->assertTrue($config->isNew());
}
diff --git a/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateActionsTest.php b/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateActionsTest.php
index a43cb560c33..262d3589a41 100644
--- a/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateActionsTest.php
+++ b/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateActionsTest.php
@@ -27,7 +27,7 @@ class MigrateActionsTest extends MigrateDrupal6TestBase {
/**
* Tests Drupal 6 action migration to Drupal 8.
*/
- public function testActions() {
+ public function testActions(): void {
// Test default actions.
$this->assertEntity('node_publish_action', 'Publish post', 'node', []);
$this->assertEntity('node_make_sticky_action', 'Make post sticky', 'node', []);
diff --git a/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateDateFormatTest.php b/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateDateFormatTest.php
index 269ee177ce8..0e9a469c2a8 100644
--- a/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateDateFormatTest.php
+++ b/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateDateFormatTest.php
@@ -26,7 +26,7 @@ class MigrateDateFormatTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 date formats to Drupal 8 migration.
*/
- public function testDateFormats() {
+ public function testDateFormats(): void {
$short_date_format = DateFormat::load('short');
$this->assertSame('\S\H\O\R\T m/d/Y - H:i', $short_date_format->getPattern());
diff --git a/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateMenuTest.php b/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateMenuTest.php
index d86fbdd4851..322ae15ccd8 100644
--- a/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateMenuTest.php
+++ b/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateMenuTest.php
@@ -26,7 +26,7 @@ class MigrateMenuTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 menu to Drupal 8 migration.
*/
- public function testMenu() {
+ public function testMenu(): void {
$navigation_menu = Menu::load('navigation');
$this->assertSame('navigation', $navigation_menu->id());
$this->assertSame('Navigation', $navigation_menu->label());
diff --git a/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateSystemConfigurationTest.php b/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateSystemConfigurationTest.php
index cc6f2372316..093504e218e 100644
--- a/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateSystemConfigurationTest.php
+++ b/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateSystemConfigurationTest.php
@@ -145,7 +145,7 @@ class MigrateSystemConfigurationTest extends MigrateDrupal6TestBase {
/**
* Tests that all expected configuration gets migrated.
*/
- public function testConfigurationMigration() {
+ public function testConfigurationMigration(): void {
foreach ($this->expectedConfig as $config_id => $values) {
$actual = \Drupal::config($config_id)->get();
unset($actual['_core']);
diff --git a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateActionConfigsTest.php b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateActionConfigsTest.php
index c6f85d1ab70..53b53ffdab9 100644
--- a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateActionConfigsTest.php
+++ b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateActionConfigsTest.php
@@ -27,7 +27,7 @@ class MigrateActionConfigsTest extends MigrateDrupal7TestBase {
/**
* Tests migration of action variables to null.
*/
- public function testActionSettings() {
+ public function testActionSettings(): void {
$config = $this->config('action.settings');
$this->assertTrue($config->isNew());
}
diff --git a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateActionsTest.php b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateActionsTest.php
index b2ea8fe1c96..60dda796a07 100644
--- a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateActionsTest.php
+++ b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateActionsTest.php
@@ -27,7 +27,7 @@ class MigrateActionsTest extends MigrateDrupal7TestBase {
/**
* Tests Drupal 7 action migration to Drupal 8.
*/
- public function testActions() {
+ public function testActions(): void {
// Test default actions.
$this->assertEntity('node_publish_action', 'Publish content', 'node', []);
$this->assertEntity('node_make_sticky_action', 'Make content sticky', 'node', []);
diff --git a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateGlobalThemeSettingsTest.php b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateGlobalThemeSettingsTest.php
index 22cd7319c95..04faddb611b 100644
--- a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateGlobalThemeSettingsTest.php
+++ b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateGlobalThemeSettingsTest.php
@@ -29,7 +29,7 @@ class MigrateGlobalThemeSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests migration of global theme settings to configuration.
*/
- public function testMigrateThemeSettings() {
+ public function testMigrateThemeSettings(): void {
$config = $this->config('system.theme.global');
$this->assertSame('image/png', $config->get('favicon.mimetype'));
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 8f013bb2216..2fa4229480a 100644
--- a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php
+++ b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php
@@ -48,7 +48,7 @@ class MigrateMenuTest extends MigrateDrupal7TestBase {
/**
* Tests the Drupal 7 menu to Drupal 8 migration.
*/
- public function testMenu() {
+ public function testMenu(): void {
$this->assertEntity('main', 'und', 'Main menu', 'The <em>Main</em> menu is used on many sites to show the major sections of the site, often in a top navigation bar.');
$this->assertEntity('admin', 'und', 'Management', 'The <em>Management</em> menu contains links for administrative tasks.');
$this->assertEntity('menu-test-menu', 'und', 'Test Menu', 'Test menu description.');
diff --git a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTranslationTest.php b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTranslationTest.php
index 29576a36233..e9502ea93c0 100644
--- a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTranslationTest.php
+++ b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTranslationTest.php
@@ -41,7 +41,7 @@ class MigrateMenuTranslationTest extends MigrateDrupal7TestBase {
/**
* Tests migration of menu translations.
*/
- public function testMenuTranslation() {
+ public function testMenuTranslation(): void {
$language_manager = \Drupal::service('language_manager');
$config_translation = $language_manager->getLanguageConfigOverride('is', 'system.menu.main');
diff --git a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateSystemConfigurationTest.php b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateSystemConfigurationTest.php
index 065dd471fcb..cfc950e81bf 100644
--- a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateSystemConfigurationTest.php
+++ b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateSystemConfigurationTest.php
@@ -177,7 +177,7 @@ class MigrateSystemConfigurationTest extends MigrateDrupal7TestBase {
/**
* Tests that all expected configuration gets migrated.
*/
- public function testConfigurationMigration() {
+ public function testConfigurationMigration(): void {
foreach ($this->expectedConfig as $config_id => $values) {
if ($config_id == 'system.mail') {
$actual = \Drupal::config($config_id)->getRawData();
diff --git a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateThemeSettingsTest.php b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateThemeSettingsTest.php
index 9cc874fe51c..4a8d49955a0 100644
--- a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateThemeSettingsTest.php
+++ b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateThemeSettingsTest.php
@@ -27,7 +27,7 @@ class MigrateThemeSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests migration of theme settings to variables to configuration.
*/
- public function testMigrateThemeSettings() {
+ public function testMigrateThemeSettings(): void {
$config = $this->config('olivero.settings');
$this->assertSame('', $config->get('favicon.path'));
diff --git a/core/modules/system/tests/src/Kernel/Module/InstallTest.php b/core/modules/system/tests/src/Kernel/Module/InstallTest.php
index 6f392e43663..dc95d49e1a3 100644
--- a/core/modules/system/tests/src/Kernel/Module/InstallTest.php
+++ b/core/modules/system/tests/src/Kernel/Module/InstallTest.php
@@ -125,7 +125,7 @@ class InstallTest extends KernelTestBase {
/**
* Tests installing a module with the same name as an enabled theme.
*/
- public function testInstallModuleSameNameAsTheme() {
+ public function testInstallModuleSameNameAsTheme(): void {
$name = 'name_collision_test';
// Install and uninstall the module.
diff --git a/core/modules/system/tests/src/Kernel/PermissionsTest.php b/core/modules/system/tests/src/Kernel/PermissionsTest.php
index 2470665d2ff..5f03065ecab 100644
--- a/core/modules/system/tests/src/Kernel/PermissionsTest.php
+++ b/core/modules/system/tests/src/Kernel/PermissionsTest.php
@@ -22,7 +22,7 @@ class PermissionsTest extends KernelTestBase {
/**
* Tests the 'access content' permission is provided by the System module.
*/
- public function testAccessContentPermission() {
+ public function testAccessContentPermission(): void {
// Uninstalling modules requires the users_data table to exist.
$this->installSchema('user', ['users_data']);
diff --git a/core/modules/system/tests/src/Kernel/PhpStorage/PhpStorageFactoryTest.php b/core/modules/system/tests/src/Kernel/PhpStorage/PhpStorageFactoryTest.php
index 57db17ac234..219ded03f30 100644
--- a/core/modules/system/tests/src/Kernel/PhpStorage/PhpStorageFactoryTest.php
+++ b/core/modules/system/tests/src/Kernel/PhpStorage/PhpStorageFactoryTest.php
@@ -34,7 +34,7 @@ class PhpStorageFactoryTest extends KernelTestBase {
/**
* Tests the get() method with no settings.
*/
- public function testGetNoSettings() {
+ public function testGetNoSettings(): void {
$php = PhpStorageFactory::get('test');
// This should be the default class used.
$this->assertInstanceOf(MTimeProtectedFileStorage::class, $php);
@@ -43,7 +43,7 @@ class PhpStorageFactoryTest extends KernelTestBase {
/**
* Tests the get() method using the 'default' settings.
*/
- public function testGetDefault() {
+ public function testGetDefault(): void {
$this->setSettings();
$php = PhpStorageFactory::get('test');
$this->assertInstanceOf(MockPhpStorage::class, $php);
@@ -52,7 +52,7 @@ class PhpStorageFactoryTest extends KernelTestBase {
/**
* Tests the get() method with overridden settings.
*/
- public function testGetOverride() {
+ public function testGetOverride(): void {
$this->setSettings('test');
$php = PhpStorageFactory::get('test');
// The FileReadOnlyStorage should be used from settings.
diff --git a/core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php b/core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php
index f0068998b85..8856055b8ce 100644
--- a/core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php
+++ b/core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php
@@ -25,7 +25,7 @@ class DbCommandBaseTest extends KernelTestBase {
/**
* Tests specifying a database key.
*/
- public function testSpecifyDatabaseKey() {
+ public function testSpecifyDatabaseKey(): void {
$command = new DbCommandBaseTester();
$command_tester = new CommandTester($command);
@@ -41,7 +41,7 @@ class DbCommandBaseTest extends KernelTestBase {
/**
* Invalid database names will throw a useful exception.
*/
- public function testSpecifyDatabaseDoesNotExist() {
+ public function testSpecifyDatabaseDoesNotExist(): void {
$command = new DbCommandBaseTester();
$command_tester = new CommandTester($command);
$command_tester->execute([
@@ -54,7 +54,7 @@ class DbCommandBaseTest extends KernelTestBase {
/**
* Tests supplying database connection as a URL.
*/
- public function testSpecifyDbUrl() {
+ public function testSpecifyDbUrl(): void {
$command = new DbCommandBaseTester();
$command_tester = new CommandTester($command);
$command_tester->execute([
@@ -72,7 +72,7 @@ class DbCommandBaseTest extends KernelTestBase {
/**
* Tests specifying a prefix for different connections.
*/
- public function testPrefix() {
+ public function testPrefix(): void {
if (Database::getConnection()->driver() == 'sqlite') {
$this->markTestSkipped('SQLITE modifies the prefixes so we cannot effectively test it');
}
diff --git a/core/modules/system/tests/src/Kernel/Scripts/DbImportCommandTest.php b/core/modules/system/tests/src/Kernel/Scripts/DbImportCommandTest.php
index ce226ffe6bd..4f158bbc9a7 100644
--- a/core/modules/system/tests/src/Kernel/Scripts/DbImportCommandTest.php
+++ b/core/modules/system/tests/src/Kernel/Scripts/DbImportCommandTest.php
@@ -61,7 +61,7 @@ class DbImportCommandTest extends KernelTestBase {
*
* @requires extension pdo_sqlite
*/
- public function testDbImportCommand() {
+ public function testDbImportCommand(): void {
$connection_info = [
'driver' => 'sqlite',
'database' => ':memory:',
diff --git a/core/modules/system/tests/src/Kernel/Scripts/DbToolsApplicationTest.php b/core/modules/system/tests/src/Kernel/Scripts/DbToolsApplicationTest.php
index 3928ce1fd74..55d28f4da4a 100644
--- a/core/modules/system/tests/src/Kernel/Scripts/DbToolsApplicationTest.php
+++ b/core/modules/system/tests/src/Kernel/Scripts/DbToolsApplicationTest.php
@@ -20,7 +20,7 @@ class DbToolsApplicationTest extends KernelTestBase {
/**
* Tests that the dump command is correctly registered.
*/
- public function testDumpCommandRegistration() {
+ public function testDumpCommandRegistration(): void {
$application = new DbToolsApplication();
$command = $application->find('dump');
$this->assertInstanceOf('\Drupal\Core\Command\DbDumpCommand', $command);
@@ -30,7 +30,7 @@ class DbToolsApplicationTest extends KernelTestBase {
/**
* Tests that the dump command is correctly registered.
*/
- public function testImportCommandRegistration() {
+ public function testImportCommandRegistration(): void {
$application = new DbToolsApplication();
$command = $application->find('import');
$this->assertInstanceOf('\Drupal\Core\Command\DbImportCommand', $command);
diff --git a/core/modules/system/tests/src/Kernel/System/CronQueueTest.php b/core/modules/system/tests/src/Kernel/System/CronQueueTest.php
index 8b2dca9a2cf..7190afc2af6 100644
--- a/core/modules/system/tests/src/Kernel/System/CronQueueTest.php
+++ b/core/modules/system/tests/src/Kernel/System/CronQueueTest.php
@@ -98,7 +98,7 @@ class CronQueueTest extends KernelTestBase {
/**
* Tests that DelayedRequeueException behaves as expected when running cron.
*/
- public function testDelayException() {
+ public function testDelayException(): void {
$database = $this->container->get('queue')->get('cron_queue_test_database_delay_exception');
$memory = $this->container->get('queue')->get('cron_queue_test_memory_delay_exception');
@@ -142,7 +142,7 @@ class CronQueueTest extends KernelTestBase {
/**
* Tests that leases are expiring correctly, also within the same request.
*/
- public function testLeaseTime() {
+ public function testLeaseTime(): void {
$queue = $this->container->get('queue')->get('cron_queue_test_lease_time');
$queue->createItem([$this->randomMachineName() => $this->randomMachineName()]);
// Run initial queue job and ensure lease time variable is initialized.
@@ -174,7 +174,7 @@ class CronQueueTest extends KernelTestBase {
*
* @see \Drupal\cron_queue_test\Plugin\QueueWorker\CronQueueTestException
*/
- public function testUncaughtExceptions() {
+ public function testUncaughtExceptions(): void {
$this->logger->log(
RfcLogLevel::ERROR,
'%type: @message in %function (line %line of %file).',
diff --git a/core/modules/system/tests/src/Kernel/System/FloodTest.php b/core/modules/system/tests/src/Kernel/System/FloodTest.php
index a4a7f7dc6cb..cf33695a6a1 100644
--- a/core/modules/system/tests/src/Kernel/System/FloodTest.php
+++ b/core/modules/system/tests/src/Kernel/System/FloodTest.php
@@ -24,7 +24,7 @@ class FloodTest extends KernelTestBase {
/**
* Tests flood control mechanism clean-up.
*/
- public function testCleanUp() {
+ public function testCleanUp(): void {
$threshold = 1;
$window_expired = -1;
$name = 'flood_test_cleanup';
@@ -52,7 +52,7 @@ class FloodTest extends KernelTestBase {
/**
* Tests flood control database backend.
*/
- public function testDatabaseBackend() {
+ public function testDatabaseBackend(): void {
$threshold = 1;
$window_expired = -1;
$name = 'flood_test_cleanup';
@@ -96,7 +96,7 @@ class FloodTest extends KernelTestBase {
/**
* Tests clearByPrefix method on flood backends.
*/
- public function testClearByPrefix() {
+ public function testClearByPrefix(): void {
$threshold = 1;
$window_expired = 3600;
$identifier = 'prefix-127.0.0.1';
diff --git a/core/modules/system/tests/src/Kernel/System/InfoAlterTest.php b/core/modules/system/tests/src/Kernel/System/InfoAlterTest.php
index 9ea81b23f06..545d15074ab 100644
--- a/core/modules/system/tests/src/Kernel/System/InfoAlterTest.php
+++ b/core/modules/system/tests/src/Kernel/System/InfoAlterTest.php
@@ -22,7 +22,7 @@ class InfoAlterTest extends KernelTestBase {
* hook_system_info_alter() is enabled. Also tests if core *_list() functions
* return freshly altered info.
*/
- public function testSystemInfoAlter() {
+ public function testSystemInfoAlter(): void {
\Drupal::state()->set('module_required_test.hook_system_info_alter', TRUE);
$info = \Drupal::service('extension.list.module')->getList();
$this->assertFalse(isset($info['node']->info['required']), 'Before the module_required_test is installed the node module is not required.');
diff --git a/core/modules/system/tests/src/Kernel/Theme/FunctionsTest.php b/core/modules/system/tests/src/Kernel/Theme/FunctionsTest.php
index 752ce443548..e4aa017c732 100644
--- a/core/modules/system/tests/src/Kernel/Theme/FunctionsTest.php
+++ b/core/modules/system/tests/src/Kernel/Theme/FunctionsTest.php
@@ -40,7 +40,7 @@ class FunctionsTest extends KernelTestBase {
/**
* Tests item-list.html.twig.
*/
- public function testItemList() {
+ public function testItemList(): void {
// Verify that empty items produce no output.
$variables = [];
$expected = '';
@@ -180,7 +180,7 @@ class FunctionsTest extends KernelTestBase {
/**
* Tests links.html.twig.
*/
- public function testLinks() {
+ public function testLinks(): void {
// Turn off the query for the
// \Drupal\Core\Utility\LinkGeneratorInterface::generate() method to compare
// the active link correctly.
@@ -301,7 +301,7 @@ class FunctionsTest extends KernelTestBase {
/**
* Tests links.html.twig using links with indexed keys.
*/
- public function testIndexedKeyedLinks() {
+ public function testIndexedKeyedLinks(): void {
// Turn off the query for the
// \Drupal\Core\Utility\LinkGeneratorInterface::generate() method to compare
// the active link correctly.
@@ -424,7 +424,7 @@ class FunctionsTest extends KernelTestBase {
*
* @see \Drupal\Core\Render\Element\Link::preRenderLinks()
*/
- public function testDrupalPreRenderLinks() {
+ public function testDrupalPreRenderLinks(): void {
// Define the base array to be rendered, containing a variety of different
// kinds of links.
$base_array = [
@@ -519,7 +519,7 @@ class FunctionsTest extends KernelTestBase {
/**
* Tests theme_image().
*/
- public function testImage() {
+ public function testImage(): void {
// Test that data URIs work with theme_image().
$variables = [];
$variables['uri'] = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==';
diff --git a/core/modules/system/tests/src/Kernel/Theme/ThemeTest.php b/core/modules/system/tests/src/Kernel/Theme/ThemeTest.php
index 4b4f32b174b..21bfbe5d43e 100644
--- a/core/modules/system/tests/src/Kernel/Theme/ThemeTest.php
+++ b/core/modules/system/tests/src/Kernel/Theme/ThemeTest.php
@@ -37,7 +37,7 @@ class ThemeTest extends KernelTestBase {
* - the render element's #attributes
* - any attributes set in the template's preprocessing function
*/
- public function testAttributeMerging() {
+ public function testAttributeMerging(): void {
$theme_test_render_element = [
'elements' => [
'#attributes' => ['data-foo' => 'bar'],
@@ -52,7 +52,7 @@ class ThemeTest extends KernelTestBase {
/**
* Tests that ThemeManager renders the expected data types.
*/
- public function testThemeDataTypes() {
+ public function testThemeDataTypes(): void {
// theme_test_false is an implemented theme hook so \Drupal::theme() service
// should return a string or an object that implements MarkupInterface,
// even though the theme function itself can return anything.
@@ -77,7 +77,7 @@ class ThemeTest extends KernelTestBase {
/**
* Tests function theme_get_suggestions() for SA-CORE-2009-003.
*/
- public function testThemeSuggestions() {
+ public function testThemeSuggestions(): void {
// Set the front page as something random otherwise the CLI
// test runner fails.
$this->config('system.site')->set('page.front', '/nobody-home')->save();
@@ -104,7 +104,7 @@ class ThemeTest extends KernelTestBase {
/**
* Tests the listInfo() function.
*/
- public function testListThemes() {
+ public function testListThemes(): void {
$this->container->get('theme_installer')->install(['test_subtheme']);
$theme_handler = $this->container->get('theme_handler');
$themes = $theme_handler->listInfo();
@@ -129,7 +129,7 @@ class ThemeTest extends KernelTestBase {
/**
* Tests child element rendering for 'render element' theme hooks.
*/
- public function testDrupalRenderChildren() {
+ public function testDrupalRenderChildren(): void {
$element = [
'#theme' => 'theme_test_render_element_children',
'child' => [
@@ -150,7 +150,7 @@ class ThemeTest extends KernelTestBase {
/**
* Tests drupal_find_theme_templates().
*/
- public function testFindThemeTemplates() {
+ public function testFindThemeTemplates(): void {
$registry = $this->container->get('theme.registry')->get();
$templates = drupal_find_theme_templates($registry, '.html.twig', $this->getThemePath('test_theme'));
$this->assertEquals('node--1', $templates['node__1']['template'], 'Template node--1.html.twig was found in test_theme.');
@@ -159,7 +159,7 @@ class ThemeTest extends KernelTestBase {
/**
* Tests the update registry is correct during theme install and uninstall.
*/
- public function testThemeUpdateManagement() {
+ public function testThemeUpdateManagement(): void {
// Install modules the theme is dependent on and enable the post update
// function.
\Drupal::state()->set('test_theme_depending_on_modules.post_update', TRUE);
@@ -186,7 +186,7 @@ class ThemeTest extends KernelTestBase {
/**
* Tests the update registry is correct during theme install and uninstall.
*/
- public function testThemeUpdateManagementRemovedPostUpdates() {
+ public function testThemeUpdateManagementRemovedPostUpdates(): void {
// Install modules the theme is dependent on and enable the removed post
// updates function.
\Drupal::state()->set('test_theme_depending_on_modules.removed_post_updates', TRUE);
diff --git a/core/modules/system/tests/src/Kernel/Theme/TwigFilterTest.php b/core/modules/system/tests/src/Kernel/Theme/TwigFilterTest.php
index bd3dfbf3b75..132cff7e116 100644
--- a/core/modules/system/tests/src/Kernel/Theme/TwigFilterTest.php
+++ b/core/modules/system/tests/src/Kernel/Theme/TwigFilterTest.php
@@ -23,7 +23,7 @@ class TwigFilterTest extends KernelTestBase {
/**
* Tests Twig "without" filter.
*/
- public function testTwigWithoutFilter() {
+ public function testTwigWithoutFilter(): void {
$filter_test = [
'#theme' => 'twig_theme_test_filter',
'#quote' => [
diff --git a/core/modules/system/tests/src/Kernel/Theme/TwigNamespaceTest.php b/core/modules/system/tests/src/Kernel/Theme/TwigNamespaceTest.php
index 3df5fc12f35..eec18f971ac 100644
--- a/core/modules/system/tests/src/Kernel/Theme/TwigNamespaceTest.php
+++ b/core/modules/system/tests/src/Kernel/Theme/TwigNamespaceTest.php
@@ -52,7 +52,7 @@ class TwigNamespaceTest extends KernelTestBase {
/**
* Tests template discovery using namespaces.
*/
- public function testTemplateDiscovery() {
+ public function testTemplateDiscovery(): void {
// Tests resolving namespaced templates in modules.
$this->assertTwigTemplate($this->twig->load('@node/node.html.twig'), 'Found node.html.twig in node module.');
@@ -63,7 +63,7 @@ class TwigNamespaceTest extends KernelTestBase {
/**
* Tests template extension and includes using namespaces.
*/
- public function testTwigNamespaces() {
+ public function testTwigNamespaces(): void {
// Test twig @extends and @include in template files.
$test = ['#theme' => 'twig_namespace_test'];
$this->setRawContent(\Drupal::service('renderer')->renderRoot($test));
diff --git a/core/modules/system/tests/src/Kernel/Theme/TwigRawTest.php b/core/modules/system/tests/src/Kernel/Theme/TwigRawTest.php
index 4295f0f4ef4..0f670b54cd1 100644
--- a/core/modules/system/tests/src/Kernel/Theme/TwigRawTest.php
+++ b/core/modules/system/tests/src/Kernel/Theme/TwigRawTest.php
@@ -23,7 +23,7 @@ class TwigRawTest extends KernelTestBase {
/**
* Tests the raw filter inside an autoescape tag.
*/
- public function testAutoescapeRaw() {
+ public function testAutoescapeRaw(): void {
$test = [
'#theme' => 'twig_raw_test',
'#script' => '<script>alert("This alert is real because I will put it through the raw filter!");</script>',
@@ -39,7 +39,7 @@ class TwigRawTest extends KernelTestBase {
* This is one of the most important tests in Drupal itself in terms of
* security.
*/
- public function testAutoescape() {
+ public function testAutoescape(): void {
$script = '<script>alert("This alert is unreal!");</script>';
$build = [
'#theme' => 'twig_autoescape_test',
diff --git a/core/modules/system/tests/src/Kernel/TimezoneResolverTest.php b/core/modules/system/tests/src/Kernel/TimezoneResolverTest.php
index eb77255fed1..7410aeba35a 100644
--- a/core/modules/system/tests/src/Kernel/TimezoneResolverTest.php
+++ b/core/modules/system/tests/src/Kernel/TimezoneResolverTest.php
@@ -29,7 +29,7 @@ class TimezoneResolverTest extends KernelTestBase {
/**
* Tests time zone resolution.
*/
- public function testGetTimeZone() {
+ public function testGetTimeZone(): void {
$this->installEntitySchema('user');
$this->installConfig(['system']);
diff --git a/core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTest.php b/core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTest.php
index 6511a082eef..d46e2ed4f4d 100644
--- a/core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTest.php
+++ b/core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTest.php
@@ -31,7 +31,7 @@ class TokenReplaceKernelTest extends TokenReplaceKernelTestBase {
/**
* Tests whether token-replacement works in various contexts.
*/
- public function testSystemTokenRecognition() {
+ public function testSystemTokenRecognition(): void {
// Generate prefixes and suffixes for the token context.
$tests = [
['prefix' => 'this is the ', 'suffix' => ' site'],
@@ -61,7 +61,7 @@ class TokenReplaceKernelTest extends TokenReplaceKernelTestBase {
/**
* Tests the clear parameter.
*/
- public function testClear() {
+ public function testClear(): void {
// Valid token.
$source = '[site:name]';
// No user passed in, should be untouched.
@@ -83,7 +83,7 @@ class TokenReplaceKernelTest extends TokenReplaceKernelTestBase {
/**
* Tests the generation of all system site information tokens.
*/
- public function testSystemSiteTokenReplacement() {
+ public function testSystemSiteTokenReplacement(): void {
$url_options = [
'absolute' => TRUE,
'language' => $this->interfaceLanguage,
@@ -156,7 +156,7 @@ class TokenReplaceKernelTest extends TokenReplaceKernelTestBase {
/**
* Tests the generation of all system date tokens.
*/
- public function testSystemDateTokenReplacement() {
+ public function testSystemDateTokenReplacement(): void {
// Set time to one hour before request.
$date = \Drupal::time()->getRequestTime() - 3600;
diff --git a/core/modules/system/tests/src/Unit/Batch/BatchControllerTest.php b/core/modules/system/tests/src/Unit/Batch/BatchControllerTest.php
index 605b135327b..12a225526e5 100644
--- a/core/modules/system/tests/src/Unit/Batch/BatchControllerTest.php
+++ b/core/modules/system/tests/src/Unit/Batch/BatchControllerTest.php
@@ -23,7 +23,7 @@ class BatchControllerTest extends UnitTestCase {
*
* @covers ::batchPageTitle
*/
- public function testBatchPageTitle() {
+ public function testBatchPageTitle(): void {
$batch_storage = $this->createMock(BatchStorageInterface::class);
$controller = new BatchController($this->root, $batch_storage);
require_once $this->root . '/core/includes/form.inc';
diff --git a/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php b/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
index f2f1d6e20cd..fed64ed349d 100644
--- a/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
+++ b/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
@@ -141,7 +141,7 @@ class PathBasedBreadcrumbBuilderTest extends UnitTestCase {
*
* @covers ::build
*/
- public function testBuildOnFrontpage() {
+ public function testBuildOnFrontpage(): void {
$this->pathMatcher->expects($this->once())
->method('isFrontPage')
->willReturn(TRUE);
@@ -158,7 +158,7 @@ class PathBasedBreadcrumbBuilderTest extends UnitTestCase {
*
* @covers ::build
*/
- public function testBuildWithOnePathElement() {
+ public function testBuildWithOnePathElement(): void {
$this->context->expects($this->once())
->method('getPathInfo')
->willReturn('/example');
@@ -176,7 +176,7 @@ class PathBasedBreadcrumbBuilderTest extends UnitTestCase {
* @covers ::build
* @covers ::getRequestForPath
*/
- public function testBuildWithTwoPathElements() {
+ public function testBuildWithTwoPathElements(): void {
$this->context->expects($this->once())
->method('getPathInfo')
->willReturn('/example/baz');
@@ -215,7 +215,7 @@ class PathBasedBreadcrumbBuilderTest extends UnitTestCase {
* @covers ::build
* @covers ::getRequestForPath
*/
- public function testBuildWithThreePathElements() {
+ public function testBuildWithThreePathElements(): void {
$this->context->expects($this->once())
->method('getPathInfo')
->willReturn('/example/bar/baz');
@@ -273,7 +273,7 @@ class PathBasedBreadcrumbBuilderTest extends UnitTestCase {
*
* @dataProvider providerTestBuildWithException
*/
- public function testBuildWithException($exception_class, $exception_argument) {
+ public function testBuildWithException($exception_class, $exception_argument): void {
$this->context->expects($this->once())
->method('getPathInfo')
->willReturn('/example/bar');
@@ -314,7 +314,7 @@ class PathBasedBreadcrumbBuilderTest extends UnitTestCase {
* @covers ::build
* @covers ::getRequestForPath
*/
- public function testBuildWithNonProcessedPath() {
+ public function testBuildWithNonProcessedPath(): void {
$this->context->expects($this->once())
->method('getPathInfo')
->willReturn('/example/bar');
@@ -341,7 +341,7 @@ class PathBasedBreadcrumbBuilderTest extends UnitTestCase {
*
* @covers ::applies
*/
- public function testApplies() {
+ public function testApplies(): void {
$this->assertTrue($this->builder->applies($this->createMock('Drupal\Core\Routing\RouteMatchInterface')));
}
@@ -351,7 +351,7 @@ class PathBasedBreadcrumbBuilderTest extends UnitTestCase {
* @covers ::build
* @covers ::getRequestForPath
*/
- public function testBuildWithUserPath() {
+ public function testBuildWithUserPath(): void {
$this->context->expects($this->once())
->method('getPathInfo')
->willReturn('/user/1/edit');
diff --git a/core/modules/system/tests/src/Unit/Event/SecurityFileUploadEventSubscriberTest.php b/core/modules/system/tests/src/Unit/Event/SecurityFileUploadEventSubscriberTest.php
index 50a4baed4af..8c92f8d05af 100644
--- a/core/modules/system/tests/src/Unit/Event/SecurityFileUploadEventSubscriberTest.php
+++ b/core/modules/system/tests/src/Unit/Event/SecurityFileUploadEventSubscriberTest.php
@@ -32,7 +32,7 @@ class SecurityFileUploadEventSubscriberTest extends UnitTestCase {
*
* @covers ::sanitizeName
*/
- public function testSanitizeName(string $filename, string $allowed_extensions, string $expected_filename, ?string $expected_filename_with_insecure_uploads = NULL) {
+ public function testSanitizeName(string $filename, string $allowed_extensions, string $expected_filename, ?string $expected_filename_with_insecure_uploads = NULL): void {
// Configure insecure uploads to be renamed.
$config_factory = $this->getConfigFactoryStub([
'system.file' => [
@@ -106,7 +106,7 @@ class SecurityFileUploadEventSubscriberTest extends UnitTestCase {
*
* @covers ::sanitizeName
*/
- public function testSanitizeNameNoMunge(string $filename, string $allowed_extensions) {
+ public function testSanitizeNameNoMunge(string $filename, string $allowed_extensions): void {
$config_factory = $this->getConfigFactoryStub([
'system.file' => [
'allow_insecure_uploads' => FALSE,
diff --git a/core/modules/system/tests/src/Unit/FileTransfer/FileTransferTest.php b/core/modules/system/tests/src/Unit/FileTransfer/FileTransferTest.php
index 29cb90f958c..e13c7d77851 100644
--- a/core/modules/system/tests/src/Unit/FileTransfer/FileTransferTest.php
+++ b/core/modules/system/tests/src/Unit/FileTransfer/FileTransferTest.php
@@ -26,7 +26,7 @@ class FileTransferTest extends UnitTestCase {
$this->testConnection = TestFileTransfer::factory($this->root, []);
}
- public function testFileTransferMagicMethods() {
+ public function testFileTransferMagicMethods(): void {
// Test to ensure __get() preserves public access.
$this->assertInstanceOf(MockTestConnection::class, $this->testConnection->connection);
}
diff --git a/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php b/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php
index bade40dfbb5..da1865e0fef 100644
--- a/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php
+++ b/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php
@@ -100,7 +100,7 @@ class MenuLinkTreeTest extends UnitTestCase {
* @covers ::build
* @dataProvider providerTestBuildCacheability
*/
- public function testBuildCacheability($description, $tree, $expected_build, $access, array $access_cache_contexts = []) {
+ public function testBuildCacheability($description, $tree, $expected_build, $access, array $access_cache_contexts = []): void {
if ($access !== NULL) {
$access->addCacheContexts($access_cache_contexts);
}
diff --git a/core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php b/core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php
index 735d3513210..780ba81c12b 100644
--- a/core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php
+++ b/core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php
@@ -69,7 +69,7 @@ class SystemLocalTasksTest extends LocalTaskIntegrationTestBase {
*
* @dataProvider getSystemAdminRoutes
*/
- public function testSystemAdminLocalTasks($route, $expected) {
+ public function testSystemAdminLocalTasks($route, $expected): void {
$this->assertLocalTasks($route, $expected);
}
diff --git a/core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php b/core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php
index 24a12a53b47..ab42b418125 100644
--- a/core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php
+++ b/core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php
@@ -52,7 +52,7 @@ class PreprocessPagerTest extends UnitTestCase {
*
* @covers ::template_preprocess_pager
*/
- public function testQuantityNotSet() {
+ public function testQuantityNotSet(): void {
require_once $this->root . '/core/includes/theme.inc';
$variables = [
'pager' => [
@@ -73,7 +73,7 @@ class PreprocessPagerTest extends UnitTestCase {
*
* @covers ::template_preprocess_pager
*/
- public function testQuantitySet() {
+ public function testQuantitySet(): void {
require_once $this->root . '/core/includes/theme.inc';
$variables = [
'pager' => [
@@ -98,7 +98,7 @@ class PreprocessPagerTest extends UnitTestCase {
*
* @covers ::template_preprocess_pager
*/
- public function testEmptyPaginationHeadingLevelSet() {
+ public function testEmptyPaginationHeadingLevelSet(): void {
require_once $this->root . '/core/includes/theme.inc';
$variables = [
'pager' => [
@@ -120,7 +120,7 @@ class PreprocessPagerTest extends UnitTestCase {
*
* @covers ::template_preprocess_pager
*/
- public function testPaginationHeadingLevelNotSet() {
+ public function testPaginationHeadingLevelNotSet(): void {
require_once $this->root . '/core/includes/theme.inc';
$variables = [
'pager' => [
@@ -141,7 +141,7 @@ class PreprocessPagerTest extends UnitTestCase {
*
* @covers ::template_preprocess_pager
*/
- public function testPaginationHeadingLevelSet() {
+ public function testPaginationHeadingLevelSet(): void {
require_once $this->root . '/core/includes/theme.inc';
$variables = [
'pager' => [
@@ -163,7 +163,7 @@ class PreprocessPagerTest extends UnitTestCase {
*
* @covers ::template_preprocess_pager
*/
- public function testPaginationHeadingLevelInvalid() {
+ public function testPaginationHeadingLevelInvalid(): void {
require_once $this->root . '/core/includes/theme.inc';
$variables = [
'pager' => [
diff --git a/core/modules/system/tests/src/Unit/Routing/AdminRouteSubscriberTest.php b/core/modules/system/tests/src/Unit/Routing/AdminRouteSubscriberTest.php
index a2a0a03f98a..7cd8f89c11e 100644
--- a/core/modules/system/tests/src/Unit/Routing/AdminRouteSubscriberTest.php
+++ b/core/modules/system/tests/src/Unit/Routing/AdminRouteSubscriberTest.php
@@ -22,7 +22,7 @@ class AdminRouteSubscriberTest extends UnitTestCase {
*
* @dataProvider providerTestAlterRoutes
*/
- public function testAlterRoutes(Route $route, $is_admin) {
+ public function testAlterRoutes(Route $route, $is_admin): void {
$collection = new RouteCollection();
$collection->add('the_route', $route);
(new AdminRouteSubscriber())->onAlterRoutes(new RouteBuildEvent($collection));
diff --git a/core/modules/system/tests/src/Unit/TraitAccessTest.php b/core/modules/system/tests/src/Unit/TraitAccessTest.php
index 2abd92171b4..424ab939ddd 100644
--- a/core/modules/system/tests/src/Unit/TraitAccessTest.php
+++ b/core/modules/system/tests/src/Unit/TraitAccessTest.php
@@ -20,7 +20,7 @@ class TraitAccessTest extends UnitTestCase {
/**
* @coversNothing
*/
- public function testSimpleStuff() {
+ public function testSimpleStuff(): void {
$stuff = $this->getStuff();
$this->assertSame($stuff, 'stuff', "Same old stuff");
}
diff --git a/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php b/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php
index 42e04e2ce8f..41b6d49d5a7 100644
--- a/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php
@@ -66,7 +66,7 @@ class EarlyDateTest extends TaxonomyTestBase {
/**
* Tests taxonomy functionality with nodes prior to 1970.
*/
- public function testTaxonomyEarlyDateNode() {
+ public function testTaxonomyEarlyDateNode(): void {
// Posts an article with a taxonomy term and a date prior to 1970.
$date = new DrupalDateTime('1969-01-01 00:00:00');
$edit = [];
diff --git a/core/modules/taxonomy/tests/src/Functional/Rest/TermResourceTestBase.php b/core/modules/taxonomy/tests/src/Functional/Rest/TermResourceTestBase.php
index 416038f9840..2c64a7b04c9 100644
--- a/core/modules/taxonomy/tests/src/Functional/Rest/TermResourceTestBase.php
+++ b/core/modules/taxonomy/tests/src/Functional/Rest/TermResourceTestBase.php
@@ -283,7 +283,7 @@ abstract class TermResourceTestBase extends EntityResourceTestBase {
*
* @see \Drupal\Tests\rest\Functional\EntityResource\Node\NodeResourceTestBase::testPatchPath()
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
$this->initAuthentication();
$this->provisionEntityResource();
$this->setUpAuthorization('GET');
@@ -332,7 +332,7 @@ abstract class TermResourceTestBase extends EntityResourceTestBase {
*
* @dataProvider providerTestGetTermWithParent
*/
- public function testGetTermWithParent(array $parent_term_ids) {
+ public function testGetTermWithParent(array $parent_term_ids): void {
// Create all possible parent terms.
Term::create(['vid' => Vocabulary::load('camelids')->id()])
->setName('Lamoids')
diff --git a/core/modules/taxonomy/tests/src/Functional/Rest/TermXmlAnonTest.php b/core/modules/taxonomy/tests/src/Functional/Rest/TermXmlAnonTest.php
index 2c3691b3f0e..f5c7a2bc562 100644
--- a/core/modules/taxonomy/tests/src/Functional/Rest/TermXmlAnonTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Rest/TermXmlAnonTest.php
@@ -34,7 +34,7 @@ class TermXmlAnonTest extends TermResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/taxonomy/tests/src/Functional/Rest/TermXmlBasicAuthTest.php b/core/modules/taxonomy/tests/src/Functional/Rest/TermXmlBasicAuthTest.php
index efce9ab17eb..caa6e5e0556 100644
--- a/core/modules/taxonomy/tests/src/Functional/Rest/TermXmlBasicAuthTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Rest/TermXmlBasicAuthTest.php
@@ -44,7 +44,7 @@ class TermXmlBasicAuthTest extends TermResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/taxonomy/tests/src/Functional/Rest/TermXmlCookieTest.php b/core/modules/taxonomy/tests/src/Functional/Rest/TermXmlCookieTest.php
index 1979dffab64..7eba87162c1 100644
--- a/core/modules/taxonomy/tests/src/Functional/Rest/TermXmlCookieTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Rest/TermXmlCookieTest.php
@@ -39,7 +39,7 @@ class TermXmlCookieTest extends TermResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/taxonomy/tests/src/Functional/RssTest.php b/core/modules/taxonomy/tests/src/Functional/RssTest.php
index b24eaabcec8..4c186b8a9a5 100644
--- a/core/modules/taxonomy/tests/src/Functional/RssTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/RssTest.php
@@ -83,7 +83,7 @@ class RssTest extends TaxonomyTestBase {
*
* Create a node and assert that taxonomy terms appear in rss.xml.
*/
- public function testTaxonomyRss() {
+ public function testTaxonomyRss(): void {
// Create two taxonomy terms.
$term1 = $this->createTerm($this->vocabulary);
diff --git a/core/modules/taxonomy/tests/src/Functional/TaxonomyRevisionTest.php b/core/modules/taxonomy/tests/src/Functional/TaxonomyRevisionTest.php
index 0f3ea991dc4..06cfd027993 100644
--- a/core/modules/taxonomy/tests/src/Functional/TaxonomyRevisionTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TaxonomyRevisionTest.php
@@ -32,7 +32,7 @@ class TaxonomyRevisionTest extends BrowserTestBase {
/**
* Tests default revision settings on vocabularies.
*/
- public function testVocabularyTermRevision() {
+ public function testVocabularyTermRevision(): void {
$assert = $this->assertSession();
$vocabulary1 = $this->createVocabulary(['new_revision' => TRUE]);
$vocabulary2 = $this->createVocabulary(['new_revision' => FALSE]);
diff --git a/core/modules/taxonomy/tests/src/Functional/TaxonomyTermIndentationTest.php b/core/modules/taxonomy/tests/src/Functional/TaxonomyTermIndentationTest.php
index c6f797c2378..6db21d6fbbb 100644
--- a/core/modules/taxonomy/tests/src/Functional/TaxonomyTermIndentationTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TaxonomyTermIndentationTest.php
@@ -45,7 +45,7 @@ class TaxonomyTermIndentationTest extends TaxonomyTestBase {
/**
* Tests term indentation.
*/
- public function testTermIndentation() {
+ public function testTermIndentation(): void {
$assert = $this->assertSession();
// Create three taxonomy terms.
$term1 = $this->createTerm($this->vocabulary);
diff --git a/core/modules/taxonomy/tests/src/Functional/TaxonomyTermPagerTest.php b/core/modules/taxonomy/tests/src/Functional/TaxonomyTermPagerTest.php
index 5a4aff0ab5e..592b2382f7c 100644
--- a/core/modules/taxonomy/tests/src/Functional/TaxonomyTermPagerTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TaxonomyTermPagerTest.php
@@ -45,7 +45,7 @@ class TaxonomyTermPagerTest extends TaxonomyTestBase {
/**
* Tests that the pager is displayed properly on the term overview page.
*/
- public function testTaxonomyTermOverviewPager() {
+ public function testTaxonomyTermOverviewPager(): void {
// Set limit to 3 terms per page.
$this->config('taxonomy.settings')
->set('terms_per_page_admin', '3')
@@ -78,7 +78,7 @@ class TaxonomyTermPagerTest extends TaxonomyTestBase {
/**
* Tests that overview page only loads the necessary terms.
*/
- public function testTaxonomyTermOverviewTermLoad() {
+ public function testTaxonomyTermOverviewTermLoad(): void {
// Set limit to 3 terms per page.
$this->config('taxonomy.settings')
->set('terms_per_page_admin', '3')
diff --git a/core/modules/taxonomy/tests/src/Functional/TermAccessTest.php b/core/modules/taxonomy/tests/src/Functional/TermAccessTest.php
index 3e9a985b387..985c1ac63d4 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermAccessTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermAccessTest.php
@@ -25,7 +25,7 @@ class TermAccessTest extends TaxonomyTestBase {
/**
* Tests access control functionality for taxonomy terms.
*/
- public function testTermAccess() {
+ public function testTermAccess(): void {
$assert_session = $this->assertSession();
$vocabulary = $this->createVocabulary();
diff --git a/core/modules/taxonomy/tests/src/Functional/TermAutocompleteTest.php b/core/modules/taxonomy/tests/src/Functional/TermAutocompleteTest.php
index d4f413a4a04..3845ff3ca49 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermAutocompleteTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermAutocompleteTest.php
@@ -168,7 +168,7 @@ class TermAutocompleteTest extends TaxonomyTestBase {
*
* @see \Drupal\taxonomy\Controller\TermAutocompleteController::autocomplete()
*/
- public function testAutocompleteCountResults() {
+ public function testAutocompleteCountResults(): void {
// Test that no matching term found.
$data = $this->drupalGetJson(
$this->autocompleteUrl,
@@ -204,7 +204,7 @@ class TermAutocompleteTest extends TaxonomyTestBase {
*
* @see \Drupal\taxonomy\Controller\TermAutocompleteController::autocomplete()
*/
- public function testAutocompleteOrderedResults() {
+ public function testAutocompleteOrderedResults(): void {
$expectedResults = [
'aaa 10 bbb',
'aaa 11 bbb',
diff --git a/core/modules/taxonomy/tests/src/Functional/TermContextualLinksTest.php b/core/modules/taxonomy/tests/src/Functional/TermContextualLinksTest.php
index 718e5537290..9ce615aa601 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermContextualLinksTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermContextualLinksTest.php
@@ -26,7 +26,7 @@ class TermContextualLinksTest extends TaxonomyTestBase {
/**
* Tests contextual links.
*/
- public function testTermContextualLinks() {
+ public function testTermContextualLinks(): void {
$vocabulary = $this->createVocabulary();
$term = $this->createTerm($vocabulary);
diff --git a/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php b/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
index 79fd6e86d23..c7c8c97f54b 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
@@ -105,7 +105,7 @@ class TermIndexTest extends TaxonomyTestBase {
/**
* Tests that the taxonomy index is maintained properly.
*/
- public function testTaxonomyIndex() {
+ public function testTaxonomyIndex(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
// Create terms in the vocabulary.
$term_1 = $this->createTerm($this->vocabulary);
@@ -241,7 +241,7 @@ class TermIndexTest extends TaxonomyTestBase {
/**
* Tests that there is a link to the parent term on the child term page.
*/
- public function testTaxonomyTermHierarchyBreadcrumbs() {
+ public function testTaxonomyTermHierarchyBreadcrumbs(): void {
// Create two taxonomy terms and set term2 as the parent of term1.
$term1 = $this->createTerm($this->vocabulary);
$term2 = $this->createTerm($this->vocabulary);
diff --git a/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php b/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php
index e1fd3fdb179..e33f700c3d0 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php
@@ -49,7 +49,7 @@ class TermLanguageTest extends TaxonomyTestBase {
}
}
- public function testTermLanguage() {
+ public function testTermLanguage(): void {
// Configure the vocabulary to not hide the language selector.
$edit = [
'default_language[language_alterable]' => TRUE,
@@ -87,7 +87,7 @@ class TermLanguageTest extends TaxonomyTestBase {
$this->assertTrue($this->assertSession()->optionExists('edit-langcode-0-value', $edit['langcode[0][value]'])->isSelected());
}
- public function testDefaultTermLanguage() {
+ public function testDefaultTermLanguage(): void {
// Configure the vocabulary to not hide the language selector, and make the
// default language of the terms fixed.
$edit = [
@@ -127,7 +127,7 @@ class TermLanguageTest extends TaxonomyTestBase {
/**
* Tests that translated terms are displayed correctly on the term overview.
*/
- public function testTermTranslatedOnOverviewPage() {
+ public function testTermTranslatedOnOverviewPage(): void {
// Configure the vocabulary to not hide the language selector.
$edit = [
'default_language[language_alterable]' => TRUE,
diff --git a/core/modules/taxonomy/tests/src/Functional/TermParentsTest.php b/core/modules/taxonomy/tests/src/Functional/TermParentsTest.php
index 1a4d7a4760e..c37d4486b47 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermParentsTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermParentsTest.php
@@ -64,7 +64,7 @@ class TermParentsTest extends BrowserTestBase {
/**
* Tests specifying parents when creating terms.
*/
- public function testAddWithParents() {
+ public function testAddWithParents(): void {
$this->drupalGet("/admin/structure/taxonomy/manage/{$this->vocabularyId}/add");
$page = $this->getSession()->getPage();
@@ -135,7 +135,7 @@ class TermParentsTest extends BrowserTestBase {
/**
* Tests editing the parents of existing terms.
*/
- public function testEditingParents() {
+ public function testEditingParents(): void {
$terms = $this->doTestEditingSingleParent();
$term_5 = array_pop($terms);
$term_4 = array_pop($terms);
@@ -161,7 +161,7 @@ class TermParentsTest extends BrowserTestBase {
/**
* Tests specifying parents when creating terms and a disabled parent form.
*/
- public function testEditingParentsWithDisabledFormElement() {
+ public function testEditingParentsWithDisabledFormElement(): void {
// Disable the parent form element.
$this->state->set('taxonomy_test.disable_parent_form_element', TRUE);
$this->drupalGet("/admin/structure/taxonomy/manage/{$this->vocabularyId}/add");
@@ -253,7 +253,7 @@ class TermParentsTest extends BrowserTestBase {
/**
* Test the term add/edit form with parent query parameter.
*/
- public function testParentFromQuery() {
+ public function testParentFromQuery(): void {
// Create three terms without any parents.
$term_1 = $this->createTerm('Test term 1');
$term_2 = $this->createTerm('Test term 2');
diff --git a/core/modules/taxonomy/tests/src/Functional/TermTest.php b/core/modules/taxonomy/tests/src/Functional/TermTest.php
index 01e7e0056df..70aea5a79ca 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermTest.php
@@ -92,7 +92,7 @@ class TermTest extends TaxonomyTestBase {
/**
* The "parent" field must restrict references to the same vocabulary.
*/
- public function testParentHandlerSettings() {
+ public function testParentHandlerSettings(): void {
$vocabulary_fields = \Drupal::service('entity_field.manager')->getFieldDefinitions('taxonomy_term', $this->vocabulary->id());
$parent_target_bundles = $vocabulary_fields['parent']->getSetting('handler_settings')['target_bundles'];
$this->assertSame([$this->vocabulary->id() => $this->vocabulary->id()], $parent_target_bundles);
@@ -101,7 +101,7 @@ class TermTest extends TaxonomyTestBase {
/**
* Tests terms in a single and multiple hierarchy.
*/
- public function testTaxonomyTermHierarchy() {
+ public function testTaxonomyTermHierarchy(): void {
// Create two taxonomy terms.
$term1 = $this->createTerm($this->vocabulary);
$term2 = $this->createTerm($this->vocabulary);
@@ -143,7 +143,7 @@ class TermTest extends TaxonomyTestBase {
/**
* Tests that many terms with parents show on each page.
*/
- public function testTaxonomyTermChildTerms() {
+ public function testTaxonomyTermChildTerms(): void {
// Set limit to 10 terms per page. Set variable to 9 so 10 terms appear.
$this->config('taxonomy.settings')->set('terms_per_page_admin', '9')->save();
$term1 = $this->createTerm($this->vocabulary);
@@ -197,7 +197,7 @@ class TermTest extends TaxonomyTestBase {
/**
* Tests term creation with a free-tagging vocabulary from the node form.
*/
- public function testNodeTermCreationAndDeletion() {
+ public function testNodeTermCreationAndDeletion(): void {
// Enable tags in the vocabulary.
$field = $this->field;
\Drupal::service('entity_display.repository')
@@ -292,7 +292,7 @@ class TermTest extends TaxonomyTestBase {
/**
* Save, edit and delete a term using the user interface.
*/
- public function testTermInterface() {
+ public function testTermInterface(): void {
\Drupal::service('module_installer')->install(['views']);
$edit = [
'name[0][value]' => $this->randomMachineName(12),
@@ -429,7 +429,7 @@ class TermTest extends TaxonomyTestBase {
/**
* Test UI with override_selector TRUE.
*/
- public function testTermSaveOverrideSelector() {
+ public function testTermSaveOverrideSelector(): void {
$this->config('taxonomy.settings')->set('override_selector', TRUE)->save();
// Create a Term.
@@ -454,7 +454,7 @@ class TermTest extends TaxonomyTestBase {
/**
* Save, edit and delete a term using the user interface.
*/
- public function testTermReorder() {
+ public function testTermReorder(): void {
$assert = $this->assertSession();
$this->createTerm($this->vocabulary);
$this->createTerm($this->vocabulary);
@@ -522,7 +522,7 @@ class TermTest extends TaxonomyTestBase {
/**
* Tests saving a term with multiple parents through the UI.
*/
- public function testTermMultipleParentsInterface() {
+ public function testTermMultipleParentsInterface(): void {
// Add two new terms to the vocabulary so that we can have multiple parents.
// These will be terms with tids of 1 and 2 respectively.
$this->createTerm($this->vocabulary);
@@ -618,7 +618,7 @@ class TermTest extends TaxonomyTestBase {
/**
* Tests that editing and saving a node with no changes works correctly.
*/
- public function testReSavingTags() {
+ public function testReSavingTags(): void {
// Enable tags in the vocabulary.
$field = $this->field;
\Drupal::service('entity_display.repository')
@@ -648,7 +648,7 @@ class TermTest extends TaxonomyTestBase {
/**
* Check the breadcrumb on edit and delete a term page.
*/
- public function testTermBreadcrumbs() {
+ public function testTermBreadcrumbs(): void {
$edit = [
'name[0][value]' => $this->randomMachineName(14),
'description[0][value]' => $this->randomMachineName(100),
diff --git a/core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php b/core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php
index 208036c2d90..21f7f301885 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php
@@ -64,7 +64,7 @@ class TermTranslationFieldViewTest extends TaxonomyTestBase {
/**
* Tests if the translated taxonomy term is displayed.
*/
- public function testTranslatedTaxonomyTermReferenceDisplay() {
+ public function testTranslatedTaxonomyTermReferenceDisplay(): void {
$path = 'node/' . $this->node->id();
$translation_path = $this->translateToLangcode . '/' . $path;
diff --git a/core/modules/taxonomy/tests/src/Functional/TermTranslationTest.php b/core/modules/taxonomy/tests/src/Functional/TermTranslationTest.php
index e1bbcfd363e..37ffbe522f1 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermTranslationTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermTranslationTest.php
@@ -60,7 +60,7 @@ class TermTranslationTest extends TaxonomyTestBase {
/**
* Tests translated breadcrumbs.
*/
- public function testTranslatedBreadcrumbs() {
+ public function testTranslatedBreadcrumbs(): void {
// Ensure non-translated breadcrumb is correct.
$breadcrumb = [Url::fromRoute('<front>')->toString() => 'Home'];
foreach ($this->terms as $term) {
@@ -94,7 +94,7 @@ class TermTranslationTest extends TaxonomyTestBase {
/**
* Tests translation of terms are showed in the node.
*/
- public function testTermsTranslation() {
+ public function testTermsTranslation(): void {
// Set the display of the term reference field on the article content type
// to "Check boxes/radio buttons".
diff --git a/core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php b/core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php
index c41eef8aacf..ff06aeef973 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php
@@ -108,7 +108,7 @@ class TermTranslationUITest extends ContentTranslationUITestBase {
/**
* {@inheritdoc}
*/
- public function testTranslationUI() {
+ public function testTranslationUI(): void {
parent::testTranslationUI();
// Make sure that no row was inserted for taxonomy vocabularies which do
@@ -128,7 +128,7 @@ class TermTranslationUITest extends ContentTranslationUITestBase {
/**
* Tests translate link on vocabulary term list.
*/
- public function testTranslateLinkVocabularyAdminPage() {
+ public function testTranslateLinkVocabularyAdminPage(): void {
$this->drupalLogin($this->drupalCreateUser(array_merge(parent::getTranslatorPermissions(), ['access administration pages', 'administer taxonomy'])));
$values = [
diff --git a/core/modules/taxonomy/tests/src/Functional/ThemeTest.php b/core/modules/taxonomy/tests/src/Functional/ThemeTest.php
index 917dc0f569d..f31a58b4c23 100644
--- a/core/modules/taxonomy/tests/src/Functional/ThemeTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/ThemeTest.php
@@ -42,7 +42,7 @@ class ThemeTest extends TaxonomyTestBase {
/**
* Tests the theme used when adding, viewing and editing taxonomy terms.
*/
- public function testTaxonomyTermThemes() {
+ public function testTaxonomyTermThemes(): void {
// Adding a term to a vocabulary is considered an administrative action and
// should use the administrative theme.
$vocabulary = $this->createVocabulary();
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyDefaultArgumentTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyDefaultArgumentTest.php
index bdbe0920c26..90209f7f6fe 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyDefaultArgumentTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyDefaultArgumentTest.php
@@ -26,7 +26,7 @@ class TaxonomyDefaultArgumentTest extends TaxonomyTestBase {
/**
* Tests escaping of page title when the taxonomy plugin provides it.
*/
- public function testTermTitleEscaping() {
+ public function testTermTitleEscaping(): void {
$this->term1->setName('<em>Markup</em>')->save();
$this->drupalGet('taxonomy_default_argument_test/' . $this->term1->id());
$this->assertSession()->assertEscaped($this->term1->label());
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldAllTermsTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldAllTermsTest.php
index 7d192156309..52e07caf7b3 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldAllTermsTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldAllTermsTest.php
@@ -29,7 +29,7 @@ class TaxonomyFieldAllTermsTest extends TaxonomyTestBase {
/**
* Tests the "all terms" field handler.
*/
- public function testViewsHandlerAllTermsField() {
+ public function testViewsHandlerAllTermsField(): void {
$this->term1->setName('<em>Markup</em>')->save();
$view = Views::getView('taxonomy_all_terms_test');
$this->executeView($view);
@@ -54,7 +54,7 @@ class TaxonomyFieldAllTermsTest extends TaxonomyTestBase {
/**
* Tests token replacement in the "all terms" field handler.
*/
- public function testViewsHandlerAllTermsWithTokens() {
+ public function testViewsHandlerAllTermsWithTokens(): void {
$view = Views::getView('taxonomy_all_terms_test');
$this->drupalGet('taxonomy_all_terms_token_test');
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php
index 2c9c866e44b..36d6444b780 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php
@@ -114,7 +114,7 @@ class TaxonomyFieldFilterTest extends ViewTestBase {
/**
* Tests description and term name filters.
*/
- public function testFilters() {
+ public function testFilters(): void {
// Test the name filter page, which filters for name contains 'Comida'.
// Should show just the Spanish translation, once.
$this->assertPageCounts('test-name-filter', ['es' => 1, 'fr' => 0, 'en' => 0], 'Comida name filter');
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php
index 31ed23421be..386bce016b7 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php
@@ -115,7 +115,7 @@ class TaxonomyIndexTidUiTest extends UITestBase {
/**
* Tests the filter UI.
*/
- public function testFilterUI() {
+ public function testFilterUI(): void {
$this->drupalGet('admin/structure/views/nojs/handler/test_filter_taxonomy_index_tid/default/filter/tid');
$result = $this->assertSession()->selectExists('edit-options-value')->findAll('css', 'option');
@@ -162,7 +162,7 @@ class TaxonomyIndexTidUiTest extends UITestBase {
/**
* Tests exposed taxonomy filters.
*/
- public function testExposedFilter() {
+ public function testExposedFilter(): void {
$node_type = $this->drupalCreateContentType(['type' => 'page']);
// Create the tag field itself.
@@ -293,7 +293,7 @@ class TaxonomyIndexTidUiTest extends UITestBase {
/**
* Tests exposed grouped taxonomy filters.
*/
- public function testExposedGroupedFilter() {
+ public function testExposedGroupedFilter(): void {
// Create a content type with a taxonomy field.
$this->drupalCreateContentType(['type' => 'article']);
$field_name = 'field_views_testing_tags';
@@ -337,7 +337,7 @@ class TaxonomyIndexTidUiTest extends UITestBase {
/**
* Tests that an exposed taxonomy filter doesn't show unpublished terms.
*/
- public function testExposedUnpublishedFilterOptions() {
+ public function testExposedUnpublishedFilterOptions(): void {
$this->terms[1][0]->setUnpublished()->save();
// Expose the filter.
$this->drupalGet('admin/structure/views/nojs/handler/test_filter_taxonomy_index_tid/default/filter/tid');
@@ -376,7 +376,7 @@ class TaxonomyIndexTidUiTest extends UITestBase {
/**
* Tests using the TaxonomyIndexTid in a filter group.
*/
- public function testFilterGrouping() {
+ public function testFilterGrouping(): void {
$node_type = $this->drupalCreateContentType(['type' => 'page']);
// Create the tag field itself.
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyParentUITest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyParentUITest.php
index 83f045a0825..c6b6f374a1a 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyParentUITest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyParentUITest.php
@@ -43,7 +43,7 @@ class TaxonomyParentUITest extends UITestBase {
/**
* Tests the taxonomy parent plugin UI.
*/
- public function testTaxonomyParentUI() {
+ public function testTaxonomyParentUI(): void {
$this->drupalGet('admin/structure/views/nojs/handler/test_taxonomy_parent/default/relationship/parent');
$this->assertSession()->pageTextNotContains('The handler for this item is broken or missing.');
}
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyRelationshipTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyRelationshipTest.php
index f0a7bc4386b..cfa26a405c9 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyRelationshipTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyRelationshipTest.php
@@ -59,7 +59,7 @@ class TaxonomyRelationshipTest extends TaxonomyTestBase {
/**
* Tests the taxonomy parent plugin UI.
*/
- public function testTaxonomyRelationships() {
+ public function testTaxonomyRelationships(): void {
// Check the generated views data of taxonomy_index.
$views_data = Views::viewsData()->get('taxonomy_index');
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php
index 400f8c4fbcb..86ca9d664e0 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermArgumentDepthTest.php
@@ -63,7 +63,7 @@ class TaxonomyTermArgumentDepthTest extends TaxonomyTestBase {
/**
* Tests title escaping.
*/
- public function testTermWithDepthArgumentTitleEscaping() {
+ public function testTermWithDepthArgumentTitleEscaping(): void {
$this->drupalGet('test_argument_taxonomy_index_tid_depth/' . $this->terms[0]->id());
$this->assertSession()->assertEscaped($this->terms[0]->label());
}
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
index b4ab6a7e9d2..4f384757216 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
@@ -86,7 +86,7 @@ class TaxonomyTermViewTest extends TaxonomyTestBase {
/**
* Tests that the taxonomy term view is working properly.
*/
- public function testTaxonomyTermView() {
+ public function testTaxonomyTermView(): void {
// Create terms in the vocabulary.
$term = $this->createTerm();
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyVocabularyArgumentTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyVocabularyArgumentTest.php
index 49d15eabdc8..a76bb4099df 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyVocabularyArgumentTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyVocabularyArgumentTest.php
@@ -72,7 +72,7 @@ class TaxonomyVocabularyArgumentTest extends TaxonomyTestBase {
*
* @see Drupal\taxonomy\Plugin\views\argument\VocabularyVid
*/
- public function testTermWithVocabularyArgument() {
+ public function testTermWithVocabularyArgument(): void {
$this->drupalGet('test_argument_taxonomy_vocabulary/' . $this->vocabularies[0]->id());
// First term should be present.
$this->assertSession()->pageTextContains($this->terms[0]->label());
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TermDisplayConfigurableTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TermDisplayConfigurableTest.php
index e18a3dc2e26..742f2123318 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TermDisplayConfigurableTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TermDisplayConfigurableTest.php
@@ -26,7 +26,7 @@ class TermDisplayConfigurableTest extends TaxonomyTestBase {
/**
* Sets base fields to configurable display and check settings are respected.
*/
- public function testDisplayConfigurable() {
+ public function testDisplayConfigurable(): void {
$user = $this->drupalCreateUser(['administer nodes']);
$this->drupalLogin($user);
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TermNameFieldTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TermNameFieldTest.php
index 213d67715c1..4fafdf0304e 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TermNameFieldTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TermNameFieldTest.php
@@ -29,7 +29,7 @@ class TermNameFieldTest extends TaxonomyTestBase {
/**
* Tests term name field plugin functionality.
*/
- public function testTermNameField() {
+ public function testTermNameField(): void {
$this->term1->name->value = $this->randomMachineName() . ' ' . $this->randomMachineName();
$this->term1->save();
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TermTranslationViewsTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TermTranslationViewsTest.php
index 77844f0b60f..6453205b4b5 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TermTranslationViewsTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TermTranslationViewsTest.php
@@ -75,7 +75,7 @@ class TermTranslationViewsTest extends TaxonomyTestBase {
* Taxonomy term: Term ID & Content: Has taxonomy term ID (with depth)
* contextual filters are enabled for two separate view modes.
*/
- public function testTermsTranslationWithContextualFilter() {
+ public function testTermsTranslationWithContextualFilter(): void {
$this->drupalLogin($this->rootUser);
foreach ($this->terms as $term) {
diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyLanguageTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyLanguageTest.php
index 09ea651c711..b2b64d6a6ee 100644
--- a/core/modules/taxonomy/tests/src/Functional/VocabularyLanguageTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/VocabularyLanguageTest.php
@@ -45,7 +45,7 @@ class VocabularyLanguageTest extends TaxonomyTestBase {
/**
* Tests language settings for vocabularies.
*/
- public function testVocabularyLanguage() {
+ public function testVocabularyLanguage(): void {
$this->drupalGet('admin/structure/taxonomy/add');
// Check that we have the language selector available.
@@ -76,7 +76,7 @@ class VocabularyLanguageTest extends TaxonomyTestBase {
/**
* Tests term language settings for vocabulary terms are saved and updated.
*/
- public function testVocabularyDefaultLanguageForTerms() {
+ public function testVocabularyDefaultLanguageForTerms(): void {
// Add a new vocabulary and check that the default language settings are for
// the terms are saved.
$edit = [
diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php
index e699e9e4e5d..a4338642bc3 100644
--- a/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php
@@ -39,7 +39,7 @@ class VocabularyPermissionsTest extends TaxonomyTestBase {
/**
* Create, edit and delete a vocabulary via the user interface.
*/
- public function testVocabularyPermissionsVocabulary() {
+ public function testVocabularyPermissionsVocabulary(): void {
// VocabularyTest.php already tests for user with "administer taxonomy"
// permission.
@@ -67,7 +67,7 @@ class VocabularyPermissionsTest extends TaxonomyTestBase {
/**
* Tests the vocabulary overview permission.
*/
- public function testTaxonomyVocabularyOverviewPermissions() {
+ public function testTaxonomyVocabularyOverviewPermissions(): void {
// Create two vocabularies, one with two terms, the other without any term.
/** @var \Drupal\taxonomy\Entity\Vocabulary $vocabulary1 , $vocabulary2 */
$vocabulary1 = $this->createVocabulary();
@@ -247,7 +247,7 @@ class VocabularyPermissionsTest extends TaxonomyTestBase {
/**
* Create, edit and delete a taxonomy term via the user interface.
*/
- public function testVocabularyPermissionsTaxonomyTerm() {
+ public function testVocabularyPermissionsTaxonomyTerm(): void {
// Vocabulary used for creating, removing and editing terms.
$vocabulary = $this->createVocabulary();
diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularySerializationTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularySerializationTest.php
index 3eb05c7f5c3..1aefd30e8e1 100644
--- a/core/modules/taxonomy/tests/src/Functional/VocabularySerializationTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/VocabularySerializationTest.php
@@ -39,7 +39,7 @@ class VocabularySerializationTest extends BrowserTestBase {
Vocabulary::create(['vid' => 'test', 'name' => 'Test'])->save();
}
- public function testSerialization() {
+ public function testSerialization(): void {
$this->drupalGet('/vocabulary_serialization_test/test');
$this->assertSession()->statusCodeEquals(200);
$this->assertSame('this is the output', $this->getSession()->getPage()->getContent());
diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php
index 60c9d42e51d..e20e993ba5c 100644
--- a/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php
@@ -56,7 +56,7 @@ class VocabularyTranslationTest extends TaxonomyTestBase {
/**
* Tests language settings for vocabularies.
*/
- public function testVocabularyLanguage() {
+ public function testVocabularyLanguage(): void {
$this->drupalGet('admin/structure/taxonomy/add');
// Check that the field to enable content translation is available.
diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php
index a5cd0a922e6..5bdfc88c390 100644
--- a/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php
@@ -41,7 +41,7 @@ class VocabularyUiTest extends TaxonomyTestBase {
/**
* Create, edit and delete a vocabulary via the user interface.
*/
- public function testVocabularyInterface() {
+ public function testVocabularyInterface(): void {
// Visit the main taxonomy administration page.
$this->drupalGet('admin/structure/taxonomy');
@@ -111,7 +111,7 @@ class VocabularyUiTest extends TaxonomyTestBase {
/**
* Changing weights on the vocabulary overview with two or more vocabularies.
*/
- public function testTaxonomyAdminChangingWeights() {
+ public function testTaxonomyAdminChangingWeights(): void {
// Create some vocabularies.
for ($i = 0; $i < 10; $i++) {
$this->createVocabulary();
@@ -141,7 +141,7 @@ class VocabularyUiTest extends TaxonomyTestBase {
/**
* Tests the vocabulary overview with no vocabularies.
*/
- public function testTaxonomyAdminNoVocabularies() {
+ public function testTaxonomyAdminNoVocabularies(): void {
// Delete all vocabularies.
$vocabularies = Vocabulary::loadMultiple();
foreach ($vocabularies as $key => $vocabulary) {
@@ -157,7 +157,7 @@ class VocabularyUiTest extends TaxonomyTestBase {
/**
* Deleting a vocabulary.
*/
- public function testTaxonomyAdminDeletingVocabulary() {
+ public function testTaxonomyAdminDeletingVocabulary(): void {
// Create a vocabulary.
$vid = $this->randomMachineName();
$edit = [
diff --git a/core/modules/taxonomy/tests/src/Kernel/ContextProvider/TermContextTest.php b/core/modules/taxonomy/tests/src/Kernel/ContextProvider/TermContextTest.php
index 70f37221b71..4ec6e63a8ef 100644
--- a/core/modules/taxonomy/tests/src/Kernel/ContextProvider/TermContextTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/ContextProvider/TermContextTest.php
@@ -36,7 +36,7 @@ class TermContextTest extends KernelTestBase {
/**
* @covers ::getAvailableContexts
*/
- public function testGetAvailableContexts() {
+ public function testGetAvailableContexts(): void {
$context_repository = $this->container->get('context.repository');
// Test taxonomy_term.taxonomy_term_route_context:taxonomy_term exists.
@@ -49,7 +49,7 @@ class TermContextTest extends KernelTestBase {
/**
* @covers ::getRuntimeContexts
*/
- public function testGetRuntimeContexts() {
+ public function testGetRuntimeContexts(): void {
// Create term.
$vocabulary = $this->createVocabulary();
$term = $this->createTerm($vocabulary);
diff --git a/core/modules/taxonomy/tests/src/Kernel/LoadMultipleTest.php b/core/modules/taxonomy/tests/src/Kernel/LoadMultipleTest.php
index a7b19459212..0508a06519b 100644
--- a/core/modules/taxonomy/tests/src/Kernel/LoadMultipleTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/LoadMultipleTest.php
@@ -40,7 +40,7 @@ class LoadMultipleTest extends KernelTestBase {
/**
* Tests loading multiple taxonomy terms by term ID and vocabulary.
*/
- public function testTaxonomyTermMultipleLoad() {
+ public function testTaxonomyTermMultipleLoad(): void {
// Create a vocabulary.
$vocabulary = $this->createVocabulary();
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/MigrateTaxonomyConfigsTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/MigrateTaxonomyConfigsTest.php
index 8a6d5dcfd49..bdb3cc6708e 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/MigrateTaxonomyConfigsTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/MigrateTaxonomyConfigsTest.php
@@ -32,7 +32,7 @@ class MigrateTaxonomyConfigsTest extends MigrateDrupal6TestBase {
/**
* Tests migration of taxonomy variables to taxonomy.settings.yml.
*/
- public function testTaxonomySettings() {
+ public function testTaxonomySettings(): void {
$config = $this->config('taxonomy.settings');
$this->assertSame(100, $config->get('terms_per_page_admin'));
$this->assertFalse($config->get('override_selector'));
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/MigrateTaxonomyTermStubTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/MigrateTaxonomyTermStubTest.php
index 37a9989ae45..bbcdda473bd 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/MigrateTaxonomyTermStubTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/MigrateTaxonomyTermStubTest.php
@@ -35,7 +35,7 @@ class MigrateTaxonomyTermStubTest extends MigrateDrupalTestBase {
/**
* Tests creation of taxonomy term stubs.
*/
- public function testStub() {
+ public function testStub(): void {
Vocabulary::create([
'vid' => 'test_vocabulary',
'name' => 'Test vocabulary',
@@ -46,7 +46,7 @@ class MigrateTaxonomyTermStubTest extends MigrateDrupalTestBase {
/**
* Tests creation of stubs when weight is mapped.
*/
- public function testStubWithWeightMapping() {
+ public function testStubWithWeightMapping(): void {
// Create a vocabulary via migration for the terms to reference.
$vocabulary_data_rows = [
['id' => '1', 'name' => 'tags'],
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/TaxonomyTermDeriverTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/TaxonomyTermDeriverTest.php
index 69ce4563554..0615b19afba 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/TaxonomyTermDeriverTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/TaxonomyTermDeriverTest.php
@@ -20,7 +20,7 @@ class TaxonomyTermDeriverTest extends MigrateDrupal7TestBase {
/**
* Tests fields exist in process pipeline for term migrations.
*/
- public function testBuilder() {
+ public function testBuilder(): void {
// Test a field on the vocabfixed term.
$process = $this->getMigration('d7_taxonomy_term:vocabfixed')->getProcess();
$this->assertSame('field_training', $process['field_training'][0]['source']);
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTest.php
index f0050c878ae..d12ca4f1edd 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTest.php
@@ -31,7 +31,7 @@ class MigrateTaxonomyTermTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 taxonomy term to Drupal 8 migration.
*/
- public function testTaxonomyTerms() {
+ public function testTaxonomyTerms(): void {
$expected_results = [
'1' => [
'source_vid' => 1,
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyVocabularyTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyVocabularyTest.php
index ce4ad03110a..844e40f1e3e 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyVocabularyTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyVocabularyTest.php
@@ -30,7 +30,7 @@ class MigrateTaxonomyVocabularyTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 taxonomy vocabularies to Drupal 8 migration.
*/
- public function testTaxonomyVocabulary() {
+ public function testTaxonomyVocabulary(): void {
for ($i = 0; $i < 3; $i++) {
$j = $i + 1;
$vocabulary = Vocabulary::load("vocabulary_{$j}_i_{$i}_");
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyVocabularyTranslationTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyVocabularyTranslationTest.php
index f67385145b4..502ba4930b3 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyVocabularyTranslationTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyVocabularyTranslationTest.php
@@ -37,7 +37,7 @@ class MigrateTaxonomyVocabularyTranslationTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 i18n taxonomy vocabularies to Drupal 8 migration.
*/
- public function testTaxonomyVocabularyTranslation() {
+ public function testTaxonomyVocabularyTranslation(): void {
$language_manager = \Drupal::service('language_manager');
$config = $language_manager->getLanguageConfigOverride('zu', 'taxonomy.vocabulary.vocabulary_1_i_0_');
$this->assertSame('zu - vocabulary 1 (i=0)', $config->get('name'));
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 e05b439c434..16116a6b9bb 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermLocalizedTranslationTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermLocalizedTranslationTest.php
@@ -119,7 +119,7 @@ class MigrateTermLocalizedTranslationTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 i18n localized taxonomy term to Drupal 8 migration.
*/
- public function testTranslatedLocalizedTaxonomyTerms() {
+ public function testTranslatedLocalizedTaxonomyTerms(): void {
$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, []);
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeComplete.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeComplete.php
index 941d3800573..7fb16096cd4 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeComplete.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeComplete.php
@@ -49,7 +49,7 @@ class MigrateTermNodeComplete extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 term-node association to Drupal 8 migration.
*/
- public function testTermNode() {
+ public function testTermNode(): void {
$this->container->get('entity_type.manager')
->getStorage('node')
->resetCache([1, 2]);
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeRevisionTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeRevisionTest.php
index 208dfdb5f9f..68882ea4d2a 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeRevisionTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeRevisionTest.php
@@ -32,7 +32,7 @@ class MigrateTermNodeRevisionTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 term-node revision association to Drupal 8 migration.
*/
- public function testTermRevisionNode() {
+ public function testTermRevisionNode(): void {
$node = \Drupal::entityTypeManager()->getStorage('node')->loadRevision(2001);
$this->assertCount(2, $node->field_vocabulary_3_i_2_);
$this->assertSame('4', $node->field_vocabulary_3_i_2_[0]->target_id);
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTest.php
index 2f361186137..1d9654dd505 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTest.php
@@ -32,7 +32,7 @@ class MigrateTermNodeTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 term-node association to Drupal 8 migration.
*/
- public function testTermNode() {
+ public function testTermNode(): void {
// This is a base plugin id and we want to run all derivatives.
$this->executeMigrations(['d6_term_node']);
@@ -53,7 +53,7 @@ class MigrateTermNodeTest extends MigrateDrupal6TestBase {
/**
* Tests that term relationships are ignored for un-migrated nodes.
*/
- public function testSkipNonExistentNode() {
+ public function testSkipNonExistentNode(): void {
// Node 2 is migrated by d6_node__story, but we need to pretend that it
// failed, so record that in the map table.
$this->mockFailure('d6_node:story', ['nid' => 2, 'language' => 'en']);
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTranslationTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTranslationTest.php
index c06eae94c5d..8d9465f61a3 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTranslationTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTranslationTest.php
@@ -53,7 +53,7 @@ class MigrateTermNodeTranslationTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 term-node association to Drupal 8 migration.
*/
- public function testTermNode() {
+ public function testTermNode(): void {
$this->container->get('entity_type.manager')
->getStorage('node')
->resetCache([18, 21]);
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityDisplayTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityDisplayTest.php
index 0d3bef67ab5..bf0df9b3122 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityDisplayTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityDisplayTest.php
@@ -39,7 +39,7 @@ class MigrateVocabularyEntityDisplayTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 vocabulary-node type association to Drupal 8 migration.
*/
- public function testVocabularyEntityDisplay() {
+ public function testVocabularyEntityDisplay(): void {
$this->executeMigration('d6_vocabulary_entity_display');
// Test that the field exists.
@@ -61,7 +61,7 @@ class MigrateVocabularyEntityDisplayTest extends MigrateDrupal6TestBase {
* Vocabulary displays should be ignored when they belong to node types which
* were not migrated.
*/
- public function testSkipNonExistentNodeType() {
+ public function testSkipNonExistentNodeType(): void {
// The "story" node type is migrated by d6_node_type but we need to pretend
// that it didn't occur, so record that in the map table.
$this->mockFailure('d6_node_type', ['type' => 'story']);
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityFormDisplayTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityFormDisplayTest.php
index 928e73b8ef0..10a0d991fc3 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityFormDisplayTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityFormDisplayTest.php
@@ -39,7 +39,7 @@ class MigrateVocabularyEntityFormDisplayTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 vocabulary-node type association to Drupal 8 migration.
*/
- public function testVocabularyEntityFormDisplay() {
+ public function testVocabularyEntityFormDisplay(): void {
$this->executeMigration('d6_vocabulary_entity_form_display');
// Test that the field exists.
@@ -66,7 +66,7 @@ class MigrateVocabularyEntityFormDisplayTest extends MigrateDrupal6TestBase {
* Vocabulary displays should be ignored when they belong to node types which
* were not migrated.
*/
- public function testSkipNonExistentNodeType() {
+ public function testSkipNonExistentNodeType(): void {
// The "story" node type is migrated by d6_node_type but we need to pretend
// that it didn't occur, so record that in the map table.
$this->mockFailure('d6_node_type', ['type' => 'story']);
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldInstanceTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldInstanceTest.php
index aa55777e31c..187c357b566 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldInstanceTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldInstanceTest.php
@@ -38,7 +38,7 @@ class MigrateVocabularyFieldInstanceTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 vocabulary-node type association to Drupal 8 migration.
*/
- public function testVocabularyFieldInstance() {
+ public function testVocabularyFieldInstance(): void {
$this->executeMigration('d6_vocabulary_field_instance');
// Test that the field exists. Tags has a multilingual option of 'None'.
@@ -121,7 +121,7 @@ class MigrateVocabularyFieldInstanceTest extends MigrateDrupal6TestBase {
* Vocabulary field instances should be ignored when they belong to node
* types which were not migrated.
*/
- public function testSkipNonExistentNodeType() {
+ public function testSkipNonExistentNodeType(): void {
// The "story" node type is migrated by d6_node_type but we need to pretend
// that it didn't occur, so record that in the map table.
$this->mockFailure('d6_node_type', ['type' => 'story']);
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldTest.php
index c93ba538307..d0204f4fa26 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldTest.php
@@ -30,7 +30,7 @@ class MigrateVocabularyFieldTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 vocabulary-node type association to Drupal 8 migration.
*/
- public function testVocabularyField() {
+ public function testVocabularyField(): void {
// Test that the field exists.
$field_storage_id = 'node.field_tags';
/** @var \Drupal\field\FieldStorageConfigInterface $field_storage */
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateNodeTaxonomyTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateNodeTaxonomyTest.php
index 96dd5bce5f3..791052402c3 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateNodeTaxonomyTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateNodeTaxonomyTest.php
@@ -42,7 +42,7 @@ class MigrateNodeTaxonomyTest extends MigrateDrupal7TestBase {
/**
* Tests node migration from Drupal 7 to 8.
*/
- public function testMigration() {
+ public function testMigration(): void {
$node = Node::load(2);
$this->assertInstanceOf(NodeInterface::class, $node);
$this->assertEquals(9, $node->field_tags[0]->target_id);
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 1ee4e4986f6..657c520e2f7 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php
@@ -108,7 +108,7 @@ class MigrateTaxonomyTermTest extends MigrateDrupal7TestBase {
/**
* Tests the Drupal 7 taxonomy term to Drupal 8 migration.
*/
- public function testTaxonomyTerms() {
+ public function testTaxonomyTerms(): void {
$this->assertEntity(1, 'en', 'General discussion', 'sujet_de_discussion', '', NULL, 2);
// Tests that terms that used the Drupal 7 Title module and that have their
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 84c30acb4e1..1fb8b819fdc 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTranslationTest.php
@@ -132,7 +132,7 @@ class MigrateTaxonomyTermTranslationTest extends MigrateDrupal7TestBase {
/**
* Tests the Drupal i18n taxonomy term to Drupal 8 migration.
*/
- public function testTaxonomyTermTranslation() {
+ public function testTaxonomyTermTranslation(): void {
// Forums vocabulary, no multilingual option.
$this->assertEntity(1, 'en', 'General discussion', 'sujet_de_discussion', NULL, NULL, 2, []);
$this->assertEntity(5, 'en', 'Custom Forum', 'sujet_de_discussion', 'Where the cool kids are.', NULL, 3, []);
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 92be17f71da..3cde0fb5485 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTest.php
@@ -54,7 +54,7 @@ class MigrateTaxonomyVocabularyTest extends MigrateDrupal7TestBase {
/**
* Tests the Drupal 7 taxonomy vocabularies to Drupal 8 migration.
*/
- public function testTaxonomyVocabulary() {
+ public function testTaxonomyVocabulary(): void {
$this->assertEntity('tags', 'Tags', 'Use tags to group articles on similar topics into categories.', 0);
$this->assertEntity('sujet_de_discussion', 'Sujet de discussion', 'Forum navigation vocabulary', -10);
$this->assertEntity('test_vocabulary', 'Test Vocabulary', 'This is the vocabulary description', 0);
diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTranslationTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTranslationTest.php
index 74a6045435a..71f1674660c 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTranslationTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTranslationTest.php
@@ -38,7 +38,7 @@ class MigrateTaxonomyVocabularyTranslationTest extends MigrateDrupal7TestBase {
/**
* Tests the Drupal 7 i18n taxonomy vocabularies to Drupal 8 migration.
*/
- public function testTaxonomyVocabularyTranslation() {
+ public function testTaxonomyVocabularyTranslation(): void {
/** @var \Drupal\language\ConfigurableLanguageManagerInterface $language_manager */
$language_manager = \Drupal::service('language_manager');
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 926d7cafffc..3417af607fc 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTermLocalizedTranslationTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTermLocalizedTranslationTest.php
@@ -115,7 +115,7 @@ class MigrateTermLocalizedTranslationTest extends MigrateDrupal7TestBase {
/**
* Tests the Drupal 6 i18n localized taxonomy term to Drupal 8 migration.
*/
- public function testTranslatedLocalizedTaxonomyTerms() {
+ public function testTranslatedLocalizedTaxonomyTerms(): void {
$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, []);
diff --git a/core/modules/taxonomy/tests/src/Kernel/PendingRevisionTest.php b/core/modules/taxonomy/tests/src/Kernel/PendingRevisionTest.php
index ba42428c66f..0030b64b08c 100644
--- a/core/modules/taxonomy/tests/src/Kernel/PendingRevisionTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/PendingRevisionTest.php
@@ -47,7 +47,7 @@ class PendingRevisionTest extends KernelTestBase {
/**
* Tests that the taxonomy index work correctly with pending revisions.
*/
- public function testTaxonomyIndexWithPendingRevision() {
+ public function testTaxonomyIndexWithPendingRevision(): void {
\Drupal::configFactory()->getEditable('taxonomy.settings')->set('maintain_index_table', TRUE)->save();
Vocabulary::create([
diff --git a/core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php b/core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php
index 7343586c2f1..785a060eb10 100644
--- a/core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php
@@ -31,7 +31,7 @@ class TaxonomyQueryAlterTest extends KernelTestBase {
/**
* Tests that appropriate tags are added when querying the database.
*/
- public function testTaxonomyQueryAlter() {
+ public function testTaxonomyQueryAlter(): void {
$this->installEntitySchema('taxonomy_term');
// Create a new vocabulary and add a few terms to it.
diff --git a/core/modules/taxonomy/tests/src/Kernel/TermEntityQueryTest.php b/core/modules/taxonomy/tests/src/Kernel/TermEntityQueryTest.php
index 9916995674c..91ccb65d901 100644
--- a/core/modules/taxonomy/tests/src/Kernel/TermEntityQueryTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/TermEntityQueryTest.php
@@ -30,7 +30,7 @@ class TermEntityQueryTest extends KernelTestBase {
/**
* Tests that a basic taxonomy entity query works.
*/
- public function testTermEntityQuery() {
+ public function testTermEntityQuery(): void {
$this->installEntitySchema('taxonomy_term');
$vocabulary = $this->createVocabulary();
diff --git a/core/modules/taxonomy/tests/src/Kernel/TermEntityReferenceTest.php b/core/modules/taxonomy/tests/src/Kernel/TermEntityReferenceTest.php
index 417725d8ad0..ab302e6b419 100644
--- a/core/modules/taxonomy/tests/src/Kernel/TermEntityReferenceTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/TermEntityReferenceTest.php
@@ -47,7 +47,7 @@ class TermEntityReferenceTest extends KernelTestBase {
* field to limit the target vocabulary to one of them, ensuring that
* the restriction applies.
*/
- public function testSelectionTestVocabularyRestriction() {
+ public function testSelectionTestVocabularyRestriction(): void {
// Create two vocabularies.
$vocabulary = Vocabulary::create([
'name' => 'test1',
diff --git a/core/modules/taxonomy/tests/src/Kernel/TermHierarchyValidationTest.php b/core/modules/taxonomy/tests/src/Kernel/TermHierarchyValidationTest.php
index 04596aefd8c..ea45ce86327 100644
--- a/core/modules/taxonomy/tests/src/Kernel/TermHierarchyValidationTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/TermHierarchyValidationTest.php
@@ -33,7 +33,7 @@ class TermHierarchyValidationTest extends EntityKernelTestBase {
/**
* Tests the term hierarchy validation with re-parenting in pending revisions.
*/
- public function testTermHierarchyValidation() {
+ public function testTermHierarchyValidation(): void {
$vocabulary_id = $this->randomMachineName();
$vocabulary = Vocabulary::create([
'name' => $vocabulary_id,
diff --git a/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php b/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
index b77aeca661c..c49bdef2fb1 100644
--- a/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
@@ -37,7 +37,7 @@ class TermKernelTest extends KernelTestBase {
/**
* Tests that a deleted term is no longer in the vocabulary.
*/
- public function testTermDelete() {
+ public function testTermDelete(): void {
$vocabulary = $this->createVocabulary();
$valid_term = $this->createTerm($vocabulary);
// Delete a valid term.
@@ -49,7 +49,7 @@ class TermKernelTest extends KernelTestBase {
/**
* Deleting a parent of a term with multiple parents does not delete the term.
*/
- public function testMultipleParentDelete() {
+ public function testMultipleParentDelete(): void {
$vocabulary = $this->createVocabulary();
$parent_term1 = $this->createTerm($vocabulary);
$parent_term2 = $this->createTerm($vocabulary);
@@ -73,7 +73,7 @@ class TermKernelTest extends KernelTestBase {
/**
* Tests a taxonomy with terms that have multiple parents of different depths.
*/
- public function testTaxonomyVocabularyTree() {
+ public function testTaxonomyVocabularyTree(): void {
// Create a new vocabulary with 6 terms.
$vocabulary = $this->createVocabulary();
$term = [];
@@ -153,7 +153,7 @@ class TermKernelTest extends KernelTestBase {
/**
* Tests that a Term is renderable when unsaved (preview).
*/
- public function testTermPreview() {
+ public function testTermPreview(): void {
$entity_manager = \Drupal::entityTypeManager();
$vocabulary = $this->createVocabulary();
diff --git a/core/modules/taxonomy/tests/src/Kernel/TermValidationTest.php b/core/modules/taxonomy/tests/src/Kernel/TermValidationTest.php
index 7228b08a696..9443b3081dd 100644
--- a/core/modules/taxonomy/tests/src/Kernel/TermValidationTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/TermValidationTest.php
@@ -32,7 +32,7 @@ class TermValidationTest extends EntityKernelTestBase {
/**
* Tests the term validation constraints.
*/
- public function testValidation() {
+ public function testValidation(): void {
$this->entityTypeManager->getStorage('taxonomy_vocabulary')->create([
'vid' => 'tags',
'name' => 'Tags',
diff --git a/core/modules/taxonomy/tests/src/Kernel/TokenReplaceTest.php b/core/modules/taxonomy/tests/src/Kernel/TokenReplaceTest.php
index 6fdfd55f1d7..a0253d1aab9 100644
--- a/core/modules/taxonomy/tests/src/Kernel/TokenReplaceTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/TokenReplaceTest.php
@@ -97,7 +97,7 @@ class TokenReplaceTest extends KernelTestBase {
/**
* Creates some terms and a node, then tests the tokens generated from them.
*/
- public function testTaxonomyTokenReplacement() {
+ public function testTaxonomyTokenReplacement(): void {
$token_service = \Drupal::token();
$language_interface = \Drupal::languageManager()->getCurrentLanguage();
diff --git a/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentTransformTermTest.php b/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentTransformTermTest.php
index 3375dea2faf..a6ab7c67c0e 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentTransformTermTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentTransformTermTest.php
@@ -29,7 +29,7 @@ class ArgumentTransformTermTest extends TaxonomyTestBase {
* @param string $name
* The name of the taxonomy term to use for the test.
*/
- public function testTermArgumentTransformation($name) {
+ public function testTermArgumentTransformation($name): void {
/** @var \Drupal\taxonomy\TermInterface $term */
$term = $this->createTerm(['name' => $name]);
diff --git a/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermNameTest.php b/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermNameTest.php
index f93307a4742..582fd7c7d34 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermNameTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermNameTest.php
@@ -80,7 +80,7 @@ class ArgumentValidatorTermNameTest extends TaxonomyTestBase {
/**
* Tests the term name argument validator plugin.
*/
- public function testArgumentValidatorTermName() {
+ public function testArgumentValidatorTermName(): void {
$view = Views::getView('test_taxonomy_name_argument');
$view->initHandlers();
@@ -150,7 +150,7 @@ class ArgumentValidatorTermNameTest extends TaxonomyTestBase {
/**
* Tests the access checking in term name argument validator plugin.
*/
- public function testArgumentValidatorTermNameAccess() {
+ public function testArgumentValidatorTermNameAccess(): void {
$this->installConfig(['user']);
$this->setCurrentUser($this->createUser(['access content']));
$view = Views::getView('test_taxonomy_name_argument');
diff --git a/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermTest.php b/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermTest.php
index 27091feb368..b693dc9aa19 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermTest.php
@@ -56,7 +56,7 @@ class ArgumentValidatorTermTest extends TaxonomyTestBase {
/**
* Tests the term argument validator plugin.
*/
- public function testArgumentValidatorTerm() {
+ public function testArgumentValidatorTerm(): void {
$view = Views::getView('test_argument_validator_term');
$view->initHandlers();
diff --git a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyDefaultArgumentTest.php b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyDefaultArgumentTest.php
index 09138983a14..eea33c764b1 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyDefaultArgumentTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyDefaultArgumentTest.php
@@ -56,7 +56,7 @@ class TaxonomyDefaultArgumentTest extends TaxonomyTestBase {
/**
* Tests the relationship.
*/
- public function testNodePath() {
+ public function testNodePath(): void {
$view = $this->initViewWithRequest($this->nodes[0]->toUrl()->toString());
$expected = implode(',', [$this->term1->id(), $this->term2->id()]);
@@ -65,7 +65,7 @@ class TaxonomyDefaultArgumentTest extends TaxonomyTestBase {
$view->destroy();
}
- public function testNodePathWithViewSelection() {
+ public function testNodePathWithViewSelection(): void {
// Change the term entity reference field to use a view as selection plugin.
\Drupal::service('module_installer')->install(['entity_reference_test']);
@@ -87,7 +87,7 @@ class TaxonomyDefaultArgumentTest extends TaxonomyTestBase {
$this->assertEquals($this->nodes[0]->getCacheTags(), $view->argument['tid']->getPlugin('argument_default')->getCacheTags());
}
- public function testTermPath() {
+ public function testTermPath(): void {
$view = $this->initViewWithRequest($this->term1->toUrl()->toString());
$expected = $this->term1->id();
diff --git a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldTidTest.php b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldTidTest.php
index 295c6d6d279..fd3037bd3ab 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldTidTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldTidTest.php
@@ -61,7 +61,7 @@ class TaxonomyFieldTidTest extends ViewsKernelTestBase {
/**
* Tests the taxonomy field handler.
*/
- public function testViewsHandlerTidField() {
+ public function testViewsHandlerTidField(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
diff --git a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldVidTest.php b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldVidTest.php
index 33d80f99a46..74f4d3238c7 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldVidTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyFieldVidTest.php
@@ -83,7 +83,7 @@ class TaxonomyFieldVidTest extends ViewsKernelTestBase {
/**
* Tests the field handling for the Vocabulary ID.
*/
- public function testViewsHandlerVidField() {
+ public function testViewsHandlerVidField(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
diff --git a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyIndexTidFilterTest.php b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyIndexTidFilterTest.php
index ccfb90379bd..0e8324f82ef 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyIndexTidFilterTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyIndexTidFilterTest.php
@@ -61,7 +61,7 @@ class TaxonomyIndexTidFilterTest extends TaxonomyTestBase {
/**
* Tests dependencies are not added for terms that do not exist.
*/
- public function testConfigDependency() {
+ public function testConfigDependency(): void {
/** @var \Drupal\views\Entity\View $view */
$view = View::load('test_filter_taxonomy_index_tid__non_existing_dependency');
diff --git a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyViewsFieldAccessTest.php b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyViewsFieldAccessTest.php
index 45912d80b10..da8c717ce8e 100644
--- a/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyViewsFieldAccessTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/Views/TaxonomyViewsFieldAccessTest.php
@@ -32,7 +32,7 @@ class TaxonomyViewsFieldAccessTest extends FieldFieldAccessTestBase {
/**
* Check access for taxonomy fields.
*/
- public function testTermFields() {
+ public function testTermFields(): void {
$vocab = Vocabulary::create([
'vid' => 'random',
'name' => 'Randomness',
diff --git a/core/modules/taxonomy/tests/src/Kernel/VocabularyCrudTest.php b/core/modules/taxonomy/tests/src/Kernel/VocabularyCrudTest.php
index 2182b61491f..bf8d4dbe47b 100644
--- a/core/modules/taxonomy/tests/src/Kernel/VocabularyCrudTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/VocabularyCrudTest.php
@@ -44,7 +44,7 @@ class VocabularyCrudTest extends KernelTestBase {
/**
* Tests deleting a taxonomy that contains terms.
*/
- public function testTaxonomyVocabularyDeleteWithTerms() {
+ public function testTaxonomyVocabularyDeleteWithTerms(): void {
$vocabulary = $this->createVocabulary();
$query = \Drupal::entityQuery('taxonomy_term')->accessCheck(FALSE)->count();
@@ -74,7 +74,7 @@ class VocabularyCrudTest extends KernelTestBase {
/**
* Tests for loading multiple vocabularies.
*/
- public function testTaxonomyVocabularyLoadMultiple() {
+ public function testTaxonomyVocabularyLoadMultiple(): void {
// Ensure there are no vocabularies.
$this->assertEmpty(Vocabulary::loadMultiple());
@@ -126,7 +126,7 @@ class VocabularyCrudTest extends KernelTestBase {
/**
* Tests uninstall and reinstall of the taxonomy module.
*/
- public function testUninstallReinstall() {
+ public function testUninstallReinstall(): void {
$vocabulary = $this->createVocabulary();
// Field storages and fields attached to taxonomy term bundles should be
// removed when the module is uninstalled.
diff --git a/core/modules/taxonomy/tests/src/Unit/Menu/TaxonomyLocalTasksTest.php b/core/modules/taxonomy/tests/src/Unit/Menu/TaxonomyLocalTasksTest.php
index dc6799c960a..0b837081e41 100644
--- a/core/modules/taxonomy/tests/src/Unit/Menu/TaxonomyLocalTasksTest.php
+++ b/core/modules/taxonomy/tests/src/Unit/Menu/TaxonomyLocalTasksTest.php
@@ -26,7 +26,7 @@ class TaxonomyLocalTasksTest extends LocalTaskIntegrationTestBase {
*
* @dataProvider getTaxonomyPageRoutes
*/
- public function testTaxonomyPageLocalTasks($route, $subtask = []) {
+ public function testTaxonomyPageLocalTasks($route, $subtask = []): void {
$tasks = [
0 => ['entity.taxonomy_term.canonical', 'entity.taxonomy_term.edit_form', 'entity.taxonomy_term.delete_form'],
];
diff --git a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php
index 687ca455740..58c14e4542d 100644
--- a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php
+++ b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php
@@ -50,7 +50,7 @@ class TaxonomyTermReferenceFieldTest extends UnitTestCase {
/**
* @covers ::defineValueProcessPipeline
*/
- public function testDefineValueProcessPipeline($method = 'defineValueProcessPipeline') {
+ public function testDefineValueProcessPipeline($method = 'defineValueProcessPipeline'): void {
$this->plugin->$method($this->migration, 'field_name', []);
$expected = [
diff --git a/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php b/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php
index ed72f844b67..16573fffa8d 100644
--- a/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php
+++ b/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php
@@ -90,7 +90,7 @@ class TelephoneFieldTest extends BrowserTestBase {
*
* @covers \Drupal\telephone\Plugin\Field\FieldWidget\TelephoneDefaultWidget::formElement
*/
- public function testTelephoneWidget() {
+ public function testTelephoneWidget(): void {
$this->drupalGet('node/add/article');
$this->assertSession()->fieldValueEquals("field_telephone[0][value]", '');
$this->assertSession()->elementAttributeContains('css', 'input[name="field_telephone[0][value]"]', 'maxlength', (string) TelephoneItem::MAX_LENGTH);
@@ -104,7 +104,7 @@ class TelephoneFieldTest extends BrowserTestBase {
*
* @dataProvider providerPhoneNumbers
*/
- public function testTelephoneFormatter($input, $expected) {
+ public function testTelephoneFormatter($input, $expected): void {
// Test basic entry of telephone field.
$edit = [
'title[0][value]' => $this->randomMachineName(),
diff --git a/core/modules/telephone/tests/src/Kernel/TelephoneItemTest.php b/core/modules/telephone/tests/src/Kernel/TelephoneItemTest.php
index 7541a4a2439..b05ba71609c 100644
--- a/core/modules/telephone/tests/src/Kernel/TelephoneItemTest.php
+++ b/core/modules/telephone/tests/src/Kernel/TelephoneItemTest.php
@@ -48,7 +48,7 @@ class TelephoneItemTest extends FieldKernelTestBase {
/**
* Tests using entity fields of the telephone field type.
*/
- public function testTestItem() {
+ public function testTestItem(): void {
// Verify entity creation.
$entity = EntityTest::create();
$value = '+0123456789';
diff --git a/core/modules/text/tests/src/Functional/TextFieldTest.php b/core/modules/text/tests/src/Functional/TextFieldTest.php
index 8bfce08a22b..1ad2c627f3a 100644
--- a/core/modules/text/tests/src/Functional/TextFieldTest.php
+++ b/core/modules/text/tests/src/Functional/TextFieldTest.php
@@ -59,7 +59,7 @@ class TextFieldTest extends StringFieldTest {
/**
* Tests text field validation.
*/
- public function testTextFieldValidation() {
+ public function testTextFieldValidation(): void {
// Create a field with settings to validate.
$max_length = 3;
$field_name = $this->randomMachineName();
@@ -94,7 +94,7 @@ class TextFieldTest extends StringFieldTest {
/**
* Tests required long text with file upload.
*/
- public function testRequiredLongTextWithFileUpload() {
+ public function testRequiredLongTextWithFileUpload(): void {
// Create a text field.
$text_field_name = 'text_long';
$field_storage = FieldStorageConfig::create([
@@ -156,7 +156,7 @@ class TextFieldTest extends StringFieldTest {
/**
* Tests widgets.
*/
- public function testTextfieldWidgets() {
+ public function testTextfieldWidgets(): void {
$this->_testTextfieldWidgets('text', 'text_textfield');
$this->_testTextfieldWidgets('text_long', 'text_textarea');
}
@@ -164,7 +164,7 @@ class TextFieldTest extends StringFieldTest {
/**
* Tests widgets + 'formatted_text' setting.
*/
- public function testTextfieldWidgetsFormatted() {
+ public function testTextfieldWidgetsFormatted(): void {
$this->_testTextfieldWidgetsFormatted('text', 'text_textfield');
$this->_testTextfieldWidgetsFormatted('text_long', 'text_textarea');
}
@@ -172,7 +172,7 @@ class TextFieldTest extends StringFieldTest {
/**
* Test widgets for fields with selected allowed formats.
*/
- public function testTextfieldWidgetsAllowedFormats() {
+ public function testTextfieldWidgetsAllowedFormats(): void {
// Create one text format.
$this->drupalLogin($this->adminUser);
$format1 = FilterFormat::create([
diff --git a/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php b/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php
index 02a2e0f345c..957b7ae5e9d 100644
--- a/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php
+++ b/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php
@@ -66,7 +66,7 @@ class TextareaWithSummaryTest extends WebDriverTestBase {
/**
* Tests the textSummary javascript behavior.
*/
- public function testTextSummaryBehavior() {
+ public function testTextSummaryBehavior(): void {
// Test with field defaults.
$this->assertSummaryToggle();
@@ -104,7 +104,7 @@ class TextareaWithSummaryTest extends WebDriverTestBase {
/**
* Tests that the textSummary behavior is not run for required summary fields.
*/
- public function testTextSummaryRequiredBehavior() {
+ public function testTextSummaryRequiredBehavior(): void {
// Test with field defaults.
$this->assertSummaryToggle();
diff --git a/core/modules/text/tests/src/Kernel/Migrate/MigrateTextConfigsTest.php b/core/modules/text/tests/src/Kernel/Migrate/MigrateTextConfigsTest.php
index 87b6e4cb5dc..6723859b96e 100644
--- a/core/modules/text/tests/src/Kernel/Migrate/MigrateTextConfigsTest.php
+++ b/core/modules/text/tests/src/Kernel/Migrate/MigrateTextConfigsTest.php
@@ -27,7 +27,7 @@ class MigrateTextConfigsTest extends MigrateDrupal6TestBase {
/**
* Tests migration of text variables to text.settings.yml.
*/
- public function testTextSettings() {
+ public function testTextSettings(): void {
$config = $this->config('text.settings');
$this->assertSame(456, $config->get('default_summary_length'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'text.settings', $config->get());
diff --git a/core/modules/text/tests/src/Kernel/TextFormatterTest.php b/core/modules/text/tests/src/Kernel/TextFormatterTest.php
index 02a0491f754..2bb80eaad98 100644
--- a/core/modules/text/tests/src/Kernel/TextFormatterTest.php
+++ b/core/modules/text/tests/src/Kernel/TextFormatterTest.php
@@ -71,7 +71,7 @@ class TextFormatterTest extends EntityKernelTestBase {
/**
* Tests all text field formatters.
*/
- public function testFormatters() {
+ public function testFormatters(): void {
$formatters = [
'text_default',
'text_trimmed',
diff --git a/core/modules/text/tests/src/Kernel/TextItemBaseTest.php b/core/modules/text/tests/src/Kernel/TextItemBaseTest.php
index c080a1ecb46..6d8ce13e160 100644
--- a/core/modules/text/tests/src/Kernel/TextItemBaseTest.php
+++ b/core/modules/text/tests/src/Kernel/TextItemBaseTest.php
@@ -30,7 +30,7 @@ class TextItemBaseTest extends KernelTestBase {
* @covers ::generateSampleValue
* @dataProvider providerTextFieldSampleValue
*/
- public function testTextFieldSampleValue($max_length) {
+ public function testTextFieldSampleValue($max_length): void {
// Create a text field.
$field_definition = BaseFieldDefinition::create('text')
->setTargetEntityTypeId('foo');
@@ -66,7 +66,7 @@ class TextItemBaseTest extends KernelTestBase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependencies() {
+ public function testCalculateDependencies(): void {
$format = FilterFormat::create([
'format' => 'test_format',
'name' => 'Test format',
diff --git a/core/modules/text/tests/src/Kernel/TextSummaryTest.php b/core/modules/text/tests/src/Kernel/TextSummaryTest.php
index 89175b4a3b4..2a77312d18d 100644
--- a/core/modules/text/tests/src/Kernel/TextSummaryTest.php
+++ b/core/modules/text/tests/src/Kernel/TextSummaryTest.php
@@ -43,7 +43,7 @@ class TextSummaryTest extends KernelTestBase {
/**
* Tests text summaries for a question followed by a sentence.
*/
- public function testFirstSentenceQuestion() {
+ public function testFirstSentenceQuestion(): void {
$text = 'A question? A sentence. Another sentence.';
$expected = 'A question? A sentence.';
$this->assertTextSummary($text, $expected, NULL, 30);
@@ -52,7 +52,7 @@ class TextSummaryTest extends KernelTestBase {
/**
* Tests summary with long example.
*/
- public function testLongSentence() {
+ public function testLongSentence(): void {
// 125.
// cSpell:disable
$text =
@@ -74,7 +74,7 @@ class TextSummaryTest extends KernelTestBase {
/**
* Tests various summary length edge cases.
*/
- public function testLength() {
+ public function testLength(): void {
FilterFormat::create([
'format' => 'autop',
'name' => 'Autop',
@@ -234,7 +234,7 @@ class TextSummaryTest extends KernelTestBase {
*
* @see text_summary()
*/
- public function testInvalidFilterFormat() {
+ public function testInvalidFilterFormat(): void {
$this->assertTextSummary($this->randomString(100), '', 'non_existent_format');
}
@@ -252,7 +252,7 @@ class TextSummaryTest extends KernelTestBase {
/**
* Tests required summary.
*/
- public function testRequiredSummary() {
+ public function testRequiredSummary(): void {
$this->installEntitySchema('entity_test');
$this->setUpCurrentUser();
$field_definition = FieldStorageConfig::create([
@@ -314,7 +314,7 @@ class TextSummaryTest extends KernelTestBase {
/**
* Test text normalization when filter_html or filter_htmlcorrector enabled.
*/
- public function testNormalization() {
+ public function testNormalization(): void {
FilterFormat::create([
'format' => 'filter_html_enabled',
'name' => 'Filter HTML enabled',
diff --git a/core/modules/text/tests/src/Kernel/TextWithSummaryItemTest.php b/core/modules/text/tests/src/Kernel/TextWithSummaryItemTest.php
index 6f1e92ec78f..218140a4925 100644
--- a/core/modules/text/tests/src/Kernel/TextWithSummaryItemTest.php
+++ b/core/modules/text/tests/src/Kernel/TextWithSummaryItemTest.php
@@ -59,7 +59,7 @@ class TextWithSummaryItemTest extends FieldKernelTestBase {
/**
* Tests processed properties.
*/
- public function testCrudAndUpdate() {
+ public function testCrudAndUpdate(): void {
$entity_type = 'entity_test';
$this->createField($entity_type);
diff --git a/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php b/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php
index 644e4d4457f..dae798482d5 100644
--- a/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php
+++ b/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php
@@ -53,7 +53,7 @@ class TextFieldTest extends UnitTestCase {
/**
* @covers ::defineValueProcessPipeline
*/
- public function testFilteredTextValueProcessPipeline() {
+ public function testFilteredTextValueProcessPipeline(): void {
$field_info = [
'widget_type' => 'text_textfield',
];
@@ -76,7 +76,7 @@ class TextFieldTest extends UnitTestCase {
/**
* @covers ::defineValueProcessPipeline
*/
- public function testBooleanTextImplicitValueProcessPipeline() {
+ public function testBooleanTextImplicitValueProcessPipeline(): void {
$info = [
'widget_type' => 'optionwidgets_onoff',
'global_settings' => [
@@ -101,7 +101,7 @@ class TextFieldTest extends UnitTestCase {
/**
* @covers ::defineValueProcessPipeline
*/
- public function testBooleanTextExplicitValueProcessPipeline() {
+ public function testBooleanTextExplicitValueProcessPipeline(): void {
$info = [
'widget_type' => 'optionwidgets_onoff',
'global_settings' => [
@@ -163,7 +163,7 @@ class TextFieldTest extends UnitTestCase {
* @covers ::getFieldType
* @dataProvider getFieldTypeProvider
*/
- public function testGetFieldType($expected_type, $widget_type, array $settings = []) {
+ public function testGetFieldType($expected_type, $widget_type, array $settings = []): void {
$row = new Row();
$row->setSourceProperty('widget_type', $widget_type);
$row->setSourceProperty('global_settings', $settings);
diff --git a/core/modules/text/tests/src/Unit/Plugin/migrate/field/d7/TextFieldTest.php b/core/modules/text/tests/src/Unit/Plugin/migrate/field/d7/TextFieldTest.php
index 78cb15b86ff..a057db6f1a0 100644
--- a/core/modules/text/tests/src/Unit/Plugin/migrate/field/d7/TextFieldTest.php
+++ b/core/modules/text/tests/src/Unit/Plugin/migrate/field/d7/TextFieldTest.php
@@ -44,7 +44,7 @@ class TextFieldTest extends UnitTestCase {
* @covers ::getFieldType
* @dataProvider getFieldFormatterTypeProvider
*/
- public function testGetFieldFormatterType($type, $formatter_type, $expected) {
+ public function testGetFieldFormatterType($type, $formatter_type, $expected): void {
$row = new Row();
$row->setSourceProperty('type', $type);
$row->setSourceProperty('formatter/type', $formatter_type);
diff --git a/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php b/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
index d54dcebfc60..39faebd2bb9 100644
--- a/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
+++ b/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
@@ -124,7 +124,7 @@ class ToolbarAdminMenuTest extends BrowserTestBase {
* @see toolbar_modules_installed()
* @see toolbar_modules_uninstalled()
*/
- public function testModuleStatusChangeSubtreesHashCacheClear() {
+ public function testModuleStatusChangeSubtreesHashCacheClear(): void {
// Use an admin role to ensure the user has all available permissions. This
// results in the admin menu links changing as the taxonomy module is
// installed and uninstalled because the role will always have the
@@ -162,7 +162,7 @@ class ToolbarAdminMenuTest extends BrowserTestBase {
/**
* Tests toolbar cache tags implementation.
*/
- public function testMenuLinkUpdateSubtreesHashCacheClear() {
+ public function testMenuLinkUpdateSubtreesHashCacheClear(): void {
// The ID of (any) admin menu link.
$admin_menu_link_id = 'system.admin_config_development';
@@ -185,7 +185,7 @@ class ToolbarAdminMenuTest extends BrowserTestBase {
* @see toolbar_user_role_update()
* @see toolbar_user_update()
*/
- public function testUserRoleUpdateSubtreesHashCacheClear() {
+ public function testUserRoleUpdateSubtreesHashCacheClear(): void {
// Find the new role ID.
$all_rids = $this->adminUser->getRoles();
unset($all_rids[array_search(RoleInterface::AUTHENTICATED_ID, $all_rids)]);
@@ -250,7 +250,7 @@ class ToolbarAdminMenuTest extends BrowserTestBase {
/**
* Tests cache invalidation when one user modifies another user.
*/
- public function testNonCurrentUserAccountUpdates() {
+ public function testNonCurrentUserAccountUpdates(): void {
$admin_user_id = $this->adminUser->id();
$this->hash = $this->getSubtreesHash();
@@ -286,7 +286,7 @@ class ToolbarAdminMenuTest extends BrowserTestBase {
/**
* Tests that toolbar cache is cleared when string translations are made.
*/
- public function testLocaleTranslationSubtreesHashCacheClear() {
+ public function testLocaleTranslationSubtreesHashCacheClear(): void {
$admin_user = $this->adminUser;
// User to translate and delete string.
$translate_user = $this->drupalCreateUser([
@@ -379,7 +379,7 @@ class ToolbarAdminMenuTest extends BrowserTestBase {
/**
* Tests that the 'toolbar/subtrees/{hash}' is reachable and correct.
*/
- public function testSubtreesJsonRequest() {
+ public function testSubtreesJsonRequest(): void {
$admin_user = $this->adminUser;
$this->drupalLogin($admin_user);
// Request a new page to refresh the drupalSettings object.
@@ -394,7 +394,7 @@ class ToolbarAdminMenuTest extends BrowserTestBase {
/**
* Tests that subtrees hashes vary by the language of the page.
*/
- public function testLanguageSwitching() {
+ public function testLanguageSwitching(): void {
// Create a new language with the langcode 'xx'.
$langcode = 'xx';
$language = ConfigurableLanguage::createFromLangcode($langcode);
@@ -418,7 +418,7 @@ class ToolbarAdminMenuTest extends BrowserTestBase {
/**
* Tests that back to site link exists on admin pages, not on content pages.
*/
- public function testBackToSiteLink() {
+ public function testBackToSiteLink(): void {
// Back to site link should exist in the markup.
$this->drupalGet('test-page');
$back_link = $this->cssSelect('.home-toolbar-tab');
@@ -428,7 +428,7 @@ class ToolbarAdminMenuTest extends BrowserTestBase {
/**
* Tests that external links added to the menu appear in the toolbar.
*/
- public function testExternalLink() {
+ public function testExternalLink(): void {
$edit = [
'title[0][value]' => 'External URL',
'link[0][uri]' => 'http://example.org',
diff --git a/core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php b/core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php
index 991ba659171..bd8b056e1c7 100644
--- a/core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php
+++ b/core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php
@@ -68,7 +68,7 @@ class ToolbarCacheContextsTest extends BrowserTestBase {
/**
* Tests toolbar cache integration.
*/
- public function testCacheIntegration() {
+ public function testCacheIntegration(): void {
$this->installExtraModules(['csrf_test', 'dynamic_page_cache']);
$this->drupalLogin($this->adminUser);
$this->drupalGet('test-page');
@@ -82,7 +82,7 @@ class ToolbarCacheContextsTest extends BrowserTestBase {
/**
* Tests toolbar cache contexts.
*/
- public function testToolbarCacheContextsCaller() {
+ public function testToolbarCacheContextsCaller(): void {
// Test with default combination and permission to see toolbar.
$this->assertToolbarCacheContexts(['user', 'session'], 'Expected cache contexts found for default combination and permission to see toolbar.');
diff --git a/core/modules/toolbar/tests/src/Functional/ToolbarHookToolbarTest.php b/core/modules/toolbar/tests/src/Functional/ToolbarHookToolbarTest.php
index 575e56a66e0..03fcc60ab95 100644
--- a/core/modules/toolbar/tests/src/Functional/ToolbarHookToolbarTest.php
+++ b/core/modules/toolbar/tests/src/Functional/ToolbarHookToolbarTest.php
@@ -46,7 +46,7 @@ class ToolbarHookToolbarTest extends BrowserTestBase {
/**
* Tests for a tab and tray provided by a module implementing hook_toolbar().
*/
- public function testHookToolbar() {
+ public function testHookToolbar(): void {
$this->drupalGet('test-page');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php b/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php
index 2eef9be6ecc..3f856e9e88c 100644
--- a/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php
+++ b/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php
@@ -58,7 +58,7 @@ class ToolbarMenuTranslationTest extends BrowserTestBase {
/**
* Tests that toolbar classes don't change when adding a translation.
*/
- public function testToolbarClasses() {
+ public function testToolbarClasses(): void {
$langcode = 'es';
// Add Spanish.
diff --git a/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarActiveTrailTest.php b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarActiveTrailTest.php
index e14a32ba0d5..5c698f23f4b 100644
--- a/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarActiveTrailTest.php
+++ b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarActiveTrailTest.php
@@ -51,7 +51,7 @@ class ToolbarActiveTrailTest extends WebDriverTestBase {
*
* @throws \Behat\Mink\Exception\ElementNotFoundException
*/
- public function testToolbarActiveTrail(string $orientation) {
+ public function testToolbarActiveTrail(string $orientation): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarIntegrationTest.php b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarIntegrationTest.php
index 5c327a71e81..c315f9f6ebb 100644
--- a/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarIntegrationTest.php
+++ b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarIntegrationTest.php
@@ -26,7 +26,7 @@ class ToolbarIntegrationTest extends WebDriverTestBase {
/**
* Tests if the toolbar can be toggled with JavaScript.
*/
- public function testToolbarToggling() {
+ public function testToolbarToggling(): void {
$admin_user = $this->drupalCreateUser([
'access toolbar',
'administer site configuration',
@@ -63,7 +63,7 @@ class ToolbarIntegrationTest extends WebDriverTestBase {
/**
* Tests that the orientation toggle is not shown for empty toolbar items.
*/
- public function testEmptyTray() {
+ public function testEmptyTray(): void {
// Granting access to the toolbar but not any administrative menu links will
// result in an empty toolbar tray for the "Manage" toolbar item.
$admin_user = $this->drupalCreateUser([
diff --git a/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarStoredStateTest.php b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarStoredStateTest.php
index 9f22e736d56..7e2d7b5e0c3 100644
--- a/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarStoredStateTest.php
+++ b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarStoredStateTest.php
@@ -24,7 +24,7 @@ class ToolbarStoredStateTest extends WebDriverTestBase {
*/
protected $defaultTheme = 'stark';
- public function testToolbarStoredState() {
+ public function testToolbarStoredState(): void {
$admin_user = $this->drupalCreateUser([
'access toolbar',
'administer site configuration',
diff --git a/core/modules/toolbar/tests/src/Unit/PageCache/AllowToolbarPathTest.php b/core/modules/toolbar/tests/src/Unit/PageCache/AllowToolbarPathTest.php
index 0b91bc2be86..9a5740cdb32 100644
--- a/core/modules/toolbar/tests/src/Unit/PageCache/AllowToolbarPathTest.php
+++ b/core/modules/toolbar/tests/src/Unit/PageCache/AllowToolbarPathTest.php
@@ -37,7 +37,7 @@ class AllowToolbarPathTest extends UnitTestCase {
* @dataProvider providerTestAllowToolbarPath
* @covers ::check
*/
- public function testAllowToolbarPath($expected_result, $path) {
+ public function testAllowToolbarPath($expected_result, $path): void {
$request = Request::create($path);
$result = $this->policy->check($request);
$this->assertSame($expected_result, $result);
diff --git a/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php b/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php
index e871d8d1355..57cf3541414 100644
--- a/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php
+++ b/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php
@@ -43,7 +43,7 @@ class FileTransferAuthorizeFormTest extends UpdateUploaderTestBase {
*
* @dataProvider archiveFileUrlProvider
*/
- public function testViaAuthorize($url) {
+ public function testViaAuthorize($url): void {
// Ensure the that we can select which file transfer backend to use.
\Drupal::state()->set('test_uploaders_via_prompt', TRUE);
diff --git a/core/modules/update/tests/src/Functional/UpdateContribTest.php b/core/modules/update/tests/src/Functional/UpdateContribTest.php
index 1447874a62c..9e069db4c0d 100644
--- a/core/modules/update/tests/src/Functional/UpdateContribTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateContribTest.php
@@ -54,7 +54,7 @@ class UpdateContribTest extends UpdateTestBase {
/**
* Tests when there is no available release data for a contrib module.
*/
- public function testNoReleasesAvailable() {
+ public function testNoReleasesAvailable(): void {
$this->mockInstalledExtensionsInfo([
'aaa_update_test' => [
'project' => 'aaa_update_test',
@@ -83,7 +83,7 @@ class UpdateContribTest extends UpdateTestBase {
/**
* Tests the basic functionality of a contrib module on the status report.
*/
- public function testUpdateContribBasic() {
+ public function testUpdateContribBasic(): void {
$installed_extensions = [
'aaa_update_test' => [
'project' => 'aaa_update_test',
@@ -147,7 +147,7 @@ class UpdateContribTest extends UpdateTestBase {
* if you sort alphabetically by module name (which is the order we see things
* inside \Drupal\Core\Extension\ExtensionList::getList() for example).
*/
- public function testUpdateContribOrder() {
+ public function testUpdateContribOrder(): void {
// We want core to be version 8.0.0.
$this->mockDefaultExtensionsInfo(['version' => '8.0.0']);
// All the rest should be visible as contrib modules at version 8.x-1.0.
@@ -210,7 +210,7 @@ class UpdateContribTest extends UpdateTestBase {
/**
* Tests that subthemes are notified about security updates for base themes.
*/
- public function testUpdateBaseThemeSecurityUpdate() {
+ public function testUpdateBaseThemeSecurityUpdate(): void {
// @todo https://www.drupal.org/node/2338175 base themes have to be
// installed.
// Only install the subtheme, not the base theme.
@@ -245,7 +245,7 @@ class UpdateContribTest extends UpdateTestBase {
/**
* Tests the Update Manager module when one normal update is available.
*/
- public function testNormalUpdateAvailable() {
+ public function testNormalUpdateAvailable(): void {
$assert_session = $this->assertSession();
// Ensure that the update check requires a token.
$this->drupalGet('admin/reports/updates/check');
@@ -340,7 +340,7 @@ class UpdateContribTest extends UpdateTestBase {
* @todo https://www.drupal.org/node/2338175 extensions can not be hidden and
* base themes have to be installed.
*/
- public function testUpdateShowDisabledThemes() {
+ public function testUpdateShowDisabledThemes(): void {
$update_settings = $this->config('update.settings');
// Make sure all the update_test_* themes are uninstalled.
$extension_config = $this->config('core.extension');
@@ -403,7 +403,7 @@ class UpdateContribTest extends UpdateTestBase {
/**
* Tests updates with a hidden base theme.
*/
- public function testUpdateHiddenBaseTheme() {
+ public function testUpdateHiddenBaseTheme(): void {
\Drupal::moduleHandler()->loadInclude('update', 'inc', 'update.compare');
// Install the subtheme.
@@ -433,7 +433,7 @@ class UpdateContribTest extends UpdateTestBase {
/**
* Makes sure that if we fetch from a broken URL, sane things happen.
*/
- public function testUpdateBrokenFetchURL() {
+ public function testUpdateBrokenFetchURL(): void {
$this->mockInstalledExtensionsInfo([
'aaa_update_test' => [
'project' => 'aaa_update_test',
@@ -496,7 +496,7 @@ class UpdateContribTest extends UpdateTestBase {
* hook_update_status_alter() to try to mark this as missing a security
* update, then assert if we see the appropriate warnings on the right pages.
*/
- public function testHookUpdateStatusAlter() {
+ public function testHookUpdateStatusAlter(): void {
$update_admin_user = $this->drupalCreateUser([
'administer site configuration',
'administer software updates',
@@ -552,7 +552,7 @@ class UpdateContribTest extends UpdateTestBase {
/**
* Tests that core compatibility messages are displayed.
*/
- public function testCoreCompatibilityMessage() {
+ public function testCoreCompatibilityMessage(): void {
$this->mockInstalledExtensionsInfo([
'aaa_update_test' => [
'project' => 'aaa_update_test',
@@ -599,7 +599,7 @@ class UpdateContribTest extends UpdateTestBase {
*
* @dataProvider securityUpdateAvailabilityProvider
*/
- public function testSecurityUpdateAvailability($module_version, array $expected_security_releases, $expected_update_message_type, $fixture) {
+ public function testSecurityUpdateAvailability($module_version, array $expected_security_releases, $expected_update_message_type, $fixture): void {
$this->mockInstalledExtensionsInfo([
'aaa_update_test' => [
'project' => 'aaa_update_test',
@@ -726,7 +726,7 @@ class UpdateContribTest extends UpdateTestBase {
* They both have an '8.x-1.0' release that is unpublished and an '8.x-2.0'
* release that is published and is the expected update.
*/
- public function testRevokedRelease() {
+ public function testRevokedRelease(): void {
$this->mockInstalledExtensionsInfo([
'aaa_update_test' => [
'project' => 'aaa_update_test',
@@ -764,7 +764,7 @@ class UpdateContribTest extends UpdateTestBase {
* 'unsupported' and an '8.x-2.0' release that has the 'Release type' value of
* 'supported' and is the expected update.
*/
- public function testUnsupportedRelease() {
+ public function testUnsupportedRelease(): void {
$this->mockInstalledExtensionsInfo([
'aaa_update_test' => [
'project' => 'aaa_update_test',
@@ -790,7 +790,7 @@ class UpdateContribTest extends UpdateTestBase {
/**
* Tests messages for invalid, empty and missing version strings.
*/
- public function testNonStandardVersionStrings() {
+ public function testNonStandardVersionStrings(): void {
$version_infos = [
'invalid' => [
'version' => 'llama',
diff --git a/core/modules/update/tests/src/Functional/UpdateManagerUpdateTest.php b/core/modules/update/tests/src/Functional/UpdateManagerUpdateTest.php
index 2d6e6e2cd1f..7bd5de5f144 100644
--- a/core/modules/update/tests/src/Functional/UpdateManagerUpdateTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateManagerUpdateTest.php
@@ -182,7 +182,7 @@ class UpdateManagerUpdateTest extends UpdateTestBase {
* - 'recommended': The recommended version.
* - 'range': The versions of Drupal core required for that version.
*/
- public function testIncompatibleUpdatesTable($core_fixture, $a_fixture, $b_fixture, array $compatible, array $incompatible) {
+ public function testIncompatibleUpdatesTable($core_fixture, $a_fixture, $b_fixture, array $compatible, array $incompatible): void {
$assert_session = $this->assertSession();
$compatible_table_locator = '[data-drupal-selector="edit-projects"]';
@@ -231,7 +231,7 @@ class UpdateManagerUpdateTest extends UpdateTestBase {
/**
* Tests the Update form with an uninstalled module in the system.
*/
- public function testUninstalledUpdatesTable() {
+ public function testUninstalledUpdatesTable(): void {
$assert_session = $this->assertSession();
$compatible_table_locator = '[data-drupal-selector="edit-projects"]';
$uninstalled_table_locator = '[data-drupal-selector="edit-uninstalled-projects"]';
diff --git a/core/modules/update/tests/src/Functional/UpdateSemverCoreSecurityCoverageTest.php b/core/modules/update/tests/src/Functional/UpdateSemverCoreSecurityCoverageTest.php
index 65b44c7e006..a23b037189d 100644
--- a/core/modules/update/tests/src/Functional/UpdateSemverCoreSecurityCoverageTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateSemverCoreSecurityCoverageTest.php
@@ -29,7 +29,7 @@ class UpdateSemverCoreSecurityCoverageTest extends UpdateSemverCoreTestBase {
*
* @dataProvider securityCoverageMessageProvider
*/
- public function testSecurityCoverageMessage($installed_version, $fixture, $requirements_section_heading, $message, $mock_date) {
+ public function testSecurityCoverageMessage($installed_version, $fixture, $requirements_section_heading, $message, $mock_date): void {
\Drupal::state()->set('update_test.mock_date', $mock_date);
$this->setProjectInstalledVersion($installed_version);
$this->refreshUpdateStatus(['drupal' => $fixture]);
diff --git a/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php b/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php
index 0566b44e552..bc0264c49a8 100644
--- a/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php
@@ -20,7 +20,7 @@ class UpdateSemverCoreTest extends UpdateSemverCoreTestBase {
/**
* Ensures proper results where there are date mismatches among modules.
*/
- public function testDatestampMismatch() {
+ public function testDatestampMismatch(): void {
$this->mockInstalledExtensionsInfo([
'block' => [
// This is 2001-09-09 01:46:40 GMT, so test for "2001-Sep-".
@@ -42,7 +42,7 @@ class UpdateSemverCoreTest extends UpdateSemverCoreTestBase {
/**
* Tests the Update Manager module when the update server returns 503 errors.
*/
- public function testServiceUnavailable() {
+ public function testServiceUnavailable(): void {
$this->refreshUpdateStatus([], '503-error');
// Ensure that no "Warning: SimpleXMLElement..." parse errors are found.
$this->assertSession()->pageTextNotContains('SimpleXMLElement');
@@ -52,7 +52,7 @@ class UpdateSemverCoreTest extends UpdateSemverCoreTestBase {
/**
* Tests that exactly one fetch task per project is created and not more.
*/
- public function testFetchTasks() {
+ public function testFetchTasks(): void {
$project_a = [
'name' => 'aaa_update_test',
];
@@ -83,7 +83,7 @@ class UpdateSemverCoreTest extends UpdateSemverCoreTestBase {
* - drupal.sec.8.0.2.xml
* 'supported_branches' is '8.0.,8.1.'.
*/
- public function testBrokenThenFixedUpdates() {
+ public function testBrokenThenFixedUpdates(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer site configuration',
'view update notifications',
@@ -117,7 +117,7 @@ class UpdateSemverCoreTest extends UpdateSemverCoreTestBase {
/**
* Tests when a dev release does not have a date.
*/
- public function testDevNoReleaseDate() {
+ public function testDevNoReleaseDate(): void {
$this->setProjectInstalledVersion('8.0.x-dev');
$this->refreshUpdateStatus([$this->updateProject => 'dev-no-date']);
}
diff --git a/core/modules/update/tests/src/Functional/UpdateSemverTestBaselineTrait.php b/core/modules/update/tests/src/Functional/UpdateSemverTestBaselineTrait.php
index 6c1f7af1921..dd388da58f8 100644
--- a/core/modules/update/tests/src/Functional/UpdateSemverTestBaselineTrait.php
+++ b/core/modules/update/tests/src/Functional/UpdateSemverTestBaselineTrait.php
@@ -25,7 +25,7 @@ trait UpdateSemverTestBaselineTrait {
* - '8.0.2' is an unpublished release.
* - '8.0.3' is marked as 'Release type' 'Unsupported'.
*/
- public function testNoUpdatesAvailable() {
+ public function testNoUpdatesAvailable(): void {
foreach ([0, 1] as $minor_version) {
foreach ([0, 1] as $patch_version) {
foreach (['-alpha1', '-beta1', ''] as $extra_version) {
@@ -48,7 +48,7 @@ trait UpdateSemverTestBaselineTrait {
/**
* Tests the Update Manager module when one normal update is available.
*/
- public function testNormalUpdateAvailable() {
+ public function testNormalUpdateAvailable(): void {
$this->setProjectInstalledVersion('8.0.0');
// Ensure that the update check requires a token.
@@ -131,7 +131,7 @@ trait UpdateSemverTestBaselineTrait {
* - drupal.current.xml and semver_test.current.xml: These declare major
* releases supported, 8 and 9.
*/
- public function testMajorUpdateAvailable() {
+ public function testMajorUpdateAvailable(): void {
foreach (['9.0.0', '8.0.0-9.0.0'] as $release_history) {
foreach ([0, 1] as $minor_version) {
foreach ([0, 1] as $patch_version) {
@@ -188,7 +188,7 @@ trait UpdateSemverTestBaselineTrait {
* They both have an '8.0.2' release that is unpublished and an '8.1.0'
* release that is published and is the expected update.
*/
- public function testRevokedRelease() {
+ public function testRevokedRelease(): void {
foreach (['8.1.0', '8.1.0-unsupported'] as $fixture) {
$this->setProjectInstalledVersion('8.0.2');
$this->refreshUpdateStatus([$this->updateProject => $fixture]);
@@ -216,7 +216,7 @@ trait UpdateSemverTestBaselineTrait {
* 'unsupported' and an '8.1.0' release that has the 'Release type' value of
* 'supported' and is the expected update.
*/
- public function testUnsupportedRelease() {
+ public function testUnsupportedRelease(): void {
foreach (['8.1.0', '8.1.0-unsupported'] as $fixture) {
$this->setProjectInstalledVersion('8.0.3');
$this->refreshUpdateStatus([$this->updateProject => $fixture]);
diff --git a/core/modules/update/tests/src/Functional/UpdateSemverTestSecurityAvailabilityTrait.php b/core/modules/update/tests/src/Functional/UpdateSemverTestSecurityAvailabilityTrait.php
index b0b497a23f0..7c2d3faac53 100644
--- a/core/modules/update/tests/src/Functional/UpdateSemverTestSecurityAvailabilityTrait.php
+++ b/core/modules/update/tests/src/Functional/UpdateSemverTestSecurityAvailabilityTrait.php
@@ -23,7 +23,7 @@ trait UpdateSemverTestSecurityAvailabilityTrait {
*
* @dataProvider securityUpdateAvailabilityProvider
*/
- public function testSecurityUpdateAvailability($site_patch_version, array $expected_security_releases, $expected_update_message_type, $fixture) {
+ public function testSecurityUpdateAvailability($site_patch_version, array $expected_security_releases, $expected_update_message_type, $fixture): void {
$this->setProjectInstalledVersion("8.$site_patch_version");
$this->refreshUpdateStatus([$this->updateProject => $fixture]);
$this->assertSecurityUpdates("{$this->updateProject}-8", $expected_security_releases, $expected_update_message_type, $this->updateTableLocator);
diff --git a/core/modules/update/tests/src/Functional/UpdateSettingsFormTest.php b/core/modules/update/tests/src/Functional/UpdateSettingsFormTest.php
index 8b1cad4fc0e..160e3cef1fa 100644
--- a/core/modules/update/tests/src/Functional/UpdateSettingsFormTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateSettingsFormTest.php
@@ -29,7 +29,7 @@ class UpdateSettingsFormTest extends BrowserTestBase {
/**
* Tests the update_settings form.
*/
- public function testUpdateSettingsForm() {
+ public function testUpdateSettingsForm(): void {
$url = Url::fromRoute('update.settings');
// Users without the appropriate permissions should not be able to access.
diff --git a/core/modules/update/tests/src/Functional/UpdateUploadTest.php b/core/modules/update/tests/src/Functional/UpdateUploadTest.php
index 876015b56e7..c6ef1424015 100644
--- a/core/modules/update/tests/src/Functional/UpdateUploadTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateUploadTest.php
@@ -48,7 +48,7 @@ class UpdateUploadTest extends UpdateUploaderTestBase {
/**
* Tests upload, extraction, and update of a module.
*/
- public function testUploadModule() {
+ public function testUploadModule(): void {
// Ensure that the update information is correct before testing.
update_get_available(TRUE);
@@ -152,7 +152,7 @@ class UpdateUploadTest extends UpdateUploaderTestBase {
/**
* Ensures that archiver extensions are properly merged in the UI.
*/
- public function testFileNameExtensionMerging() {
+ public function testFileNameExtensionMerging(): void {
$this->drupalGet('admin/modules/install');
// Make sure the bogus extension supported by update_test.module is there.
$this->assertSession()->responseMatches('/file extensions are supported:.*update-test-extension/');
@@ -163,7 +163,7 @@ class UpdateUploadTest extends UpdateUploaderTestBase {
/**
* Checks the messages on update manager pages when missing a security update.
*/
- public function testUpdateManagerCoreSecurityUpdateMessages() {
+ public function testUpdateManagerCoreSecurityUpdateMessages(): void {
$this->mockDefaultExtensionsInfo(['version' => '8.0.0']);
$this->mockReleaseHistory(['drupal' => '0.2-sec']);
$this->config('update.settings')
@@ -200,7 +200,7 @@ class UpdateUploadTest extends UpdateUploaderTestBase {
/**
* Tests only an *.info.yml file are detected without supporting files.
*/
- public function testUpdateDirectory() {
+ public function testUpdateDirectory(): void {
$type = Updater::getUpdaterFromDirectory($this->root . '/core/modules/update/tests/modules/aaa_update_test');
$this->assertEquals('Drupal\\Core\\Updater\\Module', $type, 'Detected a Module');
diff --git a/core/modules/update/tests/src/Kernel/Migrate/d6/MigrateUpdateConfigsTest.php b/core/modules/update/tests/src/Kernel/Migrate/d6/MigrateUpdateConfigsTest.php
index 55f28af68ac..598904725d6 100644
--- a/core/modules/update/tests/src/Kernel/Migrate/d6/MigrateUpdateConfigsTest.php
+++ b/core/modules/update/tests/src/Kernel/Migrate/d6/MigrateUpdateConfigsTest.php
@@ -32,7 +32,7 @@ class MigrateUpdateConfigsTest extends MigrateDrupal6TestBase {
/**
* Tests migration of update variables to update.settings.yml.
*/
- public function testUpdateSettings() {
+ public function testUpdateSettings(): void {
$config = $this->config('update.settings');
$this->assertSame(2, $config->get('fetch.max_attempts'));
$this->assertSame('https://updates.drupal.org/release-history', $config->get('fetch.url'));
diff --git a/core/modules/update/tests/src/Kernel/UpdateDeleteFileIfStaleTest.php b/core/modules/update/tests/src/Kernel/UpdateDeleteFileIfStaleTest.php
index f9133fce50c..16fc7dfe338 100644
--- a/core/modules/update/tests/src/Kernel/UpdateDeleteFileIfStaleTest.php
+++ b/core/modules/update/tests/src/Kernel/UpdateDeleteFileIfStaleTest.php
@@ -24,7 +24,7 @@ class UpdateDeleteFileIfStaleTest extends KernelTestBase {
/**
* Tests the deletion of stale files.
*/
- public function testUpdateDeleteFileIfStale() {
+ public function testUpdateDeleteFileIfStale(): void {
$file_system = $this->container->get('file_system');
$file_name = $file_system->saveData($this->randomMachineName(), 'public://');
diff --git a/core/modules/update/tests/src/Kernel/UpdateReportTest.php b/core/modules/update/tests/src/Kernel/UpdateReportTest.php
index 8fb925b2342..16468e62c5b 100644
--- a/core/modules/update/tests/src/Kernel/UpdateReportTest.php
+++ b/core/modules/update/tests/src/Kernel/UpdateReportTest.php
@@ -30,7 +30,7 @@ class UpdateReportTest extends KernelTestBase {
/**
* @dataProvider providerTemplatePreprocessUpdateReport
*/
- public function testTemplatePreprocessUpdateReport($variables) {
+ public function testTemplatePreprocessUpdateReport($variables): void {
\Drupal::moduleHandler()->loadInclude('update', 'inc', 'update.report');
// The function should run without an exception being thrown when the value
@@ -66,7 +66,7 @@ class UpdateReportTest extends KernelTestBase {
*
* @see template_preprocess_update_fetch_error_message()
*/
- public function testTemplatePreprocessUpdateFetchErrorMessageNoDblog() {
+ public function testTemplatePreprocessUpdateFetchErrorMessageNoDblog(): void {
$build = [
'#theme' => 'update_fetch_error_message',
];
@@ -88,7 +88,7 @@ class UpdateReportTest extends KernelTestBase {
*
* @see template_preprocess_update_fetch_error_message()
*/
- public function testTemplatePreprocessUpdateFetchErrorMessageWithDblog() {
+ public function testTemplatePreprocessUpdateFetchErrorMessageWithDblog(): void {
\Drupal::moduleHandler()->loadInclude('update', 'inc', 'update.report');
$this->enableModules(['dblog', 'user']);
diff --git a/core/modules/update/tests/src/Kernel/UpdateStorageTest.php b/core/modules/update/tests/src/Kernel/UpdateStorageTest.php
index 2dfbd63eebe..0e486d3ca18 100644
--- a/core/modules/update/tests/src/Kernel/UpdateStorageTest.php
+++ b/core/modules/update/tests/src/Kernel/UpdateStorageTest.php
@@ -23,7 +23,7 @@ class UpdateStorageTest extends KernelTestBase {
/**
* Tests the Update module storage is cleared correctly.
*/
- public function testUpdateStorage() {
+ public function testUpdateStorage(): void {
// Setting values in both key stores, then installing the module and
// testing if these key values are cleared.
$keyvalue_update = $this->container->get('keyvalue.expirable')->get('update');
diff --git a/core/modules/update/tests/src/Unit/Menu/UpdateLocalTasksTest.php b/core/modules/update/tests/src/Unit/Menu/UpdateLocalTasksTest.php
index 41a6da04403..f70cf012f00 100644
--- a/core/modules/update/tests/src/Unit/Menu/UpdateLocalTasksTest.php
+++ b/core/modules/update/tests/src/Unit/Menu/UpdateLocalTasksTest.php
@@ -26,7 +26,7 @@ class UpdateLocalTasksTest extends LocalTaskIntegrationTestBase {
*
* @dataProvider getUpdateReportRoutes
*/
- public function testUpdateReportLocalTasks($route) {
+ public function testUpdateReportLocalTasks($route): void {
$this->assertLocalTasks($route, [
0 => ['update.status', 'update.settings', 'update.report_update'],
]);
@@ -48,7 +48,7 @@ class UpdateLocalTasksTest extends LocalTaskIntegrationTestBase {
*
* @dataProvider getUpdateModuleRoutes
*/
- public function testUpdateModuleLocalTasks($route) {
+ public function testUpdateModuleLocalTasks($route): void {
$this->assertLocalTasks($route, [
0 => ['update.module_update'],
]);
@@ -68,7 +68,7 @@ class UpdateLocalTasksTest extends LocalTaskIntegrationTestBase {
*
* @dataProvider getUpdateThemeRoutes
*/
- public function testUpdateThemeLocalTasks($route) {
+ public function testUpdateThemeLocalTasks($route): void {
$this->assertLocalTasks($route, [
0 => ['update.theme_update'],
]);
diff --git a/core/modules/update/tests/src/Unit/ProjectCoreCompatibilityTest.php b/core/modules/update/tests/src/Unit/ProjectCoreCompatibilityTest.php
index c98380f5f87..e8d872bb88f 100644
--- a/core/modules/update/tests/src/Unit/ProjectCoreCompatibilityTest.php
+++ b/core/modules/update/tests/src/Unit/ProjectCoreCompatibilityTest.php
@@ -18,7 +18,7 @@ class ProjectCoreCompatibilityTest extends UnitTestCase {
* @covers ::setReleaseMessage
* @dataProvider providerSetProjectCoreCompatibilityRanges
*/
- public function testSetProjectCoreCompatibilityRanges(array $project_data, $core_data, array $supported_branches, array $core_releases, array $expected_releases, array $expected_security_updates) {
+ public function testSetProjectCoreCompatibilityRanges(array $project_data, $core_data, array $supported_branches, array $core_releases, array $expected_releases, array $expected_security_updates): void {
$project_compatibility = new ProjectCoreCompatibility($core_data, $core_releases, $supported_branches);
$project_compatibility->setStringTranslation($this->getStringTranslationStub());
$project_compatibility->setReleaseMessage($project_data);
diff --git a/core/modules/update/tests/src/Unit/UpdateFetcherTest.php b/core/modules/update/tests/src/Unit/UpdateFetcherTest.php
index 58d4c68ed8e..4d9b47053a2 100644
--- a/core/modules/update/tests/src/Unit/UpdateFetcherTest.php
+++ b/core/modules/update/tests/src/Unit/UpdateFetcherTest.php
@@ -102,7 +102,7 @@ class UpdateFetcherTest extends UnitTestCase {
*
* @see \Drupal\update\UpdateFetcher::buildFetchUrl()
*/
- public function testUpdateBuildFetchUrl(array $project, $site_key, $expected) {
+ public function testUpdateBuildFetchUrl(array $project, $site_key, $expected): void {
$url = $this->updateFetcher->buildFetchUrl($project, $site_key);
$this->assertEquals($url, $expected);
$this->assertFalse($this->logger->hasErrorRecords());
@@ -176,7 +176,7 @@ class UpdateFetcherTest extends UnitTestCase {
* @covers ::doRequest
* @covers ::fetchProjectData
*/
- public function testUpdateFetcherNoFallback() {
+ public function testUpdateFetcherNoFallback(): void {
// First, try without the HTTP fallback setting, and HTTPS mocked to fail.
$settings = new Settings([]);
$this->mockClient(
@@ -205,7 +205,7 @@ class UpdateFetcherTest extends UnitTestCase {
* @covers ::doRequest
* @covers ::fetchProjectData
*/
- public function testUpdateFetcherHttpFallback() {
+ public function testUpdateFetcherHttpFallback(): void {
$settings = new Settings(['update_fetch_with_http_fallback' => TRUE]);
$this->mockClient(
new Response(500, [], 'HTTPS failed'),
diff --git a/core/modules/update/tests/src/Unit/UpdateMailTest.php b/core/modules/update/tests/src/Unit/UpdateMailTest.php
index 5e46b751b20..ca3f73891d2 100644
--- a/core/modules/update/tests/src/Unit/UpdateMailTest.php
+++ b/core/modules/update/tests/src/Unit/UpdateMailTest.php
@@ -76,7 +76,7 @@ class UpdateMailTest extends UnitTestCase {
*
* @dataProvider providerTestUpdateEmail
*/
- public function testUpdateEmail($notification_threshold, $params, $authorized, array $expected_body) {
+ public function testUpdateEmail($notification_threshold, $params, $authorized, array $expected_body): void {
$langcode = 'en';
$available_updates_url = 'https://example.com/admin/reports/updates';
$update_settings_url = 'https://example.com/admin/reports/updates/settings';
diff --git a/core/modules/user/tests/src/Functional/AccessRoleUITest.php b/core/modules/user/tests/src/Functional/AccessRoleUITest.php
index 910b6f93b91..12c51ee1344 100644
--- a/core/modules/user/tests/src/Functional/AccessRoleUITest.php
+++ b/core/modules/user/tests/src/Functional/AccessRoleUITest.php
@@ -43,7 +43,7 @@ class AccessRoleUITest extends UITestBase {
/**
* Tests the role access plugin UI.
*/
- public function testAccessRoleUI() {
+ public function testAccessRoleUI(): void {
$entity_type_manager = $this->container->get('entity_type.manager');
$entity_type_manager->getStorage('user_role')->create(['id' => 'custom_role', 'label' => 'Custom role'])->save();
$access_url = "admin/structure/views/nojs/display/test_access_role/default/access_options";
diff --git a/core/modules/user/tests/src/Functional/Rest/UserResourceTestBase.php b/core/modules/user/tests/src/Functional/Rest/UserResourceTestBase.php
index ef8db324607..d3c03ff5b8c 100644
--- a/core/modules/user/tests/src/Functional/Rest/UserResourceTestBase.php
+++ b/core/modules/user/tests/src/Functional/Rest/UserResourceTestBase.php
@@ -147,7 +147,7 @@ abstract class UserResourceTestBase extends EntityResourceTestBase {
/**
* Tests PATCHing security-sensitive base fields of the logged in account.
*/
- public function testPatchDxForSecuritySensitiveBaseFields() {
+ public function testPatchDxForSecuritySensitiveBaseFields(): void {
// The anonymous user is never allowed to modify itself.
if (!static::$auth) {
$this->markTestSkipped();
@@ -263,7 +263,7 @@ abstract class UserResourceTestBase extends EntityResourceTestBase {
/**
* Tests PATCHing security-sensitive base fields to change other users.
*/
- public function testPatchSecurityOtherUser() {
+ public function testPatchSecurityOtherUser(): void {
// The anonymous user is never allowed to modify other users.
if (!static::$auth) {
$this->markTestSkipped();
diff --git a/core/modules/user/tests/src/Functional/Rest/UserXmlAnonTest.php b/core/modules/user/tests/src/Functional/Rest/UserXmlAnonTest.php
index 7f80ee915e2..9b25e90217b 100644
--- a/core/modules/user/tests/src/Functional/Rest/UserXmlAnonTest.php
+++ b/core/modules/user/tests/src/Functional/Rest/UserXmlAnonTest.php
@@ -34,7 +34,7 @@ class UserXmlAnonTest extends UserResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchDxForSecuritySensitiveBaseFields() {
+ public function testPatchDxForSecuritySensitiveBaseFields(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/user/tests/src/Functional/Rest/UserXmlBasicAuthTest.php b/core/modules/user/tests/src/Functional/Rest/UserXmlBasicAuthTest.php
index 7935fdc115a..04384ea35c0 100644
--- a/core/modules/user/tests/src/Functional/Rest/UserXmlBasicAuthTest.php
+++ b/core/modules/user/tests/src/Functional/Rest/UserXmlBasicAuthTest.php
@@ -44,7 +44,7 @@ class UserXmlBasicAuthTest extends UserResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchDxForSecuritySensitiveBaseFields() {
+ public function testPatchDxForSecuritySensitiveBaseFields(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
@@ -52,7 +52,7 @@ class UserXmlBasicAuthTest extends UserResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchSecurityOtherUser() {
+ public function testPatchSecurityOtherUser(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/user/tests/src/Functional/Rest/UserXmlCookieTest.php b/core/modules/user/tests/src/Functional/Rest/UserXmlCookieTest.php
index 6524f2a53fe..f4257b75f72 100644
--- a/core/modules/user/tests/src/Functional/Rest/UserXmlCookieTest.php
+++ b/core/modules/user/tests/src/Functional/Rest/UserXmlCookieTest.php
@@ -39,7 +39,7 @@ class UserXmlCookieTest extends UserResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchDxForSecuritySensitiveBaseFields() {
+ public function testPatchDxForSecuritySensitiveBaseFields(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
@@ -47,7 +47,7 @@ class UserXmlCookieTest extends UserResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchSecurityOtherUser() {
+ public function testPatchSecurityOtherUser(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/user/tests/src/Functional/UserAccountLinksTest.php b/core/modules/user/tests/src/Functional/UserAccountLinksTest.php
index 2579ea39e93..61631cf5f71 100644
--- a/core/modules/user/tests/src/Functional/UserAccountLinksTest.php
+++ b/core/modules/user/tests/src/Functional/UserAccountLinksTest.php
@@ -38,7 +38,7 @@ class UserAccountLinksTest extends BrowserTestBase {
/**
* Tests the secondary menu.
*/
- public function testSecondaryMenu() {
+ public function testSecondaryMenu(): void {
// Create a regular user.
$user = $this->drupalCreateUser([]);
@@ -62,7 +62,7 @@ class UserAccountLinksTest extends BrowserTestBase {
/**
* Tests disabling the 'My account' link.
*/
- public function testDisabledAccountLink() {
+ public function testDisabledAccountLink(): void {
// Create an admin user and log in.
$this->drupalLogin($this->drupalCreateUser([
'access administration pages',
@@ -95,7 +95,7 @@ class UserAccountLinksTest extends BrowserTestBase {
/**
* Tests page title is set correctly on user account tabs.
*/
- public function testAccountPageTitles() {
+ public function testAccountPageTitles(): void {
// Default page titles are suffixed with the site name - Drupal.
$title_suffix = ' | Drupal';
@@ -121,7 +121,7 @@ class UserAccountLinksTest extends BrowserTestBase {
/**
* Ensures that logout URL redirects an anonymous user to the front page.
*/
- public function testAnonymousLogout() {
+ public function testAnonymousLogout(): void {
$this->drupalGet('user/logout');
$this->assertSession()->addressEquals('/');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/user/tests/src/Functional/UserAdminLanguageTest.php b/core/modules/user/tests/src/Functional/UserAdminLanguageTest.php
index e12257285ae..416dc52ae58 100644
--- a/core/modules/user/tests/src/Functional/UserAdminLanguageTest.php
+++ b/core/modules/user/tests/src/Functional/UserAdminLanguageTest.php
@@ -57,7 +57,7 @@ class UserAdminLanguageTest extends BrowserTestBase {
/**
* Tests that admin language is not configurable in single language sites.
*/
- public function testUserAdminLanguageConfigurationNotAvailableWithOnlyOneLanguage() {
+ public function testUserAdminLanguageConfigurationNotAvailableWithOnlyOneLanguage(): void {
$this->drupalLogin($this->adminUser);
$this->setLanguageNegotiation();
$path = 'user/' . $this->adminUser->id() . '/edit';
@@ -69,7 +69,7 @@ class UserAdminLanguageTest extends BrowserTestBase {
/**
* Tests that admin language negotiation is configurable only if enabled.
*/
- public function testUserAdminLanguageConfigurationAvailableWithAdminLanguageNegotiation() {
+ public function testUserAdminLanguageConfigurationAvailableWithAdminLanguageNegotiation(): void {
$this->drupalLogin($this->adminUser);
$this->addCustomLanguage();
$path = 'user/' . $this->adminUser->id() . '/edit';
@@ -97,7 +97,7 @@ class UserAdminLanguageTest extends BrowserTestBase {
* have a setting for pages they cannot access, so they should not be able to
* set a language for those pages.
*/
- public function testUserAdminLanguageConfigurationAvailableIfAdminLanguageNegotiationIsEnabled() {
+ public function testUserAdminLanguageConfigurationAvailableIfAdminLanguageNegotiationIsEnabled(): void {
$this->drupalLogin($this->adminUser);
// Adds a new language, because with only one language, setting won't show.
$this->addCustomLanguage();
@@ -124,7 +124,7 @@ class UserAdminLanguageTest extends BrowserTestBase {
/**
* Tests the actual language negotiation.
*/
- public function testActualNegotiation() {
+ public function testActualNegotiation(): void {
$this->drupalLogin($this->adminUser);
$this->addCustomLanguage();
$this->setLanguageNegotiation();
diff --git a/core/modules/user/tests/src/Functional/UserAdminListingTest.php b/core/modules/user/tests/src/Functional/UserAdminListingTest.php
index c356cc2f8ce..af9c8470709 100644
--- a/core/modules/user/tests/src/Functional/UserAdminListingTest.php
+++ b/core/modules/user/tests/src/Functional/UserAdminListingTest.php
@@ -23,7 +23,7 @@ class UserAdminListingTest extends BrowserTestBase {
/**
* Tests the listing.
*/
- public function testUserListing() {
+ public function testUserListing(): void {
// Ensure the anonymous user cannot access the admin listing.
$this->drupalGet('admin/people');
$this->assertSession()->statusCodeEquals(403);
diff --git a/core/modules/user/tests/src/Functional/UserAdminTest.php b/core/modules/user/tests/src/Functional/UserAdminTest.php
index 20ce9feed16..f65fb427e88 100644
--- a/core/modules/user/tests/src/Functional/UserAdminTest.php
+++ b/core/modules/user/tests/src/Functional/UserAdminTest.php
@@ -48,7 +48,7 @@ class UserAdminTest extends BrowserTestBase {
/**
* Registers a user and deletes it.
*/
- public function testUserAdmin() {
+ public function testUserAdmin(): void {
$config = $this->config('user.settings');
$user_a = $this->drupalCreateUser();
$user_a->name = 'User A';
@@ -182,7 +182,7 @@ class UserAdminTest extends BrowserTestBase {
/**
* Tests the alternate notification email address for user mails.
*/
- public function testNotificationEmailAddress() {
+ public function testNotificationEmailAddress(): void {
// Test that the Notification Email address field is on the config page.
$admin_user = $this->drupalCreateUser([
'administer users',
diff --git a/core/modules/user/tests/src/Functional/UserBlocksTest.php b/core/modules/user/tests/src/Functional/UserBlocksTest.php
index 0232c79915f..383fd8ae991 100644
--- a/core/modules/user/tests/src/Functional/UserBlocksTest.php
+++ b/core/modules/user/tests/src/Functional/UserBlocksTest.php
@@ -49,7 +49,7 @@ class UserBlocksTest extends BrowserTestBase {
/**
* Tests that user login block is hidden from user/login.
*/
- public function testUserLoginBlockVisibility() {
+ public function testUserLoginBlockVisibility(): void {
// Array keyed list where key being the URL address and value being expected
// visibility as boolean type.
$paths = [
@@ -72,7 +72,7 @@ class UserBlocksTest extends BrowserTestBase {
/**
* Tests the user login block.
*/
- public function testUserLoginBlock() {
+ public function testUserLoginBlock(): void {
// Create a user with some permission that anonymous users lack.
$user = $this->drupalCreateUser(['administer permissions']);
diff --git a/core/modules/user/tests/src/Functional/UserCancelTest.php b/core/modules/user/tests/src/Functional/UserCancelTest.php
index c1750c979fb..7ee8ba2752b 100644
--- a/core/modules/user/tests/src/Functional/UserCancelTest.php
+++ b/core/modules/user/tests/src/Functional/UserCancelTest.php
@@ -46,7 +46,7 @@ class UserCancelTest extends BrowserTestBase {
/**
* Attempt to cancel account without permission.
*/
- public function testUserCancelWithoutPermission() {
+ public function testUserCancelWithoutPermission(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
$user_storage = $this->container->get('entity_type.manager')->getStorage('user');
@@ -83,7 +83,7 @@ class UserCancelTest extends BrowserTestBase {
/**
* Tests ability to change the permission for canceling users.
*/
- public function testUserCancelChangePermission() {
+ public function testUserCancelChangePermission(): void {
\Drupal::service('module_installer')->install(['user_form_test']);
$this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
@@ -108,7 +108,7 @@ class UserCancelTest extends BrowserTestBase {
* This should never be possible, or the site owner would become unable to
* administer the site.
*/
- public function testUserCancelUid1() {
+ public function testUserCancelUid1(): void {
$user_storage = $this->container->get('entity_type.manager')->getStorage('user');
\Drupal::service('module_installer')->install(['views']);
@@ -132,7 +132,7 @@ class UserCancelTest extends BrowserTestBase {
/**
* Attempt invalid account cancellations.
*/
- public function testUserCancelInvalid() {
+ public function testUserCancelInvalid(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
$user_storage = $this->container->get('entity_type.manager')->getStorage('user');
@@ -179,7 +179,7 @@ class UserCancelTest extends BrowserTestBase {
/**
* Disable account and keep all content.
*/
- public function testUserBlock() {
+ public function testUserBlock(): void {
$this->config('user.settings')->set('cancel_method', 'user_cancel_block')->save();
$user_storage = $this->container->get('entity_type.manager')->getStorage('user');
@@ -216,7 +216,7 @@ class UserCancelTest extends BrowserTestBase {
/**
* Disable account and unpublish all content.
*/
- public function testUserBlockUnpublish() {
+ public function testUserBlockUnpublish(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$this->config('user.settings')->set('cancel_method', 'user_cancel_block_unpublish')->save();
// Create comment field on page.
@@ -288,7 +288,7 @@ class UserCancelTest extends BrowserTestBase {
/**
* Tests nodes are unpublished even if inaccessible to cancelling user.
*/
- public function testUserBlockUnpublishNodeAccess() {
+ public function testUserBlockUnpublishNodeAccess(): void {
\Drupal::service('module_installer')->install(['node_access_test', 'user_form_test']);
// Setup node access
@@ -330,7 +330,7 @@ class UserCancelTest extends BrowserTestBase {
/**
* Delete account and anonymize all content.
*/
- public function testUserAnonymize() {
+ public function testUserAnonymize(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
// Create comment field on page.
@@ -414,7 +414,7 @@ class UserCancelTest extends BrowserTestBase {
/**
* Delete account and anonymize all content using a batch process.
*/
- public function testUserAnonymizeBatch() {
+ public function testUserAnonymizeBatch(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
$user_storage = $this->container->get('entity_type.manager')->getStorage('user');
@@ -461,7 +461,7 @@ class UserCancelTest extends BrowserTestBase {
/**
* Delete account and remove all content.
*/
- public function testUserDelete() {
+ public function testUserDelete(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
$this->config('user.settings')->set('cancel_method', 'user_cancel_delete')->save();
\Drupal::service('module_installer')->install(['comment']);
@@ -542,7 +542,7 @@ class UserCancelTest extends BrowserTestBase {
/**
* Create an administrative user and delete another user.
*/
- public function testUserCancelByAdmin() {
+ public function testUserCancelByAdmin(): void {
$this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
// Create a regular user.
@@ -566,7 +566,7 @@ class UserCancelTest extends BrowserTestBase {
/**
* Tests deletion of a user account without an email address.
*/
- public function testUserWithoutEmailCancelByAdmin() {
+ public function testUserWithoutEmailCancelByAdmin(): void {
$this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
// Create a regular user.
@@ -593,7 +593,7 @@ class UserCancelTest extends BrowserTestBase {
/**
* Create an administrative user and mass-delete other users.
*/
- public function testMassUserCancelByAdmin() {
+ public function testMassUserCancelByAdmin(): void {
\Drupal::service('module_installer')->install(['views']);
$this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
$user_storage = $this->container->get('entity_type.manager')->getStorage('user');
@@ -648,7 +648,7 @@ class UserCancelTest extends BrowserTestBase {
/**
* Tests user cancel with node access.
*/
- public function testUserDeleteWithContentAndNodeAccess() {
+ public function testUserDeleteWithContentAndNodeAccess(): void {
\Drupal::service('module_installer')->install(['node_access_test']);
// Rebuild node access.
@@ -664,7 +664,7 @@ class UserCancelTest extends BrowserTestBase {
/**
* Delete account and anonymize all content and it's translations.
*/
- public function testUserAnonymizeTranslations() {
+ public function testUserAnonymizeTranslations(): void {
$this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
// Create comment field on page.
$this->addDefaultCommentField('node', 'page');
diff --git a/core/modules/user/tests/src/Functional/UserCreateFailMailTest.php b/core/modules/user/tests/src/Functional/UserCreateFailMailTest.php
index 646decbe535..7708b78c2c3 100644
--- a/core/modules/user/tests/src/Functional/UserCreateFailMailTest.php
+++ b/core/modules/user/tests/src/Functional/UserCreateFailMailTest.php
@@ -28,7 +28,7 @@ class UserCreateFailMailTest extends BrowserTestBase {
/**
* Tests the create user administration page.
*/
- public function testUserAdd() {
+ public function testUserAdd(): void {
$user = $this->drupalCreateUser(['administer users']);
$this->drupalLogin($user);
diff --git a/core/modules/user/tests/src/Functional/UserCreateTest.php b/core/modules/user/tests/src/Functional/UserCreateTest.php
index 04d4b29803f..5f5b614c8de 100644
--- a/core/modules/user/tests/src/Functional/UserCreateTest.php
+++ b/core/modules/user/tests/src/Functional/UserCreateTest.php
@@ -35,7 +35,7 @@ class UserCreateTest extends BrowserTestBase {
/**
* Tests user creation and display from the administration interface.
*/
- public function testUserAdd() {
+ public function testUserAdd(): void {
$user = $this->drupalCreateUser(['administer users']);
$this->drupalLogin($user);
diff --git a/core/modules/user/tests/src/Functional/UserEditTest.php b/core/modules/user/tests/src/Functional/UserEditTest.php
index 3c872d3e60e..295bc01f26e 100644
--- a/core/modules/user/tests/src/Functional/UserEditTest.php
+++ b/core/modules/user/tests/src/Functional/UserEditTest.php
@@ -22,7 +22,7 @@ class UserEditTest extends BrowserTestBase {
/**
* Tests user edit page.
*/
- public function testUserEdit() {
+ public function testUserEdit(): void {
// Test user edit functionality.
$user1 = $this->drupalCreateUser(['change own username']);
$user2 = $this->drupalCreateUser([]);
@@ -147,7 +147,7 @@ class UserEditTest extends BrowserTestBase {
* password that is literally "0" was not possible. This test ensures that
* this regression can't happen again.
*/
- public function testUserWith0Password() {
+ public function testUserWith0Password(): void {
$admin = $this->drupalCreateUser(['administer users']);
$this->drupalLogin($admin);
// Create a regular user.
@@ -162,7 +162,7 @@ class UserEditTest extends BrowserTestBase {
/**
* Tests editing of a user account without an email address.
*/
- public function testUserWithoutEmailEdit() {
+ public function testUserWithoutEmailEdit(): void {
// Test that an admin can edit users without an email address.
$admin = $this->drupalCreateUser(['administer users']);
$this->drupalLogin($admin);
@@ -179,7 +179,7 @@ class UserEditTest extends BrowserTestBase {
/**
* Tests well known change password route redirects to user edit form.
*/
- public function testUserWellKnownChangePasswordAuth() {
+ public function testUserWellKnownChangePasswordAuth(): void {
$account = $this->drupalCreateUser([]);
$this->drupalLogin($account);
$this->drupalGet('.well-known/change-password');
@@ -189,7 +189,7 @@ class UserEditTest extends BrowserTestBase {
/**
* Tests well known change password route returns 403 to anonymous user.
*/
- public function testUserWellKnownChangePasswordAnon() {
+ public function testUserWellKnownChangePasswordAnon(): void {
$this->drupalGet('.well-known/change-password');
$this->assertSession()->statusCodeEquals(403);
}
@@ -197,7 +197,7 @@ class UserEditTest extends BrowserTestBase {
/**
* Tests that a user is able to change site language.
*/
- public function testUserChangeSiteLanguage() {
+ public function testUserChangeSiteLanguage(): void {
// Install these modules here as these aren't needed for other test methods.
\Drupal::service('module_installer')->install([
'content_translation',
@@ -250,7 +250,7 @@ class UserEditTest extends BrowserTestBase {
/**
* Tests the account form implements entity field access for mail.
*/
- public function testUserMailFieldAccess() {
+ public function testUserMailFieldAccess(): void {
\Drupal::state()->set('user_access_test_forbid_mail_edit', TRUE);
\Drupal::service('module_installer')->install(['user_access_test']);
$user = $this->drupalCreateUser();
diff --git a/core/modules/user/tests/src/Functional/UserEditedOwnAccountTest.php b/core/modules/user/tests/src/Functional/UserEditedOwnAccountTest.php
index 6ee3d5d5782..9ff72b182a1 100644
--- a/core/modules/user/tests/src/Functional/UserEditedOwnAccountTest.php
+++ b/core/modules/user/tests/src/Functional/UserEditedOwnAccountTest.php
@@ -19,7 +19,7 @@ class UserEditedOwnAccountTest extends BrowserTestBase {
*/
protected $defaultTheme = 'stark';
- public function testUserEditedOwnAccount() {
+ public function testUserEditedOwnAccount(): void {
// Change account setting 'Who can register accounts?' to Administrators
// only.
$this->config('user.settings')->set('register', UserInterface::REGISTER_ADMINISTRATORS_ONLY)->save();
diff --git a/core/modules/user/tests/src/Functional/UserLanguageCreationTest.php b/core/modules/user/tests/src/Functional/UserLanguageCreationTest.php
index e52f99d9d09..fe6af7e8289 100644
--- a/core/modules/user/tests/src/Functional/UserLanguageCreationTest.php
+++ b/core/modules/user/tests/src/Functional/UserLanguageCreationTest.php
@@ -29,7 +29,7 @@ class UserLanguageCreationTest extends BrowserTestBase {
/**
* Functional test for language handling during user creation.
*/
- public function testLocalUserCreation() {
+ public function testLocalUserCreation(): void {
// User to add and remove language and create new users.
$admin_user = $this->drupalCreateUser([
'administer languages',
diff --git a/core/modules/user/tests/src/Functional/UserLanguageTest.php b/core/modules/user/tests/src/Functional/UserLanguageTest.php
index ca907eb1929..20b49139263 100644
--- a/core/modules/user/tests/src/Functional/UserLanguageTest.php
+++ b/core/modules/user/tests/src/Functional/UserLanguageTest.php
@@ -29,7 +29,7 @@ class UserLanguageTest extends BrowserTestBase {
/**
* Tests if user can change their default language.
*/
- public function testUserLanguageConfiguration() {
+ public function testUserLanguageConfiguration(): void {
// User to add and remove language.
$admin_user = $this->drupalCreateUser([
'administer languages',
diff --git a/core/modules/user/tests/src/Functional/UserLoginHttpTest.php b/core/modules/user/tests/src/Functional/UserLoginHttpTest.php
index 3cf3eeebd2f..2cf4b13c3e7 100644
--- a/core/modules/user/tests/src/Functional/UserLoginHttpTest.php
+++ b/core/modules/user/tests/src/Functional/UserLoginHttpTest.php
@@ -103,7 +103,7 @@ class UserLoginHttpTest extends BrowserTestBase {
/**
* Tests user session life cycle.
*/
- public function testLogin() {
+ public function testLogin(): void {
// Without the serialization module only JSON is supported.
$this->doTestLogin('json');
@@ -239,7 +239,7 @@ class UserLoginHttpTest extends BrowserTestBase {
/**
* Tests user password reset.
*/
- public function testPasswordReset() {
+ public function testPasswordReset(): void {
// Create a user account.
$account = $this->drupalCreateUser();
diff --git a/core/modules/user/tests/src/Functional/UserLoginTest.php b/core/modules/user/tests/src/Functional/UserLoginTest.php
index 94a6d34d63f..4302113c42a 100644
--- a/core/modules/user/tests/src/Functional/UserLoginTest.php
+++ b/core/modules/user/tests/src/Functional/UserLoginTest.php
@@ -34,7 +34,7 @@ class UserLoginTest extends BrowserTestBase {
/**
* Tests login with destination.
*/
- public function testLoginCacheTagsAndDestination() {
+ public function testLoginCacheTagsAndDestination(): void {
$this->drupalGet('user/login');
// The user login form says "Enter your <site name> username.", hence it
// depends on config:system.site, and its cache tags should be present.
@@ -50,7 +50,7 @@ class UserLoginTest extends BrowserTestBase {
/**
* Tests the global login flood control.
*/
- public function testGlobalLoginFloodControl() {
+ public function testGlobalLoginFloodControl(): void {
$this->config('user.flood')
->set('ip_limit', 10)
// Set a high per-user limit out so that it is not relevant in the test.
@@ -94,7 +94,7 @@ class UserLoginTest extends BrowserTestBase {
/**
* Tests the per-user login flood control.
*/
- public function testPerUserLoginFloodControl() {
+ public function testPerUserLoginFloodControl(): void {
$this->config('user.flood')
// Set a high global limit out so that it is not relevant in the test.
->set('ip_limit', 4000)
@@ -141,7 +141,7 @@ class UserLoginTest extends BrowserTestBase {
/**
* Tests user password is re-hashed upon login after changing $count_log2.
*/
- public function testPasswordRehashOnLogin() {
+ public function testPasswordRehashOnLogin(): void {
// Retrieve instance of password hashing algorithm.
$password_hasher = $this->container->get('password');
@@ -182,7 +182,7 @@ class UserLoginTest extends BrowserTestBase {
/**
* Tests log in with a maximum length and a too long password.
*/
- public function testPasswordLengthLogin() {
+ public function testPasswordLengthLogin(): void {
// Create a new user and authenticate.
$account = $this->drupalCreateUser([]);
$current_password = $account->passRaw;
@@ -243,7 +243,7 @@ class UserLoginTest extends BrowserTestBase {
/**
* Tests with a browser that denies cookies.
*/
- public function testCookiesNotAccepted() {
+ public function testCookiesNotAccepted(): void {
$this->drupalGet('user/login');
$form_build_id = $this->getSession()->getPage()->findField('form_build_id');
@@ -348,7 +348,7 @@ class UserLoginTest extends BrowserTestBase {
/**
* Tests that user login form has the autocomplete attributes.
*/
- public function testAutocompleteHtmlAttributes() {
+ public function testAutocompleteHtmlAttributes(): void {
$this->drupalGet('user/login');
$name_field = $this->getSession()->getPage()->findField('name');
$pass_field = $this->getSession()->getPage()->findField('pass');
diff --git a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
index 5ecf3b53f48..21cbfd5639a 100644
--- a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
+++ b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
@@ -83,7 +83,7 @@ class UserPasswordResetTest extends BrowserTestBase {
/**
* Tests password reset functionality.
*/
- public function testUserPasswordReset() {
+ public function testUserPasswordReset(): void {
// Verify that accessing the password reset form without having the session
// variables set results in an access denied message.
$this->drupalGet(Url::fromRoute('user.reset.form', ['uid' => $this->account->id()]));
@@ -242,7 +242,7 @@ class UserPasswordResetTest extends BrowserTestBase {
*
* @dataProvider languagePrefixTestProvider
*/
- public function testUserPasswordResetPreferredLanguage($setPreferredLangcode, $activeLangcode, $prefix, $visitingUrl, $expectedResetUrl, $unexpectedResetUrl) {
+ public function testUserPasswordResetPreferredLanguage($setPreferredLangcode, $activeLangcode, $prefix, $visitingUrl, $expectedResetUrl, $unexpectedResetUrl): void {
// Set two new languages.
ConfigurableLanguage::createFromLangcode('fr')->save();
ConfigurableLanguage::createFromLangcode('zh-hant')->save();
@@ -326,7 +326,7 @@ class UserPasswordResetTest extends BrowserTestBase {
/**
* Tests user password reset while logged in.
*/
- public function testUserPasswordResetLoggedIn() {
+ public function testUserPasswordResetLoggedIn(): void {
$another_account = $this->drupalCreateUser();
$this->drupalLogin($another_account);
$this->drupalGet('user/password');
@@ -382,7 +382,7 @@ class UserPasswordResetTest extends BrowserTestBase {
/**
* Tests the text box on incorrect login via link to password reset page.
*/
- public function testUserResetPasswordTextboxNotFilled() {
+ public function testUserResetPasswordTextboxNotFilled(): void {
$this->drupalGet('user/login');
$edit = [
'name' => $this->randomMachineName(),
@@ -409,7 +409,7 @@ class UserPasswordResetTest extends BrowserTestBase {
/**
* Tests password reset flood control for one user.
*/
- public function testUserResetPasswordUserFloodControl() {
+ public function testUserResetPasswordUserFloodControl(): void {
\Drupal::configFactory()->getEditable('user.flood')
->set('user_limit', 3)
->save();
@@ -440,7 +440,7 @@ class UserPasswordResetTest extends BrowserTestBase {
/**
* Tests password reset flood control for one IP.
*/
- public function testUserResetPasswordIpFloodControl() {
+ public function testUserResetPasswordIpFloodControl(): void {
\Drupal::configFactory()->getEditable('user.flood')
->set('ip_limit', 3)
->save();
@@ -466,7 +466,7 @@ class UserPasswordResetTest extends BrowserTestBase {
/**
* Tests user password reset flood control is cleared on successful reset.
*/
- public function testUserResetPasswordUserFloodControlIsCleared() {
+ public function testUserResetPasswordUserFloodControlIsCleared(): void {
\Drupal::configFactory()->getEditable('user.flood')
->set('user_limit', 3)
->save();
@@ -506,7 +506,7 @@ class UserPasswordResetTest extends BrowserTestBase {
/**
* Tests user password reset flood control is cleared on admin reset.
*/
- public function testUserResetPasswordUserFloodControlAdmin() {
+ public function testUserResetPasswordUserFloodControlAdmin(): void {
$admin_user = $this->drupalCreateUser([
'administer account settings',
'administer users',
@@ -602,7 +602,7 @@ class UserPasswordResetTest extends BrowserTestBase {
/**
* Make sure that users cannot forge password reset URLs of other users.
*/
- public function testResetImpersonation() {
+ public function testResetImpersonation(): void {
// Create two identical user accounts except for the user name. They must
// have the same empty password, so we can't use $this->drupalCreateUser().
$edit = [];
@@ -647,7 +647,7 @@ class UserPasswordResetTest extends BrowserTestBase {
/**
* Test the autocomplete attribute is present.
*/
- public function testResetFormHasAutocompleteAttribute() {
+ public function testResetFormHasAutocompleteAttribute(): void {
$this->drupalGet('user/password');
$field = $this->getSession()->getPage()->findField('name');
$this->assertEquals('username', $field->getAttribute('autocomplete'));
diff --git a/core/modules/user/tests/src/Functional/UserPermissionsAdminTest.php b/core/modules/user/tests/src/Functional/UserPermissionsAdminTest.php
index 7321e44d23c..fd96252c689 100644
--- a/core/modules/user/tests/src/Functional/UserPermissionsAdminTest.php
+++ b/core/modules/user/tests/src/Functional/UserPermissionsAdminTest.php
@@ -22,7 +22,7 @@ class UserPermissionsAdminTest extends BrowserTestBase {
/**
* Tests granting and revoking permissions via the UI sorts permissions.
*/
- public function testPermissionsSorting() {
+ public function testPermissionsSorting(): void {
$role = Role::create(['id' => 'test_role', 'label' => 'Test role']);
// Start the role with a permission that is near the end of the alphabet.
$role->grantPermission('view user email addresses');
diff --git a/core/modules/user/tests/src/Functional/UserPermissionsTest.php b/core/modules/user/tests/src/Functional/UserPermissionsTest.php
index 5dbee10410b..b9fea138163 100644
--- a/core/modules/user/tests/src/Functional/UserPermissionsTest.php
+++ b/core/modules/user/tests/src/Functional/UserPermissionsTest.php
@@ -57,7 +57,7 @@ class UserPermissionsTest extends BrowserTestBase {
/**
* Tests changing user permissions through the permissions pages.
*/
- public function testUserPermissionChanges() {
+ public function testUserPermissionChanges(): void {
$permissions_hash_generator = $this->container->get('user_permissions_hash_generator');
$storage = $this->container->get('entity_type.manager')->getStorage('user_role');
@@ -123,7 +123,7 @@ class UserPermissionsTest extends BrowserTestBase {
/**
* Tests assigning of permissions for the administrator role.
*/
- public function testAdministratorRole() {
+ public function testAdministratorRole(): void {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/people/role-settings');
@@ -168,7 +168,7 @@ class UserPermissionsTest extends BrowserTestBase {
/**
* Verify proper permission changes by user_role_change_permissions().
*/
- public function testUserRoleChangePermissions() {
+ public function testUserRoleChangePermissions(): void {
$permissions_hash_generator = $this->container->get('user_permissions_hash_generator');
$rid = $this->rid;
@@ -200,7 +200,7 @@ class UserPermissionsTest extends BrowserTestBase {
/**
* Verify 'access content' is listed in the correct location.
*/
- public function testAccessContentPermission() {
+ public function testAccessContentPermission(): void {
$this->drupalLogin($this->adminUser);
// When Node is not installed the 'access content' permission is listed next
@@ -220,7 +220,7 @@ class UserPermissionsTest extends BrowserTestBase {
/**
* Verify that module-specific pages have correct access.
*/
- public function testAccessModulePermission() {
+ public function testAccessModulePermission(): void {
$this->drupalLogin($this->adminUser);
// When Node is not installed, the node-permissions page is not available.
@@ -254,7 +254,7 @@ class UserPermissionsTest extends BrowserTestBase {
/**
* Verify that bundle-specific pages work properly.
*/
- public function testAccessBundlePermission() {
+ public function testAccessBundlePermission(): void {
$this->drupalLogin($this->adminUser);
\Drupal::service('module_installer')->install(['contact', 'taxonomy']);
diff --git a/core/modules/user/tests/src/Functional/UserPictureTest.php b/core/modules/user/tests/src/Functional/UserPictureTest.php
index 3d1f05d7769..a57506d9726 100644
--- a/core/modules/user/tests/src/Functional/UserPictureTest.php
+++ b/core/modules/user/tests/src/Functional/UserPictureTest.php
@@ -69,7 +69,7 @@ class UserPictureTest extends BrowserTestBase {
/**
* Tests creation, display, and deletion of user pictures.
*/
- public function testCreateDeletePicture() {
+ public function testCreateDeletePicture(): void {
$this->drupalLogin($this->webUser);
// Save a new picture.
@@ -108,7 +108,7 @@ class UserPictureTest extends BrowserTestBase {
/**
* Tests embedded users on node pages.
*/
- public function testPictureOnNodeComment() {
+ public function testPictureOnNodeComment(): void {
$this->drupalLogin($this->webUser);
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
@@ -177,7 +177,7 @@ class UserPictureTest extends BrowserTestBase {
*
* @see user_user_view_alter()
*/
- public function testUserViewAlter() {
+ public function testUserViewAlter(): void {
\Drupal::service('module_installer')->install(['image_module_test']);
// Set dummy_image_formatter to the default view mode of user entity.
EntityViewDisplay::load('user.user.default')->setComponent('user_picture', [
diff --git a/core/modules/user/tests/src/Functional/UserRegistrationRestTest.php b/core/modules/user/tests/src/Functional/UserRegistrationRestTest.php
index aadf5ada016..651d9d2a7fd 100644
--- a/core/modules/user/tests/src/Functional/UserRegistrationRestTest.php
+++ b/core/modules/user/tests/src/Functional/UserRegistrationRestTest.php
@@ -71,7 +71,7 @@ class UserRegistrationRestTest extends ResourceTestBase {
/**
* Tests that only anonymous users can register users.
*/
- public function testRegisterUser() {
+ public function testRegisterUser(): void {
$config = $this->config('user.settings');
// Test out different setting User Registration and Email Verification.
diff --git a/core/modules/user/tests/src/Functional/UserRegistrationTest.php b/core/modules/user/tests/src/Functional/UserRegistrationTest.php
index a6b95713baa..5aac6f11f9e 100644
--- a/core/modules/user/tests/src/Functional/UserRegistrationTest.php
+++ b/core/modules/user/tests/src/Functional/UserRegistrationTest.php
@@ -30,7 +30,7 @@ class UserRegistrationTest extends BrowserTestBase {
*/
protected $defaultTheme = 'stark';
- public function testRegistrationWithEmailVerification() {
+ public function testRegistrationWithEmailVerification(): void {
$config = $this->config('user.settings');
// Require email verification.
$config->set('verify_mail', TRUE)->save();
@@ -72,7 +72,7 @@ class UserRegistrationTest extends BrowserTestBase {
$this->assertFalse($new_user->isActive(), 'New account is blocked until approved by an administrator.');
}
- public function testRegistrationWithoutEmailVerification() {
+ public function testRegistrationWithoutEmailVerification(): void {
$config = $this->config('user.settings');
// Don't require email verification and allow registration by site visitors
// without administrator approval.
@@ -144,7 +144,7 @@ class UserRegistrationTest extends BrowserTestBase {
$this->assertSession()->pageTextContains('Member for');
}
- public function testRegistrationEmailDuplicates() {
+ public function testRegistrationEmailDuplicates(): void {
// Don't require email verification and allow registration by site visitors
// without administrator approval.
$this->config('user.settings')
@@ -178,7 +178,7 @@ class UserRegistrationTest extends BrowserTestBase {
* This is a regression test for https://www.drupal.org/node/2500527 to ensure
* that the form is not cached on GET requests.
*/
- public function testUuidFormState() {
+ public function testUuidFormState(): void {
\Drupal::service('module_installer')->install(['image']);
// Add a picture field in order to ensure that no form cache is written,
@@ -242,7 +242,7 @@ class UserRegistrationTest extends BrowserTestBase {
$this->assertNotEmpty($user_storage->loadByProperties(['name' => $edit['name']]));
}
- public function testRegistrationDefaultValues() {
+ public function testRegistrationDefaultValues(): void {
// Don't require email verification and allow registration by site visitors
// without administrator approval.
$config_user_settings = $this->config('user.settings')
@@ -288,7 +288,7 @@ class UserRegistrationTest extends BrowserTestBase {
* @see \Drupal\user\Plugin\Validation\Constraint\UserNameUnique
* @see \Drupal\user\Plugin\Validation\Constraint\UserMailUnique
*/
- public function testUniqueFields() {
+ public function testUniqueFields(): void {
$account = $this->drupalCreateUser();
$edit = ['mail' => 'test@example.com', 'name' => $account->getAccountName()];
@@ -305,7 +305,7 @@ class UserRegistrationTest extends BrowserTestBase {
/**
* Tests Field API fields on user registration forms.
*/
- public function testRegistrationWithUserFields() {
+ public function testRegistrationWithUserFields(): void {
// Create a field on 'user' entity type.
$field_storage = FieldStorageConfig::create([
'field_name' => 'test_user_field',
diff --git a/core/modules/user/tests/src/Functional/UserRoleAdminTest.php b/core/modules/user/tests/src/Functional/UserRoleAdminTest.php
index 7cc87835eec..3c54ea3c0f4 100644
--- a/core/modules/user/tests/src/Functional/UserRoleAdminTest.php
+++ b/core/modules/user/tests/src/Functional/UserRoleAdminTest.php
@@ -49,7 +49,7 @@ class UserRoleAdminTest extends BrowserTestBase {
/**
* Tests adding, renaming and deleting roles.
*/
- public function testRoleAdministration() {
+ public function testRoleAdministration(): void {
$this->drupalLogin($this->adminUser);
$default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId();
// Test presence of tab.
@@ -113,7 +113,7 @@ class UserRoleAdminTest extends BrowserTestBase {
/**
* Tests user role weight change operation and ordering.
*/
- public function testRoleWeightOrdering() {
+ public function testRoleWeightOrdering(): void {
$this->drupalLogin($this->adminUser);
$roles = Role::loadMultiple();
$weight = count($roles);
diff --git a/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php b/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php
index c6115a7854a..44f9a36cb9a 100644
--- a/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php
+++ b/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php
@@ -33,7 +33,7 @@ class UserRolesAssignmentTest extends BrowserTestBase {
/**
* Test that user can be assigned role and that the role can be removed again.
*/
- public function testAssignAndRemoveRole() {
+ public function testAssignAndRemoveRole(): void {
$rid = $this->drupalCreateRole(['administer users']);
$account = $this->drupalCreateUser();
@@ -55,7 +55,7 @@ class UserRolesAssignmentTest extends BrowserTestBase {
/**
* Tests assigning a role at user creation and removing the role.
*/
- public function testCreateUserWithRole() {
+ public function testCreateUserWithRole(): void {
$rid = $this->drupalCreateRole(['administer users']);
// Create a new user and add the role at the same time.
$edit = [
diff --git a/core/modules/user/tests/src/Functional/UserSearchTest.php b/core/modules/user/tests/src/Functional/UserSearchTest.php
index 57c75a908f7..d1432f9f4af 100644
--- a/core/modules/user/tests/src/Functional/UserSearchTest.php
+++ b/core/modules/user/tests/src/Functional/UserSearchTest.php
@@ -25,7 +25,7 @@ class UserSearchTest extends BrowserTestBase {
*/
protected $defaultTheme = 'stark';
- public function testUserSearch() {
+ public function testUserSearch(): void {
// Verify that a user without 'administer users' permission cannot search
// for users by email address. Additionally, ensure that the username has a
// plus sign to ensure searching works with that.
diff --git a/core/modules/user/tests/src/Functional/UserSubAdminTest.php b/core/modules/user/tests/src/Functional/UserSubAdminTest.php
index 250ce6abcad..c5ec390da20 100644
--- a/core/modules/user/tests/src/Functional/UserSubAdminTest.php
+++ b/core/modules/user/tests/src/Functional/UserSubAdminTest.php
@@ -26,7 +26,7 @@ class UserSubAdminTest extends BrowserTestBase {
/**
* Tests create and cancel forms as 'sub-admin'.
*/
- public function testSubAdmin() {
+ public function testSubAdmin(): void {
$user = $this->drupalCreateUser(['sub-admin']);
$this->drupalLogin($user);
diff --git a/core/modules/user/tests/src/Functional/UserTimeZoneTest.php b/core/modules/user/tests/src/Functional/UserTimeZoneTest.php
index 1a630754a11..7f25b391cc0 100644
--- a/core/modules/user/tests/src/Functional/UserTimeZoneTest.php
+++ b/core/modules/user/tests/src/Functional/UserTimeZoneTest.php
@@ -29,7 +29,7 @@ class UserTimeZoneTest extends BrowserTestBase {
/**
* Tests the display of dates and time when user-configurable time zones are set.
*/
- public function testUserTimeZone() {
+ public function testUserTimeZone(): void {
// Setup date/time settings for Los Angeles time.
$this->config('system.date')
->set('timezone.user.configurable', 1)
diff --git a/core/modules/user/tests/src/Functional/UserTokenReplaceTest.php b/core/modules/user/tests/src/Functional/UserTokenReplaceTest.php
index 881010cf8bb..a9bc370c6ce 100644
--- a/core/modules/user/tests/src/Functional/UserTokenReplaceTest.php
+++ b/core/modules/user/tests/src/Functional/UserTokenReplaceTest.php
@@ -40,7 +40,7 @@ class UserTokenReplaceTest extends BrowserTestBase {
/**
* Creates a user, then tests the tokens generated from it.
*/
- public function testUserTokenReplacement() {
+ public function testUserTokenReplacement(): void {
$token_service = \Drupal::token();
$language_interface = \Drupal::languageManager()->getCurrentLanguage();
$url_options = [
diff --git a/core/modules/user/tests/src/Functional/UserTranslationUITest.php b/core/modules/user/tests/src/Functional/UserTranslationUITest.php
index 1af1453eaae..1a388b93130 100644
--- a/core/modules/user/tests/src/Functional/UserTranslationUITest.php
+++ b/core/modules/user/tests/src/Functional/UserTranslationUITest.php
@@ -100,7 +100,7 @@ class UserTranslationUITest extends ContentTranslationUITestBase {
/**
* Tests translated user deletion.
*/
- public function testTranslatedUserDeletion() {
+ public function testTranslatedUserDeletion(): void {
$this->drupalLogin($this->administrator);
$entity_id = $this->createEntity($this->getNewEntityValues('en'), 'en');
diff --git a/core/modules/user/tests/src/Functional/Views/AccessRoleTest.php b/core/modules/user/tests/src/Functional/Views/AccessRoleTest.php
index 6aaf342bedc..58a5b0d346b 100644
--- a/core/modules/user/tests/src/Functional/Views/AccessRoleTest.php
+++ b/core/modules/user/tests/src/Functional/Views/AccessRoleTest.php
@@ -42,7 +42,7 @@ class AccessRoleTest extends AccessTestBase {
/**
* Tests role access plugin.
*/
- public function testAccessRole() {
+ public function testAccessRole(): void {
/** @var \Drupal\views\ViewEntityInterface $view */
$view = \Drupal::entityTypeManager()->getStorage('view')->load('test_access_role');
$display = &$view->getDisplay('default');
@@ -113,7 +113,7 @@ class AccessRoleTest extends AccessTestBase {
/**
* Tests access on render caching.
*/
- public function testRenderCaching() {
+ public function testRenderCaching(): void {
$view = Views::getView('test_access_role');
$display = &$view->storage->getDisplay('default');
$display['display_options']['cache'] = [
diff --git a/core/modules/user/tests/src/Functional/Views/BulkFormAccessTest.php b/core/modules/user/tests/src/Functional/Views/BulkFormAccessTest.php
index 14c6bdf879f..93ff96adabd 100644
--- a/core/modules/user/tests/src/Functional/Views/BulkFormAccessTest.php
+++ b/core/modules/user/tests/src/Functional/Views/BulkFormAccessTest.php
@@ -37,7 +37,7 @@ class BulkFormAccessTest extends UserTestBase {
/**
* Tests if users that may not be edited, can not be edited in bulk.
*/
- public function testUserEditAccess() {
+ public function testUserEditAccess(): void {
// Create an authenticated user.
$no_edit_user = $this->drupalCreateUser([], 'no_edit');
// Ensure this account is not blocked.
@@ -99,7 +99,7 @@ class BulkFormAccessTest extends UserTestBase {
/**
* Tests if users that may not be deleted, can not be deleted in bulk.
*/
- public function testUserDeleteAccess() {
+ public function testUserDeleteAccess(): void {
// Create two authenticated users.
$account = $this->drupalCreateUser([], 'no_delete');
$account2 = $this->drupalCreateUser([], 'may_delete');
diff --git a/core/modules/user/tests/src/Functional/Views/BulkFormTest.php b/core/modules/user/tests/src/Functional/Views/BulkFormTest.php
index 19e378c8806..3e1548a1022 100644
--- a/core/modules/user/tests/src/Functional/Views/BulkFormTest.php
+++ b/core/modules/user/tests/src/Functional/Views/BulkFormTest.php
@@ -39,7 +39,7 @@ class BulkFormTest extends UserTestBase {
/**
* Tests the user bulk form.
*/
- public function testBulkForm() {
+ public function testBulkForm(): void {
// Log in as a user without 'administer users'.
$this->drupalLogin($this->drupalCreateUser(['administer permissions']));
$user_storage = $this->container->get('entity_type.manager')->getStorage('user');
@@ -144,7 +144,7 @@ class BulkFormTest extends UserTestBase {
/**
* Tests the user bulk form with a combined field filter on the bulk column.
*/
- public function testBulkFormCombineFilter() {
+ public function testBulkFormCombineFilter(): void {
// Add a user.
User::load($this->users[0]->id());
$view = Views::getView('test_user_bulk_form_combine_filter');
diff --git a/core/modules/user/tests/src/Functional/Views/FilterPermissionUiTest.php b/core/modules/user/tests/src/Functional/Views/FilterPermissionUiTest.php
index 5ee903b272d..21ba6d7cfe5 100644
--- a/core/modules/user/tests/src/Functional/Views/FilterPermissionUiTest.php
+++ b/core/modules/user/tests/src/Functional/Views/FilterPermissionUiTest.php
@@ -45,7 +45,7 @@ class FilterPermissionUiTest extends ViewTestBase {
/**
* Tests basic filter handler settings in the UI.
*/
- public function testHandlerUI() {
+ public function testHandlerUI(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer views',
'administer users',
diff --git a/core/modules/user/tests/src/Functional/Views/HandlerFieldRoleTest.php b/core/modules/user/tests/src/Functional/Views/HandlerFieldRoleTest.php
index 99afa5dbe8c..24de6fbf9b3 100644
--- a/core/modules/user/tests/src/Functional/Views/HandlerFieldRoleTest.php
+++ b/core/modules/user/tests/src/Functional/Views/HandlerFieldRoleTest.php
@@ -27,7 +27,7 @@ class HandlerFieldRoleTest extends UserTestBase {
*/
protected $defaultTheme = 'stark';
- public function testRole() {
+ public function testRole(): void {
// Create a couple of roles for the view.
$role_name_a = 'a' . $this->randomMachineName(8);
$this->drupalCreateRole(['access content'], $role_name_a, '<em>' . $role_name_a . '</em>', 9);
diff --git a/core/modules/user/tests/src/Functional/Views/HandlerFieldUserNameTest.php b/core/modules/user/tests/src/Functional/Views/HandlerFieldUserNameTest.php
index 97852c7271b..656ead917de 100644
--- a/core/modules/user/tests/src/Functional/Views/HandlerFieldUserNameTest.php
+++ b/core/modules/user/tests/src/Functional/Views/HandlerFieldUserNameTest.php
@@ -27,7 +27,7 @@ class HandlerFieldUserNameTest extends UserTestBase {
*/
protected $defaultTheme = 'stark';
- public function testUserName() {
+ public function testUserName(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
@@ -69,7 +69,7 @@ class HandlerFieldUserNameTest extends UserTestBase {
/**
* Tests that the field handler works when no additional fields are added.
*/
- public function testNoAdditionalFields() {
+ public function testNoAdditionalFields(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
diff --git a/core/modules/user/tests/src/Functional/Views/HandlerFilterUserNameTest.php b/core/modules/user/tests/src/Functional/Views/HandlerFilterUserNameTest.php
index 6021c2de9fa..fc0f6c2c7aa 100644
--- a/core/modules/user/tests/src/Functional/Views/HandlerFilterUserNameTest.php
+++ b/core/modules/user/tests/src/Functional/Views/HandlerFilterUserNameTest.php
@@ -76,7 +76,7 @@ class HandlerFilterUserNameTest extends ViewTestBase {
/**
* Tests just using the filter.
*/
- public function testUserNameApi() {
+ public function testUserNameApi(): void {
$view = Views::getView('test_user_name');
$view->initHandlers();
@@ -91,7 +91,7 @@ class HandlerFilterUserNameTest extends ViewTestBase {
/**
* Tests using the user interface.
*/
- public function testAdminUserInterface() {
+ public function testAdminUserInterface(): void {
$admin_user = $this->drupalCreateUser([
'administer views',
'administer site configuration',
@@ -137,7 +137,7 @@ class HandlerFilterUserNameTest extends ViewTestBase {
/**
* Tests exposed filters.
*/
- public function testExposedFilter() {
+ public function testExposedFilter(): void {
$path = 'test_user_name';
$options = [];
diff --git a/core/modules/user/tests/src/Functional/Views/RolesRidArgumentTest.php b/core/modules/user/tests/src/Functional/Views/RolesRidArgumentTest.php
index c6359267e1e..bd7ed750869 100644
--- a/core/modules/user/tests/src/Functional/Views/RolesRidArgumentTest.php
+++ b/core/modules/user/tests/src/Functional/Views/RolesRidArgumentTest.php
@@ -32,7 +32,7 @@ class RolesRidArgumentTest extends UserTestBase {
/**
* Tests the generated title of a user: roles argument.
*/
- public function testArgumentTitle() {
+ public function testArgumentTitle(): void {
$role_id = $this->createRole([], 'markup_role_name', '<em>Role name with markup</em>');
$this->createRole([], 'second_role_name', 'Second role name');
$user = $this->createUser([], 'User with role one');
diff --git a/core/modules/user/tests/src/Functional/Views/UserChangedTest.php b/core/modules/user/tests/src/Functional/Views/UserChangedTest.php
index 11d2878d0f9..81371c778ae 100644
--- a/core/modules/user/tests/src/Functional/Views/UserChangedTest.php
+++ b/core/modules/user/tests/src/Functional/Views/UserChangedTest.php
@@ -44,7 +44,7 @@ class UserChangedTest extends ViewTestBase {
/**
* Tests changed field.
*/
- public function testChangedField() {
+ public function testChangedField(): void {
$path = 'test_user_changed';
$options = [];
diff --git a/core/modules/user/tests/src/Functional/Views/UserFieldsAccessChangeTest.php b/core/modules/user/tests/src/Functional/Views/UserFieldsAccessChangeTest.php
index 4f6a0e67b29..9ff5f8211ca 100644
--- a/core/modules/user/tests/src/Functional/Views/UserFieldsAccessChangeTest.php
+++ b/core/modules/user/tests/src/Functional/Views/UserFieldsAccessChangeTest.php
@@ -33,7 +33,7 @@ class UserFieldsAccessChangeTest extends UserTestBase {
/**
* Tests if another module can change field access.
*/
- public function testUserFieldAccess() {
+ public function testUserFieldAccess(): void {
$this->drupalGet('test_user_fields_access');
// User has access to name and created date by default.
@@ -62,7 +62,7 @@ class UserFieldsAccessChangeTest extends UserTestBase {
* Tests that the user name formatter shows a link to the user when there is
* access but not otherwise.
*/
- public function testUserNameLink() {
+ public function testUserNameLink(): void {
$test_user = $this->drupalCreateUser();
$xpath = "//td/a[.='" . $test_user->getAccountName() . "']/@href[.='" . $test_user->toUrl()->toString() . "']";
diff --git a/core/modules/user/tests/src/FunctionalJavascript/PasswordConfirmWidgetTest.php b/core/modules/user/tests/src/FunctionalJavascript/PasswordConfirmWidgetTest.php
index aafd4fc6315..7f63bec926e 100644
--- a/core/modules/user/tests/src/FunctionalJavascript/PasswordConfirmWidgetTest.php
+++ b/core/modules/user/tests/src/FunctionalJavascript/PasswordConfirmWidgetTest.php
@@ -47,7 +47,7 @@ class PasswordConfirmWidgetTest extends WebDriverTestBase {
/**
* Tests the components added to the password confirm widget.
*/
- public function testPasswordConfirmWidgetJsComponents() {
+ public function testPasswordConfirmWidgetJsComponents(): void {
$this->drupalGet($this->testUser->toUrl('edit-form'));
$password_confirm_widget_selector = '.js-form-type-password-confirm.js-form-item-pass';
@@ -129,7 +129,7 @@ class PasswordConfirmWidgetTest extends WebDriverTestBase {
/**
* Ensures that password match message is visible when widget is initialized.
*/
- public function testPasswordConfirmMessage() {
+ public function testPasswordConfirmMessage(): void {
$this->drupalGet($this->testUser->toUrl('edit-form'));
$password_confirm_widget_selector = '.js-form-type-password-confirm.js-form-item-pass';
$password_confirm_selector = '.js-form-item-pass-pass2';
@@ -145,7 +145,7 @@ class PasswordConfirmWidgetTest extends WebDriverTestBase {
/**
* Tests the password confirm widget so that only confirm input is filled.
*/
- public function testFillConfirmOnly() {
+ public function testFillConfirmOnly(): void {
$this->drupalGet($this->testUser->toUrl('edit-form'));
$password_confirm_widget_selector = '.js-form-type-password-confirm.js-form-item-pass';
$password_parent_selector = '.js-form-item-pass-pass1';
diff --git a/core/modules/user/tests/src/FunctionalJavascript/PermissionFilterTest.php b/core/modules/user/tests/src/FunctionalJavascript/PermissionFilterTest.php
index 67ccc3a6fb7..f961061c2c4 100644
--- a/core/modules/user/tests/src/FunctionalJavascript/PermissionFilterTest.php
+++ b/core/modules/user/tests/src/FunctionalJavascript/PermissionFilterTest.php
@@ -38,7 +38,7 @@ class PermissionFilterTest extends WebDriverTestBase {
/**
* Tests that filter results announcement has correct pluralization.
*/
- public function testPermissionFilter() {
+ public function testPermissionFilter(): void {
// Find the permission filter field.
$this->drupalGet('admin/people/permissions');
$assertSession = $this->assertSession();
diff --git a/core/modules/user/tests/src/FunctionalJavascript/RegistrationWithUserFieldsTest.php b/core/modules/user/tests/src/FunctionalJavascript/RegistrationWithUserFieldsTest.php
index 488fa96778b..7361ea0698c 100644
--- a/core/modules/user/tests/src/FunctionalJavascript/RegistrationWithUserFieldsTest.php
+++ b/core/modules/user/tests/src/FunctionalJavascript/RegistrationWithUserFieldsTest.php
@@ -52,7 +52,7 @@ class RegistrationWithUserFieldsTest extends WebDriverTestBase {
/**
* Tests Field API fields on user registration forms.
*/
- public function testRegistrationWithUserFields() {
+ public function testRegistrationWithUserFields(): void {
// Create a field on 'user' entity type.
$field_storage = FieldStorageConfig::create([
'field_name' => 'test_user_field',
diff --git a/core/modules/user/tests/src/FunctionalJavascript/UserPasswordResetTest.php b/core/modules/user/tests/src/FunctionalJavascript/UserPasswordResetTest.php
index a331f01564e..5d996c0298e 100644
--- a/core/modules/user/tests/src/FunctionalJavascript/UserPasswordResetTest.php
+++ b/core/modules/user/tests/src/FunctionalJavascript/UserPasswordResetTest.php
@@ -74,7 +74,7 @@ class UserPasswordResetTest extends WebDriverTestBase {
* Make sure the ajax request from uploading a user picture does not
* invalidate the reset token.
*/
- public function testUserPasswordResetWithAdditionalAjaxForm() {
+ public function testUserPasswordResetWithAdditionalAjaxForm(): void {
$this->drupalGet(Url::fromRoute('user.reset.form', ['uid' => $this->account->id()]));
// Try to reset the password for an invalid account.
diff --git a/core/modules/user/tests/src/FunctionalJavascript/UserPermissionsTest.php b/core/modules/user/tests/src/FunctionalJavascript/UserPermissionsTest.php
index f24c3aad567..0cac61c9a69 100644
--- a/core/modules/user/tests/src/FunctionalJavascript/UserPermissionsTest.php
+++ b/core/modules/user/tests/src/FunctionalJavascript/UserPermissionsTest.php
@@ -52,7 +52,7 @@ class UserPermissionsTest extends WebDriverTestBase {
/**
* Tests the dummy checkboxes added to the permissions page.
*/
- public function testPermissionCheckboxes() {
+ public function testPermissionCheckboxes(): void {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/people/permissions');
diff --git a/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php b/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php
index 090e8a7d5dd..21cc0b60797 100644
--- a/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php
+++ b/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php
@@ -103,7 +103,7 @@ class UserRoleConditionTest extends KernelTestBase {
/**
* Tests the user_role condition.
*/
- public function testConditions() {
+ public function testConditions(): void {
// Grab the user role condition and configure it to check against
// authenticated user roles.
/** @var \Drupal\Core\Condition\ConditionInterface $condition */
diff --git a/core/modules/user/tests/src/Kernel/ContextProvider/CurrentUserContextTest.php b/core/modules/user/tests/src/Kernel/ContextProvider/CurrentUserContextTest.php
index f29608682fb..3630ae3e074 100644
--- a/core/modules/user/tests/src/Kernel/ContextProvider/CurrentUserContextTest.php
+++ b/core/modules/user/tests/src/Kernel/ContextProvider/CurrentUserContextTest.php
@@ -32,7 +32,7 @@ class CurrentUserContextTest extends KernelTestBase {
/**
* @covers ::getAvailableContexts
*/
- public function testGetAvailableContexts() {
+ public function testGetAvailableContexts(): void {
$context_repository = $this->container->get('context.repository');
// Test an authenticated account.
diff --git a/core/modules/user/tests/src/Kernel/Controller/UserControllerTest.php b/core/modules/user/tests/src/Kernel/Controller/UserControllerTest.php
index 1d59ee2eb6a..74ce838520f 100644
--- a/core/modules/user/tests/src/Kernel/Controller/UserControllerTest.php
+++ b/core/modules/user/tests/src/Kernel/Controller/UserControllerTest.php
@@ -60,7 +60,7 @@ class UserControllerTest extends KernelTestBase {
*
* @covers ::userEditPage
*/
- public function testUserEditPage() {
+ public function testUserEditPage(): void {
$response = $this->userController->userEditPage();
diff --git a/core/modules/user/tests/src/Kernel/Field/UserNameFormatterTest.php b/core/modules/user/tests/src/Kernel/Field/UserNameFormatterTest.php
index 7be78399b6f..de0565527e2 100644
--- a/core/modules/user/tests/src/Kernel/Field/UserNameFormatterTest.php
+++ b/core/modules/user/tests/src/Kernel/Field/UserNameFormatterTest.php
@@ -72,7 +72,7 @@ class UserNameFormatterTest extends KernelTestBase {
/**
* Tests the formatter output.
*/
- public function testFormatter() {
+ public function testFormatter(): void {
$user = User::create([
'name' => 'test name',
]);
diff --git a/core/modules/user/tests/src/Kernel/Migrate/MigrateUserAdminPassTest.php b/core/modules/user/tests/src/Kernel/Migrate/MigrateUserAdminPassTest.php
index 038d3c623ad..f2553f9e7bc 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/MigrateUserAdminPassTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/MigrateUserAdminPassTest.php
@@ -58,7 +58,7 @@ class MigrateUserAdminPassTest extends MigrateTestBase {
/**
* Tests preserving the admin user's password.
*/
- public function testAdminPasswordPreserved() {
+ public function testAdminPasswordPreserved(): void {
$user_data_rows = [
[
'id' => '1',
diff --git a/core/modules/user/tests/src/Kernel/Migrate/MigrateUserStubTest.php b/core/modules/user/tests/src/Kernel/Migrate/MigrateUserStubTest.php
index 8fb3d8e346e..7ce461eb495 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/MigrateUserStubTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/MigrateUserStubTest.php
@@ -32,7 +32,7 @@ class MigrateUserStubTest extends MigrateDrupalTestBase {
/**
* Tests creation of user stubs.
*/
- public function testStub() {
+ public function testStub(): void {
$this->performStubTest('user');
}
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateProfileFieldOptionTranslationTest.php b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateProfileFieldOptionTranslationTest.php
index 1496f4d904e..e2da7dc0683 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateProfileFieldOptionTranslationTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateProfileFieldOptionTranslationTest.php
@@ -39,7 +39,7 @@ class MigrateProfileFieldOptionTranslationTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 field option translation.
*/
- public function testFieldOptionTranslation() {
+ public function testFieldOptionTranslation(): void {
$language_manager = $this->container->get('language_manager');
/** @var \Drupal\language\Config\LanguageConfigOverride $config_translation */
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTest.php b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTest.php
index 514caf0c25f..538a26eabbd 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserConfigsTest.php
@@ -30,7 +30,7 @@ class MigrateUserConfigsTest extends MigrateDrupal6TestBase {
/**
* Tests migration of user variables to user.mail.yml.
*/
- public function testUserMail() {
+ public function testUserMail(): void {
$config = $this->config('user.mail');
$this->assertSame('Account details for [user:name] at [site:name] (approved)', $config->get('status_activated.subject'));
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserContactSettingsTest.php b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserContactSettingsTest.php
index e7c6d0e00ee..020ceef6f75 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserContactSettingsTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserContactSettingsTest.php
@@ -31,7 +31,7 @@ class MigrateUserContactSettingsTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal6 user contact settings migration.
*/
- public function testUserContactSettings() {
+ public function testUserContactSettings(): void {
$user_data = \Drupal::service('user.data');
$module = $key = 'contact';
$uid = 2;
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 fc9eb5ad2b9..5a4cc1984f0 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureD6FileTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureD6FileTest.php
@@ -31,7 +31,7 @@ class MigrateUserPictureD6FileTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal 6 user pictures to Drupal 8 migration.
*/
- public function testUserPictures() {
+ public function testUserPictures(): void {
$file_ids = [];
foreach ($this->migration->getIdMap() as $destination_ids) {
$file_ids[] = reset($destination_ids);
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileEntityDisplayTest.php b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileEntityDisplayTest.php
index d2eb907140b..66caa7f0923 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileEntityDisplayTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileEntityDisplayTest.php
@@ -29,7 +29,7 @@ class MigrateUserProfileEntityDisplayTest extends MigrateDrupal6TestBase {
/**
* Tests migration of user profile fields.
*/
- public function testUserProfileFields() {
+ public function testUserProfileFields(): void {
$display = EntityViewDisplay::load('user.user.default');
// Test a text field.
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileEntityFormDisplayTest.php b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileEntityFormDisplayTest.php
index 4d4c83283ae..a659ba79e97 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileEntityFormDisplayTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileEntityFormDisplayTest.php
@@ -29,7 +29,7 @@ class MigrateUserProfileEntityFormDisplayTest extends MigrateDrupal6TestBase {
/**
* Tests migration of user profile fields.
*/
- public function testUserProfileEntityFormDisplay() {
+ public function testUserProfileEntityFormDisplay(): void {
$display = EntityFormDisplay::load('user.user.default');
// Test a text field.
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldInstanceTest.php b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldInstanceTest.php
index 53b437a2c4d..dbaf9dea6bb 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldInstanceTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldInstanceTest.php
@@ -33,7 +33,7 @@ class MigrateUserProfileFieldInstanceTest extends MigrateDrupal6TestBase {
/**
* Tests migration of user profile fields.
*/
- public function testUserProfileFields() {
+ public function testUserProfileFields(): void {
// Migrated a text field.
$field = FieldConfig::load('user.user.profile_color');
$this->assertSame('Favorite color', $field->label());
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldTest.php b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldTest.php
index 7f1510c1dea..d9f344a9df8 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileFieldTest.php
@@ -25,7 +25,7 @@ class MigrateUserProfileFieldTest extends MigrateDrupal6TestBase {
/**
* Tests migration of user profile fields.
*/
- public function testUserProfileFields() {
+ public function testUserProfileFields(): void {
// Migrated a text field.
$field_storage = FieldStorageConfig::load('user.profile_color');
$this->assertSame('text', $field_storage->getType(), 'Field type is text.');
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileValuesTest.php b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileValuesTest.php
index e1d723325b0..12ad8f188ab 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileValuesTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserProfileValuesTest.php
@@ -39,7 +39,7 @@ class MigrateUserProfileValuesTest extends MigrateDrupal6TestBase {
/**
* Tests Drupal 6 profile values to Drupal 8 migration.
*/
- public function testUserProfileValues() {
+ public function testUserProfileValues(): void {
$user = User::load(2);
$this->assertNotNull($user);
$this->assertSame('red', $user->profile_color->value);
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 3f96bf4564f..6fb7e9e7d9b 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserRoleTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserRoleTest.php
@@ -283,7 +283,7 @@ class MigrateUserRoleTest extends MigrateDrupal6TestBase {
*
* @dataProvider providerTestUserRole
*/
- public function testUserRole(array $modules, array $migrations, array $role_data) {
+ public function testUserRole(array $modules, array $migrations, array $role_data): void {
if ($modules) {
// Install modules that have migrations that may provide permissions.
\Drupal::service('module_installer')->install($modules);
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserTest.php b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserTest.php
index 068a81b1c4f..4d451749db0 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserTest.php
@@ -74,7 +74,7 @@ class MigrateUserTest extends MigrateDrupal6TestBase {
/**
* Tests the Drupal6 user to Drupal 8 migration.
*/
- public function testUser() {
+ public function testUser(): void {
$users = Database::getConnection('default', 'migrate')
->select('users', 'u')
->fields('u')
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d6/ProfileFieldCheckRequirementsTest.php b/core/modules/user/tests/src/Kernel/Migrate/d6/ProfileFieldCheckRequirementsTest.php
index 348704ead60..c6090f82fa6 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d6/ProfileFieldCheckRequirementsTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d6/ProfileFieldCheckRequirementsTest.php
@@ -25,7 +25,7 @@ class ProfileFieldCheckRequirementsTest extends MigrateDrupal6TestBase {
/**
* Tests exception is thrown when profile_fields tables do not exist.
*/
- public function testCheckRequirements() {
+ public function testCheckRequirements(): void {
$this->expectException(RequirementsException::class);
$this->expectExceptionMessage('Profile module not enabled on source site');
$this->getMigration('user_profile_field')
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserFloodTest.php b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserFloodTest.php
index 387a2329e7a..4f27032cf50 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserFloodTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserFloodTest.php
@@ -25,7 +25,7 @@ class MigrateUserFloodTest extends MigrateDrupal7TestBase {
/**
* Tests the migration.
*/
- public function testMigration() {
+ public function testMigration(): void {
$expected = [
'_core' => [
'default_config_hash' => 'UYfMzeP1S8jKm9PSvxf7nQNe8DsNS-3bc2WSNNXBQWs',
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserMailTest.php b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserMailTest.php
index c08a920356f..c4a04ddc9e6 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserMailTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserMailTest.php
@@ -25,7 +25,7 @@ class MigrateUserMailTest extends MigrateDrupal7TestBase {
/**
* Tests the migration.
*/
- public function testMigration() {
+ public function testMigration(): void {
$config = $this->config('user.mail');
$this->assertSame('Your account is approved!', $config->get('status_activated.subject'));
$this->assertSame('Your account was activated, and there was much rejoicing.', $config->get('status_activated.body'));
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureEntityDisplayTest.php b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureEntityDisplayTest.php
index 3dffdca92e1..7f55e7268e3 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureEntityDisplayTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureEntityDisplayTest.php
@@ -35,7 +35,7 @@ class MigrateUserPictureEntityDisplayTest extends MigrateDrupal7TestBase {
/**
* Tests the Drupal 7 user picture to Drupal 8 entity display migration.
*/
- public function testUserPictureEntityDisplay() {
+ public function testUserPictureEntityDisplay(): void {
$component = EntityViewDisplay::load('user.user.default')->getComponent('user_picture');
$this->assertSame('image', $component['type']);
$this->assertSame('', $component['settings']['image_style']);
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureEntityFormDisplayTest.php b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureEntityFormDisplayTest.php
index ad88477bfe1..07520ce37f0 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureEntityFormDisplayTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureEntityFormDisplayTest.php
@@ -31,7 +31,7 @@ class MigrateUserPictureEntityFormDisplayTest extends MigrateDrupal7TestBase {
/**
* Tests the field's entity form display settings.
*/
- public function testEntityFormDisplaySettings() {
+ public function testEntityFormDisplaySettings(): void {
$component = EntityFormDisplay::load('user.user.default')->getComponent('user_picture');
$this->assertSame('image_image', $component['type']);
$this->assertSame('throbber', $component['settings']['progress_indicator']);
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureFieldInstanceTest.php b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureFieldInstanceTest.php
index 2d7f912b2c2..7d8e29de8d0 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureFieldInstanceTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureFieldInstanceTest.php
@@ -31,7 +31,7 @@ class MigrateUserPictureFieldInstanceTest extends MigrateDrupal7TestBase {
/**
* Tests the user picture field migration.
*/
- public function testUserPictureField() {
+ public function testUserPictureField(): void {
/** @var \Drupal\field\FieldConfigInterface $field */
$field = FieldConfig::load('user.user.user_picture');
$this->assertInstanceOf(FieldConfigInterface::class, $field);
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureFieldTest.php b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureFieldTest.php
index 8864a4cffc0..56a97206e70 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureFieldTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureFieldTest.php
@@ -28,7 +28,7 @@ class MigrateUserPictureFieldTest extends MigrateDrupal7TestBase {
/**
* Tests the user picture field migration.
*/
- public function testUserPictureField() {
+ public function testUserPictureField(): void {
/** @var \Drupal\field\FieldStorageConfigInterface $field_storage */
$field_storage = FieldStorageConfig::load('user.user_picture');
$this->assertInstanceOf(FieldStorageConfigInterface::class, $field_storage);
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 a4a9e8a6c19..cab95c394cf 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserRoleTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserRoleTest.php
@@ -47,7 +47,7 @@ class MigrateUserRoleTest extends MigrateDrupal7TestBase {
/**
* Tests user role migration.
*/
- public function testUserRole() {
+ public function testUserRole(): void {
$anonymous_permissions = ['access content'];
$this->assertEntity('anonymous', 'anonymous user', $anonymous_permissions);
$this->assertEntity('authenticated', 'authenticated user', $anonymous_permissions);
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserSettingsTest.php b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserSettingsTest.php
index df40aaca3aa..da388bd9e3b 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserSettingsTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserSettingsTest.php
@@ -30,7 +30,7 @@ class MigrateUserSettingsTest extends MigrateDrupal7TestBase {
/**
* Tests the migration.
*/
- public function testMigration() {
+ public function testMigration(): void {
$config = $this->config('user.settings');
$this->assertTrue($config->get('notify.status_blocked'));
$this->assertTrue($config->get('notify.status_activated'));
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 e812f07ec8b..0b860716b13 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserTest.php
@@ -143,7 +143,7 @@ class MigrateUserTest extends MigrateDrupal7TestBase {
/**
* Tests the Drupal 7 user to Drupal 8 migration.
*/
- public function testUser() {
+ public function testUser(): void {
$users = Database::getConnection('default', 'migrate')
->select('users', 'u')
->fields('u')
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d7/ProfileFieldCheckRequirementsTest.php b/core/modules/user/tests/src/Kernel/Migrate/d7/ProfileFieldCheckRequirementsTest.php
index 91e3d96ae6c..cfffb4b4952 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d7/ProfileFieldCheckRequirementsTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d7/ProfileFieldCheckRequirementsTest.php
@@ -25,7 +25,7 @@ class ProfileFieldCheckRequirementsTest extends MigrateDrupal7TestBase {
/**
* Tests exception is thrown when profile_fields tables do not exist.
*/
- public function testCheckRequirements() {
+ public function testCheckRequirements(): void {
$this->expectException(RequirementsException::class);
$this->expectExceptionMessage('Profile module not enabled on source site');
$this->getMigration('user_profile_field')
diff --git a/core/modules/user/tests/src/Kernel/Migrate/d7/UserMigrationClassTest.php b/core/modules/user/tests/src/Kernel/Migrate/d7/UserMigrationClassTest.php
index 7b229f4580f..c5b707c6cbe 100644
--- a/core/modules/user/tests/src/Kernel/Migrate/d7/UserMigrationClassTest.php
+++ b/core/modules/user/tests/src/Kernel/Migrate/d7/UserMigrationClassTest.php
@@ -19,7 +19,7 @@ class UserMigrationClassTest extends MigrateDrupal7TestBase {
* Ensures profile fields are merged into the d7_profile_values migration's
* process pipeline.
*/
- public function testClass() {
+ public function testClass(): void {
$migration = $this->getMigration('d7_user');
/** @var \Drupal\migrate\Plugin\MigrationInterface[] $migrations */
$this->assertSame('d7_user', $migration->id());
diff --git a/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php b/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php
index 6817dc35995..787874d1447 100644
--- a/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php
+++ b/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php
@@ -31,7 +31,7 @@ class UserAccountFormFieldsTest extends KernelTestBase {
/**
* Tests the root user account form section in the "Configure site" form.
*/
- public function testInstallConfigureForm() {
+ public function testInstallConfigureForm(): void {
require_once $this->root . '/core/includes/install.core.inc';
require_once $this->root . '/core/includes/install.inc';
$install_state = install_state_defaults();
@@ -53,7 +53,7 @@ class UserAccountFormFieldsTest extends KernelTestBase {
/**
* Tests the user registration form.
*/
- public function testUserRegistrationForm() {
+ public function testUserRegistrationForm(): void {
// Install default configuration; required for AccountFormController.
$this->installConfig(['user']);
@@ -77,7 +77,7 @@ class UserAccountFormFieldsTest extends KernelTestBase {
/**
* Tests the user edit form.
*/
- public function testUserEditForm() {
+ public function testUserEditForm(): void {
// Install default configuration; required for AccountFormController.
$this->installConfig(['user']);
$this->installEntitySchema('user');
diff --git a/core/modules/user/tests/src/Kernel/UserAccountFormPasswordResetTest.php b/core/modules/user/tests/src/Kernel/UserAccountFormPasswordResetTest.php
index ca957a715fe..a7e407e0889 100644
--- a/core/modules/user/tests/src/Kernel/UserAccountFormPasswordResetTest.php
+++ b/core/modules/user/tests/src/Kernel/UserAccountFormPasswordResetTest.php
@@ -50,7 +50,7 @@ class UserAccountFormPasswordResetTest extends KernelTestBase {
/**
* Tests the reset token used only from query string.
*/
- public function testPasswordResetToken() {
+ public function testPasswordResetToken(): void {
/** @var \Symfony\Component\HttpFoundation\Request $request */
$request = $this->container->get('request_stack')->getCurrentRequest();
diff --git a/core/modules/user/tests/src/Kernel/UserActionConfigSchemaTest.php b/core/modules/user/tests/src/Kernel/UserActionConfigSchemaTest.php
index 13d4ab57c71..fa9915de285 100644
--- a/core/modules/user/tests/src/Kernel/UserActionConfigSchemaTest.php
+++ b/core/modules/user/tests/src/Kernel/UserActionConfigSchemaTest.php
@@ -27,7 +27,7 @@ class UserActionConfigSchemaTest extends KernelTestBase {
/**
* Tests whether the user action config schema are valid.
*/
- public function testValidUserActionConfigSchema() {
+ public function testValidUserActionConfigSchema(): void {
$rid = $this->randomMachineName(8);
Role::create(['id' => $rid, 'label' => $rid])->save();
diff --git a/core/modules/user/tests/src/Kernel/UserAnonymousActivateTest.php b/core/modules/user/tests/src/Kernel/UserAnonymousActivateTest.php
index 29134b58e14..8d210789aee 100644
--- a/core/modules/user/tests/src/Kernel/UserAnonymousActivateTest.php
+++ b/core/modules/user/tests/src/Kernel/UserAnonymousActivateTest.php
@@ -33,7 +33,7 @@ class UserAnonymousActivateTest extends KernelTestBase {
/**
* Tests that the anonymous user cannot be activated.
*/
- public function testAnonymousActivate() {
+ public function testAnonymousActivate(): void {
$accountAnon = \Drupal::entityTypeManager()->getStorage('user')->load(0);
// Test that the anonymous user is blocked.
diff --git a/core/modules/user/tests/src/Kernel/UserDeleteTest.php b/core/modules/user/tests/src/Kernel/UserDeleteTest.php
index 463d9f76219..148e9f24139 100644
--- a/core/modules/user/tests/src/Kernel/UserDeleteTest.php
+++ b/core/modules/user/tests/src/Kernel/UserDeleteTest.php
@@ -29,7 +29,7 @@ class UserDeleteTest extends KernelTestBase {
/**
* Tests deleting multiple users.
*/
- public function testUserDeleteMultiple() {
+ public function testUserDeleteMultiple(): void {
$this->installSchema('user', ['users_data']);
$this->installEntitySchema('user');
diff --git a/core/modules/user/tests/src/Kernel/UserEntityLabelTest.php b/core/modules/user/tests/src/Kernel/UserEntityLabelTest.php
index 52c34ccfdc6..dbf08670782 100644
--- a/core/modules/user/tests/src/Kernel/UserEntityLabelTest.php
+++ b/core/modules/user/tests/src/Kernel/UserEntityLabelTest.php
@@ -29,7 +29,7 @@ class UserEntityLabelTest extends KernelTestBase {
/**
* Tests label callback.
*/
- public function testLabelCallback() {
+ public function testLabelCallback(): void {
$this->installEntitySchema('user');
$this->installConfig(['user']);
diff --git a/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php b/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php
index 9e84b43469b..d42c4a4ca76 100644
--- a/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php
+++ b/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php
@@ -56,7 +56,7 @@ class UserEntityReferenceTest extends EntityKernelTestBase {
/**
* Tests user selection by roles.
*/
- public function testUserSelectionByRole() {
+ public function testUserSelectionByRole(): void {
$field_definition = FieldConfig::loadByName('user', 'user', 'user_reference');
$handler_settings = $field_definition->getSetting('handler_settings');
$handler_settings['filter']['role'] = [
diff --git a/core/modules/user/tests/src/Kernel/UserEntityTest.php b/core/modules/user/tests/src/Kernel/UserEntityTest.php
index 96311c2fd4d..282adb7cbf4 100644
--- a/core/modules/user/tests/src/Kernel/UserEntityTest.php
+++ b/core/modules/user/tests/src/Kernel/UserEntityTest.php
@@ -38,7 +38,7 @@ class UserEntityTest extends KernelTestBase {
* @see \Drupal\user\Entity\User::addRole()
* @see \Drupal\user\Entity\User::removeRole()
*/
- public function testUserMethods() {
+ public function testUserMethods(): void {
$role_storage = $this->container->get('entity_type.manager')->getStorage('user_role');
$role_storage->create(['id' => 'test_role_one', 'label' => 'Test role 1'])->save();
$role_storage->create(['id' => 'test_role_two', 'label' => 'Test role 2'])->save();
@@ -84,7 +84,7 @@ class UserEntityTest extends KernelTestBase {
* @see \Drupal\Core\Field\FieldItemInterface::generateSampleValue()
* @see \Drupal\Core\Entity\FieldableEntityInterface::validate()
*/
- public function testUserValidation() {
+ public function testUserValidation(): void {
$user = User::create([]);
foreach ($user as $field_name => $field) {
if (!in_array($field_name, ['uid'])) {
@@ -98,7 +98,7 @@ class UserEntityTest extends KernelTestBase {
/**
* Tests that ::existingPassword can be used for chaining.
*/
- public function testChainExistingPasswordMethod() {
+ public function testChainExistingPasswordMethod(): void {
/** @var \Drupal\user\Entity\User $user */
$user = User::create([
'name' => $this->randomMachineName(),
diff --git a/core/modules/user/tests/src/Kernel/UserFieldsTest.php b/core/modules/user/tests/src/Kernel/UserFieldsTest.php
index e5c00a28be1..79ddf369531 100644
--- a/core/modules/user/tests/src/Kernel/UserFieldsTest.php
+++ b/core/modules/user/tests/src/Kernel/UserFieldsTest.php
@@ -38,7 +38,7 @@ class UserFieldsTest extends KernelTestBase {
/**
* Tests account's available fields.
*/
- public function testUserFields() {
+ public function testUserFields(): void {
// Create the user to test the user fields.
$user = User::create([
'name' => 'foobar',
diff --git a/core/modules/user/tests/src/Kernel/UserInstallTest.php b/core/modules/user/tests/src/Kernel/UserInstallTest.php
index fd08cb0a680..9478a16404f 100644
--- a/core/modules/user/tests/src/Kernel/UserInstallTest.php
+++ b/core/modules/user/tests/src/Kernel/UserInstallTest.php
@@ -33,7 +33,7 @@ class UserInstallTest extends KernelTestBase {
/**
* Tests that the initial users have correct values.
*/
- public function testUserInstall() {
+ public function testUserInstall(): void {
$user_ids = \Drupal::entityQuery('user')->sort('uid')->accessCheck(FALSE)->execute();
$users = \Drupal::entityTypeManager()->getStorage('user')->loadMultiple($user_ids);
$anon = $users[0];
diff --git a/core/modules/user/tests/src/Kernel/UserMailDefaultsTest.php b/core/modules/user/tests/src/Kernel/UserMailDefaultsTest.php
index 39adad74b45..5e7aaae7805 100644
--- a/core/modules/user/tests/src/Kernel/UserMailDefaultsTest.php
+++ b/core/modules/user/tests/src/Kernel/UserMailDefaultsTest.php
@@ -31,7 +31,7 @@ class UserMailDefaultsTest extends KernelTestBase {
*
* @dataProvider userMailsProvider
*/
- public function testMailDefaults($key) {
+ public function testMailDefaults($key): void {
$body = $this->config('user.mail')->get("$key.body");
$this->assertStringContainsString("\n\n", $body);
}
diff --git a/core/modules/user/tests/src/Kernel/UserMailNotifyTest.php b/core/modules/user/tests/src/Kernel/UserMailNotifyTest.php
index a237b50d034..62054045320 100644
--- a/core/modules/user/tests/src/Kernel/UserMailNotifyTest.php
+++ b/core/modules/user/tests/src/Kernel/UserMailNotifyTest.php
@@ -81,7 +81,7 @@ class UserMailNotifyTest extends EntityKernelTestBase {
*
* @dataProvider userMailsProvider
*/
- public function testUserMailsSent($op, array $mail_keys) {
+ public function testUserMailsSent($op, array $mail_keys): void {
$this->installConfig('user');
$this->config('system.site')->set('mail', 'test@example.com')->save();
$this->config('user.settings')->set('notify.' . $op, TRUE)->save();
@@ -102,7 +102,7 @@ class UserMailNotifyTest extends EntityKernelTestBase {
*
* @dataProvider userMailsProvider
*/
- public function testUserMailsNotSent($op) {
+ public function testUserMailsNotSent($op): void {
$this->config('user.settings')->set('notify.' . $op, FALSE)->save();
$return = _user_mail_notify($op, $this->createUser());
$this->assertNull($return);
@@ -112,7 +112,7 @@ class UserMailNotifyTest extends EntityKernelTestBase {
/**
* Tests recovery email content and token langcode is aligned.
*/
- public function testUserRecoveryMailLanguage() {
+ public function testUserRecoveryMailLanguage(): void {
// Install locale schema.
$this->installSchema('locale', [
diff --git a/core/modules/user/tests/src/Kernel/UserRoleDeleteTest.php b/core/modules/user/tests/src/Kernel/UserRoleDeleteTest.php
index b5c19a7e0d3..cd5ce09c460 100644
--- a/core/modules/user/tests/src/Kernel/UserRoleDeleteTest.php
+++ b/core/modules/user/tests/src/Kernel/UserRoleDeleteTest.php
@@ -37,7 +37,7 @@ class UserRoleDeleteTest extends KernelTestBase {
*
* @see user_user_role_delete()
*/
- public function testRoleDeleteUserRoleReferenceDelete() {
+ public function testRoleDeleteUserRoleReferenceDelete(): void {
// Create two test roles.
$role_storage = $this->container->get('entity_type.manager')->getStorage('user_role');
$role_storage->create(['id' => 'test_role_one', 'label' => 'Test role 1'])->save();
@@ -82,7 +82,7 @@ class UserRoleDeleteTest extends KernelTestBase {
/**
* Tests the removal of user role dependencies.
*/
- public function testDependenciesRemoval() {
+ public function testDependenciesRemoval(): void {
$this->enableModules(['node', 'filter']);
/** @var \Drupal\user\RoleStorage $role_storage */
$role_storage = $this->container->get('entity_type.manager')->getStorage('user_role');
diff --git a/core/modules/user/tests/src/Kernel/UserRoleEntityTest.php b/core/modules/user/tests/src/Kernel/UserRoleEntityTest.php
index 248bbdcd1b4..8f41d069017 100644
--- a/core/modules/user/tests/src/Kernel/UserRoleEntityTest.php
+++ b/core/modules/user/tests/src/Kernel/UserRoleEntityTest.php
@@ -15,7 +15,7 @@ class UserRoleEntityTest extends KernelTestBase {
protected static $modules = ['system', 'user', 'user_permissions_test'];
- public function testOrderOfPermissions() {
+ public function testOrderOfPermissions(): void {
$role = Role::create(['id' => 'test_role', 'label' => 'Test role']);
$role->grantPermission('b')
->grantPermission('a')
@@ -30,7 +30,7 @@ class UserRoleEntityTest extends KernelTestBase {
$this->assertEquals(['a', 'b', 'c'], $role->getPermissions());
}
- public function testGrantingNonExistentPermission() {
+ public function testGrantingNonExistentPermission(): void {
$role = Role::create(['id' => 'test_role', 'label' => 'Test role']);
// A single permission that does not exist.
@@ -47,7 +47,7 @@ class UserRoleEntityTest extends KernelTestBase {
->save();
}
- public function testPermissionRevokeAndConfigSync() {
+ public function testPermissionRevokeAndConfigSync(): void {
$role = Role::create(['id' => 'test_role', 'label' => 'Test role']);
$role->setSyncing(TRUE);
$role->grantPermission('a')
diff --git a/core/modules/user/tests/src/Kernel/UserSaveStatusTest.php b/core/modules/user/tests/src/Kernel/UserSaveStatusTest.php
index d0f0d02dc18..e5763bf2729 100644
--- a/core/modules/user/tests/src/Kernel/UserSaveStatusTest.php
+++ b/core/modules/user/tests/src/Kernel/UserSaveStatusTest.php
@@ -32,7 +32,7 @@ class UserSaveStatusTest extends KernelTestBase {
/**
* Tests SAVED_NEW and SAVED_UPDATED statuses for user entity type.
*/
- public function testUserSaveStatus() {
+ public function testUserSaveStatus(): void {
// Create a new user.
$values = [
'uid' => 1,
diff --git a/core/modules/user/tests/src/Kernel/UserSaveTest.php b/core/modules/user/tests/src/Kernel/UserSaveTest.php
index 65133eaaaf6..aa44d00aa46 100644
--- a/core/modules/user/tests/src/Kernel/UserSaveTest.php
+++ b/core/modules/user/tests/src/Kernel/UserSaveTest.php
@@ -25,7 +25,7 @@ class UserSaveTest extends KernelTestBase {
/**
* Ensures that an existing password is unset after the user was saved.
*/
- public function testExistingPasswordRemoval() {
+ public function testExistingPasswordRemoval(): void {
$this->installEntitySchema('user');
/** @var \Drupal\user\Entity\User $user */
diff --git a/core/modules/user/tests/src/Kernel/UserValidationTest.php b/core/modules/user/tests/src/Kernel/UserValidationTest.php
index 08e276a1c47..e5fff84d9b1 100644
--- a/core/modules/user/tests/src/Kernel/UserValidationTest.php
+++ b/core/modules/user/tests/src/Kernel/UserValidationTest.php
@@ -43,7 +43,7 @@ class UserValidationTest extends KernelTestBase {
*
* @group legacy
*/
- public function testUsernames() {
+ public function testUsernames(): void {
// cSpell:disable
$test_cases = [
// '<username>' => ['<description>', 'assert<testName>'].
@@ -82,7 +82,7 @@ class UserValidationTest extends KernelTestBase {
/**
* Runs entity validation checks.
*/
- public function testValidation() {
+ public function testValidation(): void {
$user = User::create([
'name' => 'test',
'mail' => 'test@example.com',
diff --git a/core/modules/user/tests/src/Kernel/Views/AccessPermissionTest.php b/core/modules/user/tests/src/Kernel/Views/AccessPermissionTest.php
index 9e3092e5f46..d05ab1eb6ea 100644
--- a/core/modules/user/tests/src/Kernel/Views/AccessPermissionTest.php
+++ b/core/modules/user/tests/src/Kernel/Views/AccessPermissionTest.php
@@ -72,7 +72,7 @@ class AccessPermissionTest extends KernelTestBase {
/**
* Tests perm access plugin.
*/
- public function testAccessPerm() {
+ public function testAccessPerm(): void {
$view = Views::getView('test_access_perm');
$view->setDisplay();
@@ -87,7 +87,7 @@ class AccessPermissionTest extends KernelTestBase {
/**
* Tests access on render caching.
*/
- public function testRenderCaching() {
+ public function testRenderCaching(): void {
$view = Views::getView('test_access_perm');
$display = &$view->storage->getDisplay('default');
$display['display_options']['cache'] = [
diff --git a/core/modules/user/tests/src/Kernel/Views/ArgumentDefaultTest.php b/core/modules/user/tests/src/Kernel/Views/ArgumentDefaultTest.php
index a6235aa099e..10a783bc450 100644
--- a/core/modules/user/tests/src/Kernel/Views/ArgumentDefaultTest.php
+++ b/core/modules/user/tests/src/Kernel/Views/ArgumentDefaultTest.php
@@ -39,7 +39,7 @@ class ArgumentDefaultTest extends KernelTestBase {
/**
* Tests the current user with argument default.
*/
- public function testPluginArgumentDefaultCurrentUser() {
+ public function testPluginArgumentDefaultCurrentUser(): void {
$this->installEntitySchema('user');
ViewTestData::createTestViews(static::class, ['user_test_views']);
diff --git a/core/modules/user/tests/src/Kernel/Views/ArgumentValidateTest.php b/core/modules/user/tests/src/Kernel/Views/ArgumentValidateTest.php
index 47b7f6fd0d7..ed4049eded3 100644
--- a/core/modules/user/tests/src/Kernel/Views/ArgumentValidateTest.php
+++ b/core/modules/user/tests/src/Kernel/Views/ArgumentValidateTest.php
@@ -55,7 +55,7 @@ class ArgumentValidateTest extends ViewsKernelTestBase {
/**
* Tests the User (ID) argument validator.
*/
- public function testArgumentValidateUserUid() {
+ public function testArgumentValidateUserUid(): void {
$view = Views::getView('test_view_argument_validate_user');
$this->executeView($view);
@@ -75,7 +75,7 @@ class ArgumentValidateTest extends ViewsKernelTestBase {
/**
* Tests the UserName argument validator.
*/
- public function testArgumentValidateUserName() {
+ public function testArgumentValidateUserName(): void {
$view = Views::getView('test_view_argument_validate_username');
$this->executeView($view);
diff --git a/core/modules/user/tests/src/Kernel/Views/HandlerArgumentUserUidTest.php b/core/modules/user/tests/src/Kernel/Views/HandlerArgumentUserUidTest.php
index c3b7e871f48..11b4e2ffca7 100644
--- a/core/modules/user/tests/src/Kernel/Views/HandlerArgumentUserUidTest.php
+++ b/core/modules/user/tests/src/Kernel/Views/HandlerArgumentUserUidTest.php
@@ -39,7 +39,7 @@ class HandlerArgumentUserUidTest extends KernelTestBase {
/**
* Tests the generated title of a user: uid argument.
*/
- public function testArgumentTitle() {
+ public function testArgumentTitle(): void {
$this->installEntitySchema('user');
$this->installConfig(['user']);
User::create(['uid' => 0, 'name' => ''])->save();
diff --git a/core/modules/user/tests/src/Kernel/Views/HandlerFieldPermissionTest.php b/core/modules/user/tests/src/Kernel/Views/HandlerFieldPermissionTest.php
index c405d8c8d43..1415ae6f92c 100644
--- a/core/modules/user/tests/src/Kernel/Views/HandlerFieldPermissionTest.php
+++ b/core/modules/user/tests/src/Kernel/Views/HandlerFieldPermissionTest.php
@@ -24,7 +24,7 @@ class HandlerFieldPermissionTest extends UserKernelTestBase {
/**
* Tests the permission field handler output.
*/
- public function testFieldPermission() {
+ public function testFieldPermission(): void {
$this->setupPermissionTestData();
$view = Views::getView('test_field_permission');
diff --git a/core/modules/user/tests/src/Kernel/Views/HandlerFilterCurrentUserTest.php b/core/modules/user/tests/src/Kernel/Views/HandlerFilterCurrentUserTest.php
index 5f0879a10b3..36f56faf7ea 100644
--- a/core/modules/user/tests/src/Kernel/Views/HandlerFilterCurrentUserTest.php
+++ b/core/modules/user/tests/src/Kernel/Views/HandlerFilterCurrentUserTest.php
@@ -41,7 +41,7 @@ class HandlerFilterCurrentUserTest extends UserKernelTestBase {
/**
* Tests the current user filter handler with anonymous user.
*/
- public function testFilterCurrentUserAsAnonymous() {
+ public function testFilterCurrentUserAsAnonymous(): void {
$column_map = ['uid' => 'uid'];
$this->currentUser->setAccount(new AnonymousUserSession());
@@ -68,7 +68,7 @@ class HandlerFilterCurrentUserTest extends UserKernelTestBase {
/**
* Tests the current user filter handler with logged-in user.
*/
- public function testFilterCurrentUserAsUser() {
+ public function testFilterCurrentUserAsUser(): void {
$column_map = ['uid' => 'uid'];
$user = reset($this->users);
$this->currentUser->setAccount($user);
diff --git a/core/modules/user/tests/src/Kernel/Views/HandlerFilterPermissionTest.php b/core/modules/user/tests/src/Kernel/Views/HandlerFilterPermissionTest.php
index 7c55609aea9..105a1ac787c 100644
--- a/core/modules/user/tests/src/Kernel/Views/HandlerFilterPermissionTest.php
+++ b/core/modules/user/tests/src/Kernel/Views/HandlerFilterPermissionTest.php
@@ -30,7 +30,7 @@ class HandlerFilterPermissionTest extends UserKernelTestBase {
* @todo Fix the different commented out tests by fixing the many to one
* handler handling with the NOT operator.
*/
- public function testFilterPermission() {
+ public function testFilterPermission(): void {
$this->setupPermissionTestData();
$column_map = ['uid' => 'uid'];
diff --git a/core/modules/user/tests/src/Kernel/Views/HandlerFilterRolesTest.php b/core/modules/user/tests/src/Kernel/Views/HandlerFilterRolesTest.php
index caf2001b6ce..d7518a1a38c 100644
--- a/core/modules/user/tests/src/Kernel/Views/HandlerFilterRolesTest.php
+++ b/core/modules/user/tests/src/Kernel/Views/HandlerFilterRolesTest.php
@@ -30,7 +30,7 @@ class HandlerFilterRolesTest extends UserKernelTestBase {
/**
* Tests that role filter dependencies are calculated correctly.
*/
- public function testDependencies() {
+ public function testDependencies(): void {
$role = Role::create(['id' => 'test_user_role', 'label' => 'Test user role']);
$role->save();
$view = View::load('test_user_name');
@@ -103,7 +103,7 @@ class HandlerFilterRolesTest extends UserKernelTestBase {
/**
* Tests that a warning is triggered if the filter references a missing role.
*/
- public function testMissingRole() {
+ public function testMissingRole(): void {
$logger = $this->prophesize(LoggerInterface::class);
$this->container->get('logger.factory')
->get('system')
diff --git a/core/modules/user/tests/src/Kernel/Views/RelationshipRepresentativeNodeTest.php b/core/modules/user/tests/src/Kernel/Views/RelationshipRepresentativeNodeTest.php
index ecbdcef2402..12b059b8ef1 100644
--- a/core/modules/user/tests/src/Kernel/Views/RelationshipRepresentativeNodeTest.php
+++ b/core/modules/user/tests/src/Kernel/Views/RelationshipRepresentativeNodeTest.php
@@ -44,7 +44,7 @@ class RelationshipRepresentativeNodeTest extends KernelTestBase {
/**
* Tests the relationship.
*/
- public function testRelationship() {
+ public function testRelationship(): void {
$this->installEntitySchema('user');
$this->installEntitySchema('node');
$this->installConfig(['filter']);
diff --git a/core/modules/user/tests/src/Kernel/Views/UserDataTest.php b/core/modules/user/tests/src/Kernel/Views/UserDataTest.php
index e854fd7f169..b53b7e33a33 100644
--- a/core/modules/user/tests/src/Kernel/Views/UserDataTest.php
+++ b/core/modules/user/tests/src/Kernel/Views/UserDataTest.php
@@ -31,7 +31,7 @@ class UserDataTest extends ViewsKernelTestBase {
/**
* Tests field handler.
*/
- public function testDataField() {
+ public function testDataField(): void {
ViewTestData::createTestViews(static::class, ['user_test_views']);
$this->installEntitySchema('user');
diff --git a/core/modules/user/tests/src/Kernel/Views/UserRoleTest.php b/core/modules/user/tests/src/Kernel/Views/UserRoleTest.php
index 961f00c1ace..03c496bd4e6 100644
--- a/core/modules/user/tests/src/Kernel/Views/UserRoleTest.php
+++ b/core/modules/user/tests/src/Kernel/Views/UserRoleTest.php
@@ -19,7 +19,7 @@ class UserRoleTest extends ViewsKernelTestBase {
/**
* Tests numeric role.
*/
- public function testNumericRole() {
+ public function testNumericRole(): void {
$this->installEntitySchema('user');
$this->installSchema('user', ['users_data']);
diff --git a/core/modules/user/tests/src/Kernel/Views/UserViewsDataTest.php b/core/modules/user/tests/src/Kernel/Views/UserViewsDataTest.php
index a7444964513..183b6c13411 100644
--- a/core/modules/user/tests/src/Kernel/Views/UserViewsDataTest.php
+++ b/core/modules/user/tests/src/Kernel/Views/UserViewsDataTest.php
@@ -50,7 +50,7 @@ class UserViewsDataTest extends KernelTestBase {
/**
* Tests if user views data object doesn't contain pass field.
*/
- public function testUserPasswordFieldNotAvailableToViews() {
+ public function testUserPasswordFieldNotAvailableToViews(): void {
$field_definitions = $this->entityFieldManager->getBaseFieldDefinitions('user');
$this->assertArrayHasKey('pass', $field_definitions);
$this->assertArrayNotHasKey('pass', $this->viewsData->get('users_field_data'));
diff --git a/core/modules/user/tests/src/Kernel/Views/UserViewsFieldAccessTest.php b/core/modules/user/tests/src/Kernel/Views/UserViewsFieldAccessTest.php
index 01cae1b21af..2b7953cc961 100644
--- a/core/modules/user/tests/src/Kernel/Views/UserViewsFieldAccessTest.php
+++ b/core/modules/user/tests/src/Kernel/Views/UserViewsFieldAccessTest.php
@@ -29,7 +29,7 @@ class UserViewsFieldAccessTest extends FieldFieldAccessTestBase {
$this->installEntitySchema('user');
}
- public function testUserFields() {
+ public function testUserFields(): void {
ConfigurableLanguage::createFromLangcode('es')->save();
ConfigurableLanguage::createFromLangcode('fr')->save();
diff --git a/core/modules/user/tests/src/Kernel/WhoIsOnlineBlockTest.php b/core/modules/user/tests/src/Kernel/WhoIsOnlineBlockTest.php
index 179bda8607b..7fa4db7cce5 100644
--- a/core/modules/user/tests/src/Kernel/WhoIsOnlineBlockTest.php
+++ b/core/modules/user/tests/src/Kernel/WhoIsOnlineBlockTest.php
@@ -75,7 +75,7 @@ class WhoIsOnlineBlockTest extends KernelTestBase {
/**
* Tests the Who's Online block.
*/
- public function testWhoIsOnlineBlock() {
+ public function testWhoIsOnlineBlock(): void {
// Generate users.
$user1 = User::create([
'name' => 'user1',
diff --git a/core/modules/user/tests/src/Unit/Form/EntityPermissionsFormTest.php b/core/modules/user/tests/src/Unit/Form/EntityPermissionsFormTest.php
index bccc105552f..aa4639f3192 100644
--- a/core/modules/user/tests/src/Unit/Form/EntityPermissionsFormTest.php
+++ b/core/modules/user/tests/src/Unit/Form/EntityPermissionsFormTest.php
@@ -43,7 +43,7 @@ class EntityPermissionsFormTest extends UnitTestCase {
* @covers \Drupal\user\Form\EntityPermissionsForm::access
* @covers \Drupal\user\Form\EntityPermissionsForm::permissionsByProvider
*/
- public function testPermissionsByProvider(string $dependency_name, bool $found) {
+ public function testPermissionsByProvider(string $dependency_name, bool $found): void {
// Mock the constructor parameters.
$prophecy = $this->prophesize(PermissionHandlerInterface::class);
diff --git a/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php b/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php
index f812efce920..922e7aef2c4 100644
--- a/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php
+++ b/core/modules/user/tests/src/Unit/Menu/UserLocalTasksTest.php
@@ -35,7 +35,7 @@ class UserLocalTasksTest extends LocalTaskIntegrationTestBase {
*
* @dataProvider getUserAdminRoutes
*/
- public function testUserAdminLocalTasks($route, $expected) {
+ public function testUserAdminLocalTasks($route, $expected): void {
$this->assertLocalTasks($route, $expected);
}
@@ -56,7 +56,7 @@ class UserLocalTasksTest extends LocalTaskIntegrationTestBase {
*
* @dataProvider getUserLoginRoutes
*/
- public function testUserLoginLocalTasks($route) {
+ public function testUserLoginLocalTasks($route): void {
$tasks = [
0 => ['user.register', 'user.pass', 'user.login'],
];
@@ -79,7 +79,7 @@ class UserLocalTasksTest extends LocalTaskIntegrationTestBase {
*
* @dataProvider getUserPageRoutes
*/
- public function testUserPageLocalTasks($route, $subtask = []) {
+ public function testUserPageLocalTasks($route, $subtask = []): void {
$tasks = [
0 => ['entity.user.canonical', 'entity.user.edit_form'],
];
diff --git a/core/modules/user/tests/src/Unit/PermissionAccessCheckTest.php b/core/modules/user/tests/src/Unit/PermissionAccessCheckTest.php
index 3c98ff42bd6..3660e00fe1d 100644
--- a/core/modules/user/tests/src/Unit/PermissionAccessCheckTest.php
+++ b/core/modules/user/tests/src/Unit/PermissionAccessCheckTest.php
@@ -70,7 +70,7 @@ class PermissionAccessCheckTest extends UnitTestCase {
* @dataProvider providerTestAccess
* @covers ::access
*/
- public function testAccess($requirements, $access, array $contexts = [], $message = '') {
+ public function testAccess($requirements, $access, array $contexts = [], $message = ''): void {
$access_result = AccessResult::allowedIf($access)->addCacheContexts($contexts);
if (!empty($message)) {
$access_result->setReason($message);
diff --git a/core/modules/user/tests/src/Unit/PermissionHandlerTest.php b/core/modules/user/tests/src/Unit/PermissionHandlerTest.php
index fb71401294d..cbd35353ec1 100644
--- a/core/modules/user/tests/src/Unit/PermissionHandlerTest.php
+++ b/core/modules/user/tests/src/Unit/PermissionHandlerTest.php
@@ -88,7 +88,7 @@ class PermissionHandlerTest extends UnitTestCase {
* @covers ::buildPermissionsYaml
* @covers ::moduleProvidesPermissions
*/
- public function testBuildPermissionsYaml() {
+ public function testBuildPermissionsYaml(): void {
vfsStreamWrapper::register();
$root = new vfsStreamDirectory('modules');
vfsStreamWrapper::setRoot($root);
@@ -153,7 +153,7 @@ EOF
* @covers ::buildPermissionsYaml
* @covers ::sortPermissions
*/
- public function testBuildPermissionsSortPerModule() {
+ public function testBuildPermissionsSortPerModule(): void {
vfsStreamWrapper::register();
$root = new vfsStreamDirectory('modules');
vfsStreamWrapper::setRoot($root);
@@ -209,7 +209,7 @@ EOF
* @covers ::getPermissions
* @covers ::buildPermissionsYaml
*/
- public function testBuildPermissionsYamlCallback() {
+ public function testBuildPermissionsYamlCallback(): void {
vfsStreamWrapper::register();
$root = new vfsStreamDirectory('modules');
vfsStreamWrapper::setRoot($root);
@@ -270,7 +270,7 @@ EOF
/**
* Tests a YAML file containing both static permissions and a callback.
*/
- public function testPermissionsYamlStaticAndCallback() {
+ public function testPermissionsYamlStaticAndCallback(): void {
vfsStreamWrapper::register();
$root = new vfsStreamDirectory('modules');
vfsStreamWrapper::setRoot($root);
diff --git a/core/modules/user/tests/src/Unit/Plugin/Action/AddRoleUserTest.php b/core/modules/user/tests/src/Unit/Plugin/Action/AddRoleUserTest.php
index fd48cfa3299..df68245eb4b 100644
--- a/core/modules/user/tests/src/Unit/Plugin/Action/AddRoleUserTest.php
+++ b/core/modules/user/tests/src/Unit/Plugin/Action/AddRoleUserTest.php
@@ -15,7 +15,7 @@ class AddRoleUserTest extends RoleUserTestBase {
/**
* Tests the execute method on a user with a role.
*/
- public function testExecuteAddExistingRole() {
+ public function testExecuteAddExistingRole(): void {
$this->account->expects($this->never())
->method('addRole')
->willReturn($this->account);
@@ -34,7 +34,7 @@ class AddRoleUserTest extends RoleUserTestBase {
/**
* Tests the execute method on a user without a specific role.
*/
- public function testExecuteAddNonExistingRole() {
+ public function testExecuteAddNonExistingRole(): void {
$this->account->expects($this->once())
->method('addRole')
->willReturn($this->account);
diff --git a/core/modules/user/tests/src/Unit/Plugin/Action/RemoveRoleUserTest.php b/core/modules/user/tests/src/Unit/Plugin/Action/RemoveRoleUserTest.php
index 429f2428b48..c0b12a8c5c9 100644
--- a/core/modules/user/tests/src/Unit/Plugin/Action/RemoveRoleUserTest.php
+++ b/core/modules/user/tests/src/Unit/Plugin/Action/RemoveRoleUserTest.php
@@ -15,7 +15,7 @@ class RemoveRoleUserTest extends RoleUserTestBase {
/**
* Tests the execute method on a user with a role.
*/
- public function testExecuteRemoveExistingRole() {
+ public function testExecuteRemoveExistingRole(): void {
$this->account->expects($this->once())
->method('removeRole')
->willReturn($this->account);
@@ -34,7 +34,7 @@ class RemoveRoleUserTest extends RoleUserTestBase {
/**
* Tests the execute method on a user without a specific role.
*/
- public function testExecuteRemoveNonExistingRole() {
+ public function testExecuteRemoveNonExistingRole(): void {
$this->account->expects($this->never())
->method('removeRole')
->willReturn($this->account);
diff --git a/core/modules/user/tests/src/Unit/Plugin/Core/Entity/UserTest.php b/core/modules/user/tests/src/Unit/Plugin/Core/Entity/UserTest.php
index 8851dae88c8..bb1715af98f 100644
--- a/core/modules/user/tests/src/Unit/Plugin/Core/Entity/UserTest.php
+++ b/core/modules/user/tests/src/Unit/Plugin/Core/Entity/UserTest.php
@@ -44,7 +44,7 @@ class UserTest extends UserSessionTest {
* @see \Drupal\user\Entity\User::getRoles()
* @covers ::getRoles
*/
- public function testUserGetRoles() {
+ public function testUserGetRoles(): void {
// Anonymous user.
$user = $this->createUserSession([]);
$this->assertEquals([RoleInterface::ANONYMOUS_ID], $user->getRoles());
diff --git a/core/modules/user/tests/src/Unit/Plugin/Derivative/UserLocalTaskTest.php b/core/modules/user/tests/src/Unit/Plugin/Derivative/UserLocalTaskTest.php
index 770b5610787..25917532512 100644
--- a/core/modules/user/tests/src/Unit/Plugin/Derivative/UserLocalTaskTest.php
+++ b/core/modules/user/tests/src/Unit/Plugin/Derivative/UserLocalTaskTest.php
@@ -66,7 +66,7 @@ class UserLocalTaskTest extends UnitTestCase {
*
* @covers \Drupal\user\Plugin\Derivative\UserLocalTask::getDerivativeDefinitions
*/
- public function testGetDerivativeDefinitions() {
+ public function testGetDerivativeDefinitions(): void {
$expected = [
'permissions_entity_bundle_of_id' => [
'route_name' => 'entity.entity_bundle_of_id.entity_permissions_form',
diff --git a/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidatorTest.php b/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidatorTest.php
index ab2ae11d35f..c8d891c1028 100644
--- a/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidatorTest.php
+++ b/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/ProtectedUserFieldConstraintValidatorTest.php
@@ -69,7 +69,7 @@ class ProtectedUserFieldConstraintValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidate() {
+ public function testValidate(): void {
// Case 1: Validation context should not be touched if no items are passed.
$this->validate(NULL);
diff --git a/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/UserMailRequiredValidatorTest.php b/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/UserMailRequiredValidatorTest.php
index 02ac593f8cd..8cbd25fe5be 100644
--- a/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/UserMailRequiredValidatorTest.php
+++ b/core/modules/user/tests/src/Unit/Plugin/Validation/Constraint/UserMailRequiredValidatorTest.php
@@ -58,7 +58,7 @@ class UserMailRequiredValidatorTest extends UnitTestCase {
*
* @dataProvider providerTestValidate
*/
- public function testValidate($items, $expected_violation, $is_admin = FALSE) {
+ public function testValidate($items, $expected_violation, $is_admin = FALSE): void {
$constraint = new UserMailRequired();
// If a violation is expected, then the context's addViolation method will
diff --git a/core/modules/user/tests/src/Unit/Plugin/migrate/process/ConvertTokensTest.php b/core/modules/user/tests/src/Unit/Plugin/migrate/process/ConvertTokensTest.php
index f7e6dd29708..aab06f47477 100644
--- a/core/modules/user/tests/src/Unit/Plugin/migrate/process/ConvertTokensTest.php
+++ b/core/modules/user/tests/src/Unit/Plugin/migrate/process/ConvertTokensTest.php
@@ -25,7 +25,7 @@ class ConvertTokensTest extends MigrateProcessTestCase {
/**
* Tests conversion of user tokens.
*/
- public function testConvertTokens() {
+ public function testConvertTokens(): void {
$value = $this->plugin->transform('Account details for !username at !site', $this->migrateExecutable, $this->row, 'destination_property');
$this->assertEquals('Account details for [user:name] at [site:name]', $value);
}
@@ -33,7 +33,7 @@ class ConvertTokensTest extends MigrateProcessTestCase {
/**
* Tests conversion of user tokens with a NULL value.
*/
- public function testConvertTokensNull() {
+ public function testConvertTokensNull(): void {
$value = $this->plugin->transform(NULL, $this->migrateExecutable, $this->row, 'destination_property');
$this->assertEquals('', $value);
}
diff --git a/core/modules/user/tests/src/Unit/Plugin/views/field/UserBulkFormTest.php b/core/modules/user/tests/src/Unit/Plugin/views/field/UserBulkFormTest.php
index 95703a45920..55c864ea45d 100644
--- a/core/modules/user/tests/src/Unit/Plugin/views/field/UserBulkFormTest.php
+++ b/core/modules/user/tests/src/Unit/Plugin/views/field/UserBulkFormTest.php
@@ -29,7 +29,7 @@ class UserBulkFormTest extends UnitTestCase {
/**
* Tests the constructor assignment of actions.
*/
- public function testConstructor() {
+ public function testConstructor(): void {
$actions = [];
for ($i = 1; $i <= 2; $i++) {
diff --git a/core/modules/user/tests/src/Unit/Theme/AdminNegotiatorTest.php b/core/modules/user/tests/src/Unit/Theme/AdminNegotiatorTest.php
index 2740acf784e..cb95afcd05c 100644
--- a/core/modules/user/tests/src/Unit/Theme/AdminNegotiatorTest.php
+++ b/core/modules/user/tests/src/Unit/Theme/AdminNegotiatorTest.php
@@ -22,7 +22,7 @@ class AdminNegotiatorTest extends UnitTestCase {
/**
* @dataProvider getThemes
*/
- public function testDetermineActiveTheme($admin_theme, $expected) {
+ public function testDetermineActiveTheme($admin_theme, $expected): void {
$user = $this->prophesize(AccountInterface::class);
$config_factory = $this->getConfigFactoryStub(['system.theme' => ['admin' => $admin_theme]]);
$entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class);
diff --git a/core/modules/user/tests/src/Unit/ToolbarLinkBuilderTest.php b/core/modules/user/tests/src/Unit/ToolbarLinkBuilderTest.php
index 5c40206ee3c..5945580a844 100644
--- a/core/modules/user/tests/src/Unit/ToolbarLinkBuilderTest.php
+++ b/core/modules/user/tests/src/Unit/ToolbarLinkBuilderTest.php
@@ -21,7 +21,7 @@ class ToolbarLinkBuilderTest extends UnitTestCase {
*
* @covers ::renderDisplayName
*/
- public function testRenderDisplayName() {
+ public function testRenderDisplayName(): void {
$account = $this->prophesize(AccountProxyInterface::class);
$display_name = 'Something suspicious that should be #plain_text, not #markup';
$account->getDisplayName()->willReturn($display_name);
diff --git a/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php b/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php
index 624da1b2348..62d9e4d0433 100644
--- a/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php
+++ b/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php
@@ -160,7 +160,7 @@ class UserAccessControlHandlerTest extends UnitTestCase {
*
* @dataProvider userNameProvider
*/
- public function testUserNameAccess($viewer, $target, $view, $edit) {
+ public function testUserNameAccess($viewer, $target, $view, $edit): void {
$this->assertFieldAccess('name', $viewer, $target, $view, $edit);
}
@@ -211,7 +211,7 @@ class UserAccessControlHandlerTest extends UnitTestCase {
*
* @dataProvider hiddenUserSettingsProvider
*/
- public function testHiddenUserSettings($field, $viewer, $target, $view, $edit) {
+ public function testHiddenUserSettings($field, $viewer, $target, $view, $edit): void {
$this->assertFieldAccess($field, $viewer, $target, $view, $edit);
}
@@ -278,7 +278,7 @@ class UserAccessControlHandlerTest extends UnitTestCase {
*
* @dataProvider adminFieldAccessProvider
*/
- public function testAdminFieldAccess($field, $viewer, $target, $view, $edit) {
+ public function testAdminFieldAccess($field, $viewer, $target, $view, $edit): void {
$this->assertFieldAccess($field, $viewer, $target, $view, $edit);
}
@@ -328,7 +328,7 @@ class UserAccessControlHandlerTest extends UnitTestCase {
*
* @dataProvider passwordAccessProvider
*/
- public function testPasswordAccess($viewer, $target, $view, $edit) {
+ public function testPasswordAccess($viewer, $target, $view, $edit): void {
$this->assertFieldAccess('pass', $viewer, $target, $view, $edit);
}
@@ -373,7 +373,7 @@ class UserAccessControlHandlerTest extends UnitTestCase {
*
* @dataProvider createdAccessProvider
*/
- public function testCreatedAccess($viewer, $target, $view, $edit) {
+ public function testCreatedAccess($viewer, $target, $view, $edit): void {
$this->assertFieldAccess('created', $viewer, $target, $view, $edit);
}
@@ -409,7 +409,7 @@ class UserAccessControlHandlerTest extends UnitTestCase {
*
* @dataProvider NonExistingFieldAccessProvider
*/
- public function testNonExistingFieldAccess($viewer, $target, $view, $edit) {
+ public function testNonExistingFieldAccess($viewer, $target, $view, $edit): void {
// By default everyone has access to all fields that do not have explicit
// access control.
// @see EntityAccessControlHandler::checkFieldAccess()
diff --git a/core/modules/user/tests/src/Unit/UserAuthTest.php b/core/modules/user/tests/src/Unit/UserAuthTest.php
index 364376aa125..b007a570fd8 100644
--- a/core/modules/user/tests/src/Unit/UserAuthTest.php
+++ b/core/modules/user/tests/src/Unit/UserAuthTest.php
@@ -96,7 +96,7 @@ class UserAuthTest extends UnitTestCase {
*
* @dataProvider providerTestAuthenticateWithMissingCredentials
*/
- public function testAuthenticateWithMissingCredentials($username, $password) {
+ public function testAuthenticateWithMissingCredentials($username, $password): void {
$this->userStorage->expects($this->never())
->method('loadByProperties');
@@ -122,7 +122,7 @@ class UserAuthTest extends UnitTestCase {
*
* @covers ::authenticate
*/
- public function testAuthenticateWithNoAccountReturned() {
+ public function testAuthenticateWithNoAccountReturned(): void {
$this->userStorage->expects($this->once())
->method('loadByProperties')
->with(['name' => $this->username])
@@ -136,7 +136,7 @@ class UserAuthTest extends UnitTestCase {
*
* @covers ::authenticate
*/
- public function testAuthenticateWithIncorrectPassword() {
+ public function testAuthenticateWithIncorrectPassword(): void {
$this->userStorage->expects($this->once())
->method('loadByProperties')
->with(['name' => $this->username])
@@ -155,7 +155,7 @@ class UserAuthTest extends UnitTestCase {
*
* @covers ::authenticate
*/
- public function testAuthenticateWithCorrectPassword() {
+ public function testAuthenticateWithCorrectPassword(): void {
$this->testUser->expects($this->once())
->method('id')
->willReturn(1);
@@ -182,7 +182,7 @@ class UserAuthTest extends UnitTestCase {
*
* @covers ::authenticate
*/
- public function testAuthenticateWithZeroPassword() {
+ public function testAuthenticateWithZeroPassword(): void {
$this->testUser->expects($this->once())
->method('id')
->willReturn(2);
@@ -205,7 +205,7 @@ class UserAuthTest extends UnitTestCase {
*
* @covers ::authenticate
*/
- public function testAuthenticateWithCorrectPasswordAndNewPasswordHash() {
+ public function testAuthenticateWithCorrectPasswordAndNewPasswordHash(): void {
$this->testUser->expects($this->once())
->method('id')
->willReturn(1);
diff --git a/core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php b/core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php
index c2fc0ec35dc..dd3e6a1740c 100644
--- a/core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php
+++ b/core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php
@@ -88,7 +88,7 @@ class UserRegistrationResourceTest extends UnitTestCase {
/**
* Tests that an exception is thrown when no data provided for the account.
*/
- public function testEmptyPost() {
+ public function testEmptyPost(): void {
$this->expectException(BadRequestHttpException::class);
$this->testClass->post(NULL);
}
@@ -96,7 +96,7 @@ class UserRegistrationResourceTest extends UnitTestCase {
/**
* Tests that only new user accounts can be registered.
*/
- public function testExistedEntityPost() {
+ public function testExistedEntityPost(): void {
$entity = $this->prophesize(User::class);
$entity->isNew()->willReturn(FALSE);
$this->expectException(BadRequestHttpException::class);
@@ -107,7 +107,7 @@ class UserRegistrationResourceTest extends UnitTestCase {
/**
* Tests that admin permissions are required to register a user account.
*/
- public function testRegistrationAdminOnlyPost() {
+ public function testRegistrationAdminOnlyPost(): void {
$this->userSettings->get('register')->willReturn(UserInterface::REGISTER_ADMINISTRATORS_ONLY);
@@ -126,7 +126,7 @@ class UserRegistrationResourceTest extends UnitTestCase {
/**
* Tests that only anonymous users can register users.
*/
- public function testRegistrationAnonymousOnlyPost() {
+ public function testRegistrationAnonymousOnlyPost(): void {
$this->currentUser->isAnonymous()->willReturn(FALSE);
$this->testClass = new UserRegistrationResource([], 'plugin_id', '', [], $this->logger, $this->userSettings->reveal(), $this->currentUser->reveal(), $this->passwordGenerator);
diff --git a/core/modules/user/tests/src/Unit/Views/Argument/RolesRidTest.php b/core/modules/user/tests/src/Unit/Views/Argument/RolesRidTest.php
index f46b8932033..53538044b7e 100644
--- a/core/modules/user/tests/src/Unit/Views/Argument/RolesRidTest.php
+++ b/core/modules/user/tests/src/Unit/Views/Argument/RolesRidTest.php
@@ -21,7 +21,7 @@ class RolesRidTest extends UnitTestCase {
*
* @covers ::titleQuery
*/
- public function testTitleQuery() {
+ public function testTitleQuery(): void {
$role1 = new Role([
'id' => 'test_rid_1',
'label' => 'test rid 1',
diff --git a/core/modules/views/tests/src/Functional/BulkFormTest.php b/core/modules/views/tests/src/Functional/BulkFormTest.php
index 7f3a8a85015..7d05fb20226 100644
--- a/core/modules/views/tests/src/Functional/BulkFormTest.php
+++ b/core/modules/views/tests/src/Functional/BulkFormTest.php
@@ -50,7 +50,7 @@ class BulkFormTest extends BrowserTestBase {
/**
* Tests the bulk form.
*/
- public function testBulkForm() {
+ public function testBulkForm(): void {
$node_storage = $this->container->get('entity_type.manager')->getStorage('node');
// First, test an empty bulk form with the default style plugin to make sure
diff --git a/core/modules/views/tests/src/Functional/DefaultViewsTest.php b/core/modules/views/tests/src/Functional/DefaultViewsTest.php
index debae77fe90..a3d8afa83ea 100644
--- a/core/modules/views/tests/src/Functional/DefaultViewsTest.php
+++ b/core/modules/views/tests/src/Functional/DefaultViewsTest.php
@@ -138,7 +138,7 @@ class DefaultViewsTest extends ViewTestBase {
/**
* Tests that all Default views work as expected.
*/
- public function testDefaultViews() {
+ public function testDefaultViews(): void {
// Get all default views.
$controller = $this->container->get('entity_type.manager')->getStorage('view');
$views = $controller->loadMultiple();
@@ -185,7 +185,7 @@ class DefaultViewsTest extends ViewTestBase {
/**
* Tests the archive view.
*/
- public function testArchiveView() {
+ public function testArchiveView(): void {
// Create additional nodes compared to the one in the setup method.
// Create two nodes in the same month, and one in each following month.
$node = [
diff --git a/core/modules/views/tests/src/Functional/Entity/BaseFieldAccessTest.php b/core/modules/views/tests/src/Functional/Entity/BaseFieldAccessTest.php
index 9febcbe6ef8..2440fac096c 100644
--- a/core/modules/views/tests/src/Functional/Entity/BaseFieldAccessTest.php
+++ b/core/modules/views/tests/src/Functional/Entity/BaseFieldAccessTest.php
@@ -64,7 +64,7 @@ class BaseFieldAccessTest extends ViewTestBase {
/**
* Tests access to protected base fields.
*/
- public function testProtectedField() {
+ public function testProtectedField(): void {
$this->drupalGet('test-entity-protected-access');
$this->assertSession()->pageTextContains('ok to see this one');
$this->assertSession()->pageTextNotContains('no access value');
diff --git a/core/modules/views/tests/src/Functional/Entity/EntityQueryAccessTest.php b/core/modules/views/tests/src/Functional/Entity/EntityQueryAccessTest.php
index a8c60c0fa1f..1a5b85353ae 100644
--- a/core/modules/views/tests/src/Functional/Entity/EntityQueryAccessTest.php
+++ b/core/modules/views/tests/src/Functional/Entity/EntityQueryAccessTest.php
@@ -35,7 +35,7 @@ class EntityQueryAccessTest extends ViewTestBase {
/**
* Tests that the 'media_access' query tag is respected by Views.
*/
- public function testMediaEntityQueryAccess() {
+ public function testMediaEntityQueryAccess(): void {
$this->container->get('module_installer')->install(['media']);
$media_type = $this->createMediaType('test');
@@ -77,7 +77,7 @@ class EntityQueryAccessTest extends ViewTestBase {
/**
* Tests that the 'block_content_access' query tag is respected by Views.
*/
- public function testBlockContentEntityQueryAccess() {
+ public function testBlockContentEntityQueryAccess(): void {
$this->container->get('module_installer')->install(['block_content']);
BlockContentType::create([
diff --git a/core/modules/views/tests/src/Functional/Entity/FieldEntityTest.php b/core/modules/views/tests/src/Functional/Entity/FieldEntityTest.php
index 9183520f3d9..671153db1cf 100644
--- a/core/modules/views/tests/src/Functional/Entity/FieldEntityTest.php
+++ b/core/modules/views/tests/src/Functional/Entity/FieldEntityTest.php
@@ -86,7 +86,7 @@ class FieldEntityTest extends ViewTestBase {
/**
* Tests the getEntity method.
*/
- public function testGetEntity() {
+ public function testGetEntity(): void {
// The view is a view of comments, their nodes and their authors, so there
// are three layers of entities.
diff --git a/core/modules/views/tests/src/Functional/Entity/FieldEntityTranslationTest.php b/core/modules/views/tests/src/Functional/Entity/FieldEntityTranslationTest.php
index 2eb24283dc5..fa9c7d4f83e 100644
--- a/core/modules/views/tests/src/Functional/Entity/FieldEntityTranslationTest.php
+++ b/core/modules/views/tests/src/Functional/Entity/FieldEntityTranslationTest.php
@@ -67,7 +67,7 @@ class FieldEntityTranslationTest extends ViewTestBase {
/**
* Tests that different translation mechanisms can be used for base fields.
*/
- public function testTranslationRows() {
+ public function testTranslationRows(): void {
$node = Node::create([
'type' => 'article',
'title' => 'example EN',
diff --git a/core/modules/views/tests/src/Functional/Entity/FieldRenderedEntityTranslationTest.php b/core/modules/views/tests/src/Functional/Entity/FieldRenderedEntityTranslationTest.php
index 0c851070566..fd9fac492c0 100644
--- a/core/modules/views/tests/src/Functional/Entity/FieldRenderedEntityTranslationTest.php
+++ b/core/modules/views/tests/src/Functional/Entity/FieldRenderedEntityTranslationTest.php
@@ -73,7 +73,7 @@ class FieldRenderedEntityTranslationTest extends ViewTestBase {
/**
* Tests that different translation mechanisms can be used for base fields.
*/
- public function testTranslationRows() {
+ public function testTranslationRows(): void {
// First, an EN node with an ES translation.
/** @var \Drupal\node\NodeInterface $node */
$node = $this->entityTypeManager->getStorage('node')->create([
diff --git a/core/modules/views/tests/src/Functional/Entity/ViewNonTranslatableEntityTest.php b/core/modules/views/tests/src/Functional/Entity/ViewNonTranslatableEntityTest.php
index 6cf0dbdc4ea..5684c85aded 100644
--- a/core/modules/views/tests/src/Functional/Entity/ViewNonTranslatableEntityTest.php
+++ b/core/modules/views/tests/src/Functional/Entity/ViewNonTranslatableEntityTest.php
@@ -35,7 +35,7 @@ class ViewNonTranslatableEntityTest extends BrowserTestBase {
/**
* Tests displaying a view of non-translatable entities.
*/
- public function testViewNoTranslatableEntity() {
+ public function testViewNoTranslatableEntity(): void {
// Add a new language.
ConfigurableLanguage::createFromLangcode('sr')->save();
diff --git a/core/modules/views/tests/src/Functional/GlossaryTest.php b/core/modules/views/tests/src/Functional/GlossaryTest.php
index 2010d849124..0a197444f5c 100644
--- a/core/modules/views/tests/src/Functional/GlossaryTest.php
+++ b/core/modules/views/tests/src/Functional/GlossaryTest.php
@@ -35,7 +35,7 @@ class GlossaryTest extends ViewTestBase {
/**
* Tests the default glossary view.
*/
- public function testGlossaryView() {
+ public function testGlossaryView(): void {
// Create a content type and add some nodes, with a non-random title.
$type = $this->drupalCreateContentType();
$nodes_per_char = [
diff --git a/core/modules/views/tests/src/Functional/Handler/AreaHTTPStatusCodeTest.php b/core/modules/views/tests/src/Functional/Handler/AreaHTTPStatusCodeTest.php
index 34fc31b1e40..1fe8ed00b35 100644
--- a/core/modules/views/tests/src/Functional/Handler/AreaHTTPStatusCodeTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/AreaHTTPStatusCodeTest.php
@@ -37,7 +37,7 @@ class AreaHTTPStatusCodeTest extends ViewTestBase {
/**
* Tests the area handler.
*/
- public function testHTTPStatusCodeHandler() {
+ public function testHTTPStatusCodeHandler(): void {
$this->drupalGet('test-http-status-code');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/views/tests/src/Functional/Handler/AreaTest.php b/core/modules/views/tests/src/Functional/Handler/AreaTest.php
index f1935a19b00..60ef405c7da 100644
--- a/core/modules/views/tests/src/Functional/Handler/AreaTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/AreaTest.php
@@ -60,7 +60,7 @@ class AreaTest extends ViewTestBase {
/**
* Tests the generic UI of an area handler.
*/
- public function testUI() {
+ public function testUI(): void {
$admin_user = $this->drupalCreateUser([
'administer views',
'administer site configuration',
@@ -96,7 +96,7 @@ class AreaTest extends ViewTestBase {
/**
* Tests global tokens.
*/
- public function testRenderAreaToken() {
+ public function testRenderAreaToken(): void {
$admin_user = $this->drupalCreateUser([
'administer views',
'administer site configuration',
@@ -138,7 +138,7 @@ class AreaTest extends ViewTestBase {
/**
* Tests overriding the view title using the area title handler.
*/
- public function testTitleArea() {
+ public function testTitleArea(): void {
$view = Views::getView('frontpage');
$view->initDisplay('page_1');
diff --git a/core/modules/views/tests/src/Functional/Handler/AreaTitleWebTest.php b/core/modules/views/tests/src/Functional/Handler/AreaTitleWebTest.php
index 67551be45f0..a379125979c 100644
--- a/core/modules/views/tests/src/Functional/Handler/AreaTitleWebTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/AreaTitleWebTest.php
@@ -39,7 +39,7 @@ class AreaTitleWebTest extends ViewTestBase {
/**
* Tests the title area handler.
*/
- public function testTitleText() {
+ public function testTitleText(): void {
// Confirm that the view has the normal title before making the view return
// no result.
$this->drupalGet('test-area-title');
diff --git a/core/modules/views/tests/src/Functional/Handler/FieldDropButtonTest.php b/core/modules/views/tests/src/Functional/Handler/FieldDropButtonTest.php
index 0ecd5f05b27..355e1930e21 100644
--- a/core/modules/views/tests/src/Functional/Handler/FieldDropButtonTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/FieldDropButtonTest.php
@@ -50,7 +50,7 @@ class FieldDropButtonTest extends ViewTestBase {
/**
* Tests dropbutton field.
*/
- public function testDropbutton() {
+ public function testDropbutton(): void {
// Create some test nodes.
$nodes = [];
for ($i = 0; $i < 5; $i++) {
diff --git a/core/modules/views/tests/src/Functional/Handler/FieldEntityLinkBaseTest.php b/core/modules/views/tests/src/Functional/Handler/FieldEntityLinkBaseTest.php
index 75466892bc5..4705a620751 100644
--- a/core/modules/views/tests/src/Functional/Handler/FieldEntityLinkBaseTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/FieldEntityLinkBaseTest.php
@@ -70,7 +70,7 @@ class FieldEntityLinkBaseTest extends ViewTestBase {
/**
* Tests entity link fields.
*/
- public function testEntityLink() {
+ public function testEntityLink(): void {
$this->drupalGet('test-link-base-links');
$session = $this->assertSession();
diff --git a/core/modules/views/tests/src/Functional/Handler/FieldEntityOperationsTest.php b/core/modules/views/tests/src/Functional/Handler/FieldEntityOperationsTest.php
index ab0f1d1318a..f515a46bb45 100644
--- a/core/modules/views/tests/src/Functional/Handler/FieldEntityOperationsTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/FieldEntityOperationsTest.php
@@ -48,7 +48,7 @@ class FieldEntityOperationsTest extends ViewTestBase {
/**
* Tests entity operations field.
*/
- public function testEntityOperations() {
+ public function testEntityOperations(): void {
// Add languages and refresh the container so the entity type manager will
// have fresh data.
ConfigurableLanguage::createFromLangcode('hu')->save();
diff --git a/core/modules/views/tests/src/Functional/Handler/FieldGroupRowsWebTest.php b/core/modules/views/tests/src/Functional/Handler/FieldGroupRowsWebTest.php
index e08b5c16df7..ecd33946e1d 100644
--- a/core/modules/views/tests/src/Functional/Handler/FieldGroupRowsWebTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/FieldGroupRowsWebTest.php
@@ -99,7 +99,7 @@ class FieldGroupRowsWebTest extends ViewTestBase {
/**
* Testing when "Display all values in the same row" is checked.
*/
- public function testGroupRows() {
+ public function testGroupRows(): void {
$this->drupalGet('test-group-rows');
$result = $this->cssSelect('div.views-field-field-views-testing-group- div');
@@ -113,7 +113,7 @@ class FieldGroupRowsWebTest extends ViewTestBase {
/**
* Testing when "Display all values in the same row" is unchecked.
*/
- public function testUngroupedRows() {
+ public function testUngroupedRows(): void {
$this->drupalGet('test-ungroup-rows');
$result = $this->cssSelect('div.views-field-field-views-testing-group- div');
$rendered_value = [];
diff --git a/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php b/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php
index d24cf1a6afb..051d5e30235 100644
--- a/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php
@@ -70,7 +70,7 @@ class FieldWebTest extends ViewTestBase {
/**
* Tests the click sorting functionality.
*/
- public function testClickSorting() {
+ public function testClickSorting(): void {
$this->drupalGet('test_click_sort');
$this->assertSession()->statusCodeEquals(200);
@@ -106,7 +106,7 @@ class FieldWebTest extends ViewTestBase {
/**
* Tests the default click sorting functionality with distinct.
*/
- public function testClickSortingDistinct() {
+ public function testClickSortingDistinct(): void {
ConfigurableLanguage::createFromLangcode('es')->save();
$node = $this->drupalCreateNode();
$this->drupalGet('test_distinct_click_sorting');
@@ -218,7 +218,7 @@ class FieldWebTest extends ViewTestBase {
/**
* Tests rewriting the output to a link.
*/
- public function testAlterUrl() {
+ public function testAlterUrl(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
@@ -408,7 +408,7 @@ class FieldWebTest extends ViewTestBase {
/**
* Tests the field/label/wrapper classes.
*/
- public function testFieldClasses() {
+ public function testFieldClasses(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$view = Views::getView('test_field_classes');
@@ -519,7 +519,7 @@ class FieldWebTest extends ViewTestBase {
/**
* Tests trimming/read-more/ellipses.
*/
- public function testTextRendering() {
+ public function testTextRendering(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
diff --git a/core/modules/views/tests/src/Functional/Handler/FilterDateTest.php b/core/modules/views/tests/src/Functional/Handler/FilterDateTest.php
index 3814ed641e3..da0d2aa9a30 100644
--- a/core/modules/views/tests/src/Functional/Handler/FilterDateTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/FilterDateTest.php
@@ -99,7 +99,7 @@ class FilterDateTest extends ViewTestBase {
/**
* Runs other test methods.
*/
- public function testDateFilter() {
+ public function testDateFilter(): void {
$this->_testOffset();
$this->_testBetween();
$this->_testUiValidation();
@@ -343,7 +343,7 @@ class FilterDateTest extends ViewTestBase {
/**
* Tests that the exposed date filter is displayed without errors.
*/
- public function testExposedFilter() {
+ public function testExposedFilter(): void {
$this->drupalLogin($this->drupalCreateUser(['administer views']));
$this->drupalGet('admin/structure/views/nojs/handler/test_filter_date_between/default/filter/created');
$this->submitForm([], 'Expose filter');
diff --git a/core/modules/views/tests/src/Functional/Handler/FilterPlaceholderTextTest.php b/core/modules/views/tests/src/Functional/Handler/FilterPlaceholderTextTest.php
index 01ec573cfd8..7adc5c6cc94 100644
--- a/core/modules/views/tests/src/Functional/Handler/FilterPlaceholderTextTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/FilterPlaceholderTextTest.php
@@ -33,7 +33,7 @@ class FilterPlaceholderTextTest extends ViewTestBase {
/**
* Tests that HTML placeholders are added, when appropriate.
*/
- public function testPlaceholderText() {
+ public function testPlaceholderText(): void {
$this->drupalGet('placeholder-text-test');
// String filter that has no placeholder configured.
diff --git a/core/modules/views/tests/src/Functional/Handler/HandlerTest.php b/core/modules/views/tests/src/Functional/Handler/HandlerTest.php
index 258b79b7969..c0fbf0c4878 100644
--- a/core/modules/views/tests/src/Functional/Handler/HandlerTest.php
+++ b/core/modules/views/tests/src/Functional/Handler/HandlerTest.php
@@ -78,7 +78,7 @@ class HandlerTest extends ViewTestBase {
/**
* Tests the breakString method.
*/
- public function testBreakString() {
+ public function testBreakString(): void {
// Check defaults.
$this->assertEquals((object) ['value' => [], 'operator' => NULL], HandlerBase::breakString(''));
@@ -205,7 +205,7 @@ class HandlerTest extends ViewTestBase {
/**
* Tests the order of handlers is the same before and after saving.
*/
- public function testHandlerWeights() {
+ public function testHandlerWeights(): void {
$handler_types = ['fields', 'filters', 'sorts'];
$view = Views::getView('test_view_handler_weight');
@@ -231,7 +231,7 @@ class HandlerTest extends ViewTestBase {
/**
* Tests the relationship ui for field/filter/argument/relationship.
*/
- public function testRelationshipUI() {
+ public function testRelationshipUI(): void {
$views_admin = $this->drupalCreateUser(['administer views']);
$this->drupalLogin($views_admin);
@@ -295,7 +295,7 @@ class HandlerTest extends ViewTestBase {
/**
* Tests the relationship method on the base class.
*/
- public function testSetRelationship() {
+ public function testSetRelationship(): void {
$view = Views::getView('test_handler_relationships');
$view->setDisplay();
// Setup a broken relationship.
@@ -334,7 +334,7 @@ class HandlerTest extends ViewTestBase {
*
* @see \Drupal\views\Plugin\views\HandlerBase::placeholder()
*/
- public function testPlaceholder() {
+ public function testPlaceholder(): void {
$view = Views::getView('test_view');
$view->initHandlers();
$view->initQuery();
@@ -366,7 +366,7 @@ class HandlerTest extends ViewTestBase {
*
* @see views_test_data_handler_test_access_callback
*/
- public function testAccess() {
+ public function testAccess(): void {
$view = Views::getView('test_handler_test_access');
$views_data = $this->viewsData();
$views_data = $views_data['views_test_data'];
diff --git a/core/modules/views/tests/src/Functional/Plugin/AccessTest.php b/core/modules/views/tests/src/Functional/Plugin/AccessTest.php
index 450f6cb914e..ea1adceec11 100644
--- a/core/modules/views/tests/src/Functional/Plugin/AccessTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/AccessTest.php
@@ -74,7 +74,7 @@ class AccessTest extends ViewTestBase {
/**
* Tests none access plugin.
*/
- public function testAccessNone() {
+ public function testAccessNone(): void {
$view = Views::getView('test_access_none');
$view->setDisplay();
@@ -91,7 +91,7 @@ class AccessTest extends ViewTestBase {
*
* @see \Drupal\views_test\Plugin\views\access\StaticTest
*/
- public function testStaticAccessPlugin() {
+ public function testStaticAccessPlugin(): void {
$view = Views::getView('test_access_static');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php b/core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php
index 0628fbc7dc5..35da559fc1d 100644
--- a/core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php
@@ -59,7 +59,7 @@ class ArgumentDefaultTest extends ViewTestBase {
*
* @see \Drupal\views_test_data\Plugin\views\argument_default\ArgumentDefaultTest
*/
- public function testArgumentDefaultPlugin() {
+ public function testArgumentDefaultPlugin(): void {
$view = Views::getView('test_view');
// Add a new argument and set the test plugin for the argument_default.
@@ -96,7 +96,7 @@ class ArgumentDefaultTest extends ViewTestBase {
/**
* Tests the use of a default argument plugin that provides no options.
*/
- public function testArgumentDefaultNoOptions() {
+ public function testArgumentDefaultNoOptions(): void {
$admin_user = $this->drupalCreateUser([
'administer views',
'administer site configuration',
@@ -118,7 +118,7 @@ class ArgumentDefaultTest extends ViewTestBase {
/**
* Tests fixed default argument.
*/
- public function testArgumentDefaultFixed() {
+ public function testArgumentDefaultFixed(): void {
$random = $this->randomMachineName();
$view = Views::getView('test_argument_default_fixed');
$view->setDisplay();
@@ -144,7 +144,7 @@ class ArgumentDefaultTest extends ViewTestBase {
/**
* Tests node default argument.
*/
- public function testArgumentDefaultNode() {
+ public function testArgumentDefaultNode(): void {
// Create a user that has permission to place a view block.
$permissions = [
'administer views',
@@ -183,7 +183,7 @@ class ArgumentDefaultTest extends ViewTestBase {
/**
* Tests the query parameter default argument.
*/
- public function testArgumentDefaultQueryParameter() {
+ public function testArgumentDefaultQueryParameter(): void {
$view = Views::getView('test_argument_default_query_param');
$request = Request::create(Url::fromUri('internal:/whatever', ['absolute' => TRUE])->toString());
@@ -203,7 +203,7 @@ class ArgumentDefaultTest extends ViewTestBase {
/**
* Tests the more line generation if a default argument is provided.
*/
- public function testArgumentDefaultUrlGeneration() {
+ public function testArgumentDefaultUrlGeneration(): void {
// Create a user that has permission to place a view block.
$permissions = [
'administer views',
diff --git a/core/modules/views/tests/src/Functional/Plugin/CacheTagTest.php b/core/modules/views/tests/src/Functional/Plugin/CacheTagTest.php
index 4199934359f..4464f8703ff 100644
--- a/core/modules/views/tests/src/Functional/Plugin/CacheTagTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/CacheTagTest.php
@@ -124,7 +124,7 @@ class CacheTagTest extends ViewTestBase {
/**
* Tests the tag cache plugin.
*/
- public function testTagCaching() {
+ public function testTagCaching(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
$view = Views::getView('test_tag_cache');
diff --git a/core/modules/views/tests/src/Functional/Plugin/CacheWebTest.php b/core/modules/views/tests/src/Functional/Plugin/CacheWebTest.php
index 2d6c6a4812c..ea80e7e50d4 100644
--- a/core/modules/views/tests/src/Functional/Plugin/CacheWebTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/CacheWebTest.php
@@ -50,7 +50,7 @@ class CacheWebTest extends ViewTestBase {
/**
* Tests the output caching on an actual page.
*/
- public function testCacheOutputOnPage() {
+ public function testCacheOutputOnPage(): void {
$view = Views::getView('test_display');
$view->storage->setStatus(TRUE);
$view->setDisplay('page_1');
@@ -90,7 +90,7 @@ class CacheWebTest extends ViewTestBase {
/**
* Tests that a display without caching still contains the cache metadata.
*/
- public function testDisplayWithoutCacheStillBubblesMetadata() {
+ public function testDisplayWithoutCacheStillBubblesMetadata(): void {
$view = Views::getView('test_display');
$uncached_block = $view->buildRenderable('block_1', [], FALSE);
diff --git a/core/modules/views/tests/src/Functional/Plugin/ContextualFiltersBlockContextTest.php b/core/modules/views/tests/src/Functional/Plugin/ContextualFiltersBlockContextTest.php
index 26383ae6e05..d54c4e28c47 100644
--- a/core/modules/views/tests/src/Functional/Plugin/ContextualFiltersBlockContextTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/ContextualFiltersBlockContextTest.php
@@ -87,7 +87,7 @@ class ContextualFiltersBlockContextTest extends ViewTestBase {
/**
* Tests exposed context.
*/
- public function testBlockContext() {
+ public function testBlockContext(): void {
$this->drupalLogin($this->drupalCreateUser([
'administer views',
'administer blocks',
diff --git a/core/modules/views/tests/src/Functional/Plugin/ContextualFiltersStringTest.php b/core/modules/views/tests/src/Functional/Plugin/ContextualFiltersStringTest.php
index f47dde5224f..1a6710aff9a 100644
--- a/core/modules/views/tests/src/Functional/Plugin/ContextualFiltersStringTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/ContextualFiltersStringTest.php
@@ -71,7 +71,7 @@ class ContextualFiltersStringTest extends ViewTestBase {
/**
* Tests contextual filter for the user roles.
*/
- public function testUserRoleContextualFilter() {
+ public function testUserRoleContextualFilter(): void {
$this->drupalGet('admin/structure/views/view/test_user_role_contextual_filter');
$edit = [
'view_args' => $this->role1,
diff --git a/core/modules/views/tests/src/Functional/Plugin/DisabledDisplayTest.php b/core/modules/views/tests/src/Functional/Plugin/DisabledDisplayTest.php
index 2a749deeaa8..c2738f6d732 100644
--- a/core/modules/views/tests/src/Functional/Plugin/DisabledDisplayTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/DisabledDisplayTest.php
@@ -56,7 +56,7 @@ class DisabledDisplayTest extends ViewTestBase {
* the .enabled property disappear from the schema both the load and save
* calls will start failing.
*/
- public function testDisabledDisplays() {
+ public function testDisabledDisplays(): void {
// The displays defined in this view.
$display_ids = ['attachment_1', 'block_1', 'embed_1', 'feed_1', 'page_2'];
diff --git a/core/modules/views/tests/src/Functional/Plugin/DisplayAttachmentTest.php b/core/modules/views/tests/src/Functional/Plugin/DisplayAttachmentTest.php
index 8f2fc15994b..7a6605271de 100644
--- a/core/modules/views/tests/src/Functional/Plugin/DisplayAttachmentTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/DisplayAttachmentTest.php
@@ -49,7 +49,7 @@ class DisplayAttachmentTest extends ViewTestBase {
/**
* Tests the attachment plugin.
*/
- public function testAttachment() {
+ public function testAttachment(): void {
$this->drupalGet('test-display-attachment');
// Verify that both actual view and the attachment are rendered.
$this->assertSession()->elementsCount('xpath', '//div[contains(@class, "view-content")]', 2);
@@ -62,7 +62,7 @@ class DisplayAttachmentTest extends ViewTestBase {
/**
* Tests that nothing is output when the attachment displays are disabled.
*/
- public function testDisabledAttachments() {
+ public function testDisabledAttachments(): void {
$this->drupalCreateContentType(['type' => 'page']);
$this->drupalCreateNode();
diff --git a/core/modules/views/tests/src/Functional/Plugin/DisplayEntityReferenceTest.php b/core/modules/views/tests/src/Functional/Plugin/DisplayEntityReferenceTest.php
index bace798cdda..36564e9b104 100644
--- a/core/modules/views/tests/src/Functional/Plugin/DisplayEntityReferenceTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/DisplayEntityReferenceTest.php
@@ -131,7 +131,7 @@ class DisplayEntityReferenceTest extends ViewTestBase {
/**
* Tests the entity reference display plugin.
*/
- public function testEntityReferenceDisplay() {
+ public function testEntityReferenceDisplay(): void {
// Test that the 'title' settings are not shown.
$this->drupalGet('admin/structure/views/view/test_display_entity_reference/edit/entity_reference_1');
$this->assertSession()->linkByHrefNotExists('admin/structure/views/nojs/display/test_display_entity_reference/entity_reference_1/title');
diff --git a/core/modules/views/tests/src/Functional/Plugin/DisplayFeedTest.php b/core/modules/views/tests/src/Functional/Plugin/DisplayFeedTest.php
index e940bdf1ebe..0e092c84ae6 100644
--- a/core/modules/views/tests/src/Functional/Plugin/DisplayFeedTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/DisplayFeedTest.php
@@ -53,7 +53,7 @@ class DisplayFeedTest extends ViewTestBase {
/**
* Tests the rendered output.
*/
- public function testFeedOutput() {
+ public function testFeedOutput(): void {
$this->drupalCreateContentType(['type' => 'page']);
// Verify a title with HTML entities is properly escaped.
@@ -116,7 +116,7 @@ class DisplayFeedTest extends ViewTestBase {
/**
* Tests the rendered output for fields display.
*/
- public function testFeedFieldOutput() {
+ public function testFeedFieldOutput(): void {
$this->drupalCreateContentType(['type' => 'page']);
// Verify a title with HTML entities is properly escaped.
@@ -158,7 +158,7 @@ class DisplayFeedTest extends ViewTestBase {
/**
* Tests that nothing is output when the feed display is disabled.
*/
- public function testDisabledFeed() {
+ public function testDisabledFeed(): void {
$this->drupalCreateContentType(['type' => 'page']);
$this->drupalCreateNode();
@@ -189,7 +189,7 @@ class DisplayFeedTest extends ViewTestBase {
/**
* Tests that the feed display works when the linked display is disabled.
*/
- public function testDisabledLinkedDisplay() {
+ public function testDisabledLinkedDisplay(): void {
$view = Views::getView('test_attached_disabled');
$view->setDisplay();
// Disable the page and link the feed to the page.
diff --git a/core/modules/views/tests/src/Functional/Plugin/DisplayFeedTranslationTest.php b/core/modules/views/tests/src/Functional/Plugin/DisplayFeedTranslationTest.php
index 964235a142a..48eef57fd09 100644
--- a/core/modules/views/tests/src/Functional/Plugin/DisplayFeedTranslationTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/DisplayFeedTranslationTest.php
@@ -96,7 +96,7 @@ class DisplayFeedTranslationTest extends ViewTestBase {
/**
* Tests the rendered output for fields display with multiple translations.
*/
- public function testFeedFieldOutput() {
+ public function testFeedFieldOutput(): void {
$node = $this->drupalCreateNode([
'type' => 'page',
'title' => 'en',
diff --git a/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php b/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php
index 16ece9f9cda..01b13e84247 100644
--- a/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/DisplayPageWebTest.php
@@ -49,7 +49,7 @@ class DisplayPageWebTest extends ViewTestBase {
/**
* Tests arguments.
*/
- public function testArguments() {
+ public function testArguments(): void {
$xpath = '//span[@class="field-content"]';
// Ensure that all the entries are returned.
@@ -94,7 +94,7 @@ class DisplayPageWebTest extends ViewTestBase {
/**
* Tests menu settings of page displays.
*/
- public function testPageDisplayMenu() {
+ public function testPageDisplayMenu(): void {
// Check local tasks.
$this->drupalGet('test_page_display_menu');
$this->assertSession()->statusCodeEquals(200);
@@ -131,7 +131,7 @@ class DisplayPageWebTest extends ViewTestBase {
/**
* Tests the title is not displayed in the output.
*/
- public function testTitleOutput() {
+ public function testTitleOutput(): void {
$this->drupalGet('test_page_display_200');
$view = Views::getView('test_page_display');
@@ -142,7 +142,7 @@ class DisplayPageWebTest extends ViewTestBase {
/**
* Tests the views page path functionality.
*/
- public function testPagePaths() {
+ public function testPagePaths(): void {
$this->drupalLogin($this->createUser(['administer views']));
$this->assertPagePath('0');
$this->assertPagePath('9999');
diff --git a/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php b/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php
index 204c7717969..07da9082235 100644
--- a/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php
@@ -71,7 +71,7 @@ class DisplayTest extends ViewTestBase {
*
* @see \Drupal\views_test_data\Plugin\views\display\DisplayTest
*/
- public function testDisplayPlugin() {
+ public function testDisplayPlugin(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$view = Views::getView('test_view');
@@ -167,7 +167,7 @@ class DisplayTest extends ViewTestBase {
/**
* Tests the overriding of filter_groups.
*/
- public function testFilterGroupsOverriding() {
+ public function testFilterGroupsOverriding(): void {
$view = Views::getView('test_filter_groups');
$view->initDisplay();
@@ -180,7 +180,7 @@ class DisplayTest extends ViewTestBase {
/**
* Tests the getAttachedDisplays method.
*/
- public function testGetAttachedDisplays() {
+ public function testGetAttachedDisplays(): void {
$view = Views::getView('test_get_attach_displays');
// Both the feed_1 and the feed_2 display are attached to the page display.
@@ -194,7 +194,7 @@ class DisplayTest extends ViewTestBase {
/**
* Tests the readmore validation.
*/
- public function testReadMoreNoDisplay() {
+ public function testReadMoreNoDisplay(): void {
$view = Views::getView('test_display_more');
// Confirm that the view validates when there is a page display.
$errors = $view->validate();
@@ -220,7 +220,7 @@ class DisplayTest extends ViewTestBase {
/**
* Tests the readmore with custom URL.
*/
- public function testReadMoreCustomURL() {
+ public function testReadMoreCustomURL(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
@@ -315,7 +315,7 @@ class DisplayTest extends ViewTestBase {
/**
* Tests invalid display plugins.
*/
- public function testInvalidDisplayPlugins() {
+ public function testInvalidDisplayPlugins(): void {
$this->drupalGet('test_display_invalid');
$this->assertSession()->statusCodeEquals(200);
@@ -364,7 +364,7 @@ class DisplayTest extends ViewTestBase {
/**
* Tests display validation when a required relationship is missing.
*/
- public function testMissingRelationship() {
+ public function testMissingRelationship(): void {
$view = Views::getView('test_exposed_relationship_admin_ui');
// Remove the relationship that is not used by other handlers.
@@ -389,7 +389,7 @@ class DisplayTest extends ViewTestBase {
/**
* Tests the outputIsEmpty method on the display.
*/
- public function testOutputIsEmpty() {
+ public function testOutputIsEmpty(): void {
$view = Views::getView('test_display_empty');
$this->executeView($view);
$this->assertNotEmpty($view->result);
@@ -432,7 +432,7 @@ class DisplayTest extends ViewTestBase {
/**
* Tests translation rendering settings based on entity translatability.
*/
- public function testTranslationSetting() {
+ public function testTranslationSetting(): void {
\Drupal::service('module_installer')->install(['file']);
// By default there should be no language settings.
diff --git a/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php b/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php
index 72c9b1ead67..a6e39524c24 100644
--- a/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php
@@ -84,7 +84,7 @@ class ExposedFormCheckboxesTest extends ViewTestBase {
/**
* Tests overriding the default render option with checkboxes.
*/
- public function testExposedFormRenderCheckboxes() {
+ public function testExposedFormRenderCheckboxes(): void {
// Use a test theme to convert multi-select elements into checkboxes.
\Drupal::service('theme_installer')->install(['views_test_checkboxes_theme']);
$this->config('system.theme')
@@ -117,7 +117,7 @@ class ExposedFormCheckboxesTest extends ViewTestBase {
/**
* Tests that "is all of" filters work with checkboxes.
*/
- public function testExposedIsAllOfFilter() {
+ public function testExposedIsAllOfFilter(): void {
foreach (['Term 1', 'Term 2', 'Term 3'] as $term_name) {
// Add a few terms to the new vocabulary.
$term = Term::create([
diff --git a/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php b/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php
index 918dcda51ae..0d4fe6e4973 100644
--- a/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php
@@ -71,7 +71,7 @@ class ExposedFormTest extends ViewTestBase {
/**
* Tests the submit button.
*/
- public function testSubmitButton() {
+ public function testSubmitButton(): void {
// Test the submit button value defaults to 'Apply'.
$this->drupalGet('test_exposed_form_buttons');
$this->assertSession()->statusCodeEquals(200);
@@ -107,7 +107,7 @@ class ExposedFormTest extends ViewTestBase {
/**
* Tests the exposed form with a non-standard identifier.
*/
- public function testExposedIdentifier() {
+ public function testExposedIdentifier(): void {
// Alter the identifier of the filter to a random string.
$view = Views::getView('test_exposed_form_buttons');
$view->setDisplay();
@@ -201,7 +201,7 @@ class ExposedFormTest extends ViewTestBase {
/**
* Tests whether the reset button works on an exposed form.
*/
- public function testResetButton() {
+ public function testResetButton(): void {
// Test the button is hidden when there is no exposed input.
$this->drupalGet('test_exposed_form_buttons');
$this->assertSession()->fieldNotExists('edit-reset');
@@ -249,7 +249,7 @@ class ExposedFormTest extends ViewTestBase {
*
* @dataProvider providerTestExposedBlock
*/
- public function testExposedBlock($display) {
+ public function testExposedBlock($display): void {
$view = Views::getView('test_exposed_block');
$view->setDisplay($display);
$block = $this->drupalPlaceBlock('views_exposed_filter_block:test_exposed_block-' . $display);
@@ -334,7 +334,7 @@ class ExposedFormTest extends ViewTestBase {
/**
* Tests the input required exposed form type.
*/
- public function testInputRequired() {
+ public function testInputRequired(): void {
$view = View::load('test_exposed_form_buttons');
$display = &$view->getDisplay('default');
$display['display_options']['exposed_form']['type'] = 'input_required';
@@ -357,7 +357,7 @@ class ExposedFormTest extends ViewTestBase {
/**
* Tests the "on demand text" for the input required exposed form type.
*/
- public function testTextInputRequired() {
+ public function testTextInputRequired(): void {
$view = Views::getView('test_exposed_form_buttons');
$display = &$view->storage->getDisplay('default');
$display['display_options']['exposed_form']['type'] = 'input_required';
@@ -382,7 +382,7 @@ class ExposedFormTest extends ViewTestBase {
/**
* Tests exposed forms with exposed sort and items per page.
*/
- public function testExposedSortAndItemsPerPage() {
+ public function testExposedSortAndItemsPerPage(): void {
for ($i = 0; $i < 50; $i++) {
$entity = EntityTest::create([]);
$entity->save();
@@ -480,7 +480,7 @@ class ExposedFormTest extends ViewTestBase {
/**
* Tests a view which is rendered after a form with a validation error.
*/
- public function testFormErrorWithExposedForm() {
+ public function testFormErrorWithExposedForm(): void {
$this->drupalGet('views_test_data_error_form_page');
$this->assertSession()->statusCodeEquals(200);
$form = $this->cssSelect('form.views-exposed-form');
@@ -501,7 +501,7 @@ class ExposedFormTest extends ViewTestBase {
/**
* Tests the exposed form with a pager.
*/
- public function testExposedFilterPagination() {
+ public function testExposedFilterPagination(): void {
$this->drupalCreateContentType(['type' => 'post']);
// Create some random nodes.
for ($i = 0; $i < 5; $i++) {
@@ -548,7 +548,7 @@ class ExposedFormTest extends ViewTestBase {
/**
* Tests the "Remember the last selection" functionality.
*/
- public function testRememberSelected() {
+ public function testRememberSelected(): void {
$this->drupalGet('test_remember_selected');
$this->getSession()->getPage()->fillField('type', 'page');
$this->getSession()->getPage()->pressButton('Apply');
diff --git a/core/modules/views/tests/src/Functional/Plugin/FilterTest.php b/core/modules/views/tests/src/Functional/Plugin/FilterTest.php
index 5710582b114..1f08bb14777 100644
--- a/core/modules/views/tests/src/Functional/Plugin/FilterTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/FilterTest.php
@@ -61,7 +61,7 @@ class FilterTest extends ViewTestBase {
/**
* Tests query of the row plugin.
*/
- public function testFilterQuery() {
+ public function testFilterQuery(): void {
// Check that we can find the test filter plugin.
$plugin = $this->container->get('plugin.manager.views.filter')->createInstance('test_filter');
$this->assertInstanceOf(FilterPlugin::class, $plugin);
@@ -156,7 +156,7 @@ class FilterTest extends ViewTestBase {
/**
* Tests an exposed filter when all options are selected.
*/
- public function testInOperatorSelectAllOptions() {
+ public function testInOperatorSelectAllOptions(): void {
$row['row[type]'] = 'fields';
$this->drupalGet('admin/structure/views/nojs/display/test_filter_in_operator_ui/default/row');
$this->submitForm($row, 'Apply');
@@ -179,7 +179,7 @@ class FilterTest extends ViewTestBase {
/**
* Tests the limit of the expose operator functionality.
*/
- public function testLimitExposedOperators() {
+ public function testLimitExposedOperators(): void {
$this->drupalGet('test_filter_in_operator_ui');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/views/tests/src/Functional/Plugin/MenuLinkTest.php b/core/modules/views/tests/src/Functional/Plugin/MenuLinkTest.php
index 502637790d8..9f529872e1b 100644
--- a/core/modules/views/tests/src/Functional/Plugin/MenuLinkTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/MenuLinkTest.php
@@ -66,7 +66,7 @@ class MenuLinkTest extends ViewTestBase {
/**
* Tests that menu links using menu_link_content as parent are visible.
*/
- public function testHierarchicalMenuLinkVisibility() {
+ public function testHierarchicalMenuLinkVisibility(): void {
$this->drupalLogin($this->adminUser);
$node = $this->drupalCreateNode(['type' => 'page']);
diff --git a/core/modules/views/tests/src/Functional/Plugin/MiniPagerTest.php b/core/modules/views/tests/src/Functional/Plugin/MiniPagerTest.php
index b53099554d6..8a264d5163c 100644
--- a/core/modules/views/tests/src/Functional/Plugin/MiniPagerTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/MiniPagerTest.php
@@ -57,7 +57,7 @@ class MiniPagerTest extends ViewTestBase {
/**
* Tests the rendering of mini pagers.
*/
- public function testMiniPagerRender() {
+ public function testMiniPagerRender(): void {
// On first page, current page and next page link appear, previous page link
// does not.
$this->drupalGet('test_mini_pager');
@@ -151,7 +151,7 @@ class MiniPagerTest extends ViewTestBase {
/**
* Tests changing the heading level.
*/
- public function testPagerHeadingLevel() {
+ public function testPagerHeadingLevel(): void {
// Set "Pager Heading" to h3 and check that it is correct.
$view = Views::getView('test_mini_pager');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Functional/Plugin/MonthDatePluginTest.php b/core/modules/views/tests/src/Functional/Plugin/MonthDatePluginTest.php
index b638cd76cbb..6f9e518ed8e 100644
--- a/core/modules/views/tests/src/Functional/Plugin/MonthDatePluginTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/MonthDatePluginTest.php
@@ -65,7 +65,7 @@ class MonthDatePluginTest extends ViewTestBase {
/**
* Tests the Month Date Plugin.
*/
- public function testMonthDatePlugin() {
+ public function testMonthDatePlugin(): void {
$assert_session = $this->assertSession();
// Test fallback value.
diff --git a/core/modules/views/tests/src/Functional/Plugin/NumericFormatPluralTest.php b/core/modules/views/tests/src/Functional/Plugin/NumericFormatPluralTest.php
index 203f72bfd6f..f477f07ad06 100644
--- a/core/modules/views/tests/src/Functional/Plugin/NumericFormatPluralTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/NumericFormatPluralTest.php
@@ -51,7 +51,7 @@ class NumericFormatPluralTest extends ViewTestBase {
/**
* Tests plural formatting setting on a numeric views handler.
*/
- public function testNumericFormatPlural() {
+ public function testNumericFormatPlural(): void {
// Create a file.
$file = $this->createFile();
diff --git a/core/modules/views/tests/src/Functional/Plugin/PagerTest.php b/core/modules/views/tests/src/Functional/Plugin/PagerTest.php
index a36450509c3..0db04b21434 100644
--- a/core/modules/views/tests/src/Functional/Plugin/PagerTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/PagerTest.php
@@ -51,7 +51,7 @@ class PagerTest extends ViewTestBase {
*
* @see https://www.drupal.org/node/652712
*/
- public function testStorePagerSettings() {
+ public function testStorePagerSettings(): void {
// Show the default display so the override selection is shown.
\Drupal::configFactory()->getEditable('views.settings')->set('ui.show.default_display', TRUE)->save();
@@ -223,7 +223,7 @@ class PagerTest extends ViewTestBase {
/**
* Tests the none-pager-query.
*/
- public function testNoLimit() {
+ public function testNoLimit(): void {
// Create 11 nodes and make sure that everyone is returned.
// We create 11 nodes, because the default pager plugin had 10 items per page.
$this->drupalCreateContentType(['type' => 'page']);
@@ -254,7 +254,7 @@ class PagerTest extends ViewTestBase {
$this->assertEquals(0, $view->pager->getItemsPerPage());
}
- public function testViewTotalRowsWithoutPager() {
+ public function testViewTotalRowsWithoutPager(): void {
$this->drupalCreateContentType(['type' => 'page']);
for ($i = 0; $i < 23; $i++) {
$this->drupalCreateNode();
@@ -270,7 +270,7 @@ class PagerTest extends ViewTestBase {
/**
* Tests the some pager plugin.
*/
- public function testLimit() {
+ public function testLimit(): void {
// Create 11 nodes and make sure that everyone is returned.
// We create 11 nodes, because the default pager plugin had 10 items per page.
$this->drupalCreateContentType(['type' => 'page']);
@@ -304,7 +304,7 @@ class PagerTest extends ViewTestBase {
/**
* Tests the normal pager.
*/
- public function testNormalPager() {
+ public function testNormalPager(): void {
// Create 11 nodes and make sure that everyone is returned.
// We create 11 nodes, because the default pager plugin had 10 items per page.
$this->drupalCreateContentType(['type' => 'page']);
@@ -382,7 +382,7 @@ class PagerTest extends ViewTestBase {
/**
* Tests changing the heading level.
*/
- public function testPagerHeadingLevel() {
+ public function testPagerHeadingLevel(): void {
// Create 2 nodes and make sure that everyone is returned.
$this->drupalCreateContentType(['type' => 'page']);
for ($i = 0; $i < 2; $i++) {
@@ -416,7 +416,7 @@ class PagerTest extends ViewTestBase {
/**
* Tests rendering with NULL pager.
*/
- public function testRenderNullPager() {
+ public function testRenderNullPager(): void {
// Create 11 nodes and make sure that everyone is returned.
// We create 11 nodes, because the default pager plugin had 10 items per page.
$this->drupalCreateContentType(['type' => 'page']);
@@ -436,7 +436,7 @@ class PagerTest extends ViewTestBase {
/**
* Tests the api functions on the view object.
*/
- public function testPagerApi() {
+ public function testPagerApi(): void {
$view = Views::getView('test_pager_full');
$view->setDisplay();
// On the first round don't initialize the pager.
@@ -492,7 +492,7 @@ class PagerTest extends ViewTestBase {
/**
* Tests translating the pager using config_translation.
*/
- public function testPagerConfigTranslation() {
+ public function testPagerConfigTranslation(): void {
$view = Views::getView('content');
$display = &$view->storage->getDisplay('default');
$display['display_options']['pager']['options']['items_per_page'] = 5;
@@ -551,7 +551,7 @@ class PagerTest extends ViewTestBase {
/**
* Tests translating the pager using locale.
*/
- public function testPagerLocale() {
+ public function testPagerLocale(): void {
// Enable locale and language module.
$this->container->get('module_installer')->install(['locale', 'language']);
$this->resetAll();
diff --git a/core/modules/views/tests/src/Functional/Plugin/QueryOptionsTest.php b/core/modules/views/tests/src/Functional/Plugin/QueryOptionsTest.php
index 6a143afaf94..6312d526178 100644
--- a/core/modules/views/tests/src/Functional/Plugin/QueryOptionsTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/QueryOptionsTest.php
@@ -35,7 +35,7 @@ class QueryOptionsTest extends ViewTestBase {
/**
* Test that query overrides are stored.
*/
- public function testStoreQuerySettingsOverride() {
+ public function testStoreQuerySettingsOverride(): void {
// Show the default display so the override selection is shown.
\Drupal::configFactory()->getEditable('views.settings')->set('ui.show.default_display', TRUE)->save();
diff --git a/core/modules/views/tests/src/Functional/Plugin/StyleSummaryTest.php b/core/modules/views/tests/src/Functional/Plugin/StyleSummaryTest.php
index 78efcb727cb..3f25a0b5a76 100644
--- a/core/modules/views/tests/src/Functional/Plugin/StyleSummaryTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/StyleSummaryTest.php
@@ -58,7 +58,7 @@ class StyleSummaryTest extends ViewTestBase {
/**
* Tests a summary view.
*/
- public function testSummaryView() {
+ public function testSummaryView(): void {
$this->drupalGet('test-summary');
// Ensure styles are properly added for summary views.
diff --git a/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php b/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php
index c7a2cf39068..d4d0f8903f3 100644
--- a/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php
@@ -40,7 +40,7 @@ class StyleTableTest extends ViewTestBase {
/**
* Tests table caption/summary/description.
*/
- public function testAccessibilitySettings() {
+ public function testAccessibilitySettings(): void {
$this->drupalGet('test-table');
$this->assertSession()->elementExists('xpath', '//caption/child::text()');
@@ -84,7 +84,7 @@ class StyleTableTest extends ViewTestBase {
/**
* Tests table fields in columns.
*/
- public function testFieldInColumns() {
+ public function testFieldInColumns(): void {
$this->drupalGet('test-table');
// Ensure that both columns are in separate tds.
@@ -110,7 +110,7 @@ class StyleTableTest extends ViewTestBase {
/**
* Tests that a number with the value of "0" is displayed in the table.
*/
- public function testNumericFieldVisible() {
+ public function testNumericFieldVisible(): void {
// Adds a new data point in the views_test_data table to have a person with
// an age of zero.
$data_set = $this->dataSet();
@@ -134,7 +134,7 @@ class StyleTableTest extends ViewTestBase {
/**
* Tests that empty columns are hidden when empty_column is set.
*/
- public function testEmptyColumn() {
+ public function testEmptyColumn(): void {
// Empty the 'job' data.
\Drupal::database()->update('views_test_data')
->fields(['job' => ''])
@@ -151,7 +151,7 @@ class StyleTableTest extends ViewTestBase {
/**
* Tests grouping by a field.
*/
- public function testGrouping() {
+ public function testGrouping(): void {
/** @var \Drupal\views\ViewEntityInterface $view */
$view = \Drupal::entityTypeManager()->getStorage('view')->load('test_table');
// Get a reference to the display configuration so we can alter some
@@ -229,7 +229,7 @@ class StyleTableTest extends ViewTestBase {
/**
* Tests responsive classes and column assigning.
*/
- public function testResponsiveMergedColumns() {
+ public function testResponsiveMergedColumns(): void {
/** @var \Drupal\views\ViewEntityInterface $view */
$view = \Drupal::entityTypeManager()->getStorage('view')->load('test_table');
@@ -250,7 +250,7 @@ class StyleTableTest extends ViewTestBase {
/**
* Tests the cacheability of the table display.
*/
- public function testTableCacheability() {
+ public function testTableCacheability(): void {
\Drupal::service('module_installer')->uninstall(['page_cache']);
$url = 'test-table';
diff --git a/core/modules/views/tests/src/Functional/Plugin/ViewsBulkTest.php b/core/modules/views/tests/src/Functional/Plugin/ViewsBulkTest.php
index a63d91cfc56..141bfd07366 100644
--- a/core/modules/views/tests/src/Functional/Plugin/ViewsBulkTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/ViewsBulkTest.php
@@ -45,7 +45,7 @@ class ViewsBulkTest extends ViewTestBase {
/**
* Tests bulk selection.
*/
- public function testBulkSelection() {
+ public function testBulkSelection(): void {
// Create first node, set updated time to the past.
$node_1 = $this->drupalCreateNode([
diff --git a/core/modules/views/tests/src/Functional/Plugin/ViewsFormTest.php b/core/modules/views/tests/src/Functional/Plugin/ViewsFormTest.php
index dd9d3734ae6..d5445d2b21e 100644
--- a/core/modules/views/tests/src/Functional/Plugin/ViewsFormTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/ViewsFormTest.php
@@ -28,7 +28,7 @@ class ViewsFormTest extends ViewTestBase {
/**
* Tests the Views form wrapper.
*/
- public function testFormWrapper() {
+ public function testFormWrapper(): void {
$this->drupalGet('test_bulk_form');
// Ensure we have the form tag on the page.
$xpath = $this->cssSelect('.views-form form');
diff --git a/core/modules/views/tests/src/Functional/RenderCacheWebTest.php b/core/modules/views/tests/src/Functional/RenderCacheWebTest.php
index 0f50ad489f8..cd5a58bc5f8 100644
--- a/core/modules/views/tests/src/Functional/RenderCacheWebTest.php
+++ b/core/modules/views/tests/src/Functional/RenderCacheWebTest.php
@@ -60,7 +60,7 @@ class RenderCacheWebTest extends ViewTestBase {
/**
* Tests rendering caching of a views block with arguments.
*/
- public function testEmptyView() {
+ public function testEmptyView(): void {
$this->placeBlock('views_block:node_id_argument-block_1', ['region' => 'header']);
$this->drupalGet('<front>');
$this->assertEquals([], $this->cssSelect('div.region-header div.views-field-title'));
@@ -81,7 +81,7 @@ class RenderCacheWebTest extends ViewTestBase {
/**
* Tests render caching for display rendered with different args on same page.
*/
- public function testRepeatedDisplay() {
+ public function testRepeatedDisplay(): void {
$this->drupalGet("views_test_render_cache/node_id_argument/block_1/{$this->nodes[0]->id()}/{$this->nodes[1]->id()}");
// Confirm there are two displays.
$displays = $this->cssSelect('.views-element-container .view-id-node_id_argument.view-display-id-block_1');
diff --git a/core/modules/views/tests/src/Functional/SearchIntegrationTest.php b/core/modules/views/tests/src/Functional/SearchIntegrationTest.php
index a9910a2216a..03fd20b1324 100644
--- a/core/modules/views/tests/src/Functional/SearchIntegrationTest.php
+++ b/core/modules/views/tests/src/Functional/SearchIntegrationTest.php
@@ -37,7 +37,7 @@ class SearchIntegrationTest extends ViewTestBase {
/**
* Tests search integration.
*/
- public function testSearchIntegration() {
+ public function testSearchIntegration(): void {
// Create a content type.
$type = $this->drupalCreateContentType();
diff --git a/core/modules/views/tests/src/Functional/SearchMultilingualTest.php b/core/modules/views/tests/src/Functional/SearchMultilingualTest.php
index d0dab7eb92c..90991632e6a 100644
--- a/core/modules/views/tests/src/Functional/SearchMultilingualTest.php
+++ b/core/modules/views/tests/src/Functional/SearchMultilingualTest.php
@@ -45,7 +45,7 @@ class SearchMultilingualTest extends ViewTestBase {
/**
* Tests search with multilingual nodes.
*/
- public function testMultilingualSearchFilter() {
+ public function testMultilingualSearchFilter(): void {
// Add Spanish language programmatically.
static::createLanguageFromLangcode('es');
diff --git a/core/modules/views/tests/src/Functional/TaxonomyGlossaryTest.php b/core/modules/views/tests/src/Functional/TaxonomyGlossaryTest.php
index d1570775275..d7fb44f83cf 100644
--- a/core/modules/views/tests/src/Functional/TaxonomyGlossaryTest.php
+++ b/core/modules/views/tests/src/Functional/TaxonomyGlossaryTest.php
@@ -61,7 +61,7 @@ class TaxonomyGlossaryTest extends ViewTestBase {
/**
* Tests a taxonomy glossary view.
*/
- public function testTaxonomyGlossaryView() {
+ public function testTaxonomyGlossaryView(): void {
$initials = [];
foreach ($this->taxonomyTerms as $term) {
$char = mb_strtolower(substr($term->label(), 0, 1));
diff --git a/core/modules/views/tests/src/Functional/UserBatchActionTest.php b/core/modules/views/tests/src/Functional/UserBatchActionTest.php
index 8a21942cf65..370ff761c3a 100644
--- a/core/modules/views/tests/src/Functional/UserBatchActionTest.php
+++ b/core/modules/views/tests/src/Functional/UserBatchActionTest.php
@@ -34,7 +34,7 @@ class UserBatchActionTest extends BrowserTestBase {
/**
* Tests user admin batch.
*/
- public function testUserAction() {
+ public function testUserAction(): void {
$themes = ['stark', 'olivero', 'claro'];
$this->container->get('theme_installer')->install($themes);
diff --git a/core/modules/views/tests/src/Functional/UserPathTest.php b/core/modules/views/tests/src/Functional/UserPathTest.php
index b63c50f12bd..e2b43e8dd42 100644
--- a/core/modules/views/tests/src/Functional/UserPathTest.php
+++ b/core/modules/views/tests/src/Functional/UserPathTest.php
@@ -31,7 +31,7 @@ class UserPathTest extends ViewTestBase {
/**
* Tests if the login page is still available when using a wildcard path.
*/
- public function testUserLoginPage() {
+ public function testUserLoginPage(): void {
$this->drupalGet('user/login');
$this->assertSession()->statusCodeEquals(200);
}
diff --git a/core/modules/views/tests/src/Functional/ViewAjaxTest.php b/core/modules/views/tests/src/Functional/ViewAjaxTest.php
index 4decb6f007b..6c2e3ead5c0 100644
--- a/core/modules/views/tests/src/Functional/ViewAjaxTest.php
+++ b/core/modules/views/tests/src/Functional/ViewAjaxTest.php
@@ -37,7 +37,7 @@ class ViewAjaxTest extends ViewTestBase {
/**
* Tests an ajax view.
*/
- public function testAjaxView() {
+ public function testAjaxView(): void {
$this->drupalGet('test_ajax_view');
$drupal_settings = $this->getDrupalSettings();
@@ -51,7 +51,7 @@ class ViewAjaxTest extends ViewTestBase {
/**
* Ensures that non-ajax view cannot be accessed via an ajax HTTP request.
*/
- public function testNonAjaxViewViaAjax() {
+ public function testNonAjaxViewViaAjax(): void {
$client = $this->getHttpClient();
$response = $client->request('POST', $this->buildUrl('views/ajax'), [
'form_params' => ['view_name' => 'test_ajax_view', 'view_display_id' => 'default'],
diff --git a/core/modules/views/tests/src/Functional/ViewElementTest.php b/core/modules/views/tests/src/Functional/ViewElementTest.php
index 77f97a06cda..1a26f457dbe 100644
--- a/core/modules/views/tests/src/Functional/ViewElementTest.php
+++ b/core/modules/views/tests/src/Functional/ViewElementTest.php
@@ -37,7 +37,7 @@ class ViewElementTest extends ViewTestBase {
/**
* Tests the rendered output and form output of a view element.
*/
- public function testViewElement() {
+ public function testViewElement(): void {
$view = Views::getView('test_view_embed');
$view->setDisplay();
// Test a form.
@@ -77,7 +77,7 @@ class ViewElementTest extends ViewTestBase {
/**
* Tests the rendered output and form output of the "embed" display plugin.
*/
- public function testViewElementEmbed() {
+ public function testViewElementEmbed(): void {
$view = Views::getView('test_view_embed');
$view->setDisplay();
// Test a form.
diff --git a/core/modules/views/tests/src/Functional/ViewTranslationTest.php b/core/modules/views/tests/src/Functional/ViewTranslationTest.php
index c9212bf50f0..ade9cdc659f 100644
--- a/core/modules/views/tests/src/Functional/ViewTranslationTest.php
+++ b/core/modules/views/tests/src/Functional/ViewTranslationTest.php
@@ -53,7 +53,7 @@ class ViewTranslationTest extends ViewTestBase {
/**
* Tests that the view route title is translated.
*/
- public function testViewTitleTranslation() {
+ public function testViewTitleTranslation(): void {
$view = Views::getView('test_view');
// Create a test display, add path and default language title.
diff --git a/core/modules/views/tests/src/Functional/ViewsEscapingTest.php b/core/modules/views/tests/src/Functional/ViewsEscapingTest.php
index c7e695af17a..9c3d45a467e 100644
--- a/core/modules/views/tests/src/Functional/ViewsEscapingTest.php
+++ b/core/modules/views/tests/src/Functional/ViewsEscapingTest.php
@@ -46,7 +46,7 @@ class ViewsEscapingTest extends ViewTestBase {
/**
* Tests for incorrectly escaped markup in the views-view-fields.html.twig.
*/
- public function testViewsViewFieldsEscaping() {
+ public function testViewsViewFieldsEscaping(): void {
// Test with system theme using theme function.
$this->drupalGet('test_page_display_200');
@@ -74,7 +74,7 @@ class ViewsEscapingTest extends ViewTestBase {
/**
* Tests for incorrectly escaped markup in a header label on a display table.
*/
- public function testViewsFieldHeaderEscaping() {
+ public function testViewsFieldHeaderEscaping(): void {
// Test with a field header label having an html element wrapper.
$this->drupalGet('test_field_header');
diff --git a/core/modules/views/tests/src/Functional/ViewsFormAlterTest.php b/core/modules/views/tests/src/Functional/ViewsFormAlterTest.php
index 2f475cafebf..5d3442d70f6 100644
--- a/core/modules/views/tests/src/Functional/ViewsFormAlterTest.php
+++ b/core/modules/views/tests/src/Functional/ViewsFormAlterTest.php
@@ -24,7 +24,7 @@ class ViewsFormAlterTest extends ViewTestBase {
/**
* Tests hook_form_BASE_FORM_ID_alter for a ViewsForm.
*/
- public function testViewsFormAlter() {
+ public function testViewsFormAlter(): void {
$this->drupalLogin($this->createUser(['access media overview']));
$this->drupalGet('admin/content/media');
$count = $this->container->get('state')->get('hook_form_BASE_FORM_ID_alter_count');
diff --git a/core/modules/views/tests/src/Functional/ViewsFormMultipleTest.php b/core/modules/views/tests/src/Functional/ViewsFormMultipleTest.php
index eec9827d08f..42c2261c89a 100644
--- a/core/modules/views/tests/src/Functional/ViewsFormMultipleTest.php
+++ b/core/modules/views/tests/src/Functional/ViewsFormMultipleTest.php
@@ -48,7 +48,7 @@ class ViewsFormMultipleTest extends ViewTestBase {
/**
* Tests the a page with multiple View forms in it.
*/
- public function testViewsFormMultiple() {
+ public function testViewsFormMultiple(): void {
// Get the test page.
$this->drupalGet('views_test_form_multiple');
diff --git a/core/modules/views/tests/src/Functional/ViewsNoResultsBehaviorTest.php b/core/modules/views/tests/src/Functional/ViewsNoResultsBehaviorTest.php
index ee820f5ac8a..719b5675087 100644
--- a/core/modules/views/tests/src/Functional/ViewsNoResultsBehaviorTest.php
+++ b/core/modules/views/tests/src/Functional/ViewsNoResultsBehaviorTest.php
@@ -42,7 +42,7 @@ class ViewsNoResultsBehaviorTest extends ViewTestBase {
/**
* Tests the view with the text.
*/
- public function testDuplicateText() {
+ public function testDuplicateText(): void {
$output = $this->drupalGet('admin/content');
$this->assertEquals(1, substr_count($output, 'No content available.'), 'Only one message should be present');
}
diff --git a/core/modules/views/tests/src/Functional/ViewsThemeIntegrationTest.php b/core/modules/views/tests/src/Functional/ViewsThemeIntegrationTest.php
index eedebea8a7f..0111f34e936 100644
--- a/core/modules/views/tests/src/Functional/ViewsThemeIntegrationTest.php
+++ b/core/modules/views/tests/src/Functional/ViewsThemeIntegrationTest.php
@@ -49,7 +49,7 @@ class ViewsThemeIntegrationTest extends ViewTestBase {
/**
* Tests pre_render and post_render hooks in a theme and sub-theme.
*/
- public function testThemedViewPage() {
+ public function testThemedViewPage(): void {
\Drupal::service('theme_installer')->install(['test_basetheme', 'test_subtheme']);
diff --git a/core/modules/views/tests/src/Functional/Wizard/BasicTest.php b/core/modules/views/tests/src/Functional/Wizard/BasicTest.php
index 40828d3b527..5187acc1e86 100644
--- a/core/modules/views/tests/src/Functional/Wizard/BasicTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/BasicTest.php
@@ -29,7 +29,7 @@ class BasicTest extends WizardTestBase {
$this->drupalPlaceBlock('page_title_block');
}
- public function testViewsWizardAndListing() {
+ public function testViewsWizardAndListing(): void {
$this->drupalCreateContentType(['type' => 'article']);
$this->drupalCreateContentType(['type' => 'page']);
@@ -203,7 +203,7 @@ class BasicTest extends WizardTestBase {
*
* @see \Drupal\views\Plugin\views\display\DisplayPluginBase::mergeDefaults()
*/
- public function testWizardDefaultValues() {
+ public function testWizardDefaultValues(): void {
$random_id = $this->randomMachineName(16);
// Create a basic view.
$view = [];
diff --git a/core/modules/views/tests/src/Functional/Wizard/EntityTestRevisionTest.php b/core/modules/views/tests/src/Functional/Wizard/EntityTestRevisionTest.php
index f9d4610b824..3a9b74eeb18 100644
--- a/core/modules/views/tests/src/Functional/Wizard/EntityTestRevisionTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/EntityTestRevisionTest.php
@@ -24,7 +24,7 @@ class EntityTestRevisionTest extends WizardTestBase {
/**
* Tests creating a view of revisions where the type is not on the base table.
*/
- public function testRevisionsViewWithNoTypeOnBaseTable() {
+ public function testRevisionsViewWithNoTypeOnBaseTable(): void {
$type = [
'show[wizard_key]' => 'standard:entity_test_rev_revision',
];
diff --git a/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php b/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php
index b301aad40d7..5f9cd364dac 100644
--- a/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php
@@ -28,7 +28,7 @@ class ItemsPerPageTest extends WizardTestBase {
/**
* Tests the number of items per page.
*/
- public function testItemsPerPage() {
+ public function testItemsPerPage(): void {
$this->drupalCreateContentType(['type' => 'article']);
// Create articles, each with a different creation time so that we can do a
diff --git a/core/modules/views/tests/src/Functional/Wizard/MenuTest.php b/core/modules/views/tests/src/Functional/Wizard/MenuTest.php
index 68f0dc9a081..5ca2100d3e0 100644
--- a/core/modules/views/tests/src/Functional/Wizard/MenuTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/MenuTest.php
@@ -21,7 +21,7 @@ class MenuTest extends WizardTestBase {
/**
* Tests the menu functionality.
*/
- public function testMenus() {
+ public function testMenus(): void {
$this->drupalPlaceBlock('system_menu_block:main');
// Create a view with a page display and a menu link in the Main Menu.
diff --git a/core/modules/views/tests/src/Functional/Wizard/NodeWizardTest.php b/core/modules/views/tests/src/Functional/Wizard/NodeWizardTest.php
index 0c5c5c035e8..5fafdae573e 100644
--- a/core/modules/views/tests/src/Functional/Wizard/NodeWizardTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/NodeWizardTest.php
@@ -20,7 +20,7 @@ class NodeWizardTest extends WizardTestBase {
/**
* Tests creating a view with node titles.
*/
- public function testViewAddWithNodeTitles() {
+ public function testViewAddWithNodeTitles(): void {
$this->drupalCreateContentType(['type' => 'article']);
$view = [];
diff --git a/core/modules/views/tests/src/Functional/Wizard/PagerTest.php b/core/modules/views/tests/src/Functional/Wizard/PagerTest.php
index e25091b2353..76e37c0cd5d 100644
--- a/core/modules/views/tests/src/Functional/Wizard/PagerTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/PagerTest.php
@@ -19,7 +19,7 @@ class PagerTest extends WizardTestBase {
/**
* Tests the pager option.
*/
- public function testPager() {
+ public function testPager(): void {
// Create nodes, each with a different creation time so that we have
// conditions that are meaningful for the use of a pager.
$this->drupalCreateContentType(['type' => 'page']);
diff --git a/core/modules/views/tests/src/Functional/Wizard/SortingTest.php b/core/modules/views/tests/src/Functional/Wizard/SortingTest.php
index a3dd1bc5014..96833a5bd01 100644
--- a/core/modules/views/tests/src/Functional/Wizard/SortingTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/SortingTest.php
@@ -28,7 +28,7 @@ class SortingTest extends WizardTestBase {
/**
* Tests the sorting functionality.
*/
- public function testSorting() {
+ public function testSorting(): void {
// Create nodes, each with a different creation time so that we can do a
// meaningful sort.
$this->drupalCreateContentType(['type' => 'page']);
diff --git a/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php b/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php
index dc7beeea3e5..eefa980b46f 100644
--- a/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php
@@ -127,7 +127,7 @@ class TaggedWithTest extends WizardTestBase {
/**
* Tests the "tagged with" functionality.
*/
- public function testTaggedWith() {
+ public function testTaggedWith(): void {
// In this test we will only create nodes that have an instance of the tag
// field.
$node_add_path = 'node/add/' . $this->nodeTypeWithTags->id();
@@ -198,7 +198,7 @@ class TaggedWithTest extends WizardTestBase {
/**
* Tests that the "tagged with" form element only shows for node types that support it.
*/
- public function testTaggedWithByNodeType() {
+ public function testTaggedWithByNodeType(): void {
// The tagging field is associated with one of our node types only. So the
// "tagged with" form element on the view wizard should appear on the form
// by default (when the wizard is configured to display all content) and
@@ -249,7 +249,7 @@ class TaggedWithTest extends WizardTestBase {
/**
* Tests that "tagged with" works with views entity reference.
*/
- public function testTaggedWithByViewReference() {
+ public function testTaggedWithByViewReference(): void {
Term::create(['name' => 'term1', 'vid' => 'views_testing_tags']);
$tags_xpath = '//input[@name="show[tagged_with]"]';
diff --git a/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php b/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php
index fe2b4c85089..dff279552af 100644
--- a/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php
+++ b/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php
@@ -51,7 +51,7 @@ class BlockExposedFilterAJAXTest extends WebDriverTestBase {
/**
* Tests if exposed filtering and reset works with a views block and ajax.
*/
- public function testExposedFilteringAndReset() {
+ public function testExposedFilteringAndReset(): void {
$node = $this->createNode();
$block = $this->drupalPlaceBlock('views_block:test_block_exposed_ajax-block_1');
$this->drupalGet($node->toUrl());
diff --git a/core/modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php b/core/modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php
index b009ebdd07f..29cad07068b 100644
--- a/core/modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php
+++ b/core/modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php
@@ -56,7 +56,7 @@ class ClickSortingAJAXTest extends WebDriverTestBase {
/**
* Tests if sorting via AJAX works for the "Content" View.
*/
- public function testClickSorting() {
+ public function testClickSorting(): void {
// Visit the content page.
$this->drupalGet('test-content-ajax');
diff --git a/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php b/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php
index ff4cdd4a953..6d61ecef80a 100644
--- a/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php
+++ b/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php
@@ -77,7 +77,7 @@ class ExposedFilterAJAXTest extends WebDriverTestBase {
/**
* Tests if exposed filtering via AJAX works for the "Content" View.
*/
- public function testExposedFiltering() {
+ public function testExposedFiltering(): void {
// Visit the View page.
$this->drupalGet('admin/content');
@@ -149,7 +149,7 @@ class ExposedFilterAJAXTest extends WebDriverTestBase {
/**
* Tests if exposed filtering via AJAX works in a modal.
*/
- public function testExposedFiltersInModal() {
+ public function testExposedFiltersInModal(): void {
$this->drupalGet('views-test-modal/modal');
$assert = $this->assertSession();
@@ -197,7 +197,7 @@ class ExposedFilterAJAXTest extends WebDriverTestBase {
/**
* Tests exposed filtering via AJAX with a button element.
*/
- public function testExposedFilteringWithButtonElement() {
+ public function testExposedFilteringWithButtonElement(): void {
// Install theme to test with template system.
\Drupal::service('theme_installer')->install(['views_test_theme']);
diff --git a/core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php b/core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php
index 1366c0a6953..390046be412 100644
--- a/core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php
+++ b/core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php
@@ -82,7 +82,7 @@ class GlossaryViewTest extends WebDriverTestBase {
/**
* Tests the AJAX callbacks for the glossary view.
*/
- public function testGlossaryDefault() {
+ public function testGlossaryDefault(): void {
// Visit the default Glossary page.
$url = Url::fromRoute('view.test_glossary.page_1');
$this->drupalGet($url);
@@ -104,7 +104,7 @@ class GlossaryViewTest extends WebDriverTestBase {
/**
* Tests that the glossary also works on a language prefixed URL.
*/
- public function testGlossaryLanguagePrefix() {
+ public function testGlossaryLanguagePrefix(): void {
ConfigurableLanguage::createFromLangcode('nl')->save();
$config = $this->config('language.negotiation');
diff --git a/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php b/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php
index c2019bb8c2d..5eb53caba9c 100644
--- a/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php
+++ b/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php
@@ -67,7 +67,7 @@ class PaginationAJAXTest extends WebDriverTestBase {
/**
* Tests if pagination via AJAX works for the "Content" View.
*/
- public function testBasicPagination() {
+ public function testBasicPagination(): void {
// Visit the content page.
$this->drupalGet('test-content-ajax');
@@ -144,7 +144,7 @@ class PaginationAJAXTest extends WebDriverTestBase {
/**
* Tests if pagination via AJAX works for the filter with default value.
*/
- public function testDefaultFilterPagination() {
+ public function testDefaultFilterPagination(): void {
// Add default value to the title filter.
$view = \Drupal::configFactory()->getEditable('views.view.test_content_ajax');
$display = $view->get('display');
diff --git a/core/modules/views/tests/src/FunctionalJavascript/Plugin/BulkOperationsTest.php b/core/modules/views/tests/src/FunctionalJavascript/Plugin/BulkOperationsTest.php
index 17153865b0e..d2ce491eb84 100644
--- a/core/modules/views/tests/src/FunctionalJavascript/Plugin/BulkOperationsTest.php
+++ b/core/modules/views/tests/src/FunctionalJavascript/Plugin/BulkOperationsTest.php
@@ -40,7 +40,7 @@ class BulkOperationsTest extends WebDriverTestBase {
$this->drupalLogin($this->createUser(['bypass node access', 'administer nodes', 'access content overview']));
}
- public function testBulkOperations() {
+ public function testBulkOperations(): void {
$node_1 = $this->drupalCreateNode([
'type' => 'page',
'title' => 'The first node',
diff --git a/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/ContextualFilterTest.php b/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/ContextualFilterTest.php
index b725bb2dfbe..1987e585431 100644
--- a/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/ContextualFilterTest.php
+++ b/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/ContextualFilterTest.php
@@ -59,7 +59,7 @@ class ContextualFilterTest extends WebDriverTestBase {
/**
* Tests adding a contextual filter handler through the UI.
*/
- public function testAddContextualFilterUI() {
+ public function testAddContextualFilterUI(): void {
$this->drupalGet('/admin/structure/views/view/test_field_body');
$web_assert = $this->assertSession();
diff --git a/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php b/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php
index baa050c7a68..0eb4a9f91c2 100644
--- a/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php
+++ b/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php
@@ -112,7 +112,7 @@ class FieldTest extends WebDriverTestBase {
$this->assertEquals('Content', $web_assert->waitForElement('css', '.ui-dialog-title')->getText());
}
- public function testFormatterChanging() {
+ public function testFormatterChanging(): void {
$web_assert = $this->assertSession();
$url = '/admin/structure/views/view/test_field_body';
$this->drupalGet($url);
diff --git a/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php b/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php
index 9b00504be2a..38bd96fc651 100644
--- a/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php
+++ b/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php
@@ -59,7 +59,7 @@ class FilterTest extends WebDriverTestBase {
/**
* Tests adding a filter handler.
*/
- public function testAddingFilter() {
+ public function testAddingFilter(): void {
$web_assert = $this->assertSession();
$url = '/admin/structure/views/view/content';
diff --git a/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/GroupedExposedFilterTest.php b/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/GroupedExposedFilterTest.php
index 4acf73ff751..458d9053167 100644
--- a/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/GroupedExposedFilterTest.php
+++ b/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/GroupedExposedFilterTest.php
@@ -76,7 +76,7 @@ class GroupedExposedFilterTest extends WebDriverTestBase {
/**
* Tests if the right fields are shown and the right values set.
*/
- public function testGroupedFilterValuesUI() {
+ public function testGroupedFilterValuesUI(): void {
$web_assert = $this->assertSession();
$this->drupalGet('/admin/structure/views/view/test_exposed_admin_ui');
diff --git a/core/modules/views/tests/src/FunctionalJavascript/RedirectAjaxTest.php b/core/modules/views/tests/src/FunctionalJavascript/RedirectAjaxTest.php
index 3d5a50e4ca5..2cee37e5c95 100644
--- a/core/modules/views/tests/src/FunctionalJavascript/RedirectAjaxTest.php
+++ b/core/modules/views/tests/src/FunctionalJavascript/RedirectAjaxTest.php
@@ -53,7 +53,7 @@ class RedirectAjaxTest extends WebDriverTestBase {
/**
* Ensures that redirects work with ajax.
*/
- public function testRedirectWithAjax() {
+ public function testRedirectWithAjax(): void {
$this->drupalGet('admin/content');
$original_url = $this->getSession()->getCurrentUrl();
diff --git a/core/modules/views/tests/src/Kernel/BasicTest.php b/core/modules/views/tests/src/Kernel/BasicTest.php
index bff2a6af098..ba766c1e72c 100644
--- a/core/modules/views/tests/src/Kernel/BasicTest.php
+++ b/core/modules/views/tests/src/Kernel/BasicTest.php
@@ -23,7 +23,7 @@ class BasicTest extends ViewsKernelTestBase {
/**
* Tests a trivial result set.
*/
- public function testSimpleResultSet() {
+ public function testSimpleResultSet(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -41,7 +41,7 @@ class BasicTest extends ViewsKernelTestBase {
/**
* Tests filtering of the result set.
*/
- public function testSimpleFiltering() {
+ public function testSimpleFiltering(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -100,7 +100,7 @@ class BasicTest extends ViewsKernelTestBase {
/**
* Tests simple argument.
*/
- public function testSimpleArgument() {
+ public function testSimpleArgument(): void {
// Execute with a view
$view = Views::getView('test_simple_argument');
$view->setArguments([27]);
diff --git a/core/modules/views/tests/src/Kernel/CacheableMetadataCalculationTest.php b/core/modules/views/tests/src/Kernel/CacheableMetadataCalculationTest.php
index 90f03850c35..ed28481f551 100644
--- a/core/modules/views/tests/src/Kernel/CacheableMetadataCalculationTest.php
+++ b/core/modules/views/tests/src/Kernel/CacheableMetadataCalculationTest.php
@@ -69,7 +69,7 @@ class CacheableMetadataCalculationTest extends KernelTestBase {
*
* @see \Drupal\views\Entity\View::addCacheMetadata()
*/
- public function testCacheableMetadataCalculation() {
+ public function testCacheableMetadataCalculation(): void {
// Enabling a module that contains a view should not cause the cacheability
// metadata to be recalculated.
$this->enableModules([self::TEST_MODULE]);
diff --git a/core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php b/core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php
index d3c8fcbf820..fd172ce6271 100644
--- a/core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php
+++ b/core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php
@@ -170,7 +170,7 @@ class EntityViewsDataTest extends KernelTestBase {
/**
* Tests base tables.
*/
- public function testBaseTables() {
+ public function testBaseTables(): void {
$data = $this->entityTypeManager->getHandler('entity_test', 'views_data')->getViewsData();
$this->assertEquals('entity_test', $data['entity_test']['table']['entity type']);
@@ -193,7 +193,7 @@ class EntityViewsDataTest extends KernelTestBase {
/**
* Tests data_table support.
*/
- public function testDataTable() {
+ public function testDataTable(): void {
$entity_type = $this->baseEntityType
->set('data_table', 'entity_test_mul_property_data')
->set('id', 'entity_test_mul')
@@ -229,7 +229,7 @@ class EntityViewsDataTest extends KernelTestBase {
/**
* Tests revision table without data table support.
*/
- public function testRevisionTableWithoutDataTable() {
+ public function testRevisionTableWithoutDataTable(): void {
$entity_type = $this->baseEntityType
->set('revision_table', 'entity_test_mulrev_revision')
->set('revision_data_table', NULL)
@@ -268,7 +268,7 @@ class EntityViewsDataTest extends KernelTestBase {
/**
* Tests revision table with data table support.
*/
- public function testRevisionTableWithRevisionDataTableAndDataTable() {
+ public function testRevisionTableWithRevisionDataTableAndDataTable(): void {
$entity_type = $this->baseEntityType
->set('data_table', 'entity_test_mul_property_data')
->set('revision_table', 'entity_test_mulrev_revision')
@@ -326,7 +326,7 @@ class EntityViewsDataTest extends KernelTestBase {
/**
* Tests revision table with data table support.
*/
- public function testRevisionTableWithRevisionDataTable() {
+ public function testRevisionTableWithRevisionDataTable(): void {
$entity_type = $this->baseEntityType
->set('revision_table', 'entity_test_mulrev_revision')
->set('revision_data_table', 'entity_test_mulrev_property_revision')
@@ -382,7 +382,7 @@ class EntityViewsDataTest extends KernelTestBase {
/**
* Tests fields on the base table.
*/
- public function testBaseTableFields() {
+ public function testBaseTableFields(): void {
$data = $this->entityTypeManager->getHandler('entity_test', 'views_data')->getViewsData();
$this->assertNumericField($data['entity_test']['id']);
@@ -435,7 +435,7 @@ class EntityViewsDataTest extends KernelTestBase {
/**
* Tests fields on the data table.
*/
- public function testDataTableFields() {
+ public function testDataTableFields(): void {
$entity_test_type = new ConfigEntityType([
'class' => ConfigEntityBase::class,
'id' => 'entity_test_bundle',
@@ -524,7 +524,7 @@ class EntityViewsDataTest extends KernelTestBase {
/**
* Tests fields on the revision table.
*/
- public function testRevisionTableFields() {
+ public function testRevisionTableFields(): void {
$entity_type = $this->baseEntityType
->set('id', 'entity_test_mulrev')
->set('base_table', 'entity_test_mulrev')
diff --git a/core/modules/views/tests/src/Kernel/Entity/EntityViewsWithMultivalueBasefieldTest.php b/core/modules/views/tests/src/Kernel/Entity/EntityViewsWithMultivalueBasefieldTest.php
index c6c4b27b870..30e001a85c5 100644
--- a/core/modules/views/tests/src/Kernel/Entity/EntityViewsWithMultivalueBasefieldTest.php
+++ b/core/modules/views/tests/src/Kernel/Entity/EntityViewsWithMultivalueBasefieldTest.php
@@ -37,7 +37,7 @@ class EntityViewsWithMultivalueBasefieldTest extends ViewsKernelTestBase {
/**
* Tests entity views with multivalue base fields.
*/
- public function testView() {
+ public function testView(): void {
EntityTestMultiValueBasefield::create([
'name' => 'test',
])->save();
diff --git a/core/modules/views/tests/src/Kernel/Entity/FilterEntityBundleTest.php b/core/modules/views/tests/src/Kernel/Entity/FilterEntityBundleTest.php
index ec5797e2ef6..c3daf8260c1 100644
--- a/core/modules/views/tests/src/Kernel/Entity/FilterEntityBundleTest.php
+++ b/core/modules/views/tests/src/Kernel/Entity/FilterEntityBundleTest.php
@@ -29,7 +29,7 @@ class FilterEntityBundleTest extends ViewsKernelTestBase {
/**
* Tests the generic bundle filter.
*/
- public function testFilterEntity() {
+ public function testFilterEntity(): void {
$this->installEntitySchema('user');
$this->installEntitySchema('node');
NodeType::create(['type' => 'test_bundle', 'name' => 'Test 1'])->save();
diff --git a/core/modules/views/tests/src/Kernel/Entity/LatestRevisionFilterTest.php b/core/modules/views/tests/src/Kernel/Entity/LatestRevisionFilterTest.php
index ddd0f3cf6c3..1d6973ac51a 100644
--- a/core/modules/views/tests/src/Kernel/Entity/LatestRevisionFilterTest.php
+++ b/core/modules/views/tests/src/Kernel/Entity/LatestRevisionFilterTest.php
@@ -30,7 +30,7 @@ class LatestRevisionFilterTest extends ViewsKernelTestBase {
/**
* Tests the 'Latest revision' filter.
*/
- public function testLatestRevisionFilter() {
+ public function testLatestRevisionFilter(): void {
$this->installEntitySchema('user');
$this->installEntitySchema('node');
$this->installSchema('node', ['node_access']);
diff --git a/core/modules/views/tests/src/Kernel/Entity/LatestTranslationAffectedRevisionTest.php b/core/modules/views/tests/src/Kernel/Entity/LatestTranslationAffectedRevisionTest.php
index bbe9d038713..78362cb0b60 100644
--- a/core/modules/views/tests/src/Kernel/Entity/LatestTranslationAffectedRevisionTest.php
+++ b/core/modules/views/tests/src/Kernel/Entity/LatestTranslationAffectedRevisionTest.php
@@ -35,7 +35,7 @@ class LatestTranslationAffectedRevisionTest extends ViewsKernelTestBase {
/**
* Tests the 'Latest revision' filter.
*/
- public function testLatestRevisionFilter() {
+ public function testLatestRevisionFilter(): void {
$this->installEntitySchema('user');
$this->installEntitySchema('node');
$this->installSchema('node', ['node_access']);
diff --git a/core/modules/views/tests/src/Kernel/Entity/RowEntityRenderersTest.php b/core/modules/views/tests/src/Kernel/Entity/RowEntityRenderersTest.php
index 7c9c6611d9e..30c18ae793f 100644
--- a/core/modules/views/tests/src/Kernel/Entity/RowEntityRenderersTest.php
+++ b/core/modules/views/tests/src/Kernel/Entity/RowEntityRenderersTest.php
@@ -168,35 +168,35 @@ class RowEntityRenderersTest extends ViewsKernelTestBase {
/**
* Tests the entity row renderers.
*/
- public function testEntityRenderers() {
+ public function testEntityRenderers(): void {
$this->checkLanguageRenderers('page_1', $this->values);
}
/**
* Tests the field row renderers.
*/
- public function testFieldRenderers() {
+ public function testFieldRenderers(): void {
$this->checkLanguageRenderers('page_2', $this->values);
}
/**
* Tests the entity row renderers for relationships.
*/
- public function testEntityRenderersRelationship() {
+ public function testEntityRenderersRelationship(): void {
$this->checkLanguageRenderersRelationship('page_3', $this->values);
}
/**
* Tests the field row renderers for relationships.
*/
- public function testFieldRenderersRelationship() {
+ public function testFieldRenderersRelationship(): void {
$this->checkLanguageRenderersRelationship('page_4', $this->values);
}
/**
* Tests the row renderer with a revision base table.
*/
- public function testRevisionBaseTable() {
+ public function testRevisionBaseTable(): void {
$view = Views::getView('test_entity_row_renderers_revisions_base');
$view->execute();
$this->assertIdenticalResultset($view, $this->ids, ['nid' => 'nid', 'uid' => 'uid']);
diff --git a/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php b/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php
index c183a1bbf95..34954ed4f42 100644
--- a/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php
+++ b/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php
@@ -94,7 +94,7 @@ class ViewEntityDependenciesTest extends ViewsKernelTestBase {
/**
* Tests the getDependencies method.
*/
- public function testGetDependencies() {
+ public function testGetDependencies(): void {
$expected = [];
$expected['test_field_get_entity'] = [
'module' => [
diff --git a/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php b/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
index f9a4c9b1171..0017457e35a 100644
--- a/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
+++ b/core/modules/views/tests/src/Kernel/EventSubscriber/ViewsEntitySchemaSubscriberIntegrationTest.php
@@ -96,7 +96,7 @@ class ViewsEntitySchemaSubscriberIntegrationTest extends ViewsKernelTestBase {
/**
* Tests that views are disabled when an entity type is deleted.
*/
- public function testDeleteEntityType() {
+ public function testDeleteEntityType(): void {
$entity_storage = $this->entityTypeManager->getStorage('view');
// Make the test entity type revisionable.
@@ -134,7 +134,7 @@ class ViewsEntitySchemaSubscriberIntegrationTest extends ViewsKernelTestBase {
/**
* Tests that renaming base tables adapts the views.
*/
- public function testBaseTableRename() {
+ public function testBaseTableRename(): void {
$this->renameBaseTable();
$this->applyEntityUpdates('entity_test_update');
@@ -159,7 +159,7 @@ class ViewsEntitySchemaSubscriberIntegrationTest extends ViewsKernelTestBase {
/**
* Tests that renaming data tables adapts the views.
*/
- public function testDataTableRename() {
+ public function testDataTableRename(): void {
$this->updateEntityTypeToTranslatable(TRUE);
$entity_storage = $this->entityTypeManager->getStorage('view');
@@ -193,7 +193,7 @@ class ViewsEntitySchemaSubscriberIntegrationTest extends ViewsKernelTestBase {
/**
* Tests that renaming revision tables adapts the views.
*/
- public function testRevisionBaseTableRename() {
+ public function testRevisionBaseTableRename(): void {
$this->updateEntityTypeToRevisionable(TRUE);
/** @var \Drupal\views\Entity\View $view */
@@ -226,7 +226,7 @@ class ViewsEntitySchemaSubscriberIntegrationTest extends ViewsKernelTestBase {
/**
* Tests that renaming revision tables adapts the views.
*/
- public function testRevisionDataTableRename() {
+ public function testRevisionDataTableRename(): void {
$this->updateEntityTypeToRevisionableAndTranslatable(TRUE);
/** @var \Drupal\views\Entity\View $view */
@@ -260,7 +260,7 @@ class ViewsEntitySchemaSubscriberIntegrationTest extends ViewsKernelTestBase {
/**
* Tests that adding data tables adapts the views.
*/
- public function testDataTableAddition() {
+ public function testDataTableAddition(): void {
$this->updateEntityTypeToTranslatable(TRUE);
/** @var \Drupal\views\Entity\View $view */
@@ -282,7 +282,7 @@ class ViewsEntitySchemaSubscriberIntegrationTest extends ViewsKernelTestBase {
/**
* Tests that enabling revisions doesn't do anything.
*/
- public function testRevisionEnabling() {
+ public function testRevisionEnabling(): void {
$this->updateEntityTypeToRevisionable(TRUE);
/** @var \Drupal\views\Entity\View $view */
@@ -302,7 +302,7 @@ class ViewsEntitySchemaSubscriberIntegrationTest extends ViewsKernelTestBase {
/**
* Tests that removing revision support disables the view.
*/
- public function testRevisionDisabling() {
+ public function testRevisionDisabling(): void {
$this->updateEntityTypeToRevisionable(TRUE);
$this->updateEntityTypeToNotRevisionable(TRUE);
@@ -321,7 +321,7 @@ class ViewsEntitySchemaSubscriberIntegrationTest extends ViewsKernelTestBase {
/**
* Tests a bunch possible entity definition table updates.
*/
- public function testVariousTableUpdates() {
+ public function testVariousTableUpdates(): void {
// We want to test the following permutations of entity definition updates:
// base <-> base + translation
// base + translation <-> base + translation + revision
@@ -439,7 +439,7 @@ class ViewsEntitySchemaSubscriberIntegrationTest extends ViewsKernelTestBase {
/**
* Tests some possible entity table updates for a revision view.
*/
- public function testVariousTableUpdatesForRevisionView() {
+ public function testVariousTableUpdatesForRevisionView(): void {
// base + revision <-> base + translation + revision
$this->updateEntityTypeToRevisionable(TRUE);
@@ -474,7 +474,7 @@ class ViewsEntitySchemaSubscriberIntegrationTest extends ViewsKernelTestBase {
/**
* Tests the case when a view could not be updated automatically.
*/
- public function testViewSaveException() {
+ public function testViewSaveException(): void {
$this->renameBaseTable();
\Drupal::state()->set('entity_test_update.throw_view_exception', 'test_view_entity_test');
$this->applyEntityUpdates('entity_test_update');
@@ -513,7 +513,7 @@ class ViewsEntitySchemaSubscriberIntegrationTest extends ViewsKernelTestBase {
/**
* Tests that broken views are handled gracefully.
*/
- public function testBrokenView() {
+ public function testBrokenView(): void {
$view_id = 'test_view_entity_test';
$this->state->set('views_test_config.broken_view', $view_id);
$this->updateEntityTypeToTranslatable(TRUE);
diff --git a/core/modules/views/tests/src/Kernel/FieldApiDataTest.php b/core/modules/views/tests/src/Kernel/FieldApiDataTest.php
index b76ff0e35c8..c4c6baecd9d 100644
--- a/core/modules/views/tests/src/Kernel/FieldApiDataTest.php
+++ b/core/modules/views/tests/src/Kernel/FieldApiDataTest.php
@@ -51,7 +51,7 @@ class FieldApiDataTest extends ViewsKernelTestBase {
*
* We check data structure for both node and node revision tables.
*/
- public function testViewsData() {
+ public function testViewsData(): void {
$field_storage_string = FieldStorageConfig::create([
'field_name' => 'field_string',
'entity_type' => 'node',
@@ -211,7 +211,7 @@ class FieldApiDataTest extends ViewsKernelTestBase {
/**
* Tests filtering entries with different translatability.
*/
- public function testEntityFieldFilter() {
+ public function testEntityFieldFilter(): void {
NodeType::create([
'type' => 'bundle1',
'name' => 'Bundle One',
diff --git a/core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php b/core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php
index a44e2d5d632..61f7601511c 100644
--- a/core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php
@@ -129,7 +129,7 @@ class AreaDisplayLinkTest extends ViewsKernelTestBase {
/**
* Tests the views area display_link handler.
*/
- public function testAreaDisplayLink() {
+ public function testAreaDisplayLink(): void {
$view = Views::getView('test_view');
// Assert only path-based displays are available in the display link
diff --git a/core/modules/views/tests/src/Kernel/Handler/AreaEmptyTest.php b/core/modules/views/tests/src/Kernel/Handler/AreaEmptyTest.php
index 7e22ce2f7f6..2c4fcad07d1 100644
--- a/core/modules/views/tests/src/Kernel/Handler/AreaEmptyTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/AreaEmptyTest.php
@@ -54,7 +54,7 @@ class AreaEmptyTest extends ViewsKernelTestBase {
/**
* Tests that the header and footer areas are not rendered if empty.
*/
- public function testRenderEmptyHeaderFooter() {
+ public function testRenderEmptyHeaderFooter(): void {
$view = Views::getView('test_example_area');
$view->initHandlers();
diff --git a/core/modules/views/tests/src/Kernel/Handler/AreaEntityTest.php b/core/modules/views/tests/src/Kernel/Handler/AreaEntityTest.php
index e68ca013f48..b2a1ae370ce 100644
--- a/core/modules/views/tests/src/Kernel/Handler/AreaEntityTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/AreaEntityTest.php
@@ -62,7 +62,7 @@ class AreaEntityTest extends ViewsKernelTestBase {
/**
* Tests views data for entity area handlers.
*/
- public function testEntityAreaData() {
+ public function testEntityAreaData(): void {
$data = $this->container->get('views.views_data')->get('views');
$entity_types = $this->container->get('entity_type.manager')->getDefinitions();
@@ -90,7 +90,7 @@ class AreaEntityTest extends ViewsKernelTestBase {
/**
* Tests the area handler.
*/
- public function testEntityArea() {
+ public function testEntityArea(): void {
/** @var \Drupal\Core\Entity\EntityInterface[] $entities */
$entities = [];
for ($i = 0; $i < 3; $i++) {
diff --git a/core/modules/views/tests/src/Kernel/Handler/AreaMessagesTest.php b/core/modules/views/tests/src/Kernel/Handler/AreaMessagesTest.php
index 01efd4c71ad..52b891e3475 100644
--- a/core/modules/views/tests/src/Kernel/Handler/AreaMessagesTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/AreaMessagesTest.php
@@ -25,7 +25,7 @@ class AreaMessagesTest extends ViewsKernelTestBase {
/**
* Tests the messages area handler.
*/
- public function testMessageText() {
+ public function testMessageText(): void {
\Drupal::messenger()->addStatus('My drupal set message.');
$view = Views::getView('test_area_messages');
diff --git a/core/modules/views/tests/src/Kernel/Handler/AreaOrderTest.php b/core/modules/views/tests/src/Kernel/Handler/AreaOrderTest.php
index 18aed6c9a84..d8ddade8293 100644
--- a/core/modules/views/tests/src/Kernel/Handler/AreaOrderTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/AreaOrderTest.php
@@ -58,7 +58,7 @@ class AreaOrderTest extends ViewsKernelTestBase {
/**
* Tests the order of the handlers.
*/
- public function testAreaOrder() {
+ public function testAreaOrder(): void {
$view = Views::getView('test_area_order');
$renderable = $view->buildRenderable();
$output = $this->render($renderable);
diff --git a/core/modules/views/tests/src/Kernel/Handler/AreaResultTest.php b/core/modules/views/tests/src/Kernel/Handler/AreaResultTest.php
index 3ca261dce9b..738079da5eb 100644
--- a/core/modules/views/tests/src/Kernel/Handler/AreaResultTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/AreaResultTest.php
@@ -23,7 +23,7 @@ class AreaResultTest extends ViewsKernelTestBase {
/**
* Tests the results area handler.
*/
- public function testResult() {
+ public function testResult(): void {
$view = Views::getView('test_area_result');
$view->setDisplay('default');
$this->executeView($view);
@@ -39,7 +39,7 @@ class AreaResultTest extends ViewsKernelTestBase {
/**
* Tests the results area handler.
*/
- public function testResultEmpty() {
+ public function testResultEmpty(): void {
$view = Views::getView('test_area_result');
// Test that the area is displayed if we have checked the empty checkbox.
diff --git a/core/modules/views/tests/src/Kernel/Handler/AreaTest.php b/core/modules/views/tests/src/Kernel/Handler/AreaTest.php
index 0ffeaf5afb5..48e155af4ec 100644
--- a/core/modules/views/tests/src/Kernel/Handler/AreaTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/AreaTest.php
@@ -56,7 +56,7 @@ class AreaTest extends ViewsKernelTestBase {
/**
* Tests the rendering of an area.
*/
- public function testRenderArea() {
+ public function testRenderArea(): void {
$view = Views::getView('test_example_area');
$view->initHandlers();
@@ -87,7 +87,7 @@ class AreaTest extends ViewsKernelTestBase {
/**
* Tests the access for an area.
*/
- public function testAreaAccess() {
+ public function testAreaAccess(): void {
// Test with access denied for the area handler.
$view = Views::getView('test_example_area_access');
$view->initDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Handler/AreaTextTest.php b/core/modules/views/tests/src/Kernel/Handler/AreaTextTest.php
index f0e488025e7..371224e0b1d 100644
--- a/core/modules/views/tests/src/Kernel/Handler/AreaTextTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/AreaTextTest.php
@@ -34,7 +34,7 @@ class AreaTextTest extends ViewsKernelTestBase {
$this->installEntitySchema('user');
}
- public function testAreaText() {
+ public function testAreaText(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$view = Views::getView('test_view');
diff --git a/core/modules/views/tests/src/Kernel/Handler/AreaTitleTest.php b/core/modules/views/tests/src/Kernel/Handler/AreaTitleTest.php
index e50e38e31aa..00cb85c796d 100644
--- a/core/modules/views/tests/src/Kernel/Handler/AreaTitleTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/AreaTitleTest.php
@@ -25,7 +25,7 @@ class AreaTitleTest extends ViewsKernelTestBase {
/**
* Tests the title area handler.
*/
- public function testTitleText() {
+ public function testTitleText(): void {
$view = Views::getView('test_area_title');
$view->setDisplay('default');
diff --git a/core/modules/views/tests/src/Kernel/Handler/AreaViewTest.php b/core/modules/views/tests/src/Kernel/Handler/AreaViewTest.php
index acb0fce0ce3..162b88139bb 100644
--- a/core/modules/views/tests/src/Kernel/Handler/AreaViewTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/AreaViewTest.php
@@ -32,7 +32,7 @@ class AreaViewTest extends ViewsKernelTestBase {
/**
* Tests the view area handler.
*/
- public function testViewArea() {
+ public function testViewArea(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$view = Views::getView('test_area_view');
diff --git a/core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php b/core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php
index 1560dc73c6f..53b14c8b47b 100644
--- a/core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/ArgumentDateTest.php
@@ -58,7 +58,7 @@ class ArgumentDateTest extends ViewsKernelTestBase {
*
* @see \Drupal\node\Plugin\views\argument\CreatedFullDate
*/
- public function testCreatedFullDateHandler() {
+ public function testCreatedFullDateHandler(): void {
$view = Views::getView('test_argument_date');
$view->setDisplay('default');
$this->executeView($view, ['20000102']);
@@ -89,7 +89,7 @@ class ArgumentDateTest extends ViewsKernelTestBase {
*
* @see \Drupal\node\Plugin\views\argument\CreatedDay
*/
- public function testDayHandler() {
+ public function testDayHandler(): void {
$view = Views::getView('test_argument_date');
$view->setDisplay('embed_1');
$this->executeView($view, ['02']);
@@ -119,7 +119,7 @@ class ArgumentDateTest extends ViewsKernelTestBase {
*
* @see \Drupal\node\Plugin\views\argument\CreatedMonth
*/
- public function testMonthHandler() {
+ public function testMonthHandler(): void {
$view = Views::getView('test_argument_date');
$view->setDisplay('embed_2');
$this->executeView($view, ['01']);
@@ -143,7 +143,7 @@ class ArgumentDateTest extends ViewsKernelTestBase {
*
* @see \Drupal\node\Plugin\views\argument\CreatedWeek
*/
- public function testWeekHandler() {
+ public function testWeekHandler(): void {
$this->container->get('database')->update('views_test_data')
->fields(['created' => gmmktime(0, 0, 0, 9, 26, 2008)])
->condition('id', 1)
@@ -221,7 +221,7 @@ class ArgumentDateTest extends ViewsKernelTestBase {
*
* @see \Drupal\node\Plugin\views\argument\CreatedYear
*/
- public function testYearHandler() {
+ public function testYearHandler(): void {
$this->container->get('database')->update('views_test_data')
->fields(['created' => gmmktime(0, 0, 0, 1, 1, 2001)])
->condition('id', 3)
@@ -272,7 +272,7 @@ class ArgumentDateTest extends ViewsKernelTestBase {
*
* @see \Drupal\node\Plugin\views\argument\CreatedYearMonth
*/
- public function testYearMonthHandler() {
+ public function testYearMonthHandler(): void {
$this->container->get('database')->update('views_test_data')
->fields(['created' => gmmktime(0, 0, 0, 1, 1, 2001)])
->condition('id', 3)
diff --git a/core/modules/views/tests/src/Kernel/Handler/ArgumentNullTest.php b/core/modules/views/tests/src/Kernel/Handler/ArgumentNullTest.php
index 6c4f5ede512..1a3e462fd06 100644
--- a/core/modules/views/tests/src/Kernel/Handler/ArgumentNullTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/ArgumentNullTest.php
@@ -28,7 +28,7 @@ class ArgumentNullTest extends ViewsKernelTestBase {
return $data;
}
- public function testAreaText() {
+ public function testAreaText(): void {
// Test validation
$view = Views::getView('test_view');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Handler/ArgumentStringTest.php b/core/modules/views/tests/src/Kernel/Handler/ArgumentStringTest.php
index c044846327b..d652d0ee63b 100644
--- a/core/modules/views/tests/src/Kernel/Handler/ArgumentStringTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/ArgumentStringTest.php
@@ -31,7 +31,7 @@ class ArgumentStringTest extends ViewsKernelTestBase {
/**
* Tests the glossary feature.
*/
- public function testGlossary() {
+ public function testGlossary(): void {
$this->installEntitySchema('user');
$this->installEntitySchema('node');
NodeType::create([
diff --git a/core/modules/views/tests/src/Kernel/Handler/ComputedBundleFieldTest.php b/core/modules/views/tests/src/Kernel/Handler/ComputedBundleFieldTest.php
index 5d6e4715634..9a14bb37e18 100644
--- a/core/modules/views/tests/src/Kernel/Handler/ComputedBundleFieldTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/ComputedBundleFieldTest.php
@@ -76,7 +76,7 @@ class ComputedBundleFieldTest extends ViewsKernelTestBase {
/**
* Tests the computed field handler.
*/
- public function testComputedFieldHandler() {
+ public function testComputedFieldHandler(): void {
\Drupal::state()->set('entity_test_computed_field_item_list_value', ['computed string']);
\Drupal::state()->set('entity_test_comp_bund_fld_item_list_value', ['some other string that is also computed']);
diff --git a/core/modules/views/tests/src/Kernel/Handler/ComputedFieldTest.php b/core/modules/views/tests/src/Kernel/Handler/ComputedFieldTest.php
index 5fe915725f0..88da578f5e7 100644
--- a/core/modules/views/tests/src/Kernel/Handler/ComputedFieldTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/ComputedFieldTest.php
@@ -42,7 +42,7 @@ class ComputedFieldTest extends ViewsKernelTestBase {
/**
* Tests the computed field handler.
*/
- public function testComputedFieldHandler() {
+ public function testComputedFieldHandler(): void {
\Drupal::state()->set('entity_test_computed_field_item_list_value', ['computed string']);
$entity = EntityTestComputedField::create([]);
diff --git a/core/modules/views/tests/src/Kernel/Handler/EntityTestViewsFieldAccessTest.php b/core/modules/views/tests/src/Kernel/Handler/EntityTestViewsFieldAccessTest.php
index 51e6ece7c02..db630c9ac59 100644
--- a/core/modules/views/tests/src/Kernel/Handler/EntityTestViewsFieldAccessTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/EntityTestViewsFieldAccessTest.php
@@ -30,7 +30,7 @@ class EntityTestViewsFieldAccessTest extends FieldFieldAccessTestBase {
ConfigurableLanguage::create(['id' => 'es', 'title' => 'Spanish title', 'label' => 'Spanish label'])->save();
}
- public function testEntityTestFields() {
+ public function testEntityTestFields(): void {
$entity_test = EntityTest::create([
'name' => 'test entity name',
]);
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldBooleanTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldBooleanTest.php
index 43b2a10e25a..4f89977e541 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldBooleanTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldBooleanTest.php
@@ -35,7 +35,7 @@ class FieldBooleanTest extends ViewsKernelTestBase {
return $data;
}
- public function testFieldBoolean() {
+ public function testFieldBoolean(): void {
$view = Views::getView('test_view');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldCounterTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldCounterTest.php
index 0fc1defdcfb..5831a0f996e 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldCounterTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldCounterTest.php
@@ -28,7 +28,7 @@ class FieldCounterTest extends ViewsKernelTestBase {
*/
public static $testViews = ['test_view'];
- public function testSimple() {
+ public function testSimple(): void {
$view = Views::getView('test_view');
$view->setDisplay();
$view->displayHandlers->get('default')->overrideOption('fields', [
@@ -89,7 +89,7 @@ class FieldCounterTest extends ViewsKernelTestBase {
/**
* Tests the counter field when using a pager.
*/
- public function testPager() {
+ public function testPager(): void {
$view = Views::getView('test_view');
$view->setDisplay();
$view->displayHandlers->get('default')->overrideOption('fields', [
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldCustomTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldCustomTest.php
index 72ffdd35d11..502aa87f59a 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldCustomTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldCustomTest.php
@@ -34,7 +34,7 @@ class FieldCustomTest extends ViewsKernelTestBase {
/**
* Ensure that custom fields work and doesn't escape unnecessary markup.
*/
- public function testFieldCustom() {
+ public function testFieldCustom(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -60,7 +60,7 @@ class FieldCustomTest extends ViewsKernelTestBase {
/**
* Ensure that custom fields can use tokens.
*/
- public function testFieldCustomTokens() {
+ public function testFieldCustomTokens(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -94,7 +94,7 @@ class FieldCustomTest extends ViewsKernelTestBase {
/**
* Ensure that custom field content is XSS filtered.
*/
- public function testCustomFieldXss() {
+ public function testCustomFieldXss(): void {
$view = Views::getView('test_view');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php
index 9e6131963be..069d3ddf582 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php
@@ -69,7 +69,7 @@ class FieldDateTest extends ViewsKernelTestBase {
/**
* Sets up functional test of the views date field.
*/
- public function testFieldDate() {
+ public function testFieldDate(): void {
$view = Views::getView('test_view');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldDropbuttonTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldDropbuttonTest.php
index 6d8b6688afd..74a4df42c08 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldDropbuttonTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldDropbuttonTest.php
@@ -126,7 +126,7 @@ class FieldDropbuttonTest extends ViewsKernelTestBase {
/**
* Tests that dropbutton markup doesn't leak between rows.
*/
- public function testDropbuttonMarkupShouldNotLeakBetweenRows() {
+ public function testDropbuttonMarkupShouldNotLeakBetweenRows(): void {
$view = Views::getView('test_dropbutton');
$view->setDisplay();
$view->preExecute([]);
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldEntityLinkTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldEntityLinkTest.php
index 95382a54054..b05db299fd7 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldEntityLinkTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldEntityLinkTest.php
@@ -69,7 +69,7 @@ class FieldEntityLinkTest extends ViewsKernelTestBase {
/**
* Tests entity link fields.
*/
- public function testEntityLink() {
+ public function testEntityLink(): void {
// Anonymous users cannot see edit/delete links.
$expected_results = ['canonical' => TRUE, 'edit-form' => FALSE, 'delete-form' => FALSE, 'canonical_raw' => TRUE, 'canonical_raw_absolute' => TRUE];
$this->doTestEntityLink(\Drupal::currentUser(), $expected_results);
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php
index a1da447023b..e57953228cd 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php
@@ -236,7 +236,7 @@ class FieldFieldTest extends ViewsKernelTestBase {
/**
* Tests the result of a view with base fields and configurable fields.
*/
- public function testSimpleExecute() {
+ public function testSimpleExecute(): void {
$executable = Views::getView('test_field_field_test');
$executable->execute();
@@ -258,7 +258,7 @@ class FieldFieldTest extends ViewsKernelTestBase {
/**
* Tests the output of a view with base fields and configurable fields.
*/
- public function testSimpleRender() {
+ public function testSimpleRender(): void {
$executable = Views::getView('test_field_field_test');
$executable->execute();
@@ -281,7 +281,7 @@ class FieldFieldTest extends ViewsKernelTestBase {
*
* @see \Drupal\views_test_formatter\Plugin\Field\FieldFormatter\AttachmentTestFormatter::viewElements()
*/
- public function testAttachedRender() {
+ public function testAttachedRender(): void {
$executable = Views::getView('test_field_field_attachment_test');
$executable->execute();
@@ -306,7 +306,7 @@ class FieldFieldTest extends ViewsKernelTestBase {
* A complex field configuration contains multiple times the same field, with
* different delta limit / offset.
*/
- public function testFieldAlias() {
+ public function testFieldAlias(): void {
$executable = Views::getView('test_field_alias_test');
$executable->execute();
@@ -332,7 +332,7 @@ class FieldFieldTest extends ViewsKernelTestBase {
* A complex field configuration contains multiple times the same field, with
* different delta limit / offset.
*/
- public function testFieldAliasRender() {
+ public function testFieldAliasRender(): void {
$executable = Views::getView('test_field_alias_test');
$executable->execute();
@@ -347,7 +347,7 @@ class FieldFieldTest extends ViewsKernelTestBase {
/**
* Tests the result of a view field with field_api_classes enabled.
*/
- public function testFieldApiClassesRender() {
+ public function testFieldApiClassesRender(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$executable = Views::getView('test_field_field_test');
@@ -371,7 +371,7 @@ class FieldFieldTest extends ViewsKernelTestBase {
* A complex field configuration contains multiple times the same field, with
* different delta limit / offset.
*/
- public function testComplexExecute() {
+ public function testComplexExecute(): void {
$executable = Views::getView('test_field_field_complex_test');
$executable->execute();
@@ -400,7 +400,7 @@ class FieldFieldTest extends ViewsKernelTestBase {
/**
* Tests the output of a view with complex field configuration.
*/
- public function testComplexRender() {
+ public function testComplexRender(): void {
$executable = Views::getView('test_field_field_complex_test');
$executable->execute();
$date_formatter = \Drupal::service('date.formatter');
@@ -449,7 +449,7 @@ class FieldFieldTest extends ViewsKernelTestBase {
/**
* Tests the revision result.
*/
- public function testRevisionExecute() {
+ public function testRevisionExecute(): void {
$executable = Views::getView('test_field_field_revision_test');
$executable->execute();
@@ -470,7 +470,7 @@ class FieldFieldTest extends ViewsKernelTestBase {
/**
* Tests the output of a revision view with base and configurable fields.
*/
- public function testRevisionRender() {
+ public function testRevisionRender(): void {
$executable = Views::getView('test_field_field_revision_test');
$executable->execute();
@@ -498,7 +498,7 @@ class FieldFieldTest extends ViewsKernelTestBase {
/**
* Tests the token replacement for revision fields.
*/
- public function testRevisionTokenRender() {
+ public function testRevisionTokenRender(): void {
$view = Views::getView('test_field_field_revision_test');
$this->executeView($view);
@@ -511,7 +511,7 @@ class FieldFieldTest extends ViewsKernelTestBase {
/**
* Tests the result set of a complex revision view.
*/
- public function testRevisionComplexExecute() {
+ public function testRevisionComplexExecute(): void {
$executable = Views::getView('test_field_field_revision_complex_test');
$executable->execute();
@@ -541,7 +541,7 @@ class FieldFieldTest extends ViewsKernelTestBase {
/**
* Tests the output of a revision view with base fields and configurable fields.
*/
- public function testRevisionComplexRender() {
+ public function testRevisionComplexRender(): void {
$executable = Views::getView('test_field_field_revision_complex_test');
$executable->execute();
@@ -577,7 +577,7 @@ class FieldFieldTest extends ViewsKernelTestBase {
/**
* Tests that a field not available for every bundle is rendered as empty.
*/
- public function testMissingBundleFieldRender() {
+ public function testMissingBundleFieldRender(): void {
// Create a new bundle not having the test field attached.
$bundle = $this->randomMachineName();
entity_test_create_bundle($bundle);
@@ -598,7 +598,7 @@ class FieldFieldTest extends ViewsKernelTestBase {
/**
* Tests \Drupal\views\Plugin\views\field\EntityField::getValue.
*/
- public function testGetValueMethod() {
+ public function testGetValueMethod(): void {
$bundle = 'test_bundle';
entity_test_create_bundle($bundle);
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldFileSizeTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldFileSizeTest.php
index 5b67f332def..f29de027ba4 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldFileSizeTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldFileSizeTest.php
@@ -39,7 +39,7 @@ class FieldFileSizeTest extends ViewsKernelTestBase {
return $data;
}
- public function testFieldFileSize() {
+ public function testFieldFileSize(): void {
$view = Views::getView('test_view');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldGroupRowsTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldGroupRowsTest.php
index 9c9f4727631..373e0045fa0 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldGroupRowsTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldGroupRowsTest.php
@@ -41,7 +41,7 @@ class FieldGroupRowsTest extends ViewsKernelTestBase {
/**
* Testing the "Grouped rows" functionality.
*/
- public function testGroupRows() {
+ public function testGroupRows(): void {
$this->installConfig(['filter']);
$this->installEntitySchema('node');
$this->installEntitySchema('user');
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldKernelTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldKernelTest.php
index f9f1440fa6a..90cba869269 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldKernelTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldKernelTest.php
@@ -50,7 +50,7 @@ class FieldKernelTest extends ViewsKernelTestBase {
/**
* Tests that the render function is called.
*/
- public function testRender() {
+ public function testRender(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
@@ -68,7 +68,7 @@ class FieldKernelTest extends ViewsKernelTestBase {
/**
* Tests all things related to the query.
*/
- public function testQuery() {
+ public function testQuery(): void {
// Tests adding additional fields to the query.
$view = Views::getView('test_view');
$view->initHandlers();
@@ -133,7 +133,7 @@ class FieldKernelTest extends ViewsKernelTestBase {
/**
* Tests general rewriting of the output.
*/
- public function testRewrite() {
+ public function testRewrite(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
@@ -160,7 +160,7 @@ class FieldKernelTest extends ViewsKernelTestBase {
/**
* Tests rewriting of the output with HTML.
*/
- public function testRewriteHtmlWithTokens() {
+ public function testRewriteHtmlWithTokens(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
@@ -189,7 +189,7 @@ class FieldKernelTest extends ViewsKernelTestBase {
/**
* Tests rewriting of the output with HTML and aggregation.
*/
- public function testRewriteHtmlWithTokensAndAggregation() {
+ public function testRewriteHtmlWithTokensAndAggregation(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
@@ -221,7 +221,7 @@ class FieldKernelTest extends ViewsKernelTestBase {
/**
* Tests the arguments tokens on field level.
*/
- public function testArgumentTokens() {
+ public function testArgumentTokens(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
@@ -259,7 +259,7 @@ class FieldKernelTest extends ViewsKernelTestBase {
/**
* Tests the field tokens, row level and field level.
*/
- public function testFieldTokens() {
+ public function testFieldTokens(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
@@ -358,7 +358,7 @@ class FieldKernelTest extends ViewsKernelTestBase {
/**
* Tests the exclude setting.
*/
- public function testExclude() {
+ public function testExclude(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$view = Views::getView('test_field_output');
@@ -385,7 +385,7 @@ class FieldKernelTest extends ViewsKernelTestBase {
/**
* Tests everything related to empty output of a field.
*/
- public function testEmpty() {
+ public function testEmpty(): void {
$this->_testHideIfEmpty();
$this->_testEmptyText();
}
@@ -727,7 +727,7 @@ class FieldKernelTest extends ViewsKernelTestBase {
/**
* Tests views_handler_field::isValueEmpty().
*/
- public function testIsValueEmpty() {
+ public function testIsValueEmpty(): void {
$view = Views::getView('test_view');
$view->initHandlers();
$field = $view->field['name'];
@@ -749,7 +749,7 @@ class FieldKernelTest extends ViewsKernelTestBase {
/**
* Tests whether the filters are click sortable as expected.
*/
- public function testClickSortable() {
+ public function testClickSortable(): void {
// Test that clickSortable is TRUE by default.
$item = [
'table' => 'views_test_data',
@@ -772,7 +772,7 @@ class FieldKernelTest extends ViewsKernelTestBase {
/**
* Tests the trimText method.
*/
- public function testTrimText() {
+ public function testTrimText(): void {
// Test unicode. See https://www.drupal.org/node/513396#comment-2839416.
// cSpell:disable
$text = [
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldNumericTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldNumericTest.php
index c40b03b48e9..0983f7ff71e 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldNumericTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldNumericTest.php
@@ -27,7 +27,7 @@ class FieldNumericTest extends ViewsKernelTestBase {
*
* @dataProvider providerTestFieldNumeric
*/
- public function testFieldNumeric($field_settings, $values, $expected_values) {
+ public function testFieldNumeric($field_settings, $values, $expected_values): void {
$view = Views::getView('test_view');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldRenderedEntityTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldRenderedEntityTest.php
index aa90965b49a..c8cf36701d8 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldRenderedEntityTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldRenderedEntityTest.php
@@ -113,7 +113,7 @@ class FieldRenderedEntityTest extends ViewsKernelTestBase {
/**
* Tests the default rendered entity output.
*/
- public function testRenderedEntityWithoutAndWithField() {
+ public function testRenderedEntityWithoutAndWithField(): void {
// First test without test_field displayed.
\Drupal::currentUser()->setAccount($this->user);
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldSelfTokensTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldSelfTokensTest.php
index 13704cb3145..9c99bb0498a 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldSelfTokensTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldSelfTokensTest.php
@@ -49,7 +49,7 @@ class FieldSelfTokensTest extends ViewsKernelTestBase {
/**
* {@inheritdoc}
*/
- public function testSelfTokenEscaping() {
+ public function testSelfTokenEscaping(): void {
$view = Views::getView('test_field_self_tokens');
$view->initHandlers();
$this->executeView($view);
diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldUrlTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldUrlTest.php
index 3d19768dcd3..ee5255d2fe6 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FieldUrlTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FieldUrlTest.php
@@ -31,7 +31,7 @@ class FieldUrlTest extends ViewsKernelTestBase {
return $data;
}
- public function testFieldUrl() {
+ public function testFieldUrl(): void {
$view = Views::getView('test_view');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorDefaultTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorDefaultTest.php
index 21371f2064c..e756d94b875 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorDefaultTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorDefaultTest.php
@@ -39,7 +39,7 @@ class FilterBooleanOperatorDefaultTest extends ViewsKernelTestBase {
/**
* Tests the queryOpBoolean() with default operator.
*/
- public function testFilterBooleanOperatorDefault() {
+ public function testFilterBooleanOperatorDefault(): void {
$view = Views::getView('test_view');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorStringTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorStringTest.php
index 3ad342c6f6e..a7096a9a4bb 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorStringTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorStringTest.php
@@ -87,7 +87,7 @@ class FilterBooleanOperatorStringTest extends ViewsKernelTestBase {
/**
* Tests the BooleanOperatorString filter.
*/
- public function testFilterBooleanOperatorString() {
+ public function testFilterBooleanOperatorString(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -137,7 +137,7 @@ class FilterBooleanOperatorStringTest extends ViewsKernelTestBase {
/**
* Tests the Boolean filter with grouped exposed form enabled.
*/
- public function testFilterGroupedExposed() {
+ public function testFilterGroupedExposed(): void {
$filters = $this->getGroupedExposedFilters();
$view = Views::getView('test_view');
diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorTest.php
index 803304f567a..208b0270c16 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorTest.php
@@ -41,7 +41,7 @@ class FilterBooleanOperatorTest extends ViewsKernelTestBase {
/**
* Tests the BooleanOperator filter.
*/
- public function testFilterBooleanOperator() {
+ public function testFilterBooleanOperator(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -115,7 +115,7 @@ class FilterBooleanOperatorTest extends ViewsKernelTestBase {
/**
* Tests the boolean filter with grouped exposed form enabled.
*/
- public function testFilterGroupedExposed() {
+ public function testFilterGroupedExposed(): void {
$filters = $this->getGroupedExposedFilters();
$view = Views::getView('test_view');
diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php
index ba920f9743c..43754847722 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php
@@ -48,7 +48,7 @@ class FilterCombineTest extends ViewsKernelTestBase {
$this->installEntitySchema('entity_test');
}
- public function testFilterCombineContains() {
+ public function testFilterCombineContains(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -103,7 +103,7 @@ class FilterCombineTest extends ViewsKernelTestBase {
/**
* Tests the Combine field filter with the 'regular_expression' operator.
*/
- public function testFilterCombineRegEx() {
+ public function testFilterCombineRegEx(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -162,7 +162,7 @@ class FilterCombineTest extends ViewsKernelTestBase {
/**
* Tests the Combine field filter with the 'word' operator.
*/
- public function testFilterCombineWord() {
+ public function testFilterCombineWord(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -213,7 +213,7 @@ class FilterCombineTest extends ViewsKernelTestBase {
/**
* Tests the Combine field filter with the 'allwords' operator.
*/
- public function testFilterCombineAllWords() {
+ public function testFilterCombineAllWords(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -265,7 +265,7 @@ class FilterCombineTest extends ViewsKernelTestBase {
* and fields set in the combine filter are removed from the display
* but not from the combined filter settings.
*/
- public function testFilterCombineContainsFieldsOverwritten() {
+ public function testFilterCombineContainsFieldsOverwritten(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -309,7 +309,7 @@ class FilterCombineTest extends ViewsKernelTestBase {
/**
* Tests that the "combine" filter is only valid on displays that use fields.
*/
- public function testNonFieldsRow() {
+ public function testNonFieldsRow(): void {
$view = Views::getView('entity_test_fields');
$view->setDisplay();
@@ -349,7 +349,7 @@ class FilterCombineTest extends ViewsKernelTestBase {
*
* @covers ::opEqual
*/
- public function testFilterCombineEqual() {
+ public function testFilterCombineEqual(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -449,7 +449,7 @@ class FilterCombineTest extends ViewsKernelTestBase {
/**
* Tests the Combine field filter using the 'starts' operator.
*/
- public function testFilterCombineStarts() {
+ public function testFilterCombineStarts(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -495,7 +495,7 @@ class FilterCombineTest extends ViewsKernelTestBase {
/**
* Tests the Combine field filter using the 'not_starts' operator.
*/
- public function testFilterCombineNotStarts() {
+ public function testFilterCombineNotStarts(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -545,7 +545,7 @@ class FilterCombineTest extends ViewsKernelTestBase {
/**
* Tests the Combine field filter using the 'ends' operator.
*/
- public function testFilterCombineEnds() {
+ public function testFilterCombineEnds(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -591,7 +591,7 @@ class FilterCombineTest extends ViewsKernelTestBase {
/**
* Tests the Combine field filter using the 'not_ends' operator.
*/
- public function testFilterCombineNotEnds() {
+ public function testFilterCombineNotEnds(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -641,7 +641,7 @@ class FilterCombineTest extends ViewsKernelTestBase {
/**
* Tests the Combine field filter using the 'not' operator.
*/
- public function testFilterCombineNot() {
+ public function testFilterCombineNot(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -691,7 +691,7 @@ class FilterCombineTest extends ViewsKernelTestBase {
/**
* Tests the combine filter when no realName is used.
*/
- public function testFilterCombineNoRealName() {
+ public function testFilterCombineNoRealName(): void {
$view = Views::getView('test_view');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterEqualityTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterEqualityTest.php
index 6cca16118ec..0f054f6f2ad 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FilterEqualityTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FilterEqualityTest.php
@@ -38,7 +38,7 @@ class FilterEqualityTest extends ViewsKernelTestBase {
return $data;
}
- public function testEqual() {
+ public function testEqual(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -63,7 +63,7 @@ class FilterEqualityTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testEqualGroupedExposed() {
+ public function testEqualGroupedExposed(): void {
$filters = $this->getGroupedExposedFilters();
$view = Views::getView('test_view');
$view->newDisplay('page', 'Page', 'page_1');
@@ -83,7 +83,7 @@ class FilterEqualityTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testNotEqual() {
+ public function testNotEqual(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -117,7 +117,7 @@ class FilterEqualityTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testEqualGroupedNotExposed() {
+ public function testEqualGroupedNotExposed(): void {
$filters = $this->getGroupedExposedFilters();
$view = Views::getView('test_view');
$view->newDisplay('page', 'Page', 'page_1');
diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php
index 04008683317..8b71ceb34ae 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php
@@ -44,7 +44,7 @@ class FilterInOperatorTest extends ViewsKernelTestBase {
return $data;
}
- public function testFilterInOperatorSimple() {
+ public function testFilterInOperatorSimple(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -110,7 +110,7 @@ class FilterInOperatorTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $expected_result, $this->columnMap);
}
- public function testFilterInOperatorGroupedExposedSimple() {
+ public function testFilterInOperatorGroupedExposedSimple(): void {
$filters = $this->getGroupedExposedFilters();
$view = Views::getView('test_view');
@@ -136,7 +136,7 @@ class FilterInOperatorTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $expected_result, $this->columnMap);
}
- public function testFilterNotInOperatorGroupedExposedSimple() {
+ public function testFilterNotInOperatorGroupedExposedSimple(): void {
$filters = $this->getGroupedExposedFilters();
$view = Views::getView('test_view');
@@ -169,7 +169,7 @@ class FilterInOperatorTest extends ViewsKernelTestBase {
/**
* Tests that we can safely change the identifier on a grouped filter.
*/
- public function testFilterGroupedChangedIdentifier() {
+ public function testFilterGroupedChangedIdentifier(): void {
$filters = $this->getGroupedExposedFilters();
$view = Views::getView('test_view');
@@ -238,7 +238,7 @@ class FilterInOperatorTest extends ViewsKernelTestBase {
/**
* Tests that the InOperator filter can handle TranslatableMarkup.
*/
- public function testFilterOptionAsMarkup() {
+ public function testFilterOptionAsMarkup(): void {
$view = $this->prophesize(ViewExecutable::class);
$display = $this->prophesize(DisplayPluginBase::class);
$display->getOption('relationships')->willReturn(FALSE);
diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php
index a58234fdf34..fe54c210401 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php
@@ -42,7 +42,7 @@ class FilterNumericTest extends ViewsKernelTestBase {
return $data;
}
- public function testFilterNumericSimple() {
+ public function testFilterNumericSimple(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -68,7 +68,7 @@ class FilterNumericTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterNumericExposedGroupedSimple() {
+ public function testFilterNumericExposedGroupedSimple(): void {
$filters = $this->getGroupedExposedFilters();
$view = Views::getView('test_view');
$view->newDisplay('page', 'Page', 'page_1');
@@ -103,7 +103,7 @@ class FilterNumericTest extends ViewsKernelTestBase {
*
* @dataProvider providerTestFilterNumericBetween
*/
- public function testFilterNumericBetween($operator, $min, $max, array $expected_result) {
+ public function testFilterNumericBetween($operator, $min, $max, array $expected_result): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -192,7 +192,7 @@ class FilterNumericTest extends ViewsKernelTestBase {
];
}
- public function testFilterNumericExposedGroupedBetween() {
+ public function testFilterNumericExposedGroupedBetween(): void {
$filters = $this->getGroupedExposedFilters();
$view = Views::getView('test_view');
$view->newDisplay('page', 'Page', 'page_1');
@@ -221,7 +221,7 @@ class FilterNumericTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterNumericExposedGroupedNotBetween() {
+ public function testFilterNumericExposedGroupedNotBetween(): void {
$filters = $this->getGroupedExposedFilters();
$view = Views::getView('test_view');
$view->newDisplay('page', 'Page', 'page_1');
@@ -249,7 +249,7 @@ class FilterNumericTest extends ViewsKernelTestBase {
/**
* Tests the numeric filter handler with the 'regular_expression' operator.
*/
- public function testFilterNumericRegularExpression() {
+ public function testFilterNumericRegularExpression(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -280,7 +280,7 @@ class FilterNumericTest extends ViewsKernelTestBase {
/**
* Tests the numeric filter with negated 'regular_expression' operator.
*/
- public function testFilterNumericNotRegularExpression() {
+ public function testFilterNumericNotRegularExpression(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -325,7 +325,7 @@ class FilterNumericTest extends ViewsKernelTestBase {
*
* The tests are performed with the 'regular_expression' operator.
*/
- public function testFilterNumericExposedGroupedRegularExpression() {
+ public function testFilterNumericExposedGroupedRegularExpression(): void {
$filters = $this->getGroupedExposedFilters();
$view = Views::getView('test_view');
$view->newDisplay('page', 'Page', 'page_1');
@@ -356,7 +356,7 @@ class FilterNumericTest extends ViewsKernelTestBase {
* Tests the numeric filter handler with the 'not_regular_expression' operator
* to grouped exposed filters.
*/
- public function testFilterNumericExposedGroupedNotRegularExpression() {
+ public function testFilterNumericExposedGroupedNotRegularExpression(): void {
$filters = $this->getGroupedExposedFilters();
$view = Views::getView('test_view');
$view->newDisplay('page', 'Page', 'page_1');
@@ -385,7 +385,7 @@ class FilterNumericTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterNumericEmpty() {
+ public function testFilterNumericEmpty(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -444,7 +444,7 @@ class FilterNumericTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterNumericExposedGroupedEmpty() {
+ public function testFilterNumericExposedGroupedEmpty(): void {
$filters = $this->getGroupedExposedFilters();
$view = Views::getView('test_view');
$view->newDisplay('page', 'Page', 'page_1');
@@ -460,7 +460,7 @@ class FilterNumericTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterNumericExposedGroupedNotEmpty() {
+ public function testFilterNumericExposedGroupedNotEmpty(): void {
$filters = $this->getGroupedExposedFilters();
$view = Views::getView('test_view');
$view->newDisplay('page', 'Page', 'page_1');
@@ -497,7 +497,7 @@ class FilterNumericTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testAllowEmpty() {
+ public function testAllowEmpty(): void {
$view = Views::getView('test_view');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php
index 1e90b6c30cd..3472046018c 100644
--- a/core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php
@@ -87,7 +87,7 @@ class FilterStringTest extends ViewsKernelTestBase {
return $view;
}
- public function testFilterStringEqual() {
+ public function testFilterStringEqual(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -112,7 +112,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringGroupedExposedEqual() {
+ public function testFilterStringGroupedExposedEqual(): void {
$filters = $this->getGroupedExposedFilters();
$view = $this->getBasicPageView();
@@ -133,7 +133,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringNotEqual() {
+ public function testFilterStringNotEqual(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -167,7 +167,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringGroupedExposedNotEqual() {
+ public function testFilterStringGroupedExposedNotEqual(): void {
$filters = $this->getGroupedExposedFilters();
$view = $this->getBasicPageView();
@@ -198,7 +198,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringContains() {
+ public function testFilterStringContains(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -223,7 +223,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringGroupedExposedContains() {
+ public function testFilterStringGroupedExposedContains(): void {
$filters = $this->getGroupedExposedFilters();
$view = $this->getBasicPageView();
@@ -244,7 +244,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringWord() {
+ public function testFilterStringWord(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -332,7 +332,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset);
}
- public function testFilterStringGroupedExposedWord() {
+ public function testFilterStringGroupedExposedWord(): void {
$filters = $this->getGroupedExposedFilters();
$view = $this->getBasicPageView();
@@ -373,7 +373,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringStarts() {
+ public function testFilterStringStarts(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -398,7 +398,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringGroupedExposedStarts() {
+ public function testFilterStringGroupedExposedStarts(): void {
$filters = $this->getGroupedExposedFilters();
$view = $this->getBasicPageView();
@@ -421,7 +421,7 @@ class FilterStringTest extends ViewsKernelTestBase {
/**
* Tests the string filter with negated 'regular_expression' operator.
*/
- public function testFilterStringGroupedNotRegularExpression() {
+ public function testFilterStringGroupedNotRegularExpression(): void {
$filters = $this->getGroupedExposedFilters();
$view = $this->getBasicPageView();
@@ -451,7 +451,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringNotStarts() {
+ public function testFilterStringNotStarts(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -483,7 +483,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringGroupedExposedNotStarts() {
+ public function testFilterStringGroupedExposedNotStarts(): void {
$filters = $this->getGroupedExposedFilters();
$view = $this->getBasicPageView();
@@ -510,7 +510,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringEnds() {
+ public function testFilterStringEnds(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -538,7 +538,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringGroupedExposedEnds() {
+ public function testFilterStringGroupedExposedEnds(): void {
$filters = $this->getGroupedExposedFilters();
$view = $this->getBasicPageView();
@@ -561,7 +561,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringNotEnds() {
+ public function testFilterStringNotEnds(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -590,7 +590,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringGroupedExposedNotEnds() {
+ public function testFilterStringGroupedExposedNotEnds(): void {
$filters = $this->getGroupedExposedFilters();
$view = $this->getBasicPageView();
@@ -614,7 +614,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringNot() {
+ public function testFilterStringNot(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -643,7 +643,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringGroupedExposedNot() {
+ public function testFilterStringGroupedExposedNot(): void {
$filters = $this->getGroupedExposedFilters();
$view = $this->getBasicPageView();
@@ -668,7 +668,7 @@ class FilterStringTest extends ViewsKernelTestBase {
}
- public function testFilterStringShorter() {
+ public function testFilterStringShorter(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -696,7 +696,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringGroupedExposedShorter() {
+ public function testFilterStringGroupedExposedShorter(): void {
$filters = $this->getGroupedExposedFilters();
$view = $this->getBasicPageView();
@@ -718,7 +718,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringLonger() {
+ public function testFilterStringLonger(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -743,7 +743,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringGroupedExposedLonger() {
+ public function testFilterStringGroupedExposedLonger(): void {
$filters = $this->getGroupedExposedFilters();
$view = $this->getBasicPageView();
@@ -762,7 +762,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringEmpty() {
+ public function testFilterStringEmpty(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -786,7 +786,7 @@ class FilterStringTest extends ViewsKernelTestBase {
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}
- public function testFilterStringGroupedExposedEmpty() {
+ public function testFilterStringGroupedExposedEmpty(): void {
$filters = $this->getGroupedExposedFilters();
$view = $this->getBasicPageView();
@@ -808,7 +808,7 @@ class FilterStringTest extends ViewsKernelTestBase {
/**
* Tests the string filter handler with the negated 'regular_expression' operator.
*/
- public function testFilterStringNotRegularExpression() {
+ public function testFilterStringNotRegularExpression(): void {
$view = Views::getView('test_view');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Handler/HandlerAliasTest.php b/core/modules/views/tests/src/Kernel/Handler/HandlerAliasTest.php
index 87f3d25972d..bf594bba9c4 100644
--- a/core/modules/views/tests/src/Kernel/Handler/HandlerAliasTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/HandlerAliasTest.php
@@ -45,7 +45,7 @@ class HandlerAliasTest extends ViewsKernelTestBase {
return $data;
}
- public function testPluginAliases() {
+ public function testPluginAliases(): void {
$view = Views::getView('test_filter');
$view->initDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Handler/SortDateTest.php b/core/modules/views/tests/src/Kernel/Handler/SortDateTest.php
index 4d16522d62f..dfd60cd724e 100644
--- a/core/modules/views/tests/src/Kernel/Handler/SortDateTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/SortDateTest.php
@@ -157,7 +157,7 @@ class SortDateTest extends ViewsKernelTestBase {
/**
* Tests numeric ordering of the result set.
*/
- public function testDateOrdering() {
+ public function testDateOrdering(): void {
foreach (['second', 'minute', 'hour', 'day', 'month', 'year'] as $granularity) {
foreach ([FALSE, TRUE] as $reverse) {
$view = Views::getView('test_view');
diff --git a/core/modules/views/tests/src/Kernel/Handler/SortRandomTest.php b/core/modules/views/tests/src/Kernel/Handler/SortRandomTest.php
index d30522781f5..11456d921bf 100644
--- a/core/modules/views/tests/src/Kernel/Handler/SortRandomTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/SortRandomTest.php
@@ -71,7 +71,7 @@ class SortRandomTest extends ViewsKernelTestBase {
*
* @see DatabaseSelectTestCase::testRandomOrder()
*/
- public function testRandomOrdering() {
+ public function testRandomOrdering(): void {
// Execute a basic view first.
$view = Views::getView('test_view');
$this->executeView($view);
@@ -108,7 +108,7 @@ class SortRandomTest extends ViewsKernelTestBase {
* The random sorting should opt out of caching by defining a max age of 0.
* At the same time, the row render caching still works.
*/
- public function testRandomOrderingWithRenderCaching() {
+ public function testRandomOrderingWithRenderCaching(): void {
$view_random = $this->getBasicRandomView();
$display = &$view_random->storage->getDisplay('default');
diff --git a/core/modules/views/tests/src/Kernel/Handler/SortTest.php b/core/modules/views/tests/src/Kernel/Handler/SortTest.php
index baa2489834d..a27e46ebac5 100644
--- a/core/modules/views/tests/src/Kernel/Handler/SortTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/SortTest.php
@@ -24,7 +24,7 @@ class SortTest extends ViewsKernelTestBase {
/**
* Tests numeric ordering of the result set.
*/
- public function testNumericOrdering() {
+ public function testNumericOrdering(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -77,7 +77,7 @@ class SortTest extends ViewsKernelTestBase {
/**
* Tests string ordering of the result set.
*/
- public function testStringOrdering() {
+ public function testStringOrdering(): void {
$view = Views::getView('test_view');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Handler/SortTranslationTest.php b/core/modules/views/tests/src/Kernel/Handler/SortTranslationTest.php
index ee6f2cd0ed8..a7559a0a66b 100644
--- a/core/modules/views/tests/src/Kernel/Handler/SortTranslationTest.php
+++ b/core/modules/views/tests/src/Kernel/Handler/SortTranslationTest.php
@@ -99,7 +99,7 @@ class SortTranslationTest extends ViewsKernelTestBase {
/**
* Tests sorting on an untranslated field.
*/
- public function testSortbyUntranslatedIntegerField() {
+ public function testSortbyUntranslatedIntegerField(): void {
$map = [
'nid' => 'nid',
'node_field_data_langcode' => 'langcode',
diff --git a/core/modules/views/tests/src/Kernel/ModuleTest.php b/core/modules/views/tests/src/Kernel/ModuleTest.php
index 9fad6c3c515..67aa927f2bf 100644
--- a/core/modules/views/tests/src/Kernel/ModuleTest.php
+++ b/core/modules/views/tests/src/Kernel/ModuleTest.php
@@ -48,7 +48,7 @@ class ModuleTest extends ViewsKernelTestBase {
*
* @see \Drupal\views\Plugin\ViewsHandlerManager::getHandler()
*/
- public function testViewsGetHandler() {
+ public function testViewsGetHandler(): void {
$types = [
'field' => BrokenField::class,
'area' => BrokenArea::class,
@@ -116,7 +116,7 @@ class ModuleTest extends ViewsKernelTestBase {
/**
* Tests the load wrapper/helper functions.
*/
- public function testLoadFunctions() {
+ public function testLoadFunctions(): void {
$this->enableModules(['text', 'node']);
$this->installEntitySchema('node');
$this->installConfig(['node']);
@@ -187,7 +187,7 @@ class ModuleTest extends ViewsKernelTestBase {
/**
* Tests view enable and disable procedural wrapper functions.
*/
- public function testStatusFunctions() {
+ public function testStatusFunctions(): void {
$view = Views::getView('test_view_status')->storage;
$this->assertFalse($view->status(), 'The view status is disabled.');
@@ -204,7 +204,7 @@ class ModuleTest extends ViewsKernelTestBase {
/**
* Tests the \Drupal\views\Views::fetchPluginNames() method.
*/
- public function testViewsFetchPluginNames() {
+ public function testViewsFetchPluginNames(): void {
// All style plugins should be returned, as we have not specified a type.
$plugins = Views::fetchPluginNames('style');
$definitions = $this->container->get('plugin.manager.views.style')->getDefinitions();
@@ -228,7 +228,7 @@ class ModuleTest extends ViewsKernelTestBase {
/**
* Tests the \Drupal\views\Views::pluginList() method.
*/
- public function testViewsPluginList() {
+ public function testViewsPluginList(): void {
$plugin_list = Views::pluginList();
// Only plugins used by 'test_view' should be in the plugin list.
foreach (['display:default', 'pager:none'] as $key) {
@@ -248,7 +248,7 @@ class ModuleTest extends ViewsKernelTestBase {
/**
* Tests views.module: views_embed_view().
*/
- public function testViewsEmbedView() {
+ public function testViewsEmbedView(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
@@ -276,7 +276,7 @@ class ModuleTest extends ViewsKernelTestBase {
/**
* Tests the \Drupal\views\ViewsExecutable::preview() method.
*/
- public function testViewsPreview() {
+ public function testViewsPreview(): void {
$view = Views::getView('test_argument');
$result = $view->preview('default');
$this->assertCount(5, $result['#view']->result);
diff --git a/core/modules/views/tests/src/Kernel/Plugin/ArgumentValidatorTest.php b/core/modules/views/tests/src/Kernel/Plugin/ArgumentValidatorTest.php
index 1e87e44b9ca..64d3b00e7b5 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/ArgumentValidatorTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/ArgumentValidatorTest.php
@@ -22,7 +22,7 @@ class ArgumentValidatorTest extends ViewsKernelTestBase {
*/
public static $testViews = ['test_view_argument_validate_numeric', 'test_view'];
- public function testArgumentValidateNumeric() {
+ public function testArgumentValidateNumeric(): void {
$view = Views::getView('test_view_argument_validate_numeric');
$view->initHandlers();
$this->assertFalse($view->argument['null']->validateArgument($this->randomString()));
@@ -36,7 +36,7 @@ class ArgumentValidatorTest extends ViewsKernelTestBase {
*
* @see Drupal\views_test_data\Plugin\views\argument_validator\ArgumentValidatorTest
*/
- public function testArgumentValidatorPlugin() {
+ public function testArgumentValidatorPlugin(): void {
$view = Views::getView('test_view');
// Add a new argument and set the test plugin for the argument_validator.
diff --git a/core/modules/views/tests/src/Kernel/Plugin/BlockDependenciesTest.php b/core/modules/views/tests/src/Kernel/Plugin/BlockDependenciesTest.php
index e208b46237b..0a55efc5338 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/BlockDependenciesTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/BlockDependenciesTest.php
@@ -41,7 +41,7 @@ class BlockDependenciesTest extends ViewsKernelTestBase {
*
* @see \Drupal\views\Plugin\Derivative\ViewsExposedFilterBlock::getDerivativeDefinitions()
*/
- public function testExposedBlock() {
+ public function testExposedBlock(): void {
$block = $this->createBlock('views_exposed_filter_block:test_exposed_block-page_1');
$dependencies = $block->calculateDependencies()->getDependencies();
$expected = [
@@ -57,7 +57,7 @@ class BlockDependenciesTest extends ViewsKernelTestBase {
*
* @see \Drupal\views\Plugin\Derivative\ViewsBlock::getDerivativeDefinitions()
*/
- public function testViewsBlock() {
+ public function testViewsBlock(): void {
$block = $this->createBlock('views_block:content_recent-block_1');
$dependencies = $block->calculateDependencies()->getDependencies();
$expected = [
diff --git a/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php b/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php
index c8be7daaca0..094d6dcd5a6 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php
@@ -70,7 +70,7 @@ class CacheTest extends ViewsKernelTestBase {
*
* @see views_plugin_cache_time
*/
- public function testTimeResultCaching() {
+ public function testTimeResultCaching(): void {
$view = Views::getView('test_cache');
$view->setDisplay();
$view->display_handler->overrideOption('cache', [
@@ -108,7 +108,7 @@ class CacheTest extends ViewsKernelTestBase {
*
* @see views_plugin_cache_time
*/
- public function testTimeResultCachingWithFilter() {
+ public function testTimeResultCachingWithFilter(): void {
// Check that we can find the test filter plugin.
$plugin = $this->container->get('plugin.manager.views.filter')->createInstance('test_filter');
$this->assertInstanceOf(FilterPlugin::class, $plugin);
@@ -184,7 +184,7 @@ class CacheTest extends ViewsKernelTestBase {
/**
* Tests result caching with a pager.
*/
- public function testTimeResultCachingWithPager() {
+ public function testTimeResultCachingWithPager(): void {
$view = Views::getView('test_cache');
$view->setDisplay();
$view->display_handler->overrideOption('cache', [
@@ -227,7 +227,7 @@ class CacheTest extends ViewsKernelTestBase {
*
* @see views_plugin_cache_time
*/
- public function testNoneResultCaching() {
+ public function testNoneResultCaching(): void {
// Create a basic result which just 2 results.
$view = Views::getView('test_cache');
$view->setDisplay();
@@ -264,7 +264,7 @@ class CacheTest extends ViewsKernelTestBase {
/**
* Tests css/js storage and restoring mechanism.
*/
- public function testHeaderStorage() {
+ public function testHeaderStorage(): void {
// Create a view with output caching enabled.
// Some hook_views_pre_render in views_test_data.module adds the test css/js file.
// so they should be added to the css/js storage.
@@ -305,7 +305,7 @@ class CacheTest extends ViewsKernelTestBase {
/**
* Tests that Subqueries are cached as expected.
*/
- public function testSubqueryStringCache() {
+ public function testSubqueryStringCache(): void {
// Execute the view.
$view = Views::getView('test_groupwise_term_ui');
$view->setDisplay();
@@ -319,7 +319,7 @@ class CacheTest extends ViewsKernelTestBase {
/**
* Tests the data contained in cached items.
*/
- public function testCacheData() {
+ public function testCacheData(): void {
for ($i = 1; $i <= 5; $i++) {
Node::create([
'title' => $this->randomMachineName(8),
@@ -357,7 +357,7 @@ class CacheTest extends ViewsKernelTestBase {
/**
* Tests the cache context integration for views result cache.
*/
- public function testCacheContextIntegration() {
+ public function testCacheContextIntegration(): void {
$view = Views::getView('test_cache');
$view->setDisplay('page_2');
\Drupal::state()->set('views_test_cache_context', 'George');
@@ -389,7 +389,7 @@ class CacheTest extends ViewsKernelTestBase {
/**
* Tests that cacheability metadata is carried over from argument defaults.
*/
- public function testArgumentDefaultCache() {
+ public function testArgumentDefaultCache(): void {
$view = Views::getView('test_view');
// Add a new argument and set the test plugin for the argument_default.
diff --git a/core/modules/views/tests/src/Kernel/Plugin/CastedIntFieldJoinTestBase.php b/core/modules/views/tests/src/Kernel/Plugin/CastedIntFieldJoinTestBase.php
index 9c498e791c9..c7e8212a3e2 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/CastedIntFieldJoinTestBase.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/CastedIntFieldJoinTestBase.php
@@ -94,7 +94,7 @@ abstract class CastedIntFieldJoinTestBase extends DriverSpecificKernelTestBase {
* \Drupal\Tests\views\Kernel\Plugin\JoinTest::testBasePlugin() to ensure that
* no functionality provided by the base join plugin is broken.
*/
- public function testBuildJoin() {
+ public function testBuildJoin(): void {
// Setup a simple join and test the result sql.
$view = Views::getView('test_view');
$view->initDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Plugin/Display/ViewsMenuLinkTest.php b/core/modules/views/tests/src/Kernel/Plugin/Display/ViewsMenuLinkTest.php
index 9ecceb8891b..4626d473ffd 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/Display/ViewsMenuLinkTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/Display/ViewsMenuLinkTest.php
@@ -53,7 +53,7 @@ class ViewsMenuLinkTest extends ViewsKernelTestBase {
/**
* Tests views internal menu link options.
*/
- public function testMenuLinkOverrides() {
+ public function testMenuLinkOverrides(): void {
// Link from views module.
$views_link = $this->menuLinkManager->getDefinition('views_view:views.test_page_display_menu.page_3');
$this->assertTrue((bool) $views_link['enabled'], 'Menu link is enabled.');
diff --git a/core/modules/views/tests/src/Kernel/Plugin/DisplayExtenderTest.php b/core/modules/views/tests/src/Kernel/Plugin/DisplayExtenderTest.php
index d210facfe88..97e90bc6e5d 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/DisplayExtenderTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/DisplayExtenderTest.php
@@ -26,7 +26,7 @@ class DisplayExtenderTest extends ViewsKernelTestBase {
/**
* Tests display extenders.
*/
- public function testDisplayExtenders() {
+ public function testDisplayExtenders(): void {
$this->config('views.settings')->set('display_extenders', ['display_extender_test'])->save();
$this->assertCount(1, Views::getEnabledDisplayExtenders(), 'Make sure that there is only one enabled display extender.');
@@ -47,7 +47,7 @@ class DisplayExtenderTest extends ViewsKernelTestBase {
/**
* Tests display extenders validation.
*/
- public function testDisplayExtendersValidate() {
+ public function testDisplayExtendersValidate(): void {
$this->config('views.settings')->set('display_extenders', ['display_extender_test_3'])->save();
$view = Views::getView('test_view');
diff --git a/core/modules/views/tests/src/Kernel/Plugin/DisplayKernelTest.php b/core/modules/views/tests/src/Kernel/Plugin/DisplayKernelTest.php
index 880a4b27e65..065ce91fe99 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/DisplayKernelTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/DisplayKernelTest.php
@@ -63,7 +63,7 @@ class DisplayKernelTest extends ViewsKernelTestBase {
/**
* Tests the default display options.
*/
- public function testDefaultOptions() {
+ public function testDefaultOptions(): void {
// Save the view.
$view = Views::getView('test_display_defaults');
$view->mergeDefaults();
@@ -91,7 +91,7 @@ class DisplayKernelTest extends ViewsKernelTestBase {
/**
* Tests the \Drupal\views\Plugin\views\display\DisplayPluginBase::getPlugin() method.
*/
- public function testGetPlugin() {
+ public function testGetPlugin(): void {
$view = Views::getView('test_display_defaults');
$view->initDisplay();
$display_handler = $view->display_handler;
@@ -120,7 +120,7 @@ class DisplayKernelTest extends ViewsKernelTestBase {
/**
* Tests the ::isIdentifierUnique method.
*/
- public function testisIdentifierUnique() {
+ public function testisIdentifierUnique(): void {
$view = Views::getView('test_view');
$view->initDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php b/core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php
index 0cd0708f4f6..ceaa991dca2 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php
@@ -50,7 +50,7 @@ class DisplayPageTest extends ViewsKernelTestBase {
/**
* Checks the behavior of the page for access denied/not found behaviors.
*/
- public function testPageResponses() {
+ public function testPageResponses(): void {
\Drupal::currentUser()->setAccount(new AnonymousUserSession());
$subrequest = Request::create('/test_page_display_403', 'GET');
$response = $this->container->get('http_kernel')->handle($subrequest, HttpKernelInterface::SUB_REQUEST);
@@ -82,7 +82,7 @@ class DisplayPageTest extends ViewsKernelTestBase {
/**
* Checks that the router items are properly registered.
*/
- public function testPageRouterItems() {
+ public function testPageRouterItems(): void {
$collection = \Drupal::service('views.route_subscriber')->routes();
// Check the controller defaults.
@@ -124,7 +124,7 @@ class DisplayPageTest extends ViewsKernelTestBase {
/**
* Tests the generated menu links of views.
*/
- public function testMenuLinks() {
+ public function testMenuLinks(): void {
\Drupal::service('plugin.manager.menu.link')->rebuild();
$tree = \Drupal::menuTree()->load('admin', new MenuTreeParameters());
$this->assertTrue(isset($tree['system.admin']->subtree['views_view:views.test_page_display_menu.page_4']));
@@ -137,7 +137,7 @@ class DisplayPageTest extends ViewsKernelTestBase {
/**
* Tests the calculated dependencies for various views using Page displays.
*/
- public function testDependencies() {
+ public function testDependencies(): void {
$view = Views::getView('test_page_display');
$this->assertSame(['module' => ['views_test_data']], $view->getDependencies());
@@ -164,7 +164,7 @@ class DisplayPageTest extends ViewsKernelTestBase {
/**
* Tests the readmore functionality.
*/
- public function testReadMore() {
+ public function testReadMore(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
@@ -231,7 +231,7 @@ class DisplayPageTest extends ViewsKernelTestBase {
/**
* Tests the templates with empty rows.
*/
- public function testEmptyRow() {
+ public function testEmptyRow(): void {
$view = Views::getView('test_page_display');
$view->initDisplay();
$view->newDisplay('page', 'Page', 'empty_row');
diff --git a/core/modules/views/tests/src/Kernel/Plugin/ExposedFormRenderTest.php b/core/modules/views/tests/src/Kernel/Plugin/ExposedFormRenderTest.php
index 24a7fe5e434..97d670634b3 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/ExposedFormRenderTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/ExposedFormRenderTest.php
@@ -38,7 +38,7 @@ class ExposedFormRenderTest extends ViewsKernelTestBase {
/**
* Tests the exposed form markup.
*/
- public function testExposedFormRender() {
+ public function testExposedFormRender(): void {
$view = Views::getView('test_exposed_form_buttons');
$this->executeView($view);
$exposed_form = $view->display_handler->getPlugin('exposed_form');
@@ -58,7 +58,7 @@ class ExposedFormRenderTest extends ViewsKernelTestBase {
/**
* Tests the exposed form raw input.
*/
- public function testExposedFormRawInput() {
+ public function testExposedFormRawInput(): void {
NodeType::create([
'type' => 'article',
'name' => 'Article',
diff --git a/core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php b/core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php
index 5ffb69a1f7e..c06ab3694d9 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/FieldOrLanguageJoinTest.php
@@ -50,7 +50,7 @@ class FieldOrLanguageJoinTest extends RelationshipJoinTestBase {
* \Drupal\Tests\views\Kernel\Plugin\JoinTest::testBasePlugin() to ensure that
* no functionality provided by the base join plugin is broken.
*/
- public function testBase() {
+ public function testBase(): void {
// Setup a simple join and test the result sql.
$view = Views::getView('test_view');
$view->initDisplay();
@@ -130,7 +130,7 @@ class FieldOrLanguageJoinTest extends RelationshipJoinTestBase {
/**
* Tests the adding of conditions by the join plugin.
*/
- public function testLanguageBundleConditions() {
+ public function testLanguageBundleConditions(): void {
// Setup a simple join and test the result sql.
$view = Views::getView('test_view');
$view->initDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Plugin/JoinTest.php b/core/modules/views/tests/src/Kernel/Plugin/JoinTest.php
index 5094eed8814..87a1f007bf6 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/JoinTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/JoinTest.php
@@ -45,7 +45,7 @@ class JoinTest extends RelationshipJoinTestBase {
/**
* Tests an example join plugin.
*/
- public function testExamplePlugin() {
+ public function testExamplePlugin(): void {
// Setup a simple join and test the result sql.
$view = Views::getView('test_view');
@@ -76,7 +76,7 @@ class JoinTest extends RelationshipJoinTestBase {
/**
* Tests the join plugin base.
*/
- public function testBasePlugin() {
+ public function testBasePlugin(): void {
// Setup a simple join and test the result sql.
$view = Views::getView('test_view');
diff --git a/core/modules/views/tests/src/Kernel/Plugin/PagerKernelTest.php b/core/modules/views/tests/src/Kernel/Plugin/PagerKernelTest.php
index fbfb97a8264..ac3cd794b6c 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/PagerKernelTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/PagerKernelTest.php
@@ -42,7 +42,7 @@ class PagerKernelTest extends ViewsKernelTestBase {
* @see \Drupal\views\ViewExecutable::setOffset
* @see \Drupal\views\ViewExecutable::setCurrentPage
*/
- public function testSetPagerMethods() {
+ public function testSetPagerMethods(): void {
$view = Views::getView('test_pager_full');
// Mark the view as cacheable in order have the cache checking working
diff --git a/core/modules/views/tests/src/Kernel/Plugin/PluginBaseTest.php b/core/modules/views/tests/src/Kernel/Plugin/PluginBaseTest.php
index b3c8386bcac..42a3624e25d 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/PluginBaseTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/PluginBaseTest.php
@@ -32,7 +32,7 @@ class PluginBaseTest extends KernelTestBase {
/**
* Tests that the token replacement in views works correctly.
*/
- public function testViewsTokenReplace() {
+ public function testViewsTokenReplace(): void {
$text = '{{ langcode__value }} means {{ langcode }}';
$tokens = ['{{ langcode }}' => Markup::create('English'), '{{ langcode__value }}' => 'en'];
@@ -46,7 +46,7 @@ class PluginBaseTest extends KernelTestBase {
/**
* Tests that the token replacement in views works correctly with dots.
*/
- public function testViewsTokenReplaceWithDots() {
+ public function testViewsTokenReplaceWithDots(): void {
$text = '{{ argument.first }} comes before {{ argument.second }}';
$tokens = ['{{ argument.first }}' => 'first', '{{ argument.second }}' => 'second'];
@@ -70,7 +70,7 @@ class PluginBaseTest extends KernelTestBase {
/**
* Tests viewsTokenReplace without any twig tokens.
*/
- public function testViewsTokenReplaceWithTwigTokens() {
+ public function testViewsTokenReplaceWithTwigTokens(): void {
$text = 'Just some text';
$tokens = [];
$result = $this->testPluginBase->viewsTokenReplace($text, $tokens);
diff --git a/core/modules/views/tests/src/Kernel/Plugin/QueryTest.php b/core/modules/views/tests/src/Kernel/Plugin/QueryTest.php
index 0b20a3528c3..52b29887ed7 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/QueryTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/QueryTest.php
@@ -32,7 +32,7 @@ class QueryTest extends ViewsKernelTestBase {
/**
* Tests query plugins.
*/
- public function testQuery() {
+ public function testQuery(): void {
$this->_testInitQuery();
$this->_testQueryExecute();
$this->queryMethodsTests();
diff --git a/core/modules/views/tests/src/Kernel/Plugin/RelationshipJoinInTest.php b/core/modules/views/tests/src/Kernel/Plugin/RelationshipJoinInTest.php
index 0fe7b5b2f7c..b9e1fbe3d2b 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/RelationshipJoinInTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/RelationshipJoinInTest.php
@@ -40,7 +40,7 @@ class RelationshipJoinInTest extends RelationshipJoinTestBase {
/**
* Tests the query result of a view with a relationship with an IN condition.
*/
- public function testRelationshipInQuery() {
+ public function testRelationshipInQuery(): void {
// Update the first two Beatles to be authored by Kristiaan.
$account_k = $this->createUser([], 'Kristiaan');
$connection = Database::getConnection();
diff --git a/core/modules/views/tests/src/Kernel/Plugin/RelationshipTest.php b/core/modules/views/tests/src/Kernel/Plugin/RelationshipTest.php
index 9fad7eefdc6..e213340a4f9 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/RelationshipTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/RelationshipTest.php
@@ -37,7 +37,7 @@ class RelationshipTest extends RelationshipJoinTestBase {
/**
* Tests the query result of a view with a relationship.
*/
- public function testRelationshipQuery() {
+ public function testRelationshipQuery(): void {
$connection = Database::getConnection();
// Set the first entry to have the admin as author.
$connection->update('views_test_data')
@@ -145,7 +145,7 @@ class RelationshipTest extends RelationshipJoinTestBase {
/**
* Tests rendering of a view with a relationship.
*/
- public function testRelationshipRender() {
+ public function testRelationshipRender(): void {
$connection = Database::getConnection();
$author1 = $this->createUser();
$connection->update('views_test_data')
diff --git a/core/modules/views/tests/src/Kernel/Plugin/RowEntityTest.php b/core/modules/views/tests/src/Kernel/Plugin/RowEntityTest.php
index 548ee09feb9..99ec2045241 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/RowEntityTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/RowEntityTest.php
@@ -50,7 +50,7 @@ class RowEntityTest extends ViewsKernelTestBase {
/**
* Tests the entity row handler.
*/
- public function testEntityRow() {
+ public function testEntityRow(): void {
$user = User::create([
'name' => 'test user',
]);
diff --git a/core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php b/core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php
index 04d2602823f..1629bbdad04 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php
@@ -89,7 +89,7 @@ class RowRenderCacheTest extends ViewsKernelTestBase {
/**
* Tests complex field rewriting and uncacheable field handlers.
*/
- public function testAdvancedCaching() {
+ public function testAdvancedCaching(): void {
// Test that row field output is actually cached and with the proper cache
// contexts.
$this->doTestRenderedOutput($this->editorUser);
@@ -112,7 +112,7 @@ class RowRenderCacheTest extends ViewsKernelTestBase {
/**
* Tests that rows are not cached when the none cache plugin is used.
*/
- public function testNoCaching() {
+ public function testNoCaching(): void {
$this->setCurrentUser($this->regularUser);
$view = Views::getView('test_row_render_cache_none');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Plugin/RssFieldsTest.php b/core/modules/views/tests/src/Kernel/Plugin/RssFieldsTest.php
index a33ddbd2a1c..7773e2598af 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/RssFieldsTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/RssFieldsTest.php
@@ -49,7 +49,7 @@ class RssFieldsTest extends ViewsKernelTestBase {
* ensure that root-relative links also work in a scenario without
* subdirectory.
*/
- public function testRssFields() {
+ public function testRssFields(): void {
$this->setUpCurrentUser([], ['access content']);
$date = '1975-05-18';
diff --git a/core/modules/views/tests/src/Kernel/Plugin/SqlEntityLoadingTest.php b/core/modules/views/tests/src/Kernel/Plugin/SqlEntityLoadingTest.php
index a3e60b3dd61..571f8d0ce08 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/SqlEntityLoadingTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/SqlEntityLoadingTest.php
@@ -39,7 +39,7 @@ class SqlEntityLoadingTest extends ViewsKernelTestBase {
$this->installSchema('node', 'node_access');
}
- public function testViewWithNonDefaultPendingRevision() {
+ public function testViewWithNonDefaultPendingRevision(): void {
$node_type = NodeType::create([
'type' => 'page',
'name' => 'Page',
diff --git a/core/modules/views/tests/src/Kernel/Plugin/SqlQueryTest.php b/core/modules/views/tests/src/Kernel/Plugin/SqlQueryTest.php
index 9f3bd6bcf9a..f5d39734aa6 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/SqlQueryTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/SqlQueryTest.php
@@ -37,7 +37,7 @@ class SqlQueryTest extends ViewsKernelTestBase {
/**
* Tests adding some metadata/tags to the views query.
*/
- public function testExecuteMetadata() {
+ public function testExecuteMetadata(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -91,7 +91,7 @@ class SqlQueryTest extends ViewsKernelTestBase {
*
* @covers \Drupal\views\Plugin\views\query\Sql::getConnection
*/
- public function testGetConnection() {
+ public function testGetConnection(): void {
$view = Views::getView('test_view');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Plugin/StyleFieldsTest.php b/core/modules/views/tests/src/Kernel/Plugin/StyleFieldsTest.php
index 9bf7f20750a..f509b286bd4 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/StyleFieldsTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/StyleFieldsTest.php
@@ -24,7 +24,7 @@ class StyleFieldsTest extends ViewsKernelTestBase {
/**
* Tests inline fields and separator.
*/
- public function testInlineFields() {
+ public function testInlineFields(): void {
$renderer = $this->container->get('renderer');
$view = Views::getView('test_view');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php b/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php
index 95b11faf0e0..ad960d2357a 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php
@@ -32,7 +32,7 @@ class StyleGridTest extends PluginKernelTestBase {
/**
* Tests the grid style.
*/
- public function testGrid() {
+ public function testGrid(): void {
$view = Views::getView('test_grid');
foreach (['horizontal', 'vertical'] as $alignment) {
$this->assertGrid($view, $alignment, 5);
diff --git a/core/modules/views/tests/src/Kernel/Plugin/StyleHtmlListTest.php b/core/modules/views/tests/src/Kernel/Plugin/StyleHtmlListTest.php
index 1a4d36df4ab..677224e2d20 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/StyleHtmlListTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/StyleHtmlListTest.php
@@ -25,7 +25,7 @@ class StyleHtmlListTest extends ViewsKernelTestBase {
/**
* Make sure that the HTML list style markup is correct.
*/
- public function testDefaultRowClasses() {
+ public function testDefaultRowClasses(): void {
$view = Views::getView('test_style_html_list');
$output = $view->preview();
$output = (string) \Drupal::service('renderer')->renderRoot($output);
diff --git a/core/modules/views/tests/src/Kernel/Plugin/StyleMappingTest.php b/core/modules/views/tests/src/Kernel/Plugin/StyleMappingTest.php
index 004c66eb62b..ec3842528bc 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/StyleMappingTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/StyleMappingTest.php
@@ -26,7 +26,7 @@ class StyleMappingTest extends StyleTestBase {
/**
* Verifies that the fields were mapped correctly.
*/
- public function testMappedOutput() {
+ public function testMappedOutput(): void {
$view = Views::getView('test_style_mapping');
$output = (string) $this->mappedOutputHelper($view);
$this->assertStringNotContainsString('job', $output, 'The job field is added to the view but not in the mapping.');
diff --git a/core/modules/views/tests/src/Kernel/Plugin/StyleTableUnitTest.php b/core/modules/views/tests/src/Kernel/Plugin/StyleTableUnitTest.php
index 449faf22b86..4cb22865143 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/StyleTableUnitTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/StyleTableUnitTest.php
@@ -26,7 +26,7 @@ class StyleTableUnitTest extends PluginKernelTestBase {
/**
* Tests the table style.
*/
- public function testTable() {
+ public function testTable(): void {
$view = Views::getView('test_table');
$view->setDisplay('default');
diff --git a/core/modules/views/tests/src/Kernel/Plugin/StyleTest.php b/core/modules/views/tests/src/Kernel/Plugin/StyleTest.php
index e95c91f9787..a88ee3ae0ed 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/StyleTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/StyleTest.php
@@ -29,7 +29,7 @@ class StyleTest extends ViewsKernelTestBase {
/**
* Tests the general rendering of styles.
*/
- public function testStyle() {
+ public function testStyle(): void {
$renderer = $this->container->get('renderer');
// This run use the test row plugin and render with it.
@@ -78,7 +78,7 @@ class StyleTest extends ViewsKernelTestBase {
/**
* Tests the grouping features of styles.
*/
- public function testGrouping() {
+ public function testGrouping(): void {
$this->doTestGrouping(FALSE);
$this->doTestGrouping(TRUE);
}
@@ -278,7 +278,7 @@ class StyleTest extends ViewsKernelTestBase {
/**
* Tests custom CSS row classes.
*/
- public function testCustomRowClasses() {
+ public function testCustomRowClasses(): void {
$view = Views::getView('test_view');
$view->setDisplay();
diff --git a/core/modules/views/tests/src/Kernel/Plugin/StyleUnformattedTest.php b/core/modules/views/tests/src/Kernel/Plugin/StyleUnformattedTest.php
index 8e54fd4dcf3..a9a3f5d3133 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/StyleUnformattedTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/StyleUnformattedTest.php
@@ -23,7 +23,7 @@ class StyleUnformattedTest extends StyleTestBase {
/**
* Make sure that the default css classes works as expected.
*/
- public function testDefaultRowClasses() {
+ public function testDefaultRowClasses(): void {
$view = Views::getView('test_view');
$view->setDisplay();
$output = $view->preview();
diff --git a/core/modules/views/tests/src/Kernel/Plugin/ViewsBlockTest.php b/core/modules/views/tests/src/Kernel/Plugin/ViewsBlockTest.php
index b3ff27077a1..2afcc654dbf 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/ViewsBlockTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/ViewsBlockTest.php
@@ -44,7 +44,7 @@ class ViewsBlockTest extends ViewsKernelTestBase {
*
* @see \Drupal\views\Plugin\Block::getMachineNameSuggestion()
*/
- public function testMachineNameSuggestion() {
+ public function testMachineNameSuggestion(): void {
$plugin_definition = [
'provider' => 'views',
];
@@ -59,7 +59,7 @@ class ViewsBlockTest extends ViewsKernelTestBase {
*
* @see \Drupal\views\Plugin\Block::build()
*/
- public function testBuildWithTitleToken() {
+ public function testBuildWithTitleToken(): void {
$view = Views::getView('test_view_block');
$view->setDisplay();
@@ -93,7 +93,7 @@ class ViewsBlockTest extends ViewsKernelTestBase {
*
* @see \Drupal\views\Plugin\Block::build()
*/
- public function testBuildWithTitleOverride() {
+ public function testBuildWithTitleOverride(): void {
$view = Views::getView('test_view_block');
$view->setDisplay();
@@ -134,7 +134,7 @@ class ViewsBlockTest extends ViewsKernelTestBase {
*
* @see \Drupal\views\Plugin\Block\ViewsBlockBase::getPreviewFallbackString()
*/
- public function testGetPreviewFallbackString() {
+ public function testGetPreviewFallbackString(): void {
$plugin_definition = [
'provider' => 'views',
];
diff --git a/core/modules/views/tests/src/Kernel/Plugin/ViewsSqlExceptionTest.php b/core/modules/views/tests/src/Kernel/Plugin/ViewsSqlExceptionTest.php
index e5eb58772bb..9756d648202 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/ViewsSqlExceptionTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/ViewsSqlExceptionTest.php
@@ -32,7 +32,7 @@ class ViewsSqlExceptionTest extends ViewsKernelTestBase {
/**
* Tests for the SQL exception.
*/
- public function testSqlException() {
+ public function testSqlException(): void {
$view = Views::getView('test_filter');
$view->initDisplay();
diff --git a/core/modules/views/tests/src/Kernel/PluginInstanceTest.php b/core/modules/views/tests/src/Kernel/PluginInstanceTest.php
index 93b101576ba..9cd5dbe5866 100644
--- a/core/modules/views/tests/src/Kernel/PluginInstanceTest.php
+++ b/core/modules/views/tests/src/Kernel/PluginInstanceTest.php
@@ -74,7 +74,7 @@ class PluginInstanceTest extends ViewsKernelTestBase {
/**
* Confirms that there is plugin data for all views plugin types.
*/
- public function testPluginData() {
+ public function testPluginData(): void {
// Check that we have an array of data.
$this->assertIsArray($this->definitions);
@@ -96,7 +96,7 @@ class PluginInstanceTest extends ViewsKernelTestBase {
* This will iterate through all plugins from _views_fetch_plugin_data(),
* filtering out deprecated plugins.
*/
- public function testPluginInstances() {
+ public function testPluginInstances(): void {
$this->assertPluginInstances(FALSE);
}
diff --git a/core/modules/views/tests/src/Kernel/QueryGroupByTest.php b/core/modules/views/tests/src/Kernel/QueryGroupByTest.php
index 1eba42de59c..4d597ee646a 100644
--- a/core/modules/views/tests/src/Kernel/QueryGroupByTest.php
+++ b/core/modules/views/tests/src/Kernel/QueryGroupByTest.php
@@ -70,7 +70,7 @@ class QueryGroupByTest extends ViewsKernelTestBase {
/**
* Tests aggregate count feature.
*/
- public function testAggregateCount() {
+ public function testAggregateCount(): void {
$this->setupTestEntities();
$view = Views::getView('test_aggregate_count');
@@ -91,7 +91,7 @@ class QueryGroupByTest extends ViewsKernelTestBase {
/**
* Tests aggregate count feature with no group by.
*/
- public function testAggregateCountFunction() {
+ public function testAggregateCountFunction(): void {
$this->setupTestEntities();
$view = Views::getView('test_aggregate_count_function');
@@ -163,49 +163,49 @@ class QueryGroupByTest extends ViewsKernelTestBase {
/**
* Tests the count aggregation function.
*/
- public function testGroupByCount() {
+ public function testGroupByCount(): void {
$this->groupByTestHelper('count', [4, 3]);
}
/**
* Tests the sum aggregation function.
*/
- public function testGroupBySum() {
+ public function testGroupBySum(): void {
$this->groupByTestHelper('sum', [10, 18]);
}
/**
* Tests the average aggregation function.
*/
- public function testGroupByAverage() {
+ public function testGroupByAverage(): void {
$this->groupByTestHelper('avg', [2.5, 6]);
}
/**
* Tests the min aggregation function.
*/
- public function testGroupByMin() {
+ public function testGroupByMin(): void {
$this->groupByTestHelper('min', [1, 5]);
}
/**
* Tests the max aggregation function.
*/
- public function testGroupByMax() {
+ public function testGroupByMax(): void {
$this->groupByTestHelper('max', [4, 7]);
}
/**
* Tests aggregation with no specific function.
*/
- public function testGroupByNone() {
+ public function testGroupByNone(): void {
$this->groupByTestHelper(NULL, [1, 5]);
}
/**
* Tests groupby with filters.
*/
- public function testGroupByCountOnlyFilters() {
+ public function testGroupByCountOnlyFilters(): void {
// Check if GROUP BY and HAVING are included when a view
// doesn't display SUM, COUNT, MAX, etc. functions in SELECT statement.
@@ -223,7 +223,7 @@ class QueryGroupByTest extends ViewsKernelTestBase {
/**
* Tests grouping on base field.
*/
- public function testGroupByBaseField() {
+ public function testGroupByBaseField(): void {
$this->setupTestEntities();
$view = Views::getView('test_group_by_count');
@@ -239,7 +239,7 @@ class QueryGroupByTest extends ViewsKernelTestBase {
/**
* Tests grouping a field with cardinality > 1.
*/
- public function testGroupByFieldWithCardinality() {
+ public function testGroupByFieldWithCardinality(): void {
$field_storage = FieldStorageConfig::create([
'type' => 'integer',
'field_name' => 'field_test',
@@ -319,7 +319,7 @@ class QueryGroupByTest extends ViewsKernelTestBase {
/**
* Tests groupby with a non-existent field on some bundle.
*/
- public function testGroupByWithFieldsNotExistingOnBundle() {
+ public function testGroupByWithFieldsNotExistingOnBundle(): void {
$field_storage = FieldStorageConfig::create([
'type' => 'integer',
'field_name' => 'field_test',
diff --git a/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php b/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php
index 5b39872277c..d9a3e5dc7c9 100644
--- a/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php
+++ b/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php
@@ -45,7 +45,7 @@ class RenderCacheIntegrationTest extends ViewsKernelTestBase {
/**
* Tests a field-based view's cache tags when using the "none" cache plugin.
*/
- public function testFieldBasedViewCacheTagsWithCachePluginNone() {
+ public function testFieldBasedViewCacheTagsWithCachePluginNone(): void {
$view = Views::getView('entity_test_fields');
$view->getDisplay()->overrideOption('cache', [
'type' => 'none',
@@ -58,7 +58,7 @@ class RenderCacheIntegrationTest extends ViewsKernelTestBase {
/**
* Tests a field-based view's cache tags when using the "tag" cache plugin.
*/
- public function testFieldBasedViewCacheTagsWithCachePluginTag() {
+ public function testFieldBasedViewCacheTagsWithCachePluginTag(): void {
$view = Views::getView('entity_test_fields');
$view->getDisplay()->overrideOption('cache', [
'type' => 'tag',
@@ -71,7 +71,7 @@ class RenderCacheIntegrationTest extends ViewsKernelTestBase {
/**
* Tests a field-based view's cache tags when using the "time" cache plugin.
*/
- public function testFieldBasedViewCacheTagsWithCachePluginTime() {
+ public function testFieldBasedViewCacheTagsWithCachePluginTime(): void {
$view = Views::getView('entity_test_fields');
$view->getDisplay()->overrideOption('cache', [
'type' => 'time',
@@ -192,7 +192,7 @@ class RenderCacheIntegrationTest extends ViewsKernelTestBase {
/**
* Tests an entity-based view's cache tags when using the "none" cache plugin.
*/
- public function testEntityBasedViewCacheTagsWithCachePluginNone() {
+ public function testEntityBasedViewCacheTagsWithCachePluginNone(): void {
$view = Views::getView('entity_test_row');
$view->getDisplay()->overrideOption('cache', [
'type' => 'none',
@@ -205,7 +205,7 @@ class RenderCacheIntegrationTest extends ViewsKernelTestBase {
/**
* Tests an entity-based view's cache tags when using the "tag" cache plugin.
*/
- public function testEntityBasedViewCacheTagsWithCachePluginTag() {
+ public function testEntityBasedViewCacheTagsWithCachePluginTag(): void {
$view = Views::getView('entity_test_row');
$view->getDisplay()->overrideOption('cache', [
'type' => 'tag',
@@ -218,7 +218,7 @@ class RenderCacheIntegrationTest extends ViewsKernelTestBase {
/**
* Tests an entity-based view's cache tags when using the "time" cache plugin.
*/
- public function testEntityBasedViewCacheTagsWithCachePluginTime() {
+ public function testEntityBasedViewCacheTagsWithCachePluginTime(): void {
$view = Views::getView('entity_test_row');
$view->getDisplay()->overrideOption('cache', [
'type' => 'time',
@@ -275,7 +275,7 @@ class RenderCacheIntegrationTest extends ViewsKernelTestBase {
/**
* Ensure that the view renderable contains the cache contexts.
*/
- public function testBuildRenderableWithCacheContexts() {
+ public function testBuildRenderableWithCacheContexts(): void {
$view = View::load('test_view');
$display =& $view->getDisplay('default');
$display['cache_metadata']['contexts'] = ['views_test_cache_context'];
@@ -288,7 +288,7 @@ class RenderCacheIntegrationTest extends ViewsKernelTestBase {
/**
* Ensures that saving a view calculates the cache contexts.
*/
- public function testViewAddCacheMetadata() {
+ public function testViewAddCacheMetadata(): void {
$view = View::load('test_display');
$view->save();
diff --git a/core/modules/views/tests/src/Kernel/TestViewsTest.php b/core/modules/views/tests/src/Kernel/TestViewsTest.php
index 5a9db54488c..9e46c42d6f3 100644
--- a/core/modules/views/tests/src/Kernel/TestViewsTest.php
+++ b/core/modules/views/tests/src/Kernel/TestViewsTest.php
@@ -197,7 +197,7 @@ class TestViewsTest extends KernelTestBase {
/**
* Tests default configuration data type.
*/
- public function testDefaultConfig() {
+ public function testDefaultConfig(): void {
// Create a typed config manager with access to configuration schema in
// every module, profile and theme.
$typed_config = new TypedConfigManager(
diff --git a/core/modules/views/tests/src/Kernel/TokenReplaceTest.php b/core/modules/views/tests/src/Kernel/TokenReplaceTest.php
index a2d2ecdb3c2..95d11df2050 100644
--- a/core/modules/views/tests/src/Kernel/TokenReplaceTest.php
+++ b/core/modules/views/tests/src/Kernel/TokenReplaceTest.php
@@ -27,7 +27,7 @@ class TokenReplaceTest extends ViewsKernelTestBase {
/**
* Tests core token replacements generated from a view.
*/
- public function testTokenReplacement() {
+ public function testTokenReplacement(): void {
$token_handler = \Drupal::token();
$view = Views::getView('test_tokens');
$view->setDisplay('page_1');
@@ -74,7 +74,7 @@ class TokenReplaceTest extends ViewsKernelTestBase {
/**
* Tests core token replacements generated from a view.
*/
- public function testTokenReplacementWithMiniPager() {
+ public function testTokenReplacementWithMiniPager(): void {
$token_handler = \Drupal::token();
$view = Views::getView('test_tokens');
$view->setDisplay('page_3');
@@ -145,7 +145,7 @@ class TokenReplaceTest extends ViewsKernelTestBase {
/**
* Tests core token replacements generated from a view without results.
*/
- public function testTokenReplacementNoResults() {
+ public function testTokenReplacementNoResults(): void {
$token_handler = \Drupal::token();
$view = Views::getView('test_tokens');
$view->setDisplay('page_2');
@@ -164,7 +164,7 @@ class TokenReplaceTest extends ViewsKernelTestBase {
/**
* Tests path token replacements generated from a view without a path.
*/
- public function testTokenReplacementNoPath() {
+ public function testTokenReplacementNoPath(): void {
$token_handler = \Drupal::token();
$view = Views::getView('test_invalid_tokens');
$view->setDisplay('block_1');
diff --git a/core/modules/views/tests/src/Kernel/ViewElementTest.php b/core/modules/views/tests/src/Kernel/ViewElementTest.php
index 9cad35d7a52..4989a46a336 100644
--- a/core/modules/views/tests/src/Kernel/ViewElementTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewElementTest.php
@@ -24,7 +24,7 @@ class ViewElementTest extends ViewsKernelTestBase {
/**
* Tests the rendered output and form output of a view element.
*/
- public function testViewElement() {
+ public function testViewElement(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$view = Views::getView('test_view_embed');
@@ -74,7 +74,7 @@ class ViewElementTest extends ViewsKernelTestBase {
/**
* Tests the rendered output and form output of the "embed" display plugin.
*/
- public function testViewElementEmbed() {
+ public function testViewElementEmbed(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$view = Views::getView('test_view_embed');
@@ -134,7 +134,7 @@ class ViewElementTest extends ViewsKernelTestBase {
/**
* Tests that an exception is thrown when an invalid View is passed.
*/
- public function testInvalidView() {
+ public function testInvalidView(): void {
$renderer = $this->container->get('renderer');
$render_element = [
'#type' => 'view',
diff --git a/core/modules/views/tests/src/Kernel/ViewExecutableTest.php b/core/modules/views/tests/src/Kernel/ViewExecutableTest.php
index 64aeeac346a..501633cbbae 100644
--- a/core/modules/views/tests/src/Kernel/ViewExecutableTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewExecutableTest.php
@@ -109,7 +109,7 @@ class ViewExecutableTest extends ViewsKernelTestBase {
/**
* Tests the views.executable container service.
*/
- public function testFactoryService() {
+ public function testFactoryService(): void {
$factory = $this->container->get('views.executable');
$this->assertInstanceOf(ViewExecutableFactory::class, $factory);
$view = View::load('test_executable_displays');
@@ -119,7 +119,7 @@ class ViewExecutableTest extends ViewsKernelTestBase {
/**
* Tests the initDisplay() and initHandlers() methods.
*/
- public function testInitMethods() {
+ public function testInitMethods(): void {
$view = Views::getView('test_destroy');
$view->initDisplay();
@@ -187,14 +187,14 @@ class ViewExecutableTest extends ViewsKernelTestBase {
/**
* Tests the generation of the executable object.
*/
- public function testConstructing() {
+ public function testConstructing(): void {
Views::getView('test_destroy');
}
/**
* Tests the accessing of values on the object.
*/
- public function testProperties() {
+ public function testProperties(): void {
$view = Views::getView('test_destroy');
foreach ($this->executableProperties as $property) {
$this->assertTrue(isset($view->{$property}));
@@ -204,7 +204,7 @@ class ViewExecutableTest extends ViewsKernelTestBase {
$this->assertEquals([], $view->getExposedInput());
}
- public function testSetDisplayWithInvalidDisplay() {
+ public function testSetDisplayWithInvalidDisplay(): void {
\Drupal::service('module_installer')->install(['dblog']);
$view = Views::getView('test_executable_displays');
$view->initDisplay();
@@ -229,7 +229,7 @@ class ViewExecutableTest extends ViewsKernelTestBase {
/**
* Tests the display related methods and properties.
*/
- public function testDisplays() {
+ public function testDisplays(): void {
$view = Views::getView('test_executable_displays');
// Tests Drupal\views\ViewExecutable::initDisplay().
@@ -299,7 +299,7 @@ class ViewExecutableTest extends ViewsKernelTestBase {
/**
* Tests the setting/getting of properties.
*/
- public function testPropertyMethods() {
+ public function testPropertyMethods(): void {
$view = Views::getView('test_executable_displays');
// Test the setAjaxEnabled() method.
@@ -356,7 +356,7 @@ class ViewExecutableTest extends ViewsKernelTestBase {
/**
* Tests the destructor to be sure that necessary objects are removed.
*/
- public function testDestroy() {
+ public function testDestroy(): void {
$view = Views::getView('test_destroy');
$view->preview();
@@ -410,7 +410,7 @@ class ViewExecutableTest extends ViewsKernelTestBase {
/**
* Tests ViewExecutable::getHandlerTypes().
*/
- public function testGetHandlerTypes() {
+ public function testGetHandlerTypes(): void {
$types = ViewExecutable::getHandlerTypes();
foreach (['field', 'filter', 'argument', 'sort', 'header', 'footer', 'empty'] as $type) {
$this->assertTrue(isset($types[$type]));
@@ -429,7 +429,7 @@ class ViewExecutableTest extends ViewsKernelTestBase {
/**
* Tests ViewExecutable::getHandlers().
*/
- public function testGetHandlers() {
+ public function testGetHandlers(): void {
$view = Views::getView('test_executable_displays');
$view->setDisplay('page_1');
@@ -442,7 +442,7 @@ class ViewExecutableTest extends ViewsKernelTestBase {
/**
* Tests the validation of display handlers.
*/
- public function testValidate() {
+ public function testValidate(): void {
$view = Views::getView('test_executable_displays');
$view->setDisplay('page_1');
@@ -473,7 +473,7 @@ class ViewExecutableTest extends ViewsKernelTestBase {
/**
* Tests that nested loops of the display handlers won't break validation.
*/
- public function testValidateNestedLoops() {
+ public function testValidateNestedLoops(): void {
$view = View::create(['id' => 'test_validate_nested_loops']);
$executable = $view->getExecutable();
@@ -493,7 +493,7 @@ class ViewExecutableTest extends ViewsKernelTestBase {
/**
* Tests serialization of the ViewExecutable object.
*/
- public function testSerialization() {
+ public function testSerialization(): void {
$view = Views::getView('test_executable_displays');
$view->setDisplay('page_1');
$view->setArguments(['test']);
@@ -549,7 +549,7 @@ class ViewExecutableTest extends ViewsKernelTestBase {
/**
* Tests if argument overrides by validators are propagated to tokens.
*/
- public function testArgumentValidatorValueOverride() {
+ public function testArgumentValidatorValueOverride(): void {
$account = User::create(['name' => $this->randomString()]);
$account->save();
diff --git a/core/modules/views/tests/src/Kernel/ViewRenderTest.php b/core/modules/views/tests/src/Kernel/ViewRenderTest.php
index 84b9492ec41..e9a4b2ba3b2 100644
--- a/core/modules/views/tests/src/Kernel/ViewRenderTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewRenderTest.php
@@ -21,7 +21,7 @@ class ViewRenderTest extends ViewsKernelTestBase {
/**
* Tests render functionality.
*/
- public function testRender() {
+ public function testRender(): void {
$state = $this->container->get('state');
$state->set('views_render.test', 0);
diff --git a/core/modules/views/tests/src/Kernel/ViewStorageTest.php b/core/modules/views/tests/src/Kernel/ViewStorageTest.php
index 280237c5c4a..216a410ff6b 100644
--- a/core/modules/views/tests/src/Kernel/ViewStorageTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewStorageTest.php
@@ -58,7 +58,7 @@ class ViewStorageTest extends ViewsKernelTestBase {
/**
* Tests CRUD operations.
*/
- public function testConfigurationEntityCRUD() {
+ public function testConfigurationEntityCRUD(): void {
// Get the configuration entity type and controller.
$this->entityType = \Drupal::entityTypeManager()->getDefinition('view');
$this->controller = $this->container->get('entity_type.manager')->getStorage('view');
@@ -302,7 +302,7 @@ class ViewStorageTest extends ViewsKernelTestBase {
/**
* Tests the createDuplicate() View method.
*/
- public function testCreateDuplicate() {
+ public function testCreateDuplicate(): void {
$view = Views::getView('test_view_storage');
$copy = $view->storage->createDuplicate();
diff --git a/core/modules/views/tests/src/Kernel/ViewsConfigDependenciesIntegrationTest.php b/core/modules/views/tests/src/Kernel/ViewsConfigDependenciesIntegrationTest.php
index ae2c098341b..bb0b3e370e0 100644
--- a/core/modules/views/tests/src/Kernel/ViewsConfigDependenciesIntegrationTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewsConfigDependenciesIntegrationTest.php
@@ -49,7 +49,7 @@ class ViewsConfigDependenciesIntegrationTest extends ViewsKernelTestBase {
/**
* Tests integration with image module.
*/
- public function testImage() {
+ public function testImage(): void {
/** @var \Drupal\image\ImageStyleInterface $style */
$style = ImageStyle::create(['name' => 'foo', 'label' => 'Foo']);
$style->save();
@@ -111,7 +111,7 @@ class ViewsConfigDependenciesIntegrationTest extends ViewsKernelTestBase {
/**
* Tests removing a config dependency that deletes the View.
*/
- public function testConfigRemovalRole() {
+ public function testConfigRemovalRole(): void {
// Create a role we can add to the View and delete.
$role = Role::create([
'id' => 'dummy',
@@ -151,7 +151,7 @@ class ViewsConfigDependenciesIntegrationTest extends ViewsKernelTestBase {
/**
* Tests uninstalling a module that provides a base table for a View.
*/
- public function testConfigRemovalBaseTable() {
+ public function testConfigRemovalBaseTable(): void {
// Find all the entity types provided by the entity_test module and install
// the schema for them so we can uninstall them.
$entities = \Drupal::entityTypeManager()->getDefinitions();
diff --git a/core/modules/views/tests/src/Kernel/ViewsDataTest.php b/core/modules/views/tests/src/Kernel/ViewsDataTest.php
index 09ee97de82c..3c7d436fa79 100644
--- a/core/modules/views/tests/src/Kernel/ViewsDataTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewsDataTest.php
@@ -14,7 +14,7 @@ class ViewsDataTest extends ViewsKernelTestBase {
/**
* Tests that the service "views.views_data" is backend-overridable.
*/
- public function testViewsViewsDataIsBackendOverridable() {
+ public function testViewsViewsDataIsBackendOverridable(): void {
$definition = $this->container->getDefinition('views.views_data');
$this->assertTrue($definition->hasTag('backend_overridable'));
}
diff --git a/core/modules/views/tests/src/Kernel/ViewsHooksTest.php b/core/modules/views/tests/src/Kernel/ViewsHooksTest.php
index 3315c26e937..37d0d4aed77 100644
--- a/core/modules/views/tests/src/Kernel/ViewsHooksTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewsHooksTest.php
@@ -73,7 +73,7 @@ class ViewsHooksTest extends ViewsKernelTestBase {
/**
* Tests the hooks.
*/
- public function testHooks() {
+ public function testHooks(): void {
$view = Views::getView('test_view');
$view->setDisplay();
@@ -113,7 +113,7 @@ class ViewsHooksTest extends ViewsKernelTestBase {
* @see views_test_data_views_form_substitutions()
* @see \Drupal\views\Form\ViewsFormMainForm::preRenderViewsForm()
*/
- public function testViewsFormMainFormPreRender() {
+ public function testViewsFormMainFormPreRender(): void {
$element = [
'output' => [
'#plain_text' => '<!--will-be-escaped--><!--will-be-not-escaped-->',
@@ -131,7 +131,7 @@ class ViewsHooksTest extends ViewsKernelTestBase {
/**
* Test that hook_views_invalidate_cache() is called when a view is deleted.
*/
- public function testViewsInvalidateCacheOnDelete() {
+ public function testViewsInvalidateCacheOnDelete(): void {
$this->container->get('state')->set('views_hook_test_views_invalidate_cache', FALSE);
$view = $this->viewStorage->load('test_view');
$view->delete();
diff --git a/core/modules/views/tests/src/Kernel/ViewsPreprocessTest.php b/core/modules/views/tests/src/Kernel/ViewsPreprocessTest.php
index eecd5c8128e..3cac529801c 100644
--- a/core/modules/views/tests/src/Kernel/ViewsPreprocessTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewsPreprocessTest.php
@@ -36,7 +36,7 @@ class ViewsPreprocessTest extends ViewsKernelTestBase {
/**
* Tests css classes on displays are cleaned correctly.
*/
- public function testCssClassCleaning() {
+ public function testCssClassCleaning(): void {
\Drupal::service('theme_installer')->install(['test_theme']);
$this->config('system.theme')->set('default', 'test_theme')->save();
@@ -64,7 +64,7 @@ class ViewsPreprocessTest extends ViewsKernelTestBase {
*
* @covers ::template_preprocess_views_mini_pager
*/
- public function testEmptyPaginationHeadingLevelSet() {
+ public function testEmptyPaginationHeadingLevelSet(): void {
require_once $this->root . '/core/modules/views/views.theme.inc';
$variables = [
'tags' => [],
@@ -83,7 +83,7 @@ class ViewsPreprocessTest extends ViewsKernelTestBase {
*
* @covers ::template_preprocess_views_mini_pager
*/
- public function testPaginationHeadingLevelNotSet() {
+ public function testPaginationHeadingLevelNotSet(): void {
require_once $this->root . '/core/modules/views/views.theme.inc';
$variables = [
'tags' => [],
@@ -101,7 +101,7 @@ class ViewsPreprocessTest extends ViewsKernelTestBase {
*
* @covers ::template_preprocess_views_mini_pager
*/
- public function testPaginationHeadingLevelSet() {
+ public function testPaginationHeadingLevelSet(): void {
require_once $this->root . '/core/modules/views/views.theme.inc';
$variables = [
'tags' => [],
diff --git a/core/modules/views/tests/src/Kernel/ViewsTemplateTest.php b/core/modules/views/tests/src/Kernel/ViewsTemplateTest.php
index 610852c5fed..de3656686b3 100644
--- a/core/modules/views/tests/src/Kernel/ViewsTemplateTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewsTemplateTest.php
@@ -35,7 +35,7 @@ class ViewsTemplateTest extends ViewsKernelTestBase {
/**
* Tests render functionality.
*/
- public function testTemplate() {
+ public function testTemplate(): void {
// Make sure that the rendering just calls the preprocess function once.
$output = Views::getView('test_view_display_template')->preview();
$renderer = $this->container->get('renderer');
@@ -48,7 +48,7 @@ class ViewsTemplateTest extends ViewsKernelTestBase {
* @covers views_theme_suggestions_container_alter
* @throws \Exception
*/
- public function testThemeSuggestionsContainerAlter() {
+ public function testThemeSuggestionsContainerAlter(): void {
$build = [
'#type' => 'view',
'#name' => 'test_page_display',
diff --git a/core/modules/views/tests/src/Kernel/Wizard/WizardPluginBaseKernelTest.php b/core/modules/views/tests/src/Kernel/Wizard/WizardPluginBaseKernelTest.php
index 5cf35741728..8991c391542 100644
--- a/core/modules/views/tests/src/Kernel/Wizard/WizardPluginBaseKernelTest.php
+++ b/core/modules/views/tests/src/Kernel/Wizard/WizardPluginBaseKernelTest.php
@@ -47,7 +47,7 @@ class WizardPluginBaseKernelTest extends ViewsKernelTestBase {
*
* @see \Drupal\views\Plugin\views\wizard\WizardPluginBase
*/
- public function testCreateView() {
+ public function testCreateView(): void {
$form = [];
$form_state = new FormState();
$form = $this->wizard->buildForm($form, $form_state);
diff --git a/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php b/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
index 10ec7fc2951..129613f892b 100644
--- a/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
+++ b/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
@@ -126,7 +126,7 @@ class ViewAjaxControllerTest extends UnitTestCase {
/**
* Tests missing view_name and view_display_id.
*/
- public function testMissingViewName() {
+ public function testMissingViewName(): void {
$request = new Request();
$this->expectException(NotFoundHttpException::class);
$this->viewAjaxController->ajaxView($request);
@@ -135,7 +135,7 @@ class ViewAjaxControllerTest extends UnitTestCase {
/**
* Tests non-existent view with view_name and view_display_id.
*/
- public function testMissingView() {
+ public function testMissingView(): void {
$request = new Request();
$request->request->set('view_name', 'test_view');
$request->request->set('view_display_id', 'page_1');
@@ -152,7 +152,7 @@ class ViewAjaxControllerTest extends UnitTestCase {
/**
* Tests a view without having access to it.
*/
- public function testAccessDeniedView() {
+ public function testAccessDeniedView(): void {
$request = new Request();
$request->request->set('view_name', 'test_view');
$request->request->set('view_display_id', 'page_1');
@@ -185,7 +185,7 @@ class ViewAjaxControllerTest extends UnitTestCase {
/**
* Tests a valid view without arguments pagers etc.
*/
- public function testAjaxView() {
+ public function testAjaxView(): void {
$request = new Request();
$request->query->set('view_name', 'test_view');
$request->query->set('view_display_id', 'page_1');
@@ -222,7 +222,7 @@ class ViewAjaxControllerTest extends UnitTestCase {
/**
* Tests a valid view with a view_path with no slash.
*/
- public function testAjaxViewViewPathNoSlash() {
+ public function testAjaxViewViewPathNoSlash(): void {
$request = new Request();
$request->query->set('view_name', 'test_view');
$request->query->set('view_display_id', 'page_1');
@@ -251,7 +251,7 @@ class ViewAjaxControllerTest extends UnitTestCase {
/**
* Tests a valid view without ajax enabled.
*/
- public function testAjaxViewWithoutAjax() {
+ public function testAjaxViewWithoutAjax(): void {
$request = new Request();
$request->request->set('view_name', 'test_view');
$request->request->set('view_display_id', 'page_1');
@@ -269,7 +269,7 @@ class ViewAjaxControllerTest extends UnitTestCase {
/**
* Tests a valid view with arguments.
*/
- public function testAjaxViewWithArguments() {
+ public function testAjaxViewWithArguments(): void {
$request = new Request();
$request->request->set('view_name', 'test_view');
$request->request->set('view_display_id', 'page_1');
@@ -289,7 +289,7 @@ class ViewAjaxControllerTest extends UnitTestCase {
/**
* Tests a valid view with arguments.
*/
- public function testAjaxViewWithEmptyArguments() {
+ public function testAjaxViewWithEmptyArguments(): void {
$request = new Request();
$request->request->set('view_name', 'test_view');
$request->request->set('view_display_id', 'page_1');
@@ -310,7 +310,7 @@ class ViewAjaxControllerTest extends UnitTestCase {
/**
* Tests a valid view with arguments.
*/
- public function testAjaxViewWithHtmlEntityArguments() {
+ public function testAjaxViewWithHtmlEntityArguments(): void {
$request = new Request();
$request->request->set('view_name', 'test_view');
$request->request->set('view_display_id', 'page_1');
@@ -330,7 +330,7 @@ class ViewAjaxControllerTest extends UnitTestCase {
/**
* Tests a valid view with a pager.
*/
- public function testAjaxViewWithPager() {
+ public function testAjaxViewWithPager(): void {
$request = new Request();
$request->request->set('view_name', 'test_view');
$request->request->set('view_display_id', 'page_1');
diff --git a/core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php b/core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php
index 377a0c227f8..6d9801e6691 100644
--- a/core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php
+++ b/core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php
@@ -66,7 +66,7 @@ class RouteSubscriberTest extends UnitTestCase {
/**
* @covers ::routeRebuildFinished
*/
- public function testRouteRebuildFinished() {
+ public function testRouteRebuildFinished(): void {
[$display_1, $display_2] = $this->setupMocks();
$display_1->expects($this->once())
@@ -89,7 +89,7 @@ class RouteSubscriberTest extends UnitTestCase {
*
* @see \Drupal\views\EventSubscriber\RouteSubscriber::onAlterRoutes()
*/
- public function testOnAlterRoutes() {
+ public function testOnAlterRoutes(): void {
$collection = new RouteCollection();
// The first route will be overridden later.
$collection->add('test_route', new Route('test_route', ['_controller' => 'Drupal\Tests\Core\Controller\TestController']));
diff --git a/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php b/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php
index bbf8b8292ff..d0d63479d98 100644
--- a/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php
@@ -137,7 +137,7 @@ class ViewsBlockTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\block\ViewsBlock::build()
*/
- public function testBuild() {
+ public function testBuild(): void {
$output = $this->randomMachineName(100);
$build = ['view_build' => $output, '#view_id' => 'test_view', '#view_display_plugin_class' => '\Drupal\views\Plugin\views\display\Block', '#view_display_show_admin_links' => FALSE, '#view_display_plugin_id' => 'block', '#pre_rendered' => TRUE];
$this->executable->expects($this->once())
@@ -160,7 +160,7 @@ class ViewsBlockTest extends UnitTestCase {
*
* @covers ::build
*/
- public function testBuildEmpty() {
+ public function testBuildEmpty(): void {
$build = ['view_build' => [], '#view_id' => 'test_view', '#view_display_plugin_class' => '\Drupal\views\Plugin\views\display\Block', '#view_display_show_admin_links' => FALSE, '#view_display_plugin_id' => 'block', '#pre_rendered' => TRUE, '#cache' => ['contexts' => ['user']]];
$this->executable->expects($this->once())
->method('buildRenderable')
@@ -182,7 +182,7 @@ class ViewsBlockTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\block\ViewsBlock::build()
*/
- public function testBuildFailed() {
+ public function testBuildFailed(): void {
$output = FALSE;
$this->executable->expects($this->once())
->method('buildRenderable')
diff --git a/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php b/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
index e09ac60407e..f9b941374a2 100644
--- a/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php
@@ -64,7 +64,7 @@ class ViewsLocalTaskTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\Derivative\ViewsLocalTask::getDerivativeDefinitions()
*/
- public function testGetDerivativeDefinitionsWithoutHookMenuViews() {
+ public function testGetDerivativeDefinitionsWithoutHookMenuViews(): void {
$result = [];
$this->localTaskDerivative->setApplicableMenuViews($result);
@@ -75,7 +75,7 @@ class ViewsLocalTaskTest extends UnitTestCase {
/**
* Tests fetching the derivatives on a view with without a local task.
*/
- public function testGetDerivativeDefinitionsWithoutLocalTask() {
+ public function testGetDerivativeDefinitionsWithoutLocalTask(): void {
$executable = $this->getMockBuilder('Drupal\views\ViewExecutable')
->disableOriginalConstructor()
->getMock();
@@ -114,7 +114,7 @@ class ViewsLocalTaskTest extends UnitTestCase {
/**
* Tests fetching the derivatives on a view with a default local task.
*/
- public function testGetDerivativeDefinitionsWithLocalTask() {
+ public function testGetDerivativeDefinitionsWithLocalTask(): void {
$executable = $this->getMockBuilder('Drupal\views\ViewExecutable')
->disableOriginalConstructor()
->getMock();
@@ -171,7 +171,7 @@ class ViewsLocalTaskTest extends UnitTestCase {
/**
* Tests fetching the derivatives on a view which overrides an existing route.
*/
- public function testGetDerivativeDefinitionsWithOverrideRoute() {
+ public function testGetDerivativeDefinitionsWithOverrideRoute(): void {
$executable = $this->getMockBuilder('Drupal\views\ViewExecutable')
->disableOriginalConstructor()
->getMock();
@@ -220,7 +220,7 @@ class ViewsLocalTaskTest extends UnitTestCase {
/**
* Tests fetching the derivatives on a view with a default local task.
*/
- public function testGetDerivativeDefinitionsWithDefaultLocalTask() {
+ public function testGetDerivativeDefinitionsWithDefaultLocalTask(): void {
$executable = $this->getMockBuilder('Drupal\views\ViewExecutable')
->disableOriginalConstructor()
->getMock();
@@ -293,7 +293,7 @@ class ViewsLocalTaskTest extends UnitTestCase {
*
* The parent is defined by another module, not views.
*/
- public function testGetDerivativeDefinitionsWithExistingLocalTask() {
+ public function testGetDerivativeDefinitionsWithExistingLocalTask(): void {
$executable = $this->getMockBuilder('Drupal\views\ViewExecutable')
->disableOriginalConstructor()
->getMock();
diff --git a/core/modules/views/tests/src/Unit/Plugin/HandlerBaseTest.php b/core/modules/views/tests/src/Unit/Plugin/HandlerBaseTest.php
index 31f5c939983..a0b0b81fb57 100644
--- a/core/modules/views/tests/src/Unit/Plugin/HandlerBaseTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/HandlerBaseTest.php
@@ -29,7 +29,7 @@ class HandlerBaseTest extends UnitTestCase {
/**
* @covers ::getEntityType
*/
- public function testGetEntityTypeForFieldOnBaseTable() {
+ public function testGetEntityTypeForFieldOnBaseTable(): void {
$handler = new TestHandler([], 'test_handler', []);
$handler->init($this->executable, $this->display);
@@ -51,7 +51,7 @@ class HandlerBaseTest extends UnitTestCase {
/**
* @covers ::getEntityType
*/
- public function testGetEntityTypeForFieldWithRelationship() {
+ public function testGetEntityTypeForFieldWithRelationship(): void {
$handler = new TestHandler([], 'test_handler', []);
$options = ['relationship' => 'test_relationship'];
diff --git a/core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php b/core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php
index c7df3c222b3..48623829886 100644
--- a/core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php
@@ -157,7 +157,7 @@ class EntityTest extends UnitTestCase {
* @covers ::defineOptions
* @covers ::init
*/
- public function testRenderWithId() {
+ public function testRenderWithId(): void {
$this->setupEntityTypeManager();
$options = [
'target' => 1,
@@ -193,7 +193,7 @@ class EntityTest extends UnitTestCase {
*
* @dataProvider providerTestTokens
*/
- public function testRenderWithIdAndToken($token, $id) {
+ public function testRenderWithIdAndToken($token, $id): void {
$this->setupEntityTypeManager();
$options = [
'target' => $token,
@@ -232,7 +232,7 @@ class EntityTest extends UnitTestCase {
* @covers ::defineOptions
* @covers ::init
*/
- public function testRenderWithUuid() {
+ public function testRenderWithUuid(): void {
$this->setupEntityTypeManager();
$uuid = '1d52762e-b9d8-4177-908f-572d1a5845a4';
$options = [
@@ -265,7 +265,7 @@ class EntityTest extends UnitTestCase {
*
* @dataProvider providerTestTokens
*/
- public function testCalculateDependenciesWithPlaceholder($token, $id) {
+ public function testCalculateDependenciesWithPlaceholder($token, $id): void {
$this->setupEntityTypeManager();
$options = [
@@ -279,7 +279,7 @@ class EntityTest extends UnitTestCase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependenciesWithUuid() {
+ public function testCalculateDependenciesWithUuid(): void {
$this->setupEntityTypeManager();
$uuid = '1d52762e-b9d8-4177-908f-572d1a5845a4';
@@ -311,7 +311,7 @@ class EntityTest extends UnitTestCase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependenciesWithEntityId() {
+ public function testCalculateDependenciesWithEntityId(): void {
$this->setupEntityTypeManager();
$entity = $this->createMock('Drupal\Core\Entity\EntityInterface');
diff --git a/core/modules/views/tests/src/Unit/Plugin/area/MessagesTest.php b/core/modules/views/tests/src/Unit/Plugin/area/MessagesTest.php
index 1c81c820018..bacb6487640 100644
--- a/core/modules/views/tests/src/Unit/Plugin/area/MessagesTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/area/MessagesTest.php
@@ -42,7 +42,7 @@ class MessagesTest extends UnitTestCase {
* @covers ::defineOptions
* @covers ::render
*/
- public function testRender() {
+ public function testRender(): void {
// The handler is configured to show with empty views by default, so should
// appear.
$this->assertSame(['#type' => 'status_messages'], $this->messagesHandler->render());
diff --git a/core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php b/core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php
index 1ed0fddf035..224eba343a4 100644
--- a/core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/area/ResultTest.php
@@ -58,7 +58,7 @@ class ResultTest extends UnitTestCase {
/**
* Tests the query method.
*/
- public function testQuery() {
+ public function testQuery(): void {
$this->assertNull($this->view->get_total_rows);
// @total should set get_total_rows.
$this->resultHandler->options['content'] = '@total';
@@ -83,7 +83,7 @@ class ResultTest extends UnitTestCase {
*
* @dataProvider providerTestResultArea
*/
- public function testResultArea($content, $expected, $items_per_page = 0) {
+ public function testResultArea($content, $expected, $items_per_page = 0): void {
$this->setupViewPager($items_per_page);
$this->resultHandler->options['content'] = $content;
$this->assertEquals(['#markup' => $expected], $this->resultHandler->render());
diff --git a/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php b/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php
index b8d2a81725c..d97e70eaa3f 100644
--- a/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php
@@ -42,7 +42,7 @@ class ViewTest extends UnitTestCase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependencies() {
+ public function testCalculateDependencies(): void {
/** @var \Drupal\views\Entity\View $view_this */
/** @var \Drupal\views\Entity\View $view_other */
$view_this = $this->createMock('Drupal\views\ViewEntityInterface');
diff --git a/core/modules/views/tests/src/Unit/Plugin/argument_default/QueryParameterTest.php b/core/modules/views/tests/src/Unit/Plugin/argument_default/QueryParameterTest.php
index 796b4c7b03f..fe0d5f80292 100644
--- a/core/modules/views/tests/src/Unit/Plugin/argument_default/QueryParameterTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/argument_default/QueryParameterTest.php
@@ -20,7 +20,7 @@ class QueryParameterTest extends UnitTestCase {
* @covers ::getArgument
* @dataProvider providerGetArgument
*/
- public function testGetArgument($options, Request $request, $expected) {
+ public function testGetArgument($options, Request $request, $expected): void {
$view = $this->getMockBuilder('Drupal\views\ViewExecutable')
->disableOriginalConstructor()
->onlyMethods([])
diff --git a/core/modules/views/tests/src/Unit/Plugin/argument_default/RawTest.php b/core/modules/views/tests/src/Unit/Plugin/argument_default/RawTest.php
index 83a370ed868..33ad36dcf1c 100644
--- a/core/modules/views/tests/src/Unit/Plugin/argument_default/RawTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/argument_default/RawTest.php
@@ -22,7 +22,7 @@ class RawTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\argument_default\Raw::getArgument()
*/
- public function testGetArgument() {
+ public function testGetArgument(): void {
$view = $this->getMockBuilder('Drupal\views\ViewExecutable')
->disableOriginalConstructor()
->getMock();
diff --git a/core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php b/core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php
index e10477d4608..533e579e720 100644
--- a/core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php
@@ -123,7 +123,7 @@ class EntityTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\argument_validator\Entity::validateArgument()
*/
- public function testValidateArgumentNoAccess() {
+ public function testValidateArgumentNoAccess(): void {
$options = [];
$options['access'] = FALSE;
$options['bundles'] = [];
@@ -143,7 +143,7 @@ class EntityTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\argument_validator\Entity::validateArgument()
*/
- public function testValidateArgumentAccess() {
+ public function testValidateArgumentAccess(): void {
$options = [];
$options['access'] = TRUE;
$options['bundles'] = [];
@@ -171,7 +171,7 @@ class EntityTest extends UnitTestCase {
/**
* Tests the validate argument method with bundle checking.
*/
- public function testValidateArgumentBundle() {
+ public function testValidateArgumentBundle(): void {
$options = [];
$options['access'] = FALSE;
$options['bundles'] = ['test_bundle' => 1];
@@ -190,7 +190,7 @@ class EntityTest extends UnitTestCase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependencies() {
+ public function testCalculateDependencies(): void {
// Create an entity type manager, storage, entity type, and entity to mock the
// loading of entities providing bundles.
$entity_type_manager = $this->createMock(EntityTypeManagerInterface::class);
@@ -238,7 +238,7 @@ class EntityTest extends UnitTestCase {
/**
* Tests the validate argument method with multiple argument splitting.
*/
- public function testValidateArgumentMultiple() {
+ public function testValidateArgumentMultiple(): void {
$options = [];
$options['access'] = TRUE;
$options['bundles'] = [];
diff --git a/core/modules/views/tests/src/Unit/Plugin/display/PageTest.php b/core/modules/views/tests/src/Unit/Plugin/display/PageTest.php
index c801ec556fc..b2af4babff5 100644
--- a/core/modules/views/tests/src/Unit/Plugin/display/PageTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/display/PageTest.php
@@ -17,7 +17,7 @@ class PageTest extends UnitTestCase {
/**
* @covers ::buildBasicRenderable
*/
- public function testBuildBasicRenderable() {
+ public function testBuildBasicRenderable(): void {
$route = new Route('/test-view');
$route->setDefault('view_id', 'test_view');
$route->setOption('_view_display_plugin_id', 'page');
@@ -33,7 +33,7 @@ class PageTest extends UnitTestCase {
/**
* @covers ::buildBasicRenderable
*/
- public function testBuildBasicRenderableWithMissingRoute() {
+ public function testBuildBasicRenderableWithMissingRoute(): void {
$this->expectException(\BadFunctionCallException::class);
Page::buildBasicRenderable('test_view', 'page_1', []);
}
diff --git a/core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php b/core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php
index ae470115686..f6b12ea391e 100644
--- a/core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php
@@ -105,7 +105,7 @@ class PathPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\display\PathPluginBase::collectRoutes()
*/
- public function testCollectRoutes() {
+ public function testCollectRoutes(): void {
[$view] = $this->setupViewExecutableAccessPlugin();
$display = [];
@@ -133,7 +133,7 @@ class PathPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\display\PathPluginBase::collectRoutes()
*/
- public function testCollectRoutesWithDisplayReturnResponse() {
+ public function testCollectRoutesWithDisplayReturnResponse(): void {
[$view] = $this->setupViewExecutableAccessPlugin();
$display = [];
@@ -160,7 +160,7 @@ class PathPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\display\PathPluginBase::collectRoutes()
*/
- public function testCollectRoutesWithArguments() {
+ public function testCollectRoutesWithArguments(): void {
[$view] = $this->setupViewExecutableAccessPlugin();
$display = [];
@@ -188,7 +188,7 @@ class PathPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\display\PathPluginBase::collectRoutes()
*/
- public function testCollectRoutesWithArgumentsNotSpecifiedInPath() {
+ public function testCollectRoutesWithArgumentsNotSpecifiedInPath(): void {
[$view] = $this->setupViewExecutableAccessPlugin();
$display = [];
@@ -217,7 +217,7 @@ class PathPluginBaseTest extends UnitTestCase {
/**
* Tests the collect routes method with an alternative route name in the UI.
*/
- public function testCollectRoutesWithSpecialRouteName() {
+ public function testCollectRoutesWithSpecialRouteName(): void {
[$view] = $this->setupViewExecutableAccessPlugin();
$display = [];
@@ -243,7 +243,7 @@ class PathPluginBaseTest extends UnitTestCase {
/**
* Tests the alter route method.
*/
- public function testAlterRoute() {
+ public function testAlterRoute(): void {
$collection = new RouteCollection();
$collection->add('test_route', new Route('test_route', ['_controller' => 'Drupal\Tests\Core\Controller\TestController::content']));
$route_2 = new Route('test_route/example', ['_controller' => 'Drupal\Tests\Core\Controller\TestController::content']);
@@ -280,7 +280,7 @@ class PathPluginBaseTest extends UnitTestCase {
/**
* Tests the altering of a REST route.
*/
- public function testAlterPostRestRoute() {
+ public function testAlterPostRestRoute(): void {
$collection = new RouteCollection();
$route = new Route('test_route', ['_controller' => 'Drupal\Tests\Core\Controller\TestController::content']);
$route->setMethods(['POST']);
@@ -318,7 +318,7 @@ class PathPluginBaseTest extends UnitTestCase {
/**
* Tests the altering of a REST route.
*/
- public function testGetRestRoute() {
+ public function testGetRestRoute(): void {
$collection = new RouteCollection();
$route = new Route('test_route', ['_controller' => 'Drupal\Tests\Core\Controller\TestController::content']);
$route->setMethods(['GET']);
@@ -357,7 +357,7 @@ class PathPluginBaseTest extends UnitTestCase {
/**
* Tests the alter route method with preexisting title callback.
*/
- public function testAlterRouteWithAlterCallback() {
+ public function testAlterRouteWithAlterCallback(): void {
$collection = new RouteCollection();
$collection->add('test_route', new Route('test_route', ['_controller' => 'Drupal\Tests\Core\Controller\TestController::content', '_title_callback' => '\Drupal\Tests\views\Unit\Plugin\display\TestController::testTitle']));
$route_2 = new Route('test_route/example', ['_controller' => 'Drupal\Tests\Core\Controller\TestController::content']);
@@ -396,7 +396,7 @@ class PathPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\display\PathPluginBase::collectRoutes()
*/
- public function testCollectRoutesWithNamedParameters() {
+ public function testCollectRoutesWithNamedParameters(): void {
/** @var \Drupal\views\ViewExecutable|\PHPUnit\Framework\MockObject\MockObject $view */
[$view] = $this->setupViewExecutableAccessPlugin();
@@ -429,7 +429,7 @@ class PathPluginBaseTest extends UnitTestCase {
/**
* Tests altering routes with parameters in the overridden route.
*/
- public function testAlterRoutesWithParameters() {
+ public function testAlterRoutesWithParameters(): void {
$collection = new RouteCollection();
$collection->add('test_route', new Route('test_route/{parameter}', ['_controller' => 'Drupal\Tests\Core\Controller\TestController::content']));
@@ -466,7 +466,7 @@ class PathPluginBaseTest extends UnitTestCase {
/**
* Tests altering routes with parameters and upcasting information.
*/
- public function testAlterRoutesWithParametersAndUpcasting() {
+ public function testAlterRoutesWithParametersAndUpcasting(): void {
$collection = new RouteCollection();
$collection->add('test_route', new Route('test_route/{parameter}', ['_controller' => 'Drupal\Tests\Core\Controller\TestController::content'], [], ['parameters' => ['taxonomy_term' => 'entity:entity_test']]));
@@ -504,7 +504,7 @@ class PathPluginBaseTest extends UnitTestCase {
/**
* Tests altering routes with optional parameters in the overridden route.
*/
- public function testAlterRoutesWithOptionalParameters() {
+ public function testAlterRoutesWithOptionalParameters(): void {
$collection = new RouteCollection();
$collection->add('test_route', new Route('test_route/{parameter}', ['_controller' => 'Drupal\Tests\Core\Controller\TestController::content']));
@@ -539,7 +539,7 @@ class PathPluginBaseTest extends UnitTestCase {
/**
* Tests the getRouteName method.
*/
- public function testGetRouteName() {
+ public function testGetRouteName(): void {
[$view] = $this->setupViewExecutableAccessPlugin();
$display = [];
diff --git a/core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php b/core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php
index 63c61c30324..f3ed9a64f6b 100644
--- a/core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php
@@ -116,7 +116,7 @@ class CounterTest extends UnitTestCase {
*
* @dataProvider providerRowIndexes
*/
- public function testSimpleCounter($i) {
+ public function testSimpleCounter($i): void {
$counter_handler = new Counter([], 'counter', $this->definition);
$options = [];
$counter_handler->init($this->view, $this->display, $options);
@@ -138,7 +138,7 @@ class CounterTest extends UnitTestCase {
*
* @dataProvider providerRowIndexes
*/
- public function testCounterRandomStart($i) {
+ public function testCounterRandomStart($i): void {
// Setup a counter field with a random start.
$rand_start = rand(5, 10);
$counter_handler = new Counter([], 'counter', $this->definition);
@@ -164,7 +164,7 @@ class CounterTest extends UnitTestCase {
*
* @dataProvider providerRowIndexes
*/
- public function testCounterRandomPagerOffset($i) {
+ public function testCounterRandomPagerOffset($i): void {
// Setup a counter field with a pager with a random offset.
$offset = 3;
$this->pager->setOffset($offset);
@@ -193,7 +193,7 @@ class CounterTest extends UnitTestCase {
*
* @dataProvider providerRowIndexes
*/
- public function testCounterSecondPage($i) {
+ public function testCounterSecondPage($i): void {
$offset = 3;
// Setup a pager on the second page.
$this->pager->setOffset($offset);
diff --git a/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php b/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
index f1635f29a72..65c1475ce83 100644
--- a/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
@@ -211,7 +211,7 @@ class FieldPluginBaseTest extends UnitTestCase {
*
* @covers ::renderAsLink
*/
- public function testRenderAsLinkWithoutPath() {
+ public function testRenderAsLinkWithoutPath(): void {
$alter = [
'make_link' => TRUE,
];
@@ -237,7 +237,7 @@ class FieldPluginBaseTest extends UnitTestCase {
* @dataProvider providerTestRenderTrimmedWithMoreLinkAndPath
* @covers ::renderText
*/
- public function testRenderTrimmedWithMoreLinkAndPath($path, $url) {
+ public function testRenderTrimmedWithMoreLinkAndPath($path, $url): void {
$alter = [
'trim' => TRUE,
'max_length' => 7,
@@ -297,7 +297,7 @@ class FieldPluginBaseTest extends UnitTestCase {
*
* @covers ::renderText
*/
- public function testRenderNoResult() {
+ public function testRenderNoResult(): void {
$this->setupDisplayWithEmptyArgumentsAndFields();
$field = $this->setupTestField(['empty' => 'This <strong>should work</strong>.']);
$field->field_alias = 'key';
@@ -315,7 +315,7 @@ class FieldPluginBaseTest extends UnitTestCase {
* @dataProvider providerTestRenderAsLinkWithPathAndOptions
* @covers ::renderAsLink
*/
- public function testRenderAsLinkWithPathAndOptions($path, $alter, $final_html) {
+ public function testRenderAsLinkWithPathAndOptions($path, $alter, $final_html): void {
$alter += [
'make_link' => TRUE,
'path' => $path,
@@ -386,7 +386,7 @@ class FieldPluginBaseTest extends UnitTestCase {
* @dataProvider providerTestRenderAsLinkWithUrlAndOptions
* @covers ::renderAsLink
*/
- public function testRenderAsLinkWithUrlAndOptions(Url $url, $alter, Url $expected_url, $url_path, Url $expected_link_url, $final_html) {
+ public function testRenderAsLinkWithUrlAndOptions(Url $url, $alter, Url $expected_url, $url_path, Url $expected_link_url, $final_html): void {
$alter += [
'make_link' => TRUE,
'url' => $url,
@@ -526,7 +526,7 @@ class FieldPluginBaseTest extends UnitTestCase {
* @dataProvider providerTestRenderAsLinkWithPathAndTokens
* @covers ::renderAsLink
*/
- public function testRenderAsLinkWithPathAndTokens($path, $tokens, $link_html) {
+ public function testRenderAsLinkWithPathAndTokens($path, $tokens, $link_html): void {
$alter = [
'make_link' => TRUE,
'path' => $path,
@@ -586,7 +586,7 @@ class FieldPluginBaseTest extends UnitTestCase {
* @dataProvider providerTestRenderAsExternalLinkWithPathAndTokens
* @covers ::renderAsLink
*/
- public function testRenderAsExternalLinkWithPathAndTokens($path, $tokens, $link_html, $context) {
+ public function testRenderAsExternalLinkWithPathAndTokens($path, $tokens, $link_html, $context): void {
$alter = [
'make_link' => TRUE,
'path' => $path,
@@ -652,7 +652,7 @@ class FieldPluginBaseTest extends UnitTestCase {
/**
* @covers ::getRenderTokens
*/
- public function testGetRenderTokensWithoutFieldsAndArguments() {
+ public function testGetRenderTokensWithoutFieldsAndArguments(): void {
$field = $this->setupTestField();
$this->display->expects($this->any())
@@ -668,7 +668,7 @@ class FieldPluginBaseTest extends UnitTestCase {
/**
* @covers ::getRenderTokens
*/
- public function testGetRenderTokensWithoutArguments() {
+ public function testGetRenderTokensWithoutArguments(): void {
$field = $this->setupTestField(['id' => 'id']);
$field->last_render = 'last rendered output';
@@ -685,7 +685,7 @@ class FieldPluginBaseTest extends UnitTestCase {
/**
* @covers ::getRenderTokens
*/
- public function testGetRenderTokensWithArguments() {
+ public function testGetRenderTokensWithArguments(): void {
$field = $this->setupTestField(['id' => 'id']);
$field->view->args = ['argument value'];
$field->view->build_info['substitutions']['{{ arguments.name }}'] = 'argument value';
@@ -817,7 +817,7 @@ class FieldPluginBaseTest extends UnitTestCase {
* @covers ::elementLabelClasses
* @covers ::elementWrapperClasses
*/
- public function testElementClassesWithTokens() {
+ public function testElementClassesWithTokens(): void {
$functions = [
'elementClasses' => 'element_class',
'elementLabelClasses' => 'element_label_class',
diff --git a/core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php b/core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
index a6eeea7bdfd..c9c04a97d89 100644
--- a/core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php
@@ -125,7 +125,7 @@ class FieldTest extends UnitTestCase {
/**
* @covers ::__construct
*/
- public function testConstruct() {
+ public function testConstruct(): void {
$definition = [
'entity_type' => 'test_entity',
// Just provide 'entity field' as definition. This is how EntityViewsData
@@ -140,7 +140,7 @@ class FieldTest extends UnitTestCase {
/**
* @covers ::defineOptions
*/
- public function testDefineOptionsWithNoOptions() {
+ public function testDefineOptionsWithNoOptions(): void {
$definition = [
'entity_type' => 'test_entity',
'field_name' => 'title',
@@ -167,7 +167,7 @@ class FieldTest extends UnitTestCase {
/**
* @covers ::defineOptions
*/
- public function testDefineOptionsWithDefaultFormatterOnFieldDefinition() {
+ public function testDefineOptionsWithDefaultFormatterOnFieldDefinition(): void {
$definition = [
'entity_type' => 'test_entity',
'field_name' => 'title',
@@ -195,7 +195,7 @@ class FieldTest extends UnitTestCase {
/**
* @covers ::defineOptions
*/
- public function testDefineOptionsWithDefaultFormatterOnFieldType() {
+ public function testDefineOptionsWithDefaultFormatterOnFieldType(): void {
$definition = [
'entity_type' => 'test_entity',
'field_name' => 'title',
@@ -222,7 +222,7 @@ class FieldTest extends UnitTestCase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependenciesWithBaseField() {
+ public function testCalculateDependenciesWithBaseField(): void {
$definition = [
'entity_type' => 'test_entity',
'field_name' => 'title',
@@ -244,7 +244,7 @@ class FieldTest extends UnitTestCase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependenciesWithConfiguredField() {
+ public function testCalculateDependenciesWithConfiguredField(): void {
$definition = [
'entity_type' => 'test_entity',
'field_name' => 'body',
@@ -270,7 +270,7 @@ class FieldTest extends UnitTestCase {
/**
* @covers ::access
*/
- public function testAccess() {
+ public function testAccess(): void {
$definition = [
'entity_type' => 'test_entity',
'field_name' => 'title',
@@ -321,7 +321,7 @@ class FieldTest extends UnitTestCase {
* @param string $order
* The sort order.
*/
- public function testClickSortWithOutConfiguredColumn($order) {
+ public function testClickSortWithOutConfiguredColumn($order): void {
$definition = [
'entity_type' => 'test_entity',
'field_name' => 'title',
@@ -343,7 +343,7 @@ class FieldTest extends UnitTestCase {
*
* @covers ::clickSort
*/
- public function testClickSortWithBaseField($order) {
+ public function testClickSortWithBaseField($order): void {
$definition = [
'entity_type' => 'test_entity',
'field_name' => 'title',
@@ -403,7 +403,7 @@ class FieldTest extends UnitTestCase {
*
* @covers ::clickSort
*/
- public function testClickSortWithConfiguredField($order) {
+ public function testClickSortWithConfiguredField($order): void {
$definition = [
'entity_type' => 'test_entity',
'field_name' => 'body',
@@ -458,7 +458,7 @@ class FieldTest extends UnitTestCase {
/**
* @covers ::query
*/
- public function testQueryWithGroupByForBaseField() {
+ public function testQueryWithGroupByForBaseField(): void {
$definition = [
'entity_type' => 'test_entity',
'field_name' => 'title',
@@ -520,7 +520,7 @@ class FieldTest extends UnitTestCase {
/**
* @covers ::query
*/
- public function testQueryWithGroupByForConfigField() {
+ public function testQueryWithGroupByForConfigField(): void {
$definition = [
'entity_type' => 'test_entity',
'field_name' => 'body',
@@ -584,7 +584,7 @@ class FieldTest extends UnitTestCase {
*
* @dataProvider providerTestPrepareItemsByDelta
*/
- public function testPrepareItemsByDelta(array $options, array $expected_values) {
+ public function testPrepareItemsByDelta(array $options, array $expected_values): void {
$definition = [
'entity_type' => 'test_entity',
'field_name' => 'integer',
diff --git a/core/modules/views/tests/src/Unit/Plugin/filter/FilterPluginBaseTest.php b/core/modules/views/tests/src/Unit/Plugin/filter/FilterPluginBaseTest.php
index 6ef76466f48..0c9990c8131 100644
--- a/core/modules/views/tests/src/Unit/Plugin/filter/FilterPluginBaseTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/filter/FilterPluginBaseTest.php
@@ -18,7 +18,7 @@ class FilterPluginBaseTest extends UnitTestCase {
*
* @dataProvider acceptExposedInputProvider
*/
- public function testAcceptExposedInput(bool $expected_result, array $options, array $input) {
+ public function testAcceptExposedInput(bool $expected_result, array $options, array $input): void {
$definition = [
'title' => 'Accept exposed input Test',
'group' => 'Test',
diff --git a/core/modules/views/tests/src/Unit/Plugin/filter/InOperatorTest.php b/core/modules/views/tests/src/Unit/Plugin/filter/InOperatorTest.php
index 7a208c3b0a9..dd0fea7dd87 100644
--- a/core/modules/views/tests/src/Unit/Plugin/filter/InOperatorTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/filter/InOperatorTest.php
@@ -16,7 +16,7 @@ class InOperatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidate() {
+ public function testValidate(): void {
$definition = [
'title' => 'Is InOperator Test',
'group' => 'Test',
diff --git a/core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php b/core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php
index e8906f874fb..6c2cb0ca563 100644
--- a/core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/pager/PagerPluginBaseTest.php
@@ -53,7 +53,7 @@ class PagerPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\PagerPluginBase::getItemsPerPage()
*/
- public function testGetItemsPerPage() {
+ public function testGetItemsPerPage(): void {
$this->assertEquals(5, $this->pager->getItemsPerPage());
}
@@ -62,7 +62,7 @@ class PagerPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\PagerPluginBase::setItemsPerPage()
*/
- public function testSetItemsPerPage() {
+ public function testSetItemsPerPage(): void {
$this->pager->setItemsPerPage(6);
$this->assertEquals(6, $this->pager->getItemsPerPage());
}
@@ -72,7 +72,7 @@ class PagerPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\PagerPluginBase::getOffset()
*/
- public function testGetOffset() {
+ public function testGetOffset(): void {
$this->assertEquals(1, $this->pager->getOffset());
}
@@ -81,7 +81,7 @@ class PagerPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\PagerPluginBase::setOffset()
*/
- public function testSetOffset() {
+ public function testSetOffset(): void {
$this->pager->setOffset(2);
$this->assertEquals(2, $this->pager->getOffset());
}
@@ -91,7 +91,7 @@ class PagerPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\PagerPluginBase::getCurrentPage()
*/
- public function testGetCurrentPage() {
+ public function testGetCurrentPage(): void {
$this->assertEquals(1, $this->pager->getCurrentPage());
}
@@ -100,7 +100,7 @@ class PagerPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\PagerPluginBase::setCurrentPage()
*/
- public function testSetCurrentPage() {
+ public function testSetCurrentPage(): void {
$this->pager->setCurrentPage(2);
$this->assertEquals(2, $this->pager->getCurrentPage());
@@ -117,7 +117,7 @@ class PagerPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\PagerPluginBase::getTotalItems()
*/
- public function testGetTotalItems() {
+ public function testGetTotalItems(): void {
// Should return 0 by default.
$this->assertEquals(0, $this->pager->getTotalItems());
@@ -130,7 +130,7 @@ class PagerPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\PagerPluginBase::getPagerId()
*/
- public function testGetPagerId() {
+ public function testGetPagerId(): void {
// Should return 0 if 'id' is not set.
$this->assertEquals(0, $this->pager->getPagerId());
@@ -144,7 +144,7 @@ class PagerPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\PagerPluginBase::usePager()
*/
- public function testUsePager() {
+ public function testUsePager(): void {
$this->assertTrue($this->pager->usePager());
}
@@ -153,7 +153,7 @@ class PagerPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\PagerPluginBase::useCountQuery()
*/
- public function testUseCountQuery() {
+ public function testUseCountQuery(): void {
$this->assertTrue($this->pager->useCountQuery());
}
@@ -162,7 +162,7 @@ class PagerPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\PagerPluginBase::usedExposed()
*/
- public function testUsesExposed() {
+ public function testUsesExposed(): void {
$this->assertFalse($this->pager->usesExposed());
}
@@ -173,7 +173,7 @@ class PagerPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\PagerPluginBase::hasMoreRecords()
*/
- public function testHasMoreRecords($items_per_page, $total_items, $current_page, $has_more_records) {
+ public function testHasMoreRecords($items_per_page, $total_items, $current_page, $has_more_records): void {
$this->pager->setItemsPerPage($items_per_page);
$this->pager->total_items = $total_items;
$this->pager->setCurrentPage($current_page);
@@ -207,7 +207,7 @@ class PagerPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\PagerPluginBase::executeCountQuery()
*/
- public function testExecuteCountQueryWithoutOffset() {
+ public function testExecuteCountQueryWithoutOffset(): void {
$statement = $this->createMock('\Drupal\Tests\views\Unit\Plugin\pager\TestStatementInterface');
$statement->expects($this->once())
@@ -231,7 +231,7 @@ class PagerPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\PagerPluginBase::executeCountQuery()
*/
- public function testExecuteCountQueryWithOffset() {
+ public function testExecuteCountQueryWithOffset(): void {
$statement = $this->createMock('\Drupal\Tests\views\Unit\Plugin\pager\TestStatementInterface');
$statement->expects($this->once())
@@ -255,7 +255,7 @@ class PagerPluginBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\PagerPluginBase::executeCountQuery()
*/
- public function testExecuteCountQueryWithOffsetLargerThanResult() {
+ public function testExecuteCountQueryWithOffsetLargerThanResult(): void {
$statement = $this->createMock(TestStatementInterface::class);
$statement->expects($this->once())
diff --git a/core/modules/views/tests/src/Unit/Plugin/pager/SqlBaseTest.php b/core/modules/views/tests/src/Unit/Plugin/pager/SqlBaseTest.php
index a56d8e409d1..2a48cb4a81e 100644
--- a/core/modules/views/tests/src/Unit/Plugin/pager/SqlBaseTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/pager/SqlBaseTest.php
@@ -68,7 +68,7 @@ class SqlBaseTest extends UnitTestCase {
*
* @see \Drupal\views\Plugin\views\pager\SqlBase::query()
*/
- public function testQuery() {
+ public function testQuery(): void {
$request = new Request([
'items_per_page' => 'All',
]);
diff --git a/core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php b/core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php
index a1878ee4451..6daac05a351 100644
--- a/core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/query/SqlTest.php
@@ -30,7 +30,7 @@ class SqlTest extends UnitTestCase {
* @covers ::getCacheTags
* @covers ::getAllEntities
*/
- public function testGetCacheTags() {
+ public function testGetCacheTags(): void {
$view = $this->prophesize('Drupal\views\ViewExecutable')->reveal();
$entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class);
$date_sql = $this->prophesize(DateSqlInterface::class);
@@ -78,7 +78,7 @@ class SqlTest extends UnitTestCase {
* @covers ::getCacheTags
* @covers ::getAllEntities
*/
- public function testGetCacheMaxAge() {
+ public function testGetCacheMaxAge(): void {
$view = $this->prophesize('Drupal\views\ViewExecutable')->reveal();
$entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class);
$date_sql = $this->prophesize(DateSqlInterface::class);
@@ -248,7 +248,7 @@ class SqlTest extends UnitTestCase {
* @covers ::loadEntities
* @covers ::assignEntitiesToResult
*/
- public function testLoadEntitiesWithEmptyResult() {
+ public function testLoadEntitiesWithEmptyResult(): void {
$view = $this->prophesize('Drupal\views\ViewExecutable')->reveal();
$view_entity = $this->prophesize(ViewEntityInterface::class);
$view_entity->get('base_table')->willReturn('entity_first');
@@ -272,7 +272,7 @@ class SqlTest extends UnitTestCase {
* @covers ::loadEntities
* @covers ::assignEntitiesToResult
*/
- public function testLoadEntitiesWithNoRelationshipAndNoRevision() {
+ public function testLoadEntitiesWithNoRelationshipAndNoRevision(): void {
$view = $this->prophesize('Drupal\views\ViewExecutable')->reveal();
$view_entity = $this->prophesize(ViewEntityInterface::class);
$view_entity->get('base_table')->willReturn('entity_first');
@@ -330,7 +330,7 @@ class SqlTest extends UnitTestCase {
* @covers ::loadEntities
* @covers ::assignEntitiesToResult
*/
- public function testLoadEntitiesWithRelationship() {
+ public function testLoadEntitiesWithRelationship(): void {
// We don't use prophecy, because prophecy enforces methods.
$view = $this->getMockBuilder(ViewExecutable::class)->disableOriginalConstructor()->getMock();
$this->setupViewWithRelationships($view);
@@ -390,7 +390,7 @@ class SqlTest extends UnitTestCase {
* @covers ::loadEntities
* @covers ::assignEntitiesToResult
*/
- public function testLoadEntitiesWithNonEntityRelationship() {
+ public function testLoadEntitiesWithNonEntityRelationship(): void {
// We don't use prophecy, because prophecy enforces methods.
$view = $this->getMockBuilder(ViewExecutable::class)->disableOriginalConstructor()->getMock();
$this->setupViewWithRelationships($view, 'entity_first_field_data');
@@ -441,7 +441,7 @@ class SqlTest extends UnitTestCase {
* @covers ::loadEntities
* @covers ::assignEntitiesToResult
*/
- public function testLoadEntitiesWithRevision() {
+ public function testLoadEntitiesWithRevision(): void {
// We don't use prophecy, because prophecy enforces methods.
$view = $this->getMockBuilder(ViewExecutable::class)
->disableOriginalConstructor()
@@ -488,7 +488,7 @@ class SqlTest extends UnitTestCase {
* @covers ::loadEntities
* @covers ::assignEntitiesToResult
*/
- public function testLoadEntitiesWithRevisionOfSameEntityType() {
+ public function testLoadEntitiesWithRevisionOfSameEntityType(): void {
// We don't use prophecy, because prophecy enforces methods.
$view = $this->getMockBuilder(ViewExecutable::class)
->disableOriginalConstructor()
@@ -550,7 +550,7 @@ class SqlTest extends UnitTestCase {
* @covers ::loadEntities
* @covers ::assignEntitiesToResult
*/
- public function testLoadEntitiesWithRelationshipAndRevision() {
+ public function testLoadEntitiesWithRelationshipAndRevision(): void {
// We don't use prophecy, because prophecy enforces methods.
$view = $this->getMockBuilder(ViewExecutable::class)->disableOriginalConstructor()->getMock();
$this->setupViewWithRelationships($view);
diff --git a/core/modules/views/tests/src/Unit/Plugin/views/display/BlockTest.php b/core/modules/views/tests/src/Unit/Plugin/views/display/BlockTest.php
index 29c3851b2ce..0d72bf27b4a 100644
--- a/core/modules/views/tests/src/Unit/Plugin/views/display/BlockTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/views/display/BlockTest.php
@@ -63,7 +63,7 @@ class BlockTest extends UnitTestCase {
/**
* Tests the build method with no overriding.
*/
- public function testBuildNoOverride() {
+ public function testBuildNoOverride(): void {
$this->executable->expects($this->never())
->method('setItemsPerPage');
@@ -77,7 +77,7 @@ class BlockTest extends UnitTestCase {
/**
* Tests the build method with overriding items per page.
*/
- public function testBuildOverride() {
+ public function testBuildOverride(): void {
$this->executable->expects($this->once())
->method('setItemsPerPage')
->with(5);
diff --git a/core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php b/core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php
index 4e6dad45978..a1c2a78a99e 100644
--- a/core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php
@@ -85,14 +85,14 @@ class EntityOperationsUnitTest extends UnitTestCase {
/**
* @covers ::usesGroupBy
*/
- public function testUsesGroupBy() {
+ public function testUsesGroupBy(): void {
$this->assertFalse($this->plugin->usesGroupBy());
}
/**
* @covers ::defineOptions
*/
- public function testDefineOptions() {
+ public function testDefineOptions(): void {
$options = $this->plugin->defineOptions();
$this->assertIsArray($options);
$this->assertArrayHasKey('destination', $options);
@@ -101,7 +101,7 @@ class EntityOperationsUnitTest extends UnitTestCase {
/**
* @covers ::render
*/
- public function testRenderWithDestination() {
+ public function testRenderWithDestination(): void {
$entity_type_id = $this->randomMachineName();
$entity = $this->getMockBuilder('\Drupal\user\Entity\Role')
->disableOriginalConstructor()
@@ -143,7 +143,7 @@ class EntityOperationsUnitTest extends UnitTestCase {
/**
* @covers ::render
*/
- public function testRenderWithoutDestination() {
+ public function testRenderWithoutDestination(): void {
$entity_type_id = $this->randomMachineName();
$entity = $this->getMockBuilder('\Drupal\user\Entity\Role')
->disableOriginalConstructor()
@@ -184,7 +184,7 @@ class EntityOperationsUnitTest extends UnitTestCase {
/**
* @covers ::render
*/
- public function testRenderWithoutEntity() {
+ public function testRenderWithoutEntity(): void {
$this->setUpMockLoggerWithMissingEntity();
$entity = NULL;
diff --git a/core/modules/views/tests/src/Unit/Plugin/views/query/MysqlDateSqlTest.php b/core/modules/views/tests/src/Unit/Plugin/views/query/MysqlDateSqlTest.php
index c797edbd208..91a4453fbff 100644
--- a/core/modules/views/tests/src/Unit/Plugin/views/query/MysqlDateSqlTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/views/query/MysqlDateSqlTest.php
@@ -37,7 +37,7 @@ class MysqlDateSqlTest extends UnitTestCase {
*
* @covers ::getDateField
*/
- public function testGetDateField() {
+ public function testGetDateField(): void {
$date_sql = new MysqlDateSql($this->database);
$expected = 'foo.field';
@@ -54,7 +54,7 @@ class MysqlDateSqlTest extends UnitTestCase {
*
* @dataProvider providerTestGetDateFormat
*/
- public function testGetDateFormat($field, $format, $expected_format) {
+ public function testGetDateFormat($field, $format, $expected_format): void {
$date_sql = new MysqlDateSql($this->database);
$this->assertEquals("DATE_FORMAT($field, '$expected_format')", $date_sql->getDateFormat($field, $format));
@@ -76,7 +76,7 @@ class MysqlDateSqlTest extends UnitTestCase {
*
* @covers ::setFieldTimezoneOffset
*/
- public function testSetFieldTimezoneOffset() {
+ public function testSetFieldTimezoneOffset(): void {
$date_sql = new MysqlDateSql($this->database);
$field = 'foobar.field';
@@ -89,7 +89,7 @@ class MysqlDateSqlTest extends UnitTestCase {
*
* @covers ::setTimezoneOffset
*/
- public function testSetTimezoneOffset() {
+ public function testSetTimezoneOffset(): void {
$database = $this->prophesize(Connection::class);
$database->query("SET @@session.time_zone = '42'")->shouldBeCalledTimes(1);
$date_sql = new MysqlDateSql($database->reveal());
diff --git a/core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php b/core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php
index 835882c3692..89e1de317b1 100644
--- a/core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php
@@ -37,7 +37,7 @@ class PostgresqlDateSqlTest extends UnitTestCase {
*
* @covers ::getDateField
*/
- public function testGetDateField() {
+ public function testGetDateField(): void {
$date_sql = new PostgresqlDateSql($this->database);
$expected = "TO_TIMESTAMP(foo.field, 'YYYY-MM-DD\"T\"HH24:MI:SS')";
@@ -54,7 +54,7 @@ class PostgresqlDateSqlTest extends UnitTestCase {
*
* @dataProvider providerTestGetDateFormat
*/
- public function testGetDateFormat($field, $format, $expected_format) {
+ public function testGetDateFormat($field, $format, $expected_format): void {
$date_sql = new PostgresqlDateSql($this->database);
$this->assertEquals("TO_CHAR($field, '$expected_format')", $date_sql->getDateFormat($field, $format));
@@ -76,7 +76,7 @@ class PostgresqlDateSqlTest extends UnitTestCase {
*
* @covers ::setFieldTimezoneOffset
*/
- public function testSetFieldTimezoneOffset() {
+ public function testSetFieldTimezoneOffset(): void {
$date_sql = new PostgresqlDateSql($this->database);
$field = 'foobar.field';
@@ -89,7 +89,7 @@ class PostgresqlDateSqlTest extends UnitTestCase {
*
* @covers ::setTimezoneOffset
*/
- public function testSetTimezoneOffset() {
+ public function testSetTimezoneOffset(): void {
$database = $this->prophesize(Connection::class);
$database->query("SET TIME ZONE INTERVAL '42' HOUR TO MINUTE")->shouldBeCalledTimes(1);
$date_sql = new PostgresqlDateSql($database->reveal());
diff --git a/core/modules/views/tests/src/Unit/Plugin/views/query/SqliteDateSqlTest.php b/core/modules/views/tests/src/Unit/Plugin/views/query/SqliteDateSqlTest.php
index 82fe4d5e0a4..d66c4c68a1a 100644
--- a/core/modules/views/tests/src/Unit/Plugin/views/query/SqliteDateSqlTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/views/query/SqliteDateSqlTest.php
@@ -39,7 +39,7 @@ class SqliteDateSqlTest extends UnitTestCase {
*
* @covers ::getDateField
*/
- public function testGetDateField() {
+ public function testGetDateField(): void {
$date_sql = new SqliteDateSql($this->database);
$expected = "strftime('%s', foo.field)";
@@ -56,7 +56,7 @@ class SqliteDateSqlTest extends UnitTestCase {
*
* @dataProvider providerTestGetDateFormat
*/
- public function testGetDateFormat($field, $format, $expected) {
+ public function testGetDateFormat($field, $format, $expected): void {
$date_sql = new SqliteDateSql($this->database);
$this->assertEquals($expected, $date_sql->getDateFormat($field, $format));
@@ -79,7 +79,7 @@ class SqliteDateSqlTest extends UnitTestCase {
*
* @covers ::setFieldTimezoneOffset
*/
- public function testSetFieldTimezoneOffset() {
+ public function testSetFieldTimezoneOffset(): void {
$date_sql = new SqliteDateSql($this->database);
$field = 'foobar.field';
@@ -92,7 +92,7 @@ class SqliteDateSqlTest extends UnitTestCase {
*
* @covers ::setTimezoneOffset
*/
- public function testSetTimezoneOffset() {
+ public function testSetTimezoneOffset(): void {
$database = $this->prophesize(Connection::class);
$database->query()->shouldNotBeCalled();
$date_sql = new SqliteDateSql($database->reveal());
diff --git a/core/modules/views/tests/src/Unit/PluginBaseTest.php b/core/modules/views/tests/src/Unit/PluginBaseTest.php
index a7e4a22017a..57fa28d4810 100644
--- a/core/modules/views/tests/src/Unit/PluginBaseTest.php
+++ b/core/modules/views/tests/src/Unit/PluginBaseTest.php
@@ -46,7 +46,7 @@ class PluginBaseTest extends UnitTestCase {
* @dataProvider providerTestUnpackOptions
* @covers ::unpackOptions
*/
- public function testUnpackOptions($storage, $options, $definition, $expected, $all = FALSE) {
+ public function testUnpackOptions($storage, $options, $definition, $expected, $all = FALSE): void {
$this->testHelperPlugin->unpackOptions($storage, $options, $definition, $all);
$this->assertEquals($storage, $expected);
}
@@ -64,7 +64,7 @@ class PluginBaseTest extends UnitTestCase {
* @dataProvider providerTestSetOptionDefault
* @covers ::setOptionDefaults
*/
- public function testSetOptionDefault($storage, $definition, $expected) {
+ public function testSetOptionDefault($storage, $definition, $expected): void {
$this->testHelperPlugin->testSetOptionDefaults($storage, $definition);
$this->assertEquals($storage, $expected);
}
@@ -283,7 +283,7 @@ class PluginBaseTest extends UnitTestCase {
* @dataProvider providerTestFilterByDefinedOptions
* @covers ::filterByDefinedOptions
*/
- public function testFilterByDefinedOptions($storage, $options, $expected_storage) {
+ public function testFilterByDefinedOptions($storage, $options, $expected_storage): void {
$this->testHelperPlugin->setDefinedOptions($options);
$this->testHelperPlugin->filterByDefinedOptions($storage);
$this->assertEquals($expected_storage, $storage);
diff --git a/core/modules/views/tests/src/Unit/PluginTypeListTest.php b/core/modules/views/tests/src/Unit/PluginTypeListTest.php
index 228b1052c7a..763cd5cf248 100644
--- a/core/modules/views/tests/src/Unit/PluginTypeListTest.php
+++ b/core/modules/views/tests/src/Unit/PluginTypeListTest.php
@@ -17,7 +17,7 @@ class PluginTypeListTest extends UnitTestCase {
/**
* Tests the plugins list is correct.
*/
- public function testPluginList() {
+ public function testPluginList(): void {
$plugin_list = [
'access',
'area',
diff --git a/core/modules/views/tests/src/Unit/Routing/ViewPageControllerTest.php b/core/modules/views/tests/src/Unit/Routing/ViewPageControllerTest.php
index 81a00391548..c299d711b04 100644
--- a/core/modules/views/tests/src/Unit/Routing/ViewPageControllerTest.php
+++ b/core/modules/views/tests/src/Unit/Routing/ViewPageControllerTest.php
@@ -49,7 +49,7 @@ class ViewPageControllerTest extends UnitTestCase {
/**
* Tests the page controller.
*/
- public function testPageController() {
+ public function testPageController(): void {
$build = [
'#type' => 'view',
'#name' => 'test_page_view',
@@ -78,7 +78,7 @@ class ViewPageControllerTest extends UnitTestCase {
/**
* Tests the page controller with arguments on a non overridden page view.
*/
- public function testHandleWithArgumentsWithoutOverridden() {
+ public function testHandleWithArgumentsWithoutOverridden(): void {
$request = new Request();
$request->attributes->set('view_id', 'test_page_view');
$request->attributes->set('display_id', 'page_1');
@@ -112,7 +112,7 @@ class ViewPageControllerTest extends UnitTestCase {
*
* Note: This test does not care about upcasting for now.
*/
- public function testHandleWithArgumentsOnOverriddenRoute() {
+ public function testHandleWithArgumentsOnOverriddenRoute(): void {
$request = new Request();
$request->attributes->set('view_id', 'test_page_view');
$request->attributes->set('display_id', 'page_1');
@@ -149,7 +149,7 @@ class ViewPageControllerTest extends UnitTestCase {
* This test care about upcasted values and ensures that the raw variables
* are pulled in.
*/
- public function testHandleWithArgumentsOnOverriddenRouteWithUpcasting() {
+ public function testHandleWithArgumentsOnOverriddenRouteWithUpcasting(): void {
$request = new Request();
$request->attributes->set('view_id', 'test_page_view');
$request->attributes->set('display_id', 'page_1');
diff --git a/core/modules/views/tests/src/Unit/ViewExecutableFactoryTest.php b/core/modules/views/tests/src/Unit/ViewExecutableFactoryTest.php
index 8e90932f2e0..8679eb4dd53 100644
--- a/core/modules/views/tests/src/Unit/ViewExecutableFactoryTest.php
+++ b/core/modules/views/tests/src/Unit/ViewExecutableFactoryTest.php
@@ -88,7 +88,7 @@ class ViewExecutableFactoryTest extends UnitTestCase {
*
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
$request_1 = new Request();
$request_2 = new Request();
diff --git a/core/modules/views/tests/src/Unit/ViewExecutableTest.php b/core/modules/views/tests/src/Unit/ViewExecutableTest.php
index 105480d5513..c971c6450c4 100644
--- a/core/modules/views/tests/src/Unit/ViewExecutableTest.php
+++ b/core/modules/views/tests/src/Unit/ViewExecutableTest.php
@@ -176,7 +176,7 @@ class ViewExecutableTest extends UnitTestCase {
/**
* @covers ::getUrl
*/
- public function testGetUrlWithOverriddenUrl() {
+ public function testGetUrlWithOverriddenUrl(): void {
$url = Url::fromRoute('example');
$this->executable->override_url = $url;
@@ -186,7 +186,7 @@ class ViewExecutableTest extends UnitTestCase {
/**
* @covers ::getUrl
*/
- public function testGetUrlWithPathNoPlaceholders() {
+ public function testGetUrlWithPathNoPlaceholders(): void {
$this->displayHandler->expects($this->any())
->method('getRoutedDisplay')
->willReturn($this->displayHandler);
@@ -206,7 +206,7 @@ class ViewExecutableTest extends UnitTestCase {
/**
* @covers ::getUrl
*/
- public function testGetUrlWithoutRouterDisplay() {
+ public function testGetUrlWithoutRouterDisplay(): void {
$this->displayHandler = $this->createMock('Drupal\views\Plugin\views\display\DisplayPluginInterface');
$this->displayHandlers->expects($this->any())
->method('get')
@@ -220,7 +220,7 @@ class ViewExecutableTest extends UnitTestCase {
/**
* @covers ::getUrl
*/
- public function testGetUrlWithPlaceholdersAndArgs() {
+ public function testGetUrlWithPlaceholdersAndArgs(): void {
$this->displayHandler->expects($this->any())
->method('getRoutedDisplay')
->willReturn($this->displayHandler);
@@ -246,7 +246,7 @@ class ViewExecutableTest extends UnitTestCase {
/**
* @covers ::getUrl
*/
- public function testGetUrlWithPlaceholdersAndWithoutArgs() {
+ public function testGetUrlWithPlaceholdersAndWithoutArgs(): void {
$this->displayHandler->expects($this->any())
->method('getRoutedDisplay')
->willReturn($this->displayHandler);
@@ -272,7 +272,7 @@ class ViewExecutableTest extends UnitTestCase {
/**
* @covers ::getUrl
*/
- public function testGetUrlWithPlaceholdersAndWithoutArgsAndExceptionValue() {
+ public function testGetUrlWithPlaceholdersAndWithoutArgsAndExceptionValue(): void {
$this->displayHandler->expects($this->any())
->method('getRoutedDisplay')
->willReturn($this->displayHandler);
@@ -309,7 +309,7 @@ class ViewExecutableTest extends UnitTestCase {
/**
* @covers ::buildThemeFunctions
*/
- public function testBuildThemeFunctions() {
+ public function testBuildThemeFunctions(): void {
/** @var \Drupal\views\ViewExecutable|\PHPUnit\Framework\MockObject\MockObject $view */
/** @var \Drupal\views\Plugin\views\display\DisplayPluginBase|\PHPUnit\Framework\MockObject\MockObject $display */
[$view, $display] = $this->setupBaseViewAndDisplay();
@@ -353,7 +353,7 @@ class ViewExecutableTest extends UnitTestCase {
/**
* @covers ::generateHandlerId
*/
- public function testGenerateHandlerId() {
+ public function testGenerateHandlerId(): void {
// Test the generateHandlerId() method.
$test_ids = ['test' => 'test', 'test_1' => 'test_1'];
$this->assertEquals('new', ViewExecutable::generateHandlerId('new', $test_ids));
@@ -370,7 +370,7 @@ class ViewExecutableTest extends UnitTestCase {
* @param $handler_type
* The handler type to set.
*/
- public function testAddHandler($option, $handler_type) {
+ public function testAddHandler($option, $handler_type): void {
/** @var \Drupal\views\ViewExecutable|\PHPUnit\Framework\MockObject\MockObject $view */
/** @var \Drupal\views\Plugin\views\display\DisplayPluginBase|\PHPUnit\Framework\MockObject\MockObject $display */
[$view, $display] = $this->setupBaseViewAndDisplay();
@@ -412,7 +412,7 @@ class ViewExecutableTest extends UnitTestCase {
* @param $handler_type
* The handler type to set.
*/
- public function testAddHandlerWithEntityField($option, $handler_type) {
+ public function testAddHandlerWithEntityField($option, $handler_type): void {
/** @var \Drupal\views\ViewExecutable|\PHPUnit\Framework\MockObject\MockObject $view */
/** @var \Drupal\views\Plugin\views\display\DisplayPluginBase|\PHPUnit\Framework\MockObject\MockObject $display */
[$view, $display] = $this->setupBaseViewAndDisplay();
@@ -476,7 +476,7 @@ class ViewExecutableTest extends UnitTestCase {
* @covers ::attachDisplays
* @dataProvider providerAttachDisplays
*/
- public function testAttachDisplays($display_enabled, $access_granted, $expected_to_be_attached) {
+ public function testAttachDisplays($display_enabled, $access_granted, $expected_to_be_attached): void {
/** @var \Drupal\views\ViewExecutable|\PHPUnit\Framework\MockObject\MockObject $view */
/** @var \Drupal\views\Plugin\views\display\DisplayPluginBase|\PHPUnit\Framework\MockObject\MockObject $display */
[$view, $display] = $this->setupBaseViewAndDisplay();
@@ -592,7 +592,7 @@ class ViewExecutableTest extends UnitTestCase {
* @covers ::setItemsPerPage
* @covers ::getItemsPerPage
*/
- public function testSetItemsPerPageBeforePreRender() {
+ public function testSetItemsPerPageBeforePreRender(): void {
/** @var \Drupal\views\ViewExecutable|\PHPUnit\Framework\MockObject\MockObject $view */
/** @var \Drupal\views\Plugin\views\display\DisplayPluginBase|\PHPUnit\Framework\MockObject\MockObject $display */
[$view, $display] = $this->setupBaseViewAndDisplay();
@@ -606,7 +606,7 @@ class ViewExecutableTest extends UnitTestCase {
* @covers ::setItemsPerPage
* @covers ::getItemsPerPage
*/
- public function testSetItemsPerPageDuringPreRender() {
+ public function testSetItemsPerPageDuringPreRender(): void {
/** @var \Drupal\views\ViewExecutable|\PHPUnit\Framework\MockObject\MockObject $view */
/** @var \Drupal\views\Plugin\views\display\DisplayPluginBase|\PHPUnit\Framework\MockObject\MockObject $display */
[$view, $display] = $this->setupBaseViewAndDisplay();
@@ -624,7 +624,7 @@ class ViewExecutableTest extends UnitTestCase {
* @covers ::setOffset
* @covers ::getOffset
*/
- public function testSetOffsetBeforePreRender() {
+ public function testSetOffsetBeforePreRender(): void {
/** @var \Drupal\views\ViewExecutable|\PHPUnit\Framework\MockObject\MockObject $view */
/** @var \Drupal\views\Plugin\views\display\DisplayPluginBase|\PHPUnit\Framework\MockObject\MockObject $display */
[$view, $display] = $this->setupBaseViewAndDisplay();
@@ -638,7 +638,7 @@ class ViewExecutableTest extends UnitTestCase {
* @covers ::setOffset
* @covers ::getOffset
*/
- public function testSetOffsetDuringPreRender() {
+ public function testSetOffsetDuringPreRender(): void {
/** @var \Drupal\views\ViewExecutable|\PHPUnit\Framework\MockObject\MockObject $view */
/** @var \Drupal\views\Plugin\views\display\DisplayPluginBase|\PHPUnit\Framework\MockObject\MockObject $display */
[$view, $display] = $this->setupBaseViewAndDisplay();
@@ -656,7 +656,7 @@ class ViewExecutableTest extends UnitTestCase {
* @covers ::setCurrentPage
* @covers ::getCurrentPage
*/
- public function testSetCurrentPageBeforePreRender() {
+ public function testSetCurrentPageBeforePreRender(): void {
/** @var \Drupal\views\ViewExecutable|\PHPUnit\Framework\MockObject\MockObject $view */
/** @var \Drupal\views\Plugin\views\display\DisplayPluginBase|\PHPUnit\Framework\MockObject\MockObject $display */
[$view, $display] = $this->setupBaseViewAndDisplay();
@@ -670,7 +670,7 @@ class ViewExecutableTest extends UnitTestCase {
* @covers ::setCurrentPage
* @covers ::getCurrentPage
*/
- public function testSetCurrentPageDuringPreRender() {
+ public function testSetCurrentPageDuringPreRender(): void {
/** @var \Drupal\views\ViewExecutable|\PHPUnit\Framework\MockObject\MockObject $view */
/** @var \Drupal\views\Plugin\views\display\DisplayPluginBase|\PHPUnit\Framework\MockObject\MockObject $display */
[$view, $display] = $this->setupBaseViewAndDisplay();
@@ -687,7 +687,7 @@ class ViewExecutableTest extends UnitTestCase {
/**
* @covers ::execute
*/
- public function testCacheIsIgnoredDuringPreview() {
+ public function testCacheIsIgnoredDuringPreview(): void {
/** @var \Drupal\views\ViewExecutable|\PHPUnit\Framework\MockObject\MockObject $view */
/** @var \Drupal\views\Plugin\views\display\DisplayPluginBase|\PHPUnit\Framework\MockObject\MockObject $display */
[$view, $display] = $this->setupBaseViewAndDisplay();
@@ -722,7 +722,7 @@ class ViewExecutableTest extends UnitTestCase {
* @covers ::execute
* @dataProvider providerExecuteReturn
*/
- public function testExecuteReturn($display_enabled, $expected_result) {
+ public function testExecuteReturn($display_enabled, $expected_result): void {
/** @var \Drupal\views\ViewExecutable|\PHPUnit\Framework\MockObject\MockObject $view */
/** @var \Drupal\views\Plugin\views\display\DisplayPluginBase|\PHPUnit\Framework\MockObject\MockObject $display */
[$view, $display] = $this->setupBaseViewAndDisplay();
diff --git a/core/modules/views/tests/src/Unit/ViewsDataHelperTest.php b/core/modules/views/tests/src/Unit/ViewsDataHelperTest.php
index fae9639b996..510a1ba953b 100644
--- a/core/modules/views/tests/src/Unit/ViewsDataHelperTest.php
+++ b/core/modules/views/tests/src/Unit/ViewsDataHelperTest.php
@@ -40,7 +40,7 @@ class ViewsDataHelperTest extends UnitTestCase {
/**
* Tests fetchFields.
*/
- public function testFetchFields() {
+ public function testFetchFields(): void {
$views_data = $this->getMockBuilder('Drupal\views\ViewsData')
->disableOriginalConstructor()
->getMock();
diff --git a/core/modules/views/tests/src/Unit/ViewsDataTest.php b/core/modules/views/tests/src/Unit/ViewsDataTest.php
index f3e4e92a398..4018cd97960 100644
--- a/core/modules/views/tests/src/Unit/ViewsDataTest.php
+++ b/core/modules/views/tests/src/Unit/ViewsDataTest.php
@@ -142,7 +142,7 @@ class ViewsDataTest extends UnitTestCase {
/**
* Tests the fetchBaseTables() method.
*/
- public function testFetchBaseTables() {
+ public function testFetchBaseTables(): void {
$this->setupMockedModuleHandler();
$data = $this->viewsData->getAll();
@@ -180,7 +180,7 @@ class ViewsDataTest extends UnitTestCase {
/**
* Tests fetching all the views data without a static cache.
*/
- public function testGetOnFirstCall() {
+ public function testGetOnFirstCall(): void {
// Ensure that the hooks are just invoked once.
$this->setupMockedModuleHandler();
@@ -201,7 +201,7 @@ class ViewsDataTest extends UnitTestCase {
/**
* Tests the cache of the full and single table data.
*/
- public function testFullAndTableGetCache() {
+ public function testFullAndTableGetCache(): void {
$expected_views_data = $this->viewsDataWithProvider();
$table_name = 'views_test_data';
$table_name_2 = 'views_test_data_2';
@@ -277,7 +277,7 @@ class ViewsDataTest extends UnitTestCase {
/**
* Tests the caching of the full views data.
*/
- public function testFullGetCache() {
+ public function testFullGetCache(): void {
$expected_views_data = $this->viewsDataWithProvider();
// Views data should be invoked once.
@@ -302,7 +302,7 @@ class ViewsDataTest extends UnitTestCase {
/**
* Tests the caching of the views data for a specific table.
*/
- public function testSingleTableGetCache() {
+ public function testSingleTableGetCache(): void {
$table_name = 'views_test_data';
$expected_views_data = $this->viewsDataWithProvider();
@@ -337,7 +337,7 @@ class ViewsDataTest extends UnitTestCase {
/**
* Tests building the views data with a non existing table.
*/
- public function testNonExistingTableGetCache() {
+ public function testNonExistingTableGetCache(): void {
$random_table_name = $this->randomMachineName();
// Views data should be invoked once.
@@ -367,7 +367,7 @@ class ViewsDataTest extends UnitTestCase {
/**
* Tests the cache backend behavior with requesting the same table multiple.
*/
- public function testCacheCallsWithSameTableMultipleTimes() {
+ public function testCacheCallsWithSameTableMultipleTimes(): void {
$expected_views_data = $this->viewsDataWithProvider();
$this->setupMockedModuleHandler();
@@ -410,7 +410,7 @@ class ViewsDataTest extends UnitTestCase {
* - all tables
* - views_test_data
*/
- public function testCacheCallsWithSameTableMultipleTimesAndWarmCache() {
+ public function testCacheCallsWithSameTableMultipleTimesAndWarmCache(): void {
$expected_views_data = $this->viewsDataWithProvider();
$this->moduleHandler->expects($this->never())
->method('invokeAllWith');
@@ -440,7 +440,7 @@ class ViewsDataTest extends UnitTestCase {
* Not warm cache:
* - views_test_data_2
*/
- public function testCacheCallsWithWarmCacheAndDifferentTable() {
+ public function testCacheCallsWithWarmCacheAndDifferentTable(): void {
$expected_views_data = $this->viewsDataWithProvider();
$this->moduleHandler->expects($this->never())
->method('invokeAllWith');
@@ -478,7 +478,7 @@ class ViewsDataTest extends UnitTestCase {
* Not warm cache:
* - $non_existing_table
*/
- public function testCacheCallsWithWarmCacheAndInvalidTable() {
+ public function testCacheCallsWithWarmCacheAndInvalidTable(): void {
$expected_views_data = $this->viewsDataWithProvider();
$non_existing_table = $this->randomMachineName();
$this->moduleHandler->expects($this->never())
@@ -518,7 +518,7 @@ class ViewsDataTest extends UnitTestCase {
* - views_test_data
* - $non_existing_table
*/
- public function testCacheCallsWithWarmCacheForInvalidTable() {
+ public function testCacheCallsWithWarmCacheForInvalidTable(): void {
$non_existing_table = $this->randomMachineName();
$this->moduleHandler->expects($this->never())
->method('invokeAllWith');
@@ -545,7 +545,7 @@ class ViewsDataTest extends UnitTestCase {
/**
* Tests the cache calls for all views data without a warm cache.
*/
- public function testCacheCallsWithoutWarmCacheAndGetAllTables() {
+ public function testCacheCallsWithoutWarmCacheAndGetAllTables(): void {
$expected_views_data = $this->viewsDataWithProvider();
$this->setupMockedModuleHandler();
@@ -571,7 +571,7 @@ class ViewsDataTest extends UnitTestCase {
* Warm cache:
* - all tables
*/
- public function testCacheCallsWithWarmCacheAndGetAllTables() {
+ public function testCacheCallsWithWarmCacheAndGetAllTables(): void {
$expected_views_data = $this->viewsDataWithProvider();
$this->moduleHandler->expects($this->never())
->method('invokeAllWith');
@@ -597,7 +597,7 @@ class ViewsDataTest extends UnitTestCase {
*
* @covers ::get
*/
- public function testCacheCallsWithoutWarmCacheAndGetMultipleTables() {
+ public function testCacheCallsWithoutWarmCacheAndGetMultipleTables(): void {
$expected_views_data = $this->viewsDataWithProvider();
$table_name = 'views_test_data';
$table_name_2 = 'views_test_data_2';
@@ -641,7 +641,7 @@ class ViewsDataTest extends UnitTestCase {
* @covers ::get
* @dataProvider providerTestGetEmptyKey
*/
- public function testGetEmptyKey($key) {
+ public function testGetEmptyKey($key): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('A valid cache entry key is required. Use getAll() to get all table data.');
diff --git a/core/modules/views/tests/src/Unit/ViewsHandlerManagerTest.php b/core/modules/views/tests/src/Unit/ViewsHandlerManagerTest.php
index 159f860c29b..dc7212df449 100644
--- a/core/modules/views/tests/src/Unit/ViewsHandlerManagerTest.php
+++ b/core/modules/views/tests/src/Unit/ViewsHandlerManagerTest.php
@@ -70,7 +70,7 @@ class ViewsHandlerManagerTest extends UnitTestCase {
* @covers ::__construct
* @covers ::getDefinitions
*/
- public function testAlterHookInvocation() {
+ public function testAlterHookInvocation(): void {
$this->moduleHandler->expects($this->once())
->method('alter')
->with('views_plugins_test', []);
@@ -81,7 +81,7 @@ class ViewsHandlerManagerTest extends UnitTestCase {
/**
* Tests getHandler() and its base information propagation.
*/
- public function testGetHandlerBaseInformationPropagation() {
+ public function testGetHandlerBaseInformationPropagation(): void {
$this->setupMockedFactory();
$item = [];
@@ -124,7 +124,7 @@ class ViewsHandlerManagerTest extends UnitTestCase {
/**
* Tests getHandler() with an override.
*/
- public function testGetHandlerOverride() {
+ public function testGetHandlerOverride(): void {
$this->setupMockedFactory();
$item = [];
@@ -152,7 +152,7 @@ class ViewsHandlerManagerTest extends UnitTestCase {
/**
* Tests getHandler() without an override.
*/
- public function testGetHandlerNoOverride() {
+ public function testGetHandlerNoOverride(): void {
$this->setupMockedFactory();
$item = [];
diff --git a/core/modules/views/tests/src/Unit/ViewsTest.php b/core/modules/views/tests/src/Unit/ViewsTest.php
index adb18cea204..784b5a89e8d 100644
--- a/core/modules/views/tests/src/Unit/ViewsTest.php
+++ b/core/modules/views/tests/src/Unit/ViewsTest.php
@@ -54,7 +54,7 @@ class ViewsTest extends UnitTestCase {
*
* @covers ::getView
*/
- public function testGetView() {
+ public function testGetView(): void {
$view = new View(['id' => 'test_view'], 'view');
$view_storage = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigEntityStorage')
@@ -83,7 +83,7 @@ class ViewsTest extends UnitTestCase {
*
* @covers ::getView
*/
- public function testGetNonExistentView() {
+ public function testGetNonExistentView(): void {
$entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class);
$storage = $this->prophesize(EntityStorageInterface::class);
$storage->load('test_view_non_existent')->willReturn(NULL);
@@ -98,7 +98,7 @@ class ViewsTest extends UnitTestCase {
*
* @dataProvider providerTestGetApplicableViews
*/
- public function testGetApplicableViews($applicable_type, $expected) {
+ public function testGetApplicableViews($applicable_type, $expected): void {
$view_1 = new View([
'id' => 'test_view_1',
'display' => [
diff --git a/core/modules/views/tests/src/Unit/WizardPluginBaseTest.php b/core/modules/views/tests/src/Unit/WizardPluginBaseTest.php
index 3c2e84baf03..1c9643102a8 100644
--- a/core/modules/views/tests/src/Unit/WizardPluginBaseTest.php
+++ b/core/modules/views/tests/src/Unit/WizardPluginBaseTest.php
@@ -20,7 +20,7 @@ class WizardPluginBaseTest extends UnitTestCase {
*
* @dataProvider providerTestGetSelected
*/
- public function testGetSelected($expected, $element = [], $parents = [], $user_input = [], $not_rebuilding_expected = NULL) {
+ public function testGetSelected($expected, $element = [], $parents = [], $user_input = [], $not_rebuilding_expected = NULL): void {
$not_rebuilding_expected = $not_rebuilding_expected ?: $expected;
$form_state = new FormState();
$form_state->setUserInput($user_input);
diff --git a/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php b/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php
index 14004fcf00b..f9f09c0468b 100644
--- a/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php
+++ b/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php
@@ -33,7 +33,7 @@ class AnalyzeTest extends UITestBase {
/**
* Tests that analyze works in general.
*/
- public function testAnalyzeBasic() {
+ public function testAnalyzeBasic(): void {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/structure/views/view/test_view/edit');
diff --git a/core/modules/views_ui/tests/src/Functional/AreaEntityUITest.php b/core/modules/views_ui/tests/src/Functional/AreaEntityUITest.php
index 79e700623f6..d45fed51e81 100644
--- a/core/modules/views_ui/tests/src/Functional/AreaEntityUITest.php
+++ b/core/modules/views_ui/tests/src/Functional/AreaEntityUITest.php
@@ -26,7 +26,7 @@ class AreaEntityUITest extends UITestBase {
*/
protected $defaultTheme = 'stark';
- public function testUI() {
+ public function testUI(): void {
// Set up a block and an entity_test entity.
$block = Block::create(['id' => 'test_id', 'plugin' => 'system_main_block', 'theme' => 'stark']);
$block->save();
diff --git a/core/modules/views_ui/tests/src/Functional/ArgumentValidatorTest.php b/core/modules/views_ui/tests/src/Functional/ArgumentValidatorTest.php
index 882991d3dd9..241f64944a1 100644
--- a/core/modules/views_ui/tests/src/Functional/ArgumentValidatorTest.php
+++ b/core/modules/views_ui/tests/src/Functional/ArgumentValidatorTest.php
@@ -28,7 +28,7 @@ class ArgumentValidatorTest extends UITestBase {
/**
* Tests the 'Specify validation criteria' checkbox functionality.
*/
- public function testSpecifyValidation() {
+ public function testSpecifyValidation(): void {
// Specify a validation based on Node for the 'id' argument on the default
// display and assert that this works.
$this->saveArgumentHandlerWithValidationOptions(TRUE);
diff --git a/core/modules/views_ui/tests/src/Functional/CachedDataUITest.php b/core/modules/views_ui/tests/src/Functional/CachedDataUITest.php
index 2c6fe2a1d5e..169fb51c491 100644
--- a/core/modules/views_ui/tests/src/Functional/CachedDataUITest.php
+++ b/core/modules/views_ui/tests/src/Functional/CachedDataUITest.php
@@ -26,7 +26,7 @@ class CachedDataUITest extends UITestBase {
/**
* Tests the shared tempstore views data in the UI.
*/
- public function testCacheData() {
+ public function testCacheData(): void {
$views_admin_user_uid = $this->fullAdminUser->id();
$temp_store = $this->container->get('tempstore.shared')->get('views');
diff --git a/core/modules/views_ui/tests/src/Functional/CustomBooleanTest.php b/core/modules/views_ui/tests/src/Functional/CustomBooleanTest.php
index ede46aa6a49..9b00ae31ec4 100644
--- a/core/modules/views_ui/tests/src/Functional/CustomBooleanTest.php
+++ b/core/modules/views_ui/tests/src/Functional/CustomBooleanTest.php
@@ -48,7 +48,7 @@ class CustomBooleanTest extends UITestBase {
/**
* Tests the setting and output of custom labels for boolean values.
*/
- public function testCustomOption() {
+ public function testCustomOption(): void {
// Add the boolean field handler to the test view.
$view = Views::getView('test_view');
$view->setDisplay();
@@ -113,7 +113,7 @@ class CustomBooleanTest extends UITestBase {
/**
* Tests the setting and output of custom labels for boolean values.
*/
- public function testCustomOptionTemplate() {
+ public function testCustomOptionTemplate(): void {
// Install theme to test with template system.
\Drupal::service('theme_installer')->install(['views_test_theme']);
diff --git a/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php b/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php
index 0c7a2b6789a..f35bae650ac 100644
--- a/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php
@@ -39,7 +39,7 @@ class DefaultViewsTest extends UITestBase {
/**
* Tests default views.
*/
- public function testDefaultViews() {
+ public function testDefaultViews(): void {
// Make sure the view starts off as disabled (does not appear on the listing
// page).
$edit_href = 'admin/structure/views/view/glossary';
@@ -173,7 +173,7 @@ class DefaultViewsTest extends UITestBase {
/**
* Tests that enabling views moves them to the correct table.
*/
- public function testSplitListing() {
+ public function testSplitListing(): void {
$this->drupalGet('admin/structure/views');
$this->assertSession()->elementNotExists('xpath', '//div[@id="views-entity-list"]/div[@class = "views-list-section enabled"]/table//td/text()[contains(., "test_view_status")]');
$this->assertSession()->elementsCount('xpath', '//div[@id="views-entity-list"]/div[@class = "views-list-section disabled"]/table//td/text()[contains(., "test_view_status")]', 1);
@@ -191,7 +191,7 @@ class DefaultViewsTest extends UITestBase {
/**
* Tests that page displays show the correct path.
*/
- public function testPathDestination() {
+ public function testPathDestination(): void {
$this->drupalGet('admin/structure/views');
// Check that links to views on default tabs are rendered correctly.
diff --git a/core/modules/views_ui/tests/src/Functional/DisplayAttachmentTest.php b/core/modules/views_ui/tests/src/Functional/DisplayAttachmentTest.php
index 6536ef40d71..13b5baf3e2d 100644
--- a/core/modules/views_ui/tests/src/Functional/DisplayAttachmentTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DisplayAttachmentTest.php
@@ -30,7 +30,7 @@ class DisplayAttachmentTest extends UITestBase {
/**
* Tests the attachment UI.
*/
- public function testAttachmentUI() {
+ public function testAttachmentUI(): void {
$this->drupalGet('admin/structure/views/view/test_attachment_ui/edit/attachment_1');
$this->assertSession()->pageTextContains('Not defined');
@@ -71,7 +71,7 @@ class DisplayAttachmentTest extends UITestBase {
/**
* Tests the attachment working after the attached page was deleted.
*/
- public function testRemoveAttachedDisplay() {
+ public function testRemoveAttachedDisplay(): void {
// Create a view.
$view = $this->randomView();
$path_prefix = 'admin/structure/views/view/' . $view['id'] . '/edit';
diff --git a/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php b/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php
index 1377855abc9..ab7d500195a 100644
--- a/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php
@@ -35,7 +35,7 @@ class DisplayCRUDTest extends UITestBase {
/**
* Tests adding a display.
*/
- public function testAddDisplay() {
+ public function testAddDisplay(): void {
// Show the default display.
$this->config('views.settings')->set('ui.show.default_display', TRUE)->save();
@@ -60,7 +60,7 @@ class DisplayCRUDTest extends UITestBase {
/**
* Tests removing a display.
*/
- public function testRemoveDisplay() {
+ public function testRemoveDisplay(): void {
$view = $this->randomView();
$path_prefix = 'admin/structure/views/view/' . $view['id'] . '/edit';
@@ -106,7 +106,7 @@ class DisplayCRUDTest extends UITestBase {
/**
* Tests that the correct display is loaded by default.
*/
- public function testDefaultDisplay() {
+ public function testDefaultDisplay(): void {
$this->drupalGet('admin/structure/views/view/test_display');
$this->assertSession()->elementsCount('xpath', '//*[@id="views-page-1-display-title"]', 1);
}
@@ -114,7 +114,7 @@ class DisplayCRUDTest extends UITestBase {
/**
* Tests the duplicating of a display.
*/
- public function testDuplicateDisplay() {
+ public function testDuplicateDisplay(): void {
$view = $this->randomView();
$path_prefix = 'admin/structure/views/view/' . $view['id'] . '/edit';
$path = $view['page[path]'];
diff --git a/core/modules/views_ui/tests/src/Functional/DisplayExtenderUITest.php b/core/modules/views_ui/tests/src/Functional/DisplayExtenderUITest.php
index 922eeb68630..884cd3d8062 100644
--- a/core/modules/views_ui/tests/src/Functional/DisplayExtenderUITest.php
+++ b/core/modules/views_ui/tests/src/Functional/DisplayExtenderUITest.php
@@ -28,7 +28,7 @@ class DisplayExtenderUITest extends UITestBase {
/**
* Tests the display extender UI.
*/
- public function testDisplayExtenderUI() {
+ public function testDisplayExtenderUI(): void {
$this->config('views.settings')->set('display_extenders', ['display_extender_test'])->save();
$view = Views::getView('test_view');
diff --git a/core/modules/views_ui/tests/src/Functional/DisplayFeedTest.php b/core/modules/views_ui/tests/src/Functional/DisplayFeedTest.php
index c1ab43b26b6..58e0f5e62a2 100644
--- a/core/modules/views_ui/tests/src/Functional/DisplayFeedTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DisplayFeedTest.php
@@ -34,7 +34,7 @@ class DisplayFeedTest extends UITestBase {
/**
* Tests feed display admin UI.
*/
- public function testFeedUI() {
+ public function testFeedUI(): void {
// Test the RSS feed.
foreach (self::$testViews as $view_name) {
$this->checkFeedViewUi($view_name);
diff --git a/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php b/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
index 8cb6a77ff24..f9f7d6505ae 100644
--- a/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
@@ -45,7 +45,7 @@ class DisplayPathTest extends UITestBase {
/**
* Runs the tests.
*/
- public function testPathUI() {
+ public function testPathUI(): void {
$this->doBasicPathUITest();
$this->doAdvancedPathsValidationTest();
$this->doPathXssFilterTest();
@@ -121,7 +121,7 @@ class DisplayPathTest extends UITestBase {
/**
* Tests deleting a page display that has no path.
*/
- public function testDeleteWithNoPath() {
+ public function testDeleteWithNoPath(): void {
$this->drupalGet('admin/structure/views/view/test_view');
$this->submitForm([], 'Add Page');
$this->submitForm([], 'Delete Page');
@@ -132,7 +132,7 @@ class DisplayPathTest extends UITestBase {
/**
* Tests the menu and tab option form.
*/
- public function testMenuOptions() {
+ public function testMenuOptions(): void {
$this->drupalGet('admin/structure/views/view/test_view');
// Add a new page display.
@@ -206,7 +206,7 @@ class DisplayPathTest extends UITestBase {
/**
* Tests the regression in https://www.drupal.org/node/2532490.
*/
- public function testDefaultMenuTabRegression() {
+ public function testDefaultMenuTabRegression(): void {
$this->container->get('module_installer')->install(['menu_link_content', 'toolbar', 'system']);
$this->resetAll();
$admin_user = $this->drupalCreateUser([
diff --git a/core/modules/views_ui/tests/src/Functional/DisplayTest.php b/core/modules/views_ui/tests/src/Functional/DisplayTest.php
index 426344b573c..0fd1b26eb7c 100644
--- a/core/modules/views_ui/tests/src/Functional/DisplayTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DisplayTest.php
@@ -38,7 +38,7 @@ class DisplayTest extends UITestBase {
/**
* Tests adding a display.
*/
- public function testAddDisplay() {
+ public function testAddDisplay(): void {
$view = $this->randomView();
$this->assertSession()->elementNotExists('xpath', '//li[@data-drupal-selector="edit-displays-top-tabs-block-1"]');
$this->assertSession()->elementNotExists('xpath', '//li[@data-drupal-selector="edit-displays-top-tabs-block-2"]');
@@ -53,7 +53,7 @@ class DisplayTest extends UITestBase {
/**
* Tests reordering of displays.
*/
- public function testReorderDisplay() {
+ public function testReorderDisplay(): void {
$view = [
'block[create]' => TRUE,
];
@@ -88,7 +88,7 @@ class DisplayTest extends UITestBase {
/**
* Tests disabling of a display.
*/
- public function testDisableDisplay() {
+ public function testDisableDisplay(): void {
$view = $this->randomView();
$path_prefix = 'admin/structure/views/view/' . $view['id'] . '/edit';
@@ -115,7 +115,7 @@ class DisplayTest extends UITestBase {
/**
* Tests views_ui_views_plugins_display_alter is altering plugin definitions.
*/
- public function testDisplayPluginsAlter() {
+ public function testDisplayPluginsAlter(): void {
$definitions = Views::pluginManager('display')->getDefinitions();
$expected = [
@@ -132,7 +132,7 @@ class DisplayTest extends UITestBase {
/**
* Tests display areas.
*/
- public function testDisplayAreas() {
+ public function testDisplayAreas(): void {
// Show the advanced column.
$this->config('views.settings')->set('ui.show.advanced_column', TRUE)->save();
@@ -158,7 +158,7 @@ class DisplayTest extends UITestBase {
/**
* Tests the link-display setting.
*/
- public function testLinkDisplay() {
+ public function testLinkDisplay(): void {
// Test setting the link display in the UI form.
$path = 'admin/structure/views/view/test_display/edit/block_1';
$link_display_path = 'admin/structure/views/nojs/display/test_display/block_1/link_display';
@@ -199,7 +199,7 @@ class DisplayTest extends UITestBase {
/**
* Tests that the view status is correctly reflected on the edit form.
*/
- public function testViewStatus() {
+ public function testViewStatus(): void {
$view = $this->randomView();
$id = $view['id'];
@@ -218,7 +218,7 @@ class DisplayTest extends UITestBase {
/**
* Ensures that no XSS is possible for buttons.
*/
- public function testDisplayTitleInButtonsXss() {
+ public function testDisplayTitleInButtonsXss(): void {
$xss_markup = '"><script>alert(123)</script>';
$view = $this->randomView();
$view = View::load($view['id']);
@@ -247,7 +247,7 @@ class DisplayTest extends UITestBase {
/**
* Tests the action links on the edit display UI.
*/
- public function testActionLinks() {
+ public function testActionLinks(): void {
// Change the display title of a display so it contains characters that will
// be escaped when rendered.
$display_title = "'<test>'";
@@ -279,7 +279,7 @@ class DisplayTest extends UITestBase {
/**
* Tests that the override option is hidden when it's not needed.
*/
- public function testHideDisplayOverride() {
+ public function testHideDisplayOverride(): void {
// Test that the override option appears with two displays.
$this->drupalGet('admin/structure/views/nojs/handler/test_display/page_1/field/title');
$this->assertSession()->pageTextContains('All displays');
diff --git a/core/modules/views_ui/tests/src/Functional/DuplicateTest.php b/core/modules/views_ui/tests/src/Functional/DuplicateTest.php
index fb1f599d459..600ae7e6fcc 100644
--- a/core/modules/views_ui/tests/src/Functional/DuplicateTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DuplicateTest.php
@@ -35,7 +35,7 @@ class DuplicateTest extends UITestBase {
/**
* Checks if duplicated view exists and has correct label.
*/
- public function testDuplicateView() {
+ public function testDuplicateView(): void {
$language_manager = $this->container->get('language_manager');
ConfigurableLanguage::createFromLangcode('nl')->save();
diff --git a/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php b/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php
index 3cb81d65f7f..5a717182ca9 100644
--- a/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php
+++ b/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php
@@ -70,7 +70,7 @@ class ExposedFormUITest extends UITestBase {
/**
* Tests the admin interface of exposed filter and sort items.
*/
- public function testExposedAdminUi() {
+ public function testExposedAdminUi(): void {
$edit = [];
$this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type');
@@ -187,7 +187,7 @@ class ExposedFormUITest extends UITestBase {
/**
* Tests the admin interface of exposed grouped filters.
*/
- public function testGroupedFilterAdminUi() {
+ public function testGroupedFilterAdminUi(): void {
$edit = [];
$this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type');
@@ -269,7 +269,7 @@ class ExposedFormUITest extends UITestBase {
$this->assertNoGroupedFilterErrors();
}
- public function testGroupedFilterAdminUiErrors() {
+ public function testGroupedFilterAdminUiErrors(): void {
// Select the empty operator without a title specified.
$this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/body_value');
$edit = [];
@@ -317,7 +317,7 @@ class ExposedFormUITest extends UITestBase {
/**
* Tests the configuration of grouped exposed filters.
*/
- public function testExposedGroupedFilter() {
+ public function testExposedGroupedFilter(): void {
// Click the Expose filter button.
$this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type');
$this->submitForm([], 'Expose filter');
diff --git a/core/modules/views_ui/tests/src/Functional/FieldUITest.php b/core/modules/views_ui/tests/src/Functional/FieldUITest.php
index 43057cb7d24..cd8a199d18a 100644
--- a/core/modules/views_ui/tests/src/Functional/FieldUITest.php
+++ b/core/modules/views_ui/tests/src/Functional/FieldUITest.php
@@ -30,7 +30,7 @@ class FieldUITest extends UITestBase {
/**
* Tests the UI of field handlers.
*/
- public function testFieldUI() {
+ public function testFieldUI(): void {
// Ensure the field is not marked as hidden on the first run.
$this->drupalGet('admin/structure/views/view/test_view/edit');
$this->assertSession()->pageTextContains('Views test: Name');
@@ -84,7 +84,7 @@ class FieldUITest extends UITestBase {
/**
* Tests the field labels.
*/
- public function testFieldLabel() {
+ public function testFieldLabel(): void {
// Create a view with unformatted style and make sure the fields have no
// labels by default.
$view = [];
diff --git a/core/modules/views_ui/tests/src/Functional/FilterBooleanWebTest.php b/core/modules/views_ui/tests/src/Functional/FilterBooleanWebTest.php
index 7e3bb185a85..19adb14ba2e 100644
--- a/core/modules/views_ui/tests/src/Functional/FilterBooleanWebTest.php
+++ b/core/modules/views_ui/tests/src/Functional/FilterBooleanWebTest.php
@@ -27,7 +27,7 @@ class FilterBooleanWebTest extends UITestBase {
/**
* Tests the filter boolean UI.
*/
- public function testFilterBooleanUI() {
+ public function testFilterBooleanUI(): void {
$this->drupalGet('admin/structure/views/nojs/add-handler/test_view/default/filter');
$this->submitForm(['name[views_test_data.status]' => TRUE], 'Add and configure filter criteria');
diff --git a/core/modules/views_ui/tests/src/Functional/FilterNumericWebTest.php b/core/modules/views_ui/tests/src/Functional/FilterNumericWebTest.php
index 4b97f1a7ad6..6612f4a7f92 100644
--- a/core/modules/views_ui/tests/src/Functional/FilterNumericWebTest.php
+++ b/core/modules/views_ui/tests/src/Functional/FilterNumericWebTest.php
@@ -30,7 +30,7 @@ class FilterNumericWebTest extends UITestBase {
/**
* Tests the filter numeric UI.
*/
- public function testFilterNumericUI() {
+ public function testFilterNumericUI(): void {
// Add a page display to the test_view to be able to test the filtering.
$path = 'test_view-path';
$this->drupalGet('admin/structure/views/view/test_view/edit');
diff --git a/core/modules/views_ui/tests/src/Functional/FilterUITest.php b/core/modules/views_ui/tests/src/Functional/FilterUITest.php
index 3e92560ade7..7891d6df02a 100644
--- a/core/modules/views_ui/tests/src/Functional/FilterUITest.php
+++ b/core/modules/views_ui/tests/src/Functional/FilterUITest.php
@@ -42,7 +42,7 @@ class FilterUITest extends UITestBase {
/**
* Tests that an option for a filter is saved as expected from the UI.
*/
- public function testFilterInOperatorUi() {
+ public function testFilterInOperatorUi(): void {
$admin_user = $this->drupalCreateUser([
'administer views',
'administer site configuration',
@@ -69,7 +69,7 @@ class FilterUITest extends UITestBase {
/**
* Tests the filters from the UI.
*/
- public function testFiltersUI() {
+ public function testFiltersUI(): void {
$admin_user = $this->drupalCreateUser([
'administer views',
'administer site configuration',
@@ -104,7 +104,7 @@ class FilterUITest extends UITestBase {
/**
* Tests the identifier settings and restrictions.
*/
- public function testFilterIdentifier() {
+ public function testFilterIdentifier(): void {
$admin_user = $this->drupalCreateUser([
'administer views',
'administer site configuration',
diff --git a/core/modules/views_ui/tests/src/Functional/GroupByTest.php b/core/modules/views_ui/tests/src/Functional/GroupByTest.php
index a81b3af2820..69210693027 100644
--- a/core/modules/views_ui/tests/src/Functional/GroupByTest.php
+++ b/core/modules/views_ui/tests/src/Functional/GroupByTest.php
@@ -28,7 +28,7 @@ class GroupByTest extends UITestBase {
*
* @todo This should check the change of the settings as well.
*/
- public function testGroupBySave() {
+ public function testGroupBySave(): void {
$this->drupalGet('admin/structure/views/view/test_views_groupby_save/edit');
$edit_groupby_url = 'admin/structure/views/nojs/handler-group/test_views_groupby_save/default/field/id';
diff --git a/core/modules/views_ui/tests/src/Functional/HandlerTest.php b/core/modules/views_ui/tests/src/Functional/HandlerTest.php
index 122b1cd8120..18e396caf77 100644
--- a/core/modules/views_ui/tests/src/Functional/HandlerTest.php
+++ b/core/modules/views_ui/tests/src/Functional/HandlerTest.php
@@ -97,7 +97,7 @@ class HandlerTest extends UITestBase {
/**
* Tests UI CRUD.
*/
- public function testUiCrud() {
+ public function testUiCrud(): void {
$handler_types = ViewExecutable::getHandlerTypes();
foreach ($handler_types as $type => $type_info) {
// Test adding handlers.
@@ -188,7 +188,7 @@ class HandlerTest extends UITestBase {
/**
* Tests escaping of field labels in help text.
*/
- public function testHandlerHelpEscaping() {
+ public function testHandlerHelpEscaping(): void {
// Setup a field with two instances using a different label.
// Ensure that the label is escaped properly.
@@ -223,7 +223,7 @@ class HandlerTest extends UITestBase {
/**
* Tests broken handlers.
*/
- public function testBrokenHandlers() {
+ public function testBrokenHandlers(): void {
$handler_types = ViewExecutable::getHandlerTypes();
foreach ($handler_types as $type => $type_info) {
$this->drupalGet('admin/structure/views/view/test_view_broken/edit');
@@ -257,7 +257,7 @@ class HandlerTest extends UITestBase {
*
* @see \Drupal\views\EntityViewsData
*/
- public function testNoDuplicateFields() {
+ public function testNoDuplicateFields(): void {
$handler_types = ['field', 'filter', 'sort', 'argument'];
foreach ($handler_types as $handler_type) {
@@ -278,7 +278,7 @@ class HandlerTest extends UITestBase {
*
* @see \Drupal\views\EntityViewsData
*/
- public function testErrorMissingHelp() {
+ public function testErrorMissingHelp(): void {
// Test that the error message is not shown for entity fields but an empty
// description field is shown instead.
$this->drupalGet('admin/structure/views/nojs/add-handler/test_node_view/default/field');
diff --git a/core/modules/views_ui/tests/src/Functional/NewViewConfigSchemaTest.php b/core/modules/views_ui/tests/src/Functional/NewViewConfigSchemaTest.php
index 1ca10a67e30..44111e64672 100644
--- a/core/modules/views_ui/tests/src/Functional/NewViewConfigSchemaTest.php
+++ b/core/modules/views_ui/tests/src/Functional/NewViewConfigSchemaTest.php
@@ -33,7 +33,7 @@ class NewViewConfigSchemaTest extends UITestBase {
/**
* Tests creating brand new views.
*/
- public function testNewViews() {
+ public function testNewViews(): void {
$this->drupalLogin($this->drupalCreateUser(['administer views']));
// Create views with all core Views wizards.
diff --git a/core/modules/views_ui/tests/src/Functional/OverrideDisplaysTest.php b/core/modules/views_ui/tests/src/Functional/OverrideDisplaysTest.php
index 90fbb65c8dd..6b481dbe4a6 100644
--- a/core/modules/views_ui/tests/src/Functional/OverrideDisplaysTest.php
+++ b/core/modules/views_ui/tests/src/Functional/OverrideDisplaysTest.php
@@ -29,7 +29,7 @@ class OverrideDisplaysTest extends UITestBase {
/**
* Tests that displays can be overridden via the UI.
*/
- public function testOverrideDisplays() {
+ public function testOverrideDisplays(): void {
// Create a basic view that shows all content, with a page and a block
// display.
$view['label'] = $this->randomMachineName(16);
@@ -94,7 +94,7 @@ class OverrideDisplaysTest extends UITestBase {
/**
* Tests that the wizard correctly sets up default and overridden displays.
*/
- public function testWizardMixedDefaultOverriddenDisplays() {
+ public function testWizardMixedDefaultOverriddenDisplays(): void {
// Create a basic view with a page, block, and feed. Give the page and feed
// identical titles, but give the block a different one, so we expect the
// page and feed to inherit their titles from the default display, but the
@@ -195,7 +195,7 @@ class OverrideDisplaysTest extends UITestBase {
/**
* Tests that the revert to all displays select-option works as expected.
*/
- public function testRevertAllDisplays() {
+ public function testRevertAllDisplays(): void {
// Create a basic view with a page, block.
// Because there is both a title on page and block we expect the title on
// the block be overridden.
diff --git a/core/modules/views_ui/tests/src/Functional/PreviewTest.php b/core/modules/views_ui/tests/src/Functional/PreviewTest.php
index c9d98962fc3..e2204a5dc5c 100644
--- a/core/modules/views_ui/tests/src/Functional/PreviewTest.php
+++ b/core/modules/views_ui/tests/src/Functional/PreviewTest.php
@@ -33,7 +33,7 @@ class PreviewTest extends UITestBase {
/**
* Tests contextual links in the preview form.
*/
- public function testPreviewContextual() {
+ public function testPreviewContextual(): void {
\Drupal::service('module_installer')->install(['contextual']);
$this->resetAll();
@@ -68,7 +68,7 @@ class PreviewTest extends UITestBase {
/**
* Tests arguments in the preview form.
*/
- public function testPreviewUI() {
+ public function testPreviewUI(): void {
$this->drupalGet('admin/structure/views/view/test_preview/edit');
$this->assertSession()->statusCodeEquals(200);
@@ -150,7 +150,7 @@ SQL;
/**
* Tests the additional information query info area.
*/
- public function testPreviewAdditionalInfo() {
+ public function testPreviewAdditionalInfo(): void {
\Drupal::service('module_installer')->install(['views_ui_test']);
$this->resetAll();
@@ -171,7 +171,7 @@ SQL;
/**
* Tests view validation error messages in the preview.
*/
- public function testPreviewError() {
+ public function testPreviewError(): void {
$this->drupalGet('admin/structure/views/view/test_preview_error/edit');
$this->assertSession()->statusCodeEquals(200);
@@ -183,7 +183,7 @@ SQL;
/**
* Tests HTML is filtered from the view title when previewing.
*/
- public function testPreviewTitle() {
+ public function testPreviewTitle(): void {
// Update the view and change title with html tags.
\Drupal::configFactory()->getEditable('views.view.test_preview')
->set('display.default.display_options.title', '<strong>Test preview title</strong>')
diff --git a/core/modules/views_ui/tests/src/Functional/QueryTest.php b/core/modules/views_ui/tests/src/Functional/QueryTest.php
index 92782b01067..9ef5d5bae88 100644
--- a/core/modules/views_ui/tests/src/Functional/QueryTest.php
+++ b/core/modules/views_ui/tests/src/Functional/QueryTest.php
@@ -39,7 +39,7 @@ class QueryTest extends UITestBase {
/**
* Tests query plugins settings.
*/
- public function testQueryUI() {
+ public function testQueryUI(): void {
$view = View::load('test_view');
$display = &$view->getDisplay('default');
$display['display_options']['query'] = ['type' => 'query_test'];
diff --git a/core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php b/core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php
index 207f23e0319..5edc08b04ce 100644
--- a/core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php
+++ b/core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php
@@ -60,7 +60,7 @@ class RearrangeFieldsTest extends UITestBase {
/**
* Tests field sorting.
*/
- public function testRearrangeFields() {
+ public function testRearrangeFields(): void {
$view_name = 'test_view';
// Checks that the order on the rearrange form matches the creation order.
diff --git a/core/modules/views_ui/tests/src/Functional/RedirectTest.php b/core/modules/views_ui/tests/src/Functional/RedirectTest.php
index 98bbea904bd..7d57860d32c 100644
--- a/core/modules/views_ui/tests/src/Functional/RedirectTest.php
+++ b/core/modules/views_ui/tests/src/Functional/RedirectTest.php
@@ -26,7 +26,7 @@ class RedirectTest extends UITestBase {
/**
* Tests the redirecting.
*/
- public function testRedirect() {
+ public function testRedirect(): void {
$view_name = 'test_view';
$random_destination = $this->randomMachineName();
diff --git a/core/modules/views_ui/tests/src/Functional/ReportFieldsTest.php b/core/modules/views_ui/tests/src/Functional/ReportFieldsTest.php
index 37cadbeab4d..36681e5ebfc 100644
--- a/core/modules/views_ui/tests/src/Functional/ReportFieldsTest.php
+++ b/core/modules/views_ui/tests/src/Functional/ReportFieldsTest.php
@@ -32,7 +32,7 @@ class ReportFieldsTest extends UITestBase {
/**
* Tests the Views fields report page.
*/
- public function testReportFields() {
+ public function testReportFields(): void {
$this->drupalGet('admin/reports/fields/views-fields');
$this->assertSession()->pageTextContains('Used in views');
$this->assertSession()->pageTextContains('No fields have been used in views yet.');
diff --git a/core/modules/views_ui/tests/src/Functional/ReportTest.php b/core/modules/views_ui/tests/src/Functional/ReportTest.php
index 5b87ccd560f..11b41c3b6d7 100644
--- a/core/modules/views_ui/tests/src/Functional/ReportTest.php
+++ b/core/modules/views_ui/tests/src/Functional/ReportTest.php
@@ -33,7 +33,7 @@ class ReportTest extends UITestBase {
/**
* Tests the existence of the views plugin report.
*/
- public function testReport() {
+ public function testReport(): void {
$this->drupalLogin($this->adminUser);
// Test the report page.
diff --git a/core/modules/views_ui/tests/src/Functional/RowUITest.php b/core/modules/views_ui/tests/src/Functional/RowUITest.php
index 187f611cf8b..2b8a31fa0a8 100644
--- a/core/modules/views_ui/tests/src/Functional/RowUITest.php
+++ b/core/modules/views_ui/tests/src/Functional/RowUITest.php
@@ -30,7 +30,7 @@ class RowUITest extends UITestBase {
/**
* Tests changing the row plugin and changing some options of a row.
*/
- public function testRowUI() {
+ public function testRowUI(): void {
$view_name = 'test_view';
$view_edit_url = "admin/structure/views/view/$view_name/edit";
diff --git a/core/modules/views_ui/tests/src/Functional/SettingsTest.php b/core/modules/views_ui/tests/src/Functional/SettingsTest.php
index 1e27b075989..426e3a3122c 100644
--- a/core/modules/views_ui/tests/src/Functional/SettingsTest.php
+++ b/core/modules/views_ui/tests/src/Functional/SettingsTest.php
@@ -36,7 +36,7 @@ class SettingsTest extends UITestBase {
/**
* Tests the settings for the edit ui.
*/
- public function testEditUI() {
+ public function testEditUI(): void {
$this->drupalLogin($this->adminUser);
// Test the settings tab exists.
diff --git a/core/modules/views_ui/tests/src/Functional/StorageTest.php b/core/modules/views_ui/tests/src/Functional/StorageTest.php
index bc4bd920cb0..3176483f647 100644
--- a/core/modules/views_ui/tests/src/Functional/StorageTest.php
+++ b/core/modules/views_ui/tests/src/Functional/StorageTest.php
@@ -38,7 +38,7 @@ class StorageTest extends UITestBase {
*
* @see views_ui_edit_details_form
*/
- public function testDetails() {
+ public function testDetails(): void {
$view_name = 'test_view';
ConfigurableLanguage::createFromLangcode('fr')->save();
diff --git a/core/modules/views_ui/tests/src/Functional/StyleTableTest.php b/core/modules/views_ui/tests/src/Functional/StyleTableTest.php
index 122ba1e5dbc..ae1e6a3eb8c 100644
--- a/core/modules/views_ui/tests/src/Functional/StyleTableTest.php
+++ b/core/modules/views_ui/tests/src/Functional/StyleTableTest.php
@@ -22,7 +22,7 @@ class StyleTableTest extends UITestBase {
/**
* Tests created a table style view.
*/
- public function testWizard() {
+ public function testWizard(): void {
// Create a new view and check that the first field has a label.
$view = [];
$view['label'] = $this->randomMachineName(16);
diff --git a/core/modules/views_ui/tests/src/Functional/StyleUITest.php b/core/modules/views_ui/tests/src/Functional/StyleUITest.php
index fe60b48488d..d04d6659322 100644
--- a/core/modules/views_ui/tests/src/Functional/StyleUITest.php
+++ b/core/modules/views_ui/tests/src/Functional/StyleUITest.php
@@ -29,7 +29,7 @@ class StyleUITest extends UITestBase {
/**
* Tests changing the style plugin and changing some options of a style.
*/
- public function testStyleUI() {
+ public function testStyleUI(): void {
$view_name = 'test_view';
$view_edit_url = "admin/structure/views/view/$view_name/edit";
diff --git a/core/modules/views_ui/tests/src/Functional/TokenizeAreaUITest.php b/core/modules/views_ui/tests/src/Functional/TokenizeAreaUITest.php
index 054c88cc61a..2d62f00a91e 100644
--- a/core/modules/views_ui/tests/src/Functional/TokenizeAreaUITest.php
+++ b/core/modules/views_ui/tests/src/Functional/TokenizeAreaUITest.php
@@ -28,7 +28,7 @@ class TokenizeAreaUITest extends UITestBase {
/**
* Tests that the right tokens are shown as available for replacement.
*/
- public function testTokenUI() {
+ public function testTokenUI(): void {
$entity_test = EntityTest::create(['bundle' => 'entity_test']);
$entity_test->save();
diff --git a/core/modules/views_ui/tests/src/Functional/TranslatedViewTest.php b/core/modules/views_ui/tests/src/Functional/TranslatedViewTest.php
index 653feb54514..ec0afc31188 100644
--- a/core/modules/views_ui/tests/src/Functional/TranslatedViewTest.php
+++ b/core/modules/views_ui/tests/src/Functional/TranslatedViewTest.php
@@ -73,7 +73,7 @@ class TranslatedViewTest extends UITestBase {
$this->rebuildContainer();
}
- public function testTranslatedStrings() {
+ public function testTranslatedStrings(): void {
$translation_url = 'admin/structure/views/view/files/translate/fr/add';
$edit_url = 'admin/structure/views/view/files';
diff --git a/core/modules/views_ui/tests/src/Functional/UnsavedPreviewTest.php b/core/modules/views_ui/tests/src/Functional/UnsavedPreviewTest.php
index f3d1e36846f..16be2e74331 100644
--- a/core/modules/views_ui/tests/src/Functional/UnsavedPreviewTest.php
+++ b/core/modules/views_ui/tests/src/Functional/UnsavedPreviewTest.php
@@ -48,7 +48,7 @@ class UnsavedPreviewTest extends UITestBase {
/**
* Tests previews of unsaved new page displays.
*/
- public function testUnsavedPageDisplayPreview() {
+ public function testUnsavedPageDisplayPreview(): void {
$this->drupalCreateContentType(['type' => 'page']);
for ($i = 0; $i < 5; $i++) {
$this->drupalCreateNode();
diff --git a/core/modules/views_ui/tests/src/Functional/ViewEditTest.php b/core/modules/views_ui/tests/src/Functional/ViewEditTest.php
index eb074c45ffb..b15fe2aeb19 100644
--- a/core/modules/views_ui/tests/src/Functional/ViewEditTest.php
+++ b/core/modules/views_ui/tests/src/Functional/ViewEditTest.php
@@ -31,7 +31,7 @@ class ViewEditTest extends UITestBase {
/**
* Tests the delete link on a views UI.
*/
- public function testDeleteLink() {
+ public function testDeleteLink(): void {
$this->drupalGet('admin/structure/views/view/test_view');
$this->assertSession()->linkExists('Delete view', 0, 'Ensure that the view delete link appears');
@@ -50,7 +50,7 @@ class ViewEditTest extends UITestBase {
/**
* Tests the machine name and administrative comment forms.
*/
- public function testOtherOptions() {
+ public function testOtherOptions(): void {
\Drupal::service('module_installer')->install(['dblog']);
$this->drupalGet('admin/structure/views/view/test_view');
// Add a new attachment display.
@@ -139,7 +139,7 @@ class ViewEditTest extends UITestBase {
/**
* Tests the language options on the views edit form.
*/
- public function testEditFormLanguageOptions() {
+ public function testEditFormLanguageOptions(): void {
$assert_session = $this->assertSession();
// Language options should not exist without language module.
@@ -262,7 +262,7 @@ class ViewEditTest extends UITestBase {
/**
* Tests Representative Node for a Taxonomy Term.
*/
- public function testRelationRepresentativeNode() {
+ public function testRelationRepresentativeNode(): void {
// Populate and submit the form.
$edit["name[taxonomy_term_field_data.tid_representative]"] = TRUE;
$this->drupalGet('admin/structure/views/nojs/add-handler/test_groupwise_term_ui/default/relationship');
diff --git a/core/modules/views_ui/tests/src/Functional/ViewsListTest.php b/core/modules/views_ui/tests/src/Functional/ViewsListTest.php
index 4d540fb3b49..2de0a885342 100644
--- a/core/modules/views_ui/tests/src/Functional/ViewsListTest.php
+++ b/core/modules/views_ui/tests/src/Functional/ViewsListTest.php
@@ -48,7 +48,7 @@ class ViewsListTest extends UITestBase {
/**
* Tests that the views list does not use a pager.
*/
- public function testViewsListLimit() {
+ public function testViewsListLimit(): void {
// Check if we can access the main views admin page.
$this->drupalGet('admin/structure/views');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/views_ui/tests/src/Functional/WizardTest.php b/core/modules/views_ui/tests/src/Functional/WizardTest.php
index 6ac9b7d8fe0..82042cc0c0e 100644
--- a/core/modules/views_ui/tests/src/Functional/WizardTest.php
+++ b/core/modules/views_ui/tests/src/Functional/WizardTest.php
@@ -25,7 +25,7 @@ class WizardTest extends WizardTestBase {
/**
* Tests filling in the wizard with really long strings.
*/
- public function testWizardFieldLength() {
+ public function testWizardFieldLength(): void {
$view = [];
$view['label'] = $this->randomMachineName(256);
$view['id'] = $this->randomMachineName(129);
diff --git a/core/modules/views_ui/tests/src/Functional/XssTest.php b/core/modules/views_ui/tests/src/Functional/XssTest.php
index 47a98951bcb..64528e943e4 100644
--- a/core/modules/views_ui/tests/src/Functional/XssTest.php
+++ b/core/modules/views_ui/tests/src/Functional/XssTest.php
@@ -23,7 +23,7 @@ class XssTest extends UITestBase {
*/
protected $defaultTheme = 'stark';
- public function testViewsUi() {
+ public function testViewsUi(): void {
$this->drupalGet('admin/structure/views/view/sa_contrib_2013_035');
// Verify that the field admin label is properly escaped.
$this->assertSession()->assertEscaped('<marquee>test</marquee>');
@@ -37,7 +37,7 @@ class XssTest extends UITestBase {
/**
* Checks the admin UI for double escaping.
*/
- public function testNoDoubleEscaping() {
+ public function testNoDoubleEscaping(): void {
$this->drupalGet('admin/structure/views');
$this->assertSession()->assertNoEscaped('&lt;');
diff --git a/core/modules/views_ui/tests/src/FunctionalJavascript/AdminAjaxTest.php b/core/modules/views_ui/tests/src/FunctionalJavascript/AdminAjaxTest.php
index 38e1a3089b7..7b6f8495264 100644
--- a/core/modules/views_ui/tests/src/FunctionalJavascript/AdminAjaxTest.php
+++ b/core/modules/views_ui/tests/src/FunctionalJavascript/AdminAjaxTest.php
@@ -39,7 +39,7 @@ class AdminAjaxTest extends WebDriverTestBase {
/**
* Confirms that form_alter is triggered after AJAX rebuilds.
*/
- public function testAjaxRebuild() {
+ public function testAjaxRebuild(): void {
\Drupal::service('theme_installer')->install(['views_ui_test_theme']);
$this->config('system.theme')
@@ -64,7 +64,7 @@ class AdminAjaxTest extends WebDriverTestBase {
/**
* Tests body scroll.
*/
- public function testBodyScroll() {
+ public function testBodyScroll(): void {
$this->drupalGet('admin/structure/views/view/user_admin_people');
$page = $this->getSession()->getPage();
foreach (['name[views.nothing]', 'name[views.dropbutton]'] as $field) {
diff --git a/core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php b/core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php
index 70fb850e6e1..9e55481c9cd 100644
--- a/core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php
+++ b/core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php
@@ -67,7 +67,7 @@ class DisplayTest extends WebDriverTestBase {
/**
* Tests adding a display.
*/
- public function testAddDisplay() {
+ public function testAddDisplay(): void {
$this->drupalGet('admin/structure/views/view/test_content_ajax');
$page = $this->getSession()->getPage();
@@ -86,7 +86,7 @@ class DisplayTest extends WebDriverTestBase {
/**
* Tests setting the administrative title.
*/
- public function testRenameDisplayAdminName() {
+ public function testRenameDisplayAdminName(): void {
$titles = ['New admin title', '</title><script>alert("alert!")</script>'];
foreach ($titles as $new_title) {
$this->drupalGet('admin/structure/views/view/test_content_ajax');
@@ -108,7 +108,7 @@ class DisplayTest extends WebDriverTestBase {
/**
* Tests contextual links on Views page displays.
*/
- public function testPageContextualLinks() {
+ public function testPageContextualLinks(): void {
$view = View::load('test_display');
$view->enable()->save();
$this->container->get('router.builder')->rebuildIfNeeded();
@@ -160,7 +160,7 @@ class DisplayTest extends WebDriverTestBase {
/**
* Test if 'add' translations are filtered from multilingual display options.
*/
- public function testAddDisplayBlockTranslation() {
+ public function testAddDisplayBlockTranslation(): void {
// Set up an additional language (Hungarian).
$langcode = 'hu';
diff --git a/core/modules/views_ui/tests/src/FunctionalJavascript/FieldDialogsTest.php b/core/modules/views_ui/tests/src/FunctionalJavascript/FieldDialogsTest.php
index 39f45b48209..edb025c2fa3 100644
--- a/core/modules/views_ui/tests/src/FunctionalJavascript/FieldDialogsTest.php
+++ b/core/modules/views_ui/tests/src/FunctionalJavascript/FieldDialogsTest.php
@@ -58,7 +58,7 @@ class FieldDialogsTest extends WebDriverTestBase {
/**
* Tests removing a field through the rearrange dialog.
*/
- public function testRemoveFieldHandler() {
+ public function testRemoveFieldHandler(): void {
$this->drupalGet('admin/structure/views/view/test_content_ajax');
$page = $this->getSession()->getPage();
diff --git a/core/modules/views_ui/tests/src/FunctionalJavascript/FilterCriteriaTest.php b/core/modules/views_ui/tests/src/FunctionalJavascript/FilterCriteriaTest.php
index a23c72f6ff1..8dffc12aa43 100644
--- a/core/modules/views_ui/tests/src/FunctionalJavascript/FilterCriteriaTest.php
+++ b/core/modules/views_ui/tests/src/FunctionalJavascript/FilterCriteriaTest.php
@@ -44,7 +44,7 @@ class FilterCriteriaTest extends WebDriverTestBase {
/**
* Tests dialog for filter criteria.
*/
- public function testFilterCriteriaDialog() {
+ public function testFilterCriteriaDialog(): void {
// Checks that the admin summary is not double escaped.
$this->drupalGet('admin/structure/views/view/who_s_online');
$page = $this->getSession()->getPage();
@@ -130,7 +130,7 @@ class FilterCriteriaTest extends WebDriverTestBase {
/**
* Tests operator labels.
*/
- public function testOperatorLabels() {
+ public function testOperatorLabels(): void {
// Open the "Frontpage" view.
$this->drupalGet('admin/structure/views/view/frontpage');
$session = $this->getSession();
diff --git a/core/modules/views_ui/tests/src/FunctionalJavascript/FilterOptionsTest.php b/core/modules/views_ui/tests/src/FunctionalJavascript/FilterOptionsTest.php
index f8c15f1d43a..3a5dc110040 100644
--- a/core/modules/views_ui/tests/src/FunctionalJavascript/FilterOptionsTest.php
+++ b/core/modules/views_ui/tests/src/FunctionalJavascript/FilterOptionsTest.php
@@ -43,7 +43,7 @@ class FilterOptionsTest extends WebDriverTestBase {
/**
* Tests filtering options in the 'Add fields' dialog.
*/
- public function testFilterOptionsAddFields() {
+ public function testFilterOptionsAddFields(): void {
$this->drupalGet('admin/structure/views/view/content');
$session = $this->getSession();
diff --git a/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php b/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php
index b9afc6146f1..13486172808 100644
--- a/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php
+++ b/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php
@@ -116,7 +116,7 @@ class PreviewTest extends WebDriverTestBase {
*
* @see https://www.drupal.org/node/2452659
*/
- public function testTaxonomyAJAX() {
+ public function testTaxonomyAJAX(): void {
\Drupal::service('module_installer')->install(['taxonomy']);
$this->getPreviewAJAX('taxonomy_term', 'page_1', 0);
}
@@ -124,7 +124,7 @@ class PreviewTest extends WebDriverTestBase {
/**
* Tests pagers in the preview form.
*/
- public function testPreviewWithPagersUI() {
+ public function testPreviewWithPagersUI(): void {
// Create 11 nodes and make sure that everyone is returned.
$this->drupalCreateContentType(['type' => 'page']);
for ($i = 0; $i < 11; $i++) {
@@ -229,7 +229,7 @@ class PreviewTest extends WebDriverTestBase {
/**
* Tests the link to sort in the preview form.
*/
- public function testPreviewSortLink() {
+ public function testPreviewSortLink(): void {
// Get the preview.
$this->getPreviewAJAX('test_click_sort_ajax', 'page_1', 0);
diff --git a/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php b/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php
index cd2f7cb9dd1..7355e16c023 100644
--- a/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php
+++ b/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php
@@ -40,7 +40,7 @@ class ViewsListingTest extends WebDriverTestBase {
/**
* Tests the filtering on the Views listing page.
*/
- public function testFilterViewsListing() {
+ public function testFilterViewsListing(): void {
$enabled_views_count = 6;
$disabled_views_count = 2;
$content_views_count = 3;
diff --git a/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsWizardTest.php b/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsWizardTest.php
index 227ccb618e0..b1026d78584 100644
--- a/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsWizardTest.php
+++ b/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsWizardTest.php
@@ -40,7 +40,7 @@ class ViewsWizardTest extends WebDriverTestBase {
/**
* Tests creating a View using the wizard.
*/
- public function testCreateViewWizard() {
+ public function testCreateViewWizard(): void {
$this->drupalGet('admin/structure/views/add');
$page = $this->getSession()->getPage();
diff --git a/core/modules/views_ui/tests/src/Kernel/TagTest.php b/core/modules/views_ui/tests/src/Kernel/TagTest.php
index a9311c65479..5881a169fa0 100644
--- a/core/modules/views_ui/tests/src/Kernel/TagTest.php
+++ b/core/modules/views_ui/tests/src/Kernel/TagTest.php
@@ -27,7 +27,7 @@ class TagTest extends ViewsKernelTestBase {
/**
* Tests the ViewsUIController::autocompleteTag() function.
*/
- public function testViewsUiAutocompleteTag() {
+ public function testViewsUiAutocompleteTag(): void {
\Drupal::moduleHandler()->loadInclude('views_ui', 'inc', 'admin');
// Save 15 views with a tag.
@@ -80,7 +80,7 @@ class TagTest extends ViewsKernelTestBase {
*
* @dataProvider providerViewsUiAutocompleteIndividualTags
*/
- public function testViewsUiAutocompleteIndividualTags($expected_tag, $search_string) {
+ public function testViewsUiAutocompleteIndividualTags($expected_tag, $search_string): void {
$controller = ViewsUIController::create($this->container);
$request = $this->container->get('request_stack')->getCurrentRequest();
$tag = 'comma, 你好, Foo bar';
diff --git a/core/modules/views_ui/tests/src/Unit/Form/Ajax/RearrangeFilterTest.php b/core/modules/views_ui/tests/src/Unit/Form/Ajax/RearrangeFilterTest.php
index a47c8450bdd..d249435decc 100644
--- a/core/modules/views_ui/tests/src/Unit/Form/Ajax/RearrangeFilterTest.php
+++ b/core/modules/views_ui/tests/src/Unit/Form/Ajax/RearrangeFilterTest.php
@@ -17,7 +17,7 @@ class RearrangeFilterTest extends UnitTestCase {
/**
* Tests static methods.
*/
- public function testStaticMethods() {
+ public function testStaticMethods(): void {
// Test the RearrangeFilter::arrayKeyPlus method.
$original = [0 => 'one', 1 => 'two', 2 => 'three'];
$expected = [1 => 'one', 2 => 'two', 3 => 'three'];
diff --git a/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php b/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php
index 442d9310818..ceae6360fc7 100644
--- a/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php
+++ b/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php
@@ -27,7 +27,7 @@ class ViewListBuilderTest extends UnitTestCase {
* @see \Drupal\views_ui\ViewListBuilder::getDisplaysList()
* @covers ::buildRow
*/
- public function testBuildRowEntityList() {
+ public function testBuildRowEntityList(): void {
$storage = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigEntityStorage')
->disableOriginalConstructor()
->getMock();
diff --git a/core/modules/views_ui/tests/src/Unit/ViewUIObjectTest.php b/core/modules/views_ui/tests/src/Unit/ViewUIObjectTest.php
index d98a31dd04c..d5fea2ab2cd 100644
--- a/core/modules/views_ui/tests/src/Unit/ViewUIObjectTest.php
+++ b/core/modules/views_ui/tests/src/Unit/ViewUIObjectTest.php
@@ -20,7 +20,7 @@ class ViewUIObjectTest extends UnitTestCase {
/**
* Tests entity method decoration.
*/
- public function testEntityDecoration() {
+ public function testEntityDecoration(): void {
$method_args = [];
$method_args['setOriginalId'] = [12];
$method_args['setStatus'] = [TRUE];
@@ -75,7 +75,7 @@ class ViewUIObjectTest extends UnitTestCase {
/**
* Tests the isLocked method.
*/
- public function testIsLocked() {
+ public function testIsLocked(): void {
$storage = $this->getMockBuilder('Drupal\views\Entity\View')
->setConstructorArgs([[], 'view'])
->getMock();
@@ -115,7 +115,7 @@ class ViewUIObjectTest extends UnitTestCase {
/**
* Tests serialization of the ViewUI object.
*/
- public function testSerialization() {
+ public function testSerialization(): void {
$storage = new View([], 'view');
$executable = $this->getMockBuilder('Drupal\views\ViewExecutable')
->disableOriginalConstructor()
diff --git a/core/modules/workflows/tests/src/Functional/WorkflowCustomStateTransitionAccessTest.php b/core/modules/workflows/tests/src/Functional/WorkflowCustomStateTransitionAccessTest.php
index 8029164aaf2..b99b2bca693 100644
--- a/core/modules/workflows/tests/src/Functional/WorkflowCustomStateTransitionAccessTest.php
+++ b/core/modules/workflows/tests/src/Functional/WorkflowCustomStateTransitionAccessTest.php
@@ -58,7 +58,7 @@ class WorkflowCustomStateTransitionAccessTest extends BrowserTestBase {
/**
* Tests the custom state/transition operation access rules.
*/
- public function testCustomWorkflowAccessOperations() {
+ public function testCustomWorkflowAccessOperations(): void {
$this->drupalLogin($this->adminUser);
$forbidden_paths = [
'admin/config/workflow/workflows/manage/test_type/state/cannot_delete/delete',
diff --git a/core/modules/workflows/tests/src/Functional/WorkflowUiNoTypeTest.php b/core/modules/workflows/tests/src/Functional/WorkflowUiNoTypeTest.php
index 3025b0c4b60..ee5b7806f4a 100644
--- a/core/modules/workflows/tests/src/Functional/WorkflowUiNoTypeTest.php
+++ b/core/modules/workflows/tests/src/Functional/WorkflowUiNoTypeTest.php
@@ -38,7 +38,7 @@ class WorkflowUiNoTypeTest extends BrowserTestBase {
/**
* Tests the creation of a workflow through the UI.
*/
- public function testWorkflowUiWithNoType() {
+ public function testWorkflowUiWithNoType(): void {
$this->drupalLogin($this->createUser(['access administration pages', 'administer workflows']));
$this->drupalGet('admin/config/workflow/workflows/add');
// There are no workflow types so this should be a 403.
diff --git a/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php b/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php
index 15285313097..c959cc020b6 100644
--- a/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php
+++ b/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php
@@ -40,7 +40,7 @@ class WorkflowUiTest extends BrowserTestBase {
/**
* Tests route access/permissions.
*/
- public function testAccess() {
+ public function testAccess(): void {
// Create a minimal workflow for testing.
$workflow = Workflow::create(['id' => 'test', 'type' => 'workflow_type_test', 'label' => 'Test']);
$workflow
@@ -91,7 +91,7 @@ class WorkflowUiTest extends BrowserTestBase {
/**
* Tests the machine name validation of the state add form.
*/
- public function testStateMachineNameValidation() {
+ public function testStateMachineNameValidation(): void {
Workflow::create([
'id' => 'test_workflow',
'label' => 'Test workflow',
@@ -119,7 +119,7 @@ class WorkflowUiTest extends BrowserTestBase {
/**
* Tests the creation of a workflow through the UI.
*/
- public function testWorkflowCreation() {
+ public function testWorkflowCreation(): void {
$workflow_storage = $this->container->get('entity_type.manager')->getStorage('workflow');
/** @var \Drupal\workflows\WorkflowInterface $workflow */
$this->drupalLogin($this->createUser(['access administration pages', 'administer workflows']));
@@ -291,7 +291,7 @@ class WorkflowUiTest extends BrowserTestBase {
/**
* Tests the workflow configuration form.
*/
- public function testWorkflowConfigurationForm() {
+ public function testWorkflowConfigurationForm(): void {
$workflow = Workflow::create(['id' => 'test', 'type' => 'workflow_type_complex_test', 'label' => 'Test']);
$workflow
->getTypePlugin()
@@ -314,7 +314,7 @@ class WorkflowUiTest extends BrowserTestBase {
/**
* Tests a workflow, state, and transition can have a numeric ID and label.
*/
- public function testNumericIds() {
+ public function testNumericIds(): void {
$this->drupalLogin($this->createUser(['administer workflows']));
$this->drupalGet('admin/config/workflow/workflows');
$this->clickLink('Add workflow');
@@ -343,7 +343,7 @@ class WorkflowUiTest extends BrowserTestBase {
/**
* Tests the sorting of states and transitions by weight and label.
*/
- public function testSorting() {
+ public function testSorting(): void {
$workflow = Workflow::create(['id' => 'test', 'type' => 'workflow_type_complex_test', 'label' => 'Test']);
$workflow
->getTypePlugin()
diff --git a/core/modules/workflows/tests/src/Kernel/ComplexWorkflowTypeTest.php b/core/modules/workflows/tests/src/Kernel/ComplexWorkflowTypeTest.php
index f36ef8a5038..f1fb13c1bd6 100644
--- a/core/modules/workflows/tests/src/Kernel/ComplexWorkflowTypeTest.php
+++ b/core/modules/workflows/tests/src/Kernel/ComplexWorkflowTypeTest.php
@@ -24,7 +24,7 @@ class ComplexWorkflowTypeTest extends KernelTestBase {
/**
* @covers \Drupal\workflows\Entity\Workflow::loadMultipleByType
*/
- public function testLoadMultipleByType() {
+ public function testLoadMultipleByType(): void {
$workflow1 = Workflow::create([
'id' => 'test1',
'label' => 'Test 1',
diff --git a/core/modules/workflows/tests/src/Kernel/PredefinedWorkflowTypeTest.php b/core/modules/workflows/tests/src/Kernel/PredefinedWorkflowTypeTest.php
index 5cd634613a3..39fa5082cdd 100644
--- a/core/modules/workflows/tests/src/Kernel/PredefinedWorkflowTypeTest.php
+++ b/core/modules/workflows/tests/src/Kernel/PredefinedWorkflowTypeTest.php
@@ -22,7 +22,7 @@ class PredefinedWorkflowTypeTest extends KernelTestBase {
/**
* Tests a predefined workflow type.
*/
- public function testPredefinedWorkflowType() {
+ public function testPredefinedWorkflowType(): void {
$workflow = Workflow::create([
'id' => 'aces',
'label' => 'Aces Workflow',
diff --git a/core/modules/workflows/tests/src/Kernel/RequiredStatesTest.php b/core/modules/workflows/tests/src/Kernel/RequiredStatesTest.php
index a9368965dd1..c76a989ebfa 100644
--- a/core/modules/workflows/tests/src/Kernel/RequiredStatesTest.php
+++ b/core/modules/workflows/tests/src/Kernel/RequiredStatesTest.php
@@ -26,7 +26,7 @@ class RequiredStatesTest extends KernelTestBase {
* @covers ::getRequiredStates
* @covers ::__construct
*/
- public function testGetRequiredStates() {
+ public function testGetRequiredStates(): void {
$workflow = Workflow::create([
'id' => 'test',
'label' => 'Test workflow',
@@ -45,7 +45,7 @@ class RequiredStatesTest extends KernelTestBase {
/**
* @covers \Drupal\workflows\Entity\Workflow::preSave
*/
- public function testDeleteRequiredStateAPI() {
+ public function testDeleteRequiredStateAPI(): void {
$workflow = Workflow::create([
'id' => 'test',
'label' => 'Test workflow',
@@ -62,7 +62,7 @@ class RequiredStatesTest extends KernelTestBase {
/**
* @covers \Drupal\workflows\Entity\Workflow::preSave
*/
- public function testNoStatesRequiredStateAPI() {
+ public function testNoStatesRequiredStateAPI(): void {
$workflow = Workflow::create([
'id' => 'test',
'type' => 'workflow_type_required_state_test',
@@ -78,7 +78,7 @@ class RequiredStatesTest extends KernelTestBase {
/**
* Ensures that initialized configuration can be changed.
*/
- public function testChangeRequiredStateAPI() {
+ public function testChangeRequiredStateAPI(): void {
$workflow = Workflow::create([
'id' => 'test',
'label' => 'Test workflow',
diff --git a/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php b/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php
index 81cf994a94b..b3e3d9a9c20 100644
--- a/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php
+++ b/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php
@@ -72,7 +72,7 @@ class WorkflowAccessControlHandlerTest extends KernelTestBase {
/**
* @covers ::checkCreateAccess
*/
- public function testCheckCreateAccess() {
+ public function testCheckCreateAccess(): void {
// A user must have the correct permission to create a workflow.
$this->assertEquals(
AccessResult::neutral()
@@ -101,7 +101,7 @@ class WorkflowAccessControlHandlerTest extends KernelTestBase {
* @covers ::checkAccess
* @dataProvider checkAccessProvider
*/
- public function testCheckAccess($user, $operation, $result, $states_to_create = []) {
+ public function testCheckAccess($user, $operation, $result, $states_to_create = []): void {
$workflow = Workflow::create([
'type' => 'workflow_type_test',
'id' => 'test_workflow',
diff --git a/core/modules/workflows/tests/src/Kernel/WorkflowDependenciesTest.php b/core/modules/workflows/tests/src/Kernel/WorkflowDependenciesTest.php
index 07fdeb0407c..e0f9c681e55 100644
--- a/core/modules/workflows/tests/src/Kernel/WorkflowDependenciesTest.php
+++ b/core/modules/workflows/tests/src/Kernel/WorkflowDependenciesTest.php
@@ -29,7 +29,7 @@ class WorkflowDependenciesTest extends KernelTestBase {
/**
* Tests \Drupal\workflows\Entity\Workflow::onDependencyRemoval().
*/
- public function testOnDependencyRemoval() {
+ public function testOnDependencyRemoval(): void {
// Create a workflow that has a dependency on a third party setting.
$workflow = Workflow::create([
'id' => 'test3',
diff --git a/core/modules/workflows/tests/src/Unit/StateTest.php b/core/modules/workflows/tests/src/Unit/StateTest.php
index 2ce55c4745c..a5e508a3d5b 100644
--- a/core/modules/workflows/tests/src/Unit/StateTest.php
+++ b/core/modules/workflows/tests/src/Unit/StateTest.php
@@ -22,7 +22,7 @@ class StateTest extends UnitTestCase {
* @covers ::label
* @covers ::weight
*/
- public function testGetters() {
+ public function testGetters(): void {
$state = new State(
$this->prophesize(WorkflowTypeInterface::class)->reveal(),
'draft',
@@ -37,7 +37,7 @@ class StateTest extends UnitTestCase {
/**
* @covers ::canTransitionTo
*/
- public function testCanTransitionTo() {
+ public function testCanTransitionTo(): void {
$workflow_type = new TestType([], '', []);
$workflow_type
->addState('draft', 'Draft')
@@ -54,7 +54,7 @@ class StateTest extends UnitTestCase {
/**
* @covers ::getTransitionTo
*/
- public function testGetTransitionTo() {
+ public function testGetTransitionTo(): void {
$workflow_type = new TestType([], '', []);
$workflow_type
->addState('draft', 'Draft')
@@ -68,7 +68,7 @@ class StateTest extends UnitTestCase {
/**
* @covers ::getTransitionTo
*/
- public function testGetTransitionToException() {
+ public function testGetTransitionToException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("Can not transition to 'published' state");
$workflow_type = new TestType([], '', []);
@@ -80,7 +80,7 @@ class StateTest extends UnitTestCase {
/**
* @covers ::getTransitions
*/
- public function testGetTransitions() {
+ public function testGetTransitions(): void {
$workflow_type = new TestType([], '', []);
$workflow_type
->addState('draft', 'Draft')
@@ -99,7 +99,7 @@ class StateTest extends UnitTestCase {
/**
* @covers ::labelCallback
*/
- public function testLabelCallback() {
+ public function testLabelCallback(): void {
$workflow_type = $this->prophesize(WorkflowTypeInterface::class)->reveal();
$states = [
new State($workflow_type, 'draft', 'Draft'),
diff --git a/core/modules/workflows/tests/src/Unit/TransitionTest.php b/core/modules/workflows/tests/src/Unit/TransitionTest.php
index 5ff7d02abbd..7aac71ff078 100644
--- a/core/modules/workflows/tests/src/Unit/TransitionTest.php
+++ b/core/modules/workflows/tests/src/Unit/TransitionTest.php
@@ -21,7 +21,7 @@ class TransitionTest extends UnitTestCase {
* @covers ::id
* @covers ::label
*/
- public function testGetters() {
+ public function testGetters(): void {
$state = new Transition(
$this->prophesize(WorkflowTypeInterface::class)->reveal(),
'draft_published',
@@ -37,7 +37,7 @@ class TransitionTest extends UnitTestCase {
* @covers ::from
* @covers ::to
*/
- public function testFromAndTo() {
+ public function testFromAndTo(): void {
$workflow = new TestType([], '', []);
$workflow
->addState('draft', 'Draft')
diff --git a/core/modules/workflows/tests/src/Unit/WorkflowStateTransitionOperationsAccessCheckTest.php b/core/modules/workflows/tests/src/Unit/WorkflowStateTransitionOperationsAccessCheckTest.php
index 1f7b4ed4517..da1aabd97dc 100644
--- a/core/modules/workflows/tests/src/Unit/WorkflowStateTransitionOperationsAccessCheckTest.php
+++ b/core/modules/workflows/tests/src/Unit/WorkflowStateTransitionOperationsAccessCheckTest.php
@@ -25,7 +25,7 @@ class WorkflowStateTransitionOperationsAccessCheckTest extends UnitTestCase {
* @covers ::access
* @dataProvider accessTestCases
*/
- public function testAccess($route_requirement, $resulting_entity_access_check, $route_parameters = []) {
+ public function testAccess($route_requirement, $resulting_entity_access_check, $route_parameters = []): void {
$workflow_entity_access_result = AccessResult::allowed();
$workflow = $this->prophesize(WorkflowInterface::class);
$workflow->access($resulting_entity_access_check, Argument::type(AccountInterface::class), TRUE)
@@ -94,7 +94,7 @@ class WorkflowStateTransitionOperationsAccessCheckTest extends UnitTestCase {
/**
* @covers ::access
*/
- public function testMissingRouteParams() {
+ public function testMissingRouteParams(): void {
$workflow = $this->prophesize(WorkflowInterface::class);
$workflow->access()->shouldNotBeCalled();
@@ -126,7 +126,7 @@ class WorkflowStateTransitionOperationsAccessCheckTest extends UnitTestCase {
* @covers ::access
* @dataProvider invalidOperationNameTestCases
*/
- public function testInvalidOperationName($operation_name) {
+ public function testInvalidOperationName($operation_name): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage("Invalid _workflow_access operation '$operation_name' specified for route 'Foo Route'.");
$route = new Route('', [], [
diff --git a/core/modules/workflows/tests/src/Unit/WorkflowTest.php b/core/modules/workflows/tests/src/Unit/WorkflowTest.php
index d15567d22cd..76fae5af6f6 100644
--- a/core/modules/workflows/tests/src/Unit/WorkflowTest.php
+++ b/core/modules/workflows/tests/src/Unit/WorkflowTest.php
@@ -38,7 +38,7 @@ class WorkflowTest extends UnitTestCase {
* @covers ::addState
* @covers ::hasState
*/
- public function testAddAndHasState() {
+ public function testAddAndHasState(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
$this->assertFalse($workflow->getTypePlugin()->hasState('draft'));
@@ -59,7 +59,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::addState
*/
- public function testAddStateException() {
+ public function testAddStateException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The state 'draft' already exists in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -70,7 +70,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::addState
*/
- public function testAddStateInvalidIdException() {
+ public function testAddStateInvalidIdException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The state ID 'draft-draft' must contain only lowercase letters, numbers, and underscores");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -80,7 +80,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::getStates
*/
- public function testGetStates() {
+ public function testGetStates(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
// Getting states works when there are none.
@@ -124,7 +124,7 @@ class WorkflowTest extends UnitTestCase {
/**
* Tests numeric IDs when added to a workflow.
*/
- public function testNumericIdSorting() {
+ public function testNumericIdSorting(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
$workflow_type = $workflow->getTypePlugin();
@@ -145,7 +145,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::getStates
*/
- public function testGetStatesException() {
+ public function testGetStatesException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The state 'state_that_does_not_exist' does not exist in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -155,7 +155,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::getState
*/
- public function testGetState() {
+ public function testGetState(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
// By default states are ordered in the order added.
$workflow
@@ -184,7 +184,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::getState
*/
- public function testGetStateException() {
+ public function testGetStateException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The state 'state_that_does_not_exist' does not exist in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -194,7 +194,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::setStateLabel
*/
- public function testSetStateLabel() {
+ public function testSetStateLabel(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
$workflow->getTypePlugin()->addState('draft', 'Draft');
$this->assertEquals('Draft', $workflow->getTypePlugin()->getState('draft')->label());
@@ -205,7 +205,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::setStateLabel
*/
- public function testSetStateLabelException() {
+ public function testSetStateLabelException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The state 'draft' does not exist in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -215,7 +215,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::setStateWeight
*/
- public function testSetStateWeight() {
+ public function testSetStateWeight(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
$workflow->getTypePlugin()->addState('draft', 'Draft');
$this->assertEquals(0, $workflow->getTypePlugin()->getState('draft')->weight());
@@ -226,7 +226,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::setStateWeight
*/
- public function testSetStateWeightException() {
+ public function testSetStateWeightException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The state 'draft' does not exist in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -236,7 +236,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::setStateWeight
*/
- public function testSetStateWeightNonNumericException() {
+ public function testSetStateWeightNonNumericException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The weight 'foo' must be numeric for state 'Published'.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -247,7 +247,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::deleteState
*/
- public function testDeleteState() {
+ public function testDeleteState(): void {
$workflow_type = new TestType([], '', []);
$workflow_type
->addState('draft', 'Draft')
@@ -269,7 +269,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::deleteState
*/
- public function testDeleteStateException() {
+ public function testDeleteStateException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The state 'draft' does not exist in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -279,7 +279,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::deleteState
*/
- public function testDeleteOnlyStateException() {
+ public function testDeleteOnlyStateException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The state 'draft' can not be deleted from workflow as it is the only state");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -291,7 +291,7 @@ class WorkflowTest extends UnitTestCase {
* @covers ::addTransition
* @covers ::hasTransition
*/
- public function testAddTransition() {
+ public function testAddTransition(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
// By default states are ordered in the order added.
@@ -314,7 +314,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::addTransition
*/
- public function testAddTransitionDuplicateException() {
+ public function testAddTransitionDuplicateException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The transition 'publish' already exists in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -326,7 +326,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::addTransition
*/
- public function testAddTransitionInvalidIdException() {
+ public function testAddTransitionInvalidIdException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The transition ID 'publish-publish' must contain only lowercase letters, numbers, and underscores");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -337,7 +337,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::addTransition
*/
- public function testAddTransitionMissingFromException() {
+ public function testAddTransitionMissingFromException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The state 'draft' does not exist in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -348,7 +348,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::addTransition
*/
- public function testAddTransitionDuplicateTransitionStatesException() {
+ public function testAddTransitionDuplicateTransitionStatesException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The 'publish' transition already allows 'draft' to 'published' transitions in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -363,7 +363,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::addTransition
*/
- public function testAddTransitionConsistentAfterFromCatch() {
+ public function testAddTransitionConsistentAfterFromCatch(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
$workflow->getTypePlugin()->addState('published', 'Published');
try {
@@ -380,7 +380,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::addTransition
*/
- public function testAddTransitionMissingToException() {
+ public function testAddTransitionMissingToException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The state 'published' does not exist in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -392,7 +392,7 @@ class WorkflowTest extends UnitTestCase {
* @covers ::getTransitions
* @covers ::setTransitionWeight
*/
- public function testGetTransitions() {
+ public function testGetTransitions(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
// Getting transitions works when there are none.
@@ -436,7 +436,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::getTransition
*/
- public function testGetTransition() {
+ public function testGetTransition(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
// By default states are ordered in the order added.
$workflow
@@ -460,7 +460,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::getTransition
*/
- public function testGetTransitionException() {
+ public function testGetTransitionException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The transition 'transition_that_does_not_exist' does not exist in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -470,7 +470,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::getTransitionsForState
*/
- public function testGetTransitionsForState() {
+ public function testGetTransitionsForState(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
// By default states are ordered in the order added.
$workflow
@@ -494,7 +494,7 @@ class WorkflowTest extends UnitTestCase {
* @covers ::getTransitionFromStateToState
* @covers ::hasTransitionFromStateToState
*/
- public function testGetTransitionFromStateToState() {
+ public function testGetTransitionFromStateToState(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
// By default states are ordered in the order added.
$workflow
@@ -515,7 +515,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::getTransitionFromStateToState
*/
- public function testGetTransitionFromStateToStateException() {
+ public function testGetTransitionFromStateToStateException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The transition from 'archived' to 'archived' does not exist in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -535,7 +535,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::setTransitionLabel
*/
- public function testSetTransitionLabel() {
+ public function testSetTransitionLabel(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
$workflow
->getTypePlugin()
@@ -550,7 +550,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::setTransitionLabel
*/
- public function testSetTransitionLabelException() {
+ public function testSetTransitionLabelException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The transition 'draft-published' does not exist in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -561,7 +561,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::setTransitionWeight
*/
- public function testSetTransitionWeight() {
+ public function testSetTransitionWeight(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
$workflow
->getTypePlugin()
@@ -576,7 +576,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::setTransitionWeight
*/
- public function testSetTransitionWeightException() {
+ public function testSetTransitionWeightException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The transition 'draft-published' does not exist in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -587,7 +587,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::setTransitionWeight
*/
- public function testSetTransitionWeightNonNumericException() {
+ public function testSetTransitionWeightNonNumericException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The weight 'foo' must be numeric for transition 'Publish'.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -599,7 +599,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::setTransitionFromStates
*/
- public function testSetTransitionFromStates() {
+ public function testSetTransitionFromStates(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
$workflow
->getTypePlugin()
@@ -624,7 +624,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::setTransitionFromStates
*/
- public function testSetTransitionFromStatesMissingTransition() {
+ public function testSetTransitionFromStatesMissingTransition(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The transition 'test' does not exist in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -641,7 +641,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::setTransitionFromStates
*/
- public function testSetTransitionFromStatesMissingState() {
+ public function testSetTransitionFromStatesMissingState(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The state 'published' does not exist in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -657,7 +657,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::setTransitionFromStates
*/
- public function testSetTransitionFromStatesAlreadyExists() {
+ public function testSetTransitionFromStatesAlreadyExists(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The 'create_new_draft' transition already allows 'draft' to 'draft' transitions in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -675,7 +675,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::deleteTransition
*/
- public function testDeleteTransition() {
+ public function testDeleteTransition(): void {
$workflow_type = new TestType([], '', []);
$workflow_type
->addState('draft', 'Draft')
@@ -691,7 +691,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers ::deleteTransition
*/
- public function testDeleteTransitionException() {
+ public function testDeleteTransitionException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The transition 'draft-published' does not exist in workflow.");
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
@@ -702,7 +702,7 @@ class WorkflowTest extends UnitTestCase {
/**
* @covers \Drupal\workflows\Entity\Workflow::status
*/
- public function testStatus() {
+ public function testStatus(): void {
$workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
$this->assertFalse($workflow->status());
$workflow->getTypePlugin()->addState('published', 'Published');
diff --git a/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php b/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php
index 800d40af8a0..9144c1eb0bf 100644
--- a/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php
+++ b/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php
@@ -83,7 +83,7 @@ class PathWorkspacesTest extends BrowserTestBase {
/**
* Tests path aliases with workspaces.
*/
- public function testPathAliases() {
+ public function testPathAliases(): void {
// Create a published node in Live, without an alias.
$node = $this->drupalCreateNode([
'type' => 'article',
@@ -123,7 +123,7 @@ class PathWorkspacesTest extends BrowserTestBase {
/**
* Tests path aliases with workspaces and user switching.
*/
- public function testPathAliasesUserSwitch() {
+ public function testPathAliasesUserSwitch(): void {
// Create a published node in Live, without an alias.
$node = $this->drupalCreateNode([
'type' => 'article',
@@ -167,7 +167,7 @@ class PathWorkspacesTest extends BrowserTestBase {
/**
* Tests path aliases with workspaces for translatable nodes.
*/
- public function testPathAliasesWithTranslation() {
+ public function testPathAliasesWithTranslation(): void {
$stage = Workspace::load('stage');
// Create one node with a random alias.
diff --git a/core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlAnonTest.php b/core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlAnonTest.php
index 930e917dbbb..2e3dd785b69 100644
--- a/core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlAnonTest.php
+++ b/core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlAnonTest.php
@@ -35,7 +35,7 @@ class WorkspaceXmlAnonTest extends WorkspaceResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlBasicAuthTest.php b/core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlBasicAuthTest.php
index eacd4ac49ef..cbecdd36d2c 100644
--- a/core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlBasicAuthTest.php
+++ b/core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlBasicAuthTest.php
@@ -45,7 +45,7 @@ class WorkspaceXmlBasicAuthTest extends WorkspaceResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlCookieTest.php b/core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlCookieTest.php
index 5f064f7163d..9065e0714a1 100644
--- a/core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlCookieTest.php
+++ b/core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlCookieTest.php
@@ -40,7 +40,7 @@ class WorkspaceXmlCookieTest extends WorkspaceResourceTestBase {
/**
* {@inheritdoc}
*/
- public function testPatchPath() {
+ public function testPatchPath(): void {
// Deserialization of the XML format is not supported.
$this->markTestSkipped();
}
diff --git a/core/modules/workspaces/tests/src/Functional/UpdateSystem/ActiveWorkspaceUpdateTest.php b/core/modules/workspaces/tests/src/Functional/UpdateSystem/ActiveWorkspaceUpdateTest.php
index 17e6fa5af07..c10d6ae59ad 100644
--- a/core/modules/workspaces/tests/src/Functional/UpdateSystem/ActiveWorkspaceUpdateTest.php
+++ b/core/modules/workspaces/tests/src/Functional/UpdateSystem/ActiveWorkspaceUpdateTest.php
@@ -54,7 +54,7 @@ class ActiveWorkspaceUpdateTest extends BrowserTestBase {
/**
* Tests that there is no active workspace during database updates.
*/
- public function testActiveWorkspaceDuringUpdate() {
+ public function testActiveWorkspaceDuringUpdate(): void {
/** @var \Drupal\workspaces\WorkspaceManagerInterface $workspace_manager */
$workspace_manager = \Drupal::service('workspaces.manager');
diff --git a/core/modules/workspaces/tests/src/Functional/WorkspaceBypassTest.php b/core/modules/workspaces/tests/src/Functional/WorkspaceBypassTest.php
index 7d1d84e6fc0..a4dc09c14ad 100644
--- a/core/modules/workspaces/tests/src/Functional/WorkspaceBypassTest.php
+++ b/core/modules/workspaces/tests/src/Functional/WorkspaceBypassTest.php
@@ -32,7 +32,7 @@ class WorkspaceBypassTest extends BrowserTestBase {
/**
* Verifies that a user can edit anything in a workspace they own.
*/
- public function testBypassOwnWorkspace() {
+ public function testBypassOwnWorkspace(): void {
$permissions = [
'create workspace',
'edit own workspace',
diff --git a/core/modules/workspaces/tests/src/Functional/WorkspaceCacheContextTest.php b/core/modules/workspaces/tests/src/Functional/WorkspaceCacheContextTest.php
index 40edb1a68ff..1e46e94c2b1 100644
--- a/core/modules/workspaces/tests/src/Functional/WorkspaceCacheContextTest.php
+++ b/core/modules/workspaces/tests/src/Functional/WorkspaceCacheContextTest.php
@@ -33,7 +33,7 @@ class WorkspaceCacheContextTest extends BrowserTestBase {
/**
* Tests the 'workspace' cache context.
*/
- public function testWorkspaceCacheContext() {
+ public function testWorkspaceCacheContext(): void {
$renderer = \Drupal::service('renderer');
$cache_contexts_manager = \Drupal::service("cache_contexts_manager");
/** @var \Drupal\Core\Cache\VariationCacheFactoryInterface $variation_cache_factory */
diff --git a/core/modules/workspaces/tests/src/Functional/WorkspaceConcurrentEditingTest.php b/core/modules/workspaces/tests/src/Functional/WorkspaceConcurrentEditingTest.php
index 3c21fc67330..20ddf4f9bda 100644
--- a/core/modules/workspaces/tests/src/Functional/WorkspaceConcurrentEditingTest.php
+++ b/core/modules/workspaces/tests/src/Functional/WorkspaceConcurrentEditingTest.php
@@ -28,7 +28,7 @@ class WorkspaceConcurrentEditingTest extends BrowserTestBase {
/**
* Tests editing a node in multiple workspaces.
*/
- public function testConcurrentEditing() {
+ public function testConcurrentEditing(): void {
// Create a test node.
$this->createContentType(['type' => 'test', 'label' => 'Test']);
$this->setupWorkspaceSwitcherBlock();
diff --git a/core/modules/workspaces/tests/src/Functional/WorkspaceMenuLinkContentIntegrationTest.php b/core/modules/workspaces/tests/src/Functional/WorkspaceMenuLinkContentIntegrationTest.php
index 8df9d5632e5..4ff79aa61dd 100644
--- a/core/modules/workspaces/tests/src/Functional/WorkspaceMenuLinkContentIntegrationTest.php
+++ b/core/modules/workspaces/tests/src/Functional/WorkspaceMenuLinkContentIntegrationTest.php
@@ -59,7 +59,7 @@ class WorkspaceMenuLinkContentIntegrationTest extends BrowserTestBase {
/**
* Tests custom menu links in non-default workspaces.
*/
- public function testWorkspacesWithCustomMenuLinks() {
+ public function testWorkspacesWithCustomMenuLinks(): void {
$stage = Workspace::load('stage');
$this->setupWorkspaceSwitcherBlock();
diff --git a/core/modules/workspaces/tests/src/Functional/WorkspacePermissionsTest.php b/core/modules/workspaces/tests/src/Functional/WorkspacePermissionsTest.php
index 3650a9bcde0..962d459bcf1 100644
--- a/core/modules/workspaces/tests/src/Functional/WorkspacePermissionsTest.php
+++ b/core/modules/workspaces/tests/src/Functional/WorkspacePermissionsTest.php
@@ -30,7 +30,7 @@ class WorkspacePermissionsTest extends BrowserTestBase {
/**
* Verifies that a user can create but not edit a workspace.
*/
- public function testCreateWorkspace() {
+ public function testCreateWorkspace(): void {
$editor = $this->drupalCreateUser([
'access administration pages',
'administer site configuration',
@@ -56,7 +56,7 @@ class WorkspacePermissionsTest extends BrowserTestBase {
/**
* Verifies that a user can create and edit only their own workspace.
*/
- public function testEditOwnWorkspace() {
+ public function testEditOwnWorkspace(): void {
$permissions = [
'access administration pages',
'administer site configuration',
@@ -100,7 +100,7 @@ class WorkspacePermissionsTest extends BrowserTestBase {
/**
* Verifies that a user can edit any workspace.
*/
- public function testEditAnyWorkspace() {
+ public function testEditAnyWorkspace(): void {
$permissions = [
'access administration pages',
'administer site configuration',
@@ -144,7 +144,7 @@ class WorkspacePermissionsTest extends BrowserTestBase {
/**
* Verifies that a user can create and delete only their own workspace.
*/
- public function testDeleteOwnWorkspace() {
+ public function testDeleteOwnWorkspace(): void {
$permissions = [
'access administration pages',
'administer site configuration',
@@ -178,7 +178,7 @@ class WorkspacePermissionsTest extends BrowserTestBase {
/**
* Verifies that a user can delete any workspace.
*/
- public function testDeleteAnyWorkspace() {
+ public function testDeleteAnyWorkspace(): void {
$permissions = [
'access administration pages',
'administer site configuration',
diff --git a/core/modules/workspaces/tests/src/Functional/WorkspaceSwitcherTest.php b/core/modules/workspaces/tests/src/Functional/WorkspaceSwitcherTest.php
index 4c27e4f64a3..6fbdbce51a9 100644
--- a/core/modules/workspaces/tests/src/Functional/WorkspaceSwitcherTest.php
+++ b/core/modules/workspaces/tests/src/Functional/WorkspaceSwitcherTest.php
@@ -56,7 +56,7 @@ class WorkspaceSwitcherTest extends BrowserTestBase {
/**
* Tests switching workspace via the switcher block and admin page.
*/
- public function testSwitchingWorkspaces() {
+ public function testSwitchingWorkspaces(): void {
$this->createAndActivateWorkspaceThroughUi('Vultures', 'vultures');
$gravity = $this->createWorkspaceThroughUi('Gravity', 'gravity');
@@ -81,7 +81,7 @@ class WorkspaceSwitcherTest extends BrowserTestBase {
/**
* Tests switching workspace via a query parameter.
*/
- public function testQueryParameterNegotiator() {
+ public function testQueryParameterNegotiator(): void {
$web_assert = $this->assertSession();
// Initially the default workspace should be active.
$web_assert->elementContains('css', '#block-workspace-switcher', 'None');
@@ -103,7 +103,7 @@ class WorkspaceSwitcherTest extends BrowserTestBase {
/**
* Tests that the toolbar workspace switcher doesn't disable the page cache.
*/
- public function testToolbarSwitcherDynamicPageCache() {
+ public function testToolbarSwitcherDynamicPageCache(): void {
$this->drupalLogin($this->drupalCreateUser([
'access toolbar',
'view any workspace',
diff --git a/core/modules/workspaces/tests/src/Functional/WorkspaceTest.php b/core/modules/workspaces/tests/src/Functional/WorkspaceTest.php
index 9a25f492677..92227485f1f 100644
--- a/core/modules/workspaces/tests/src/Functional/WorkspaceTest.php
+++ b/core/modules/workspaces/tests/src/Functional/WorkspaceTest.php
@@ -78,7 +78,7 @@ class WorkspaceTest extends BrowserTestBase {
/**
* Tests creating a workspace with special characters.
*/
- public function testSpecialCharacters() {
+ public function testSpecialCharacters(): void {
$this->drupalLogin($this->editor1);
$page = $this->getSession()->getPage();
@@ -99,7 +99,7 @@ class WorkspaceTest extends BrowserTestBase {
/**
* Tests that the toolbar correctly shows the active workspace.
*/
- public function testWorkspaceToolbar() {
+ public function testWorkspaceToolbar(): void {
$this->drupalLogin($this->editor1);
$this->drupalGet('/admin/config/workflow/workspaces/add');
@@ -130,7 +130,7 @@ class WorkspaceTest extends BrowserTestBase {
/**
* Tests changing the owner of a workspace.
*/
- public function testWorkspaceOwner() {
+ public function testWorkspaceOwner(): void {
$this->drupalLogin($this->editor1);
$this->drupalGet('/admin/config/workflow/workspaces/add');
@@ -153,7 +153,7 @@ class WorkspaceTest extends BrowserTestBase {
/**
* Tests that editing a workspace creates a new revision.
*/
- public function testWorkspaceFormRevisions() {
+ public function testWorkspaceFormRevisions(): void {
$this->drupalLogin($this->editor1);
$storage = \Drupal::entityTypeManager()->getStorage('workspace');
@@ -171,7 +171,7 @@ class WorkspaceTest extends BrowserTestBase {
/**
* Tests the manage workspace page.
*/
- public function testWorkspaceManagePage() {
+ public function testWorkspaceManagePage(): void {
$this->drupalCreateContentType(['type' => 'test', 'label' => 'Test']);
$permissions = [
@@ -237,7 +237,7 @@ class WorkspaceTest extends BrowserTestBase {
/**
* Tests adding new fields to workspace entities.
*/
- public function testWorkspaceFieldUi() {
+ public function testWorkspaceFieldUi(): void {
$user = $this->drupalCreateUser([
'administer workspaces',
'access administration pages',
@@ -268,7 +268,7 @@ class WorkspaceTest extends BrowserTestBase {
/**
* Verifies that a workspace with existing content may be deleted.
*/
- public function testDeleteWorkspaceWithExistingContent() {
+ public function testDeleteWorkspaceWithExistingContent(): void {
$this->createContentType(['type' => 'test', 'label' => 'Test']);
// Login and create a workspace.
@@ -294,7 +294,7 @@ class WorkspaceTest extends BrowserTestBase {
/**
* Tests the Workspaces listing UI.
*/
- public function testWorkspaceList() {
+ public function testWorkspaceList(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -340,7 +340,7 @@ class WorkspaceTest extends BrowserTestBase {
/**
* Verifies that a workspace can be published.
*/
- public function testPublishWorkspace() {
+ public function testPublishWorkspace(): void {
$this->createContentType(['type' => 'test', 'label' => 'Test']);
$permissions = [
'administer workspaces',
diff --git a/core/modules/workspaces/tests/src/Functional/WorkspaceViewTest.php b/core/modules/workspaces/tests/src/Functional/WorkspaceViewTest.php
index 266d2c2ff57..a304cffd621 100644
--- a/core/modules/workspaces/tests/src/Functional/WorkspaceViewTest.php
+++ b/core/modules/workspaces/tests/src/Functional/WorkspaceViewTest.php
@@ -29,7 +29,7 @@ class WorkspaceViewTest extends BrowserTestBase {
/**
* Verifies that a user can view their own workspace.
*/
- public function testViewOwnWorkspace() {
+ public function testViewOwnWorkspace(): void {
$permissions = [
'access administration pages',
'administer site configuration',
@@ -67,7 +67,7 @@ class WorkspaceViewTest extends BrowserTestBase {
/**
* Verifies that a user can view any workspace.
*/
- public function testViewAnyWorkspace() {
+ public function testViewAnyWorkspace(): void {
$permissions = [
'access administration pages',
'administer site configuration',
diff --git a/core/modules/workspaces/tests/src/Functional/WorkspaceViewsBulkFormTest.php b/core/modules/workspaces/tests/src/Functional/WorkspaceViewsBulkFormTest.php
index c91d568208c..4b9dc1f72b6 100644
--- a/core/modules/workspaces/tests/src/Functional/WorkspaceViewsBulkFormTest.php
+++ b/core/modules/workspaces/tests/src/Functional/WorkspaceViewsBulkFormTest.php
@@ -44,7 +44,7 @@ class WorkspaceViewsBulkFormTest extends BulkFormTest {
$this->switchToWorkspace($stage);
}
- public function testBulkForm() {
+ public function testBulkForm(): void {
// Ignore entity types that are not being tested, in order to fully re-use
// the parent test method.
$this->ignoreEntityType('view');
diff --git a/core/modules/workspaces/tests/src/Functional/WorkspacesUninstallTest.php b/core/modules/workspaces/tests/src/Functional/WorkspacesUninstallTest.php
index 3d7c3573199..453d08703c4 100644
--- a/core/modules/workspaces/tests/src/Functional/WorkspacesUninstallTest.php
+++ b/core/modules/workspaces/tests/src/Functional/WorkspacesUninstallTest.php
@@ -41,7 +41,7 @@ class WorkspacesUninstallTest extends BrowserTestBase {
/**
* Tests deleting workspace entities and uninstalling Workspaces module.
*/
- public function testUninstallingWorkspace() {
+ public function testUninstallingWorkspace(): void {
$this->createContentType(['type' => 'article']);
$this->drupalGet('/admin/modules/uninstall');
$session = $this->assertSession();
diff --git a/core/modules/workspaces/tests/src/FunctionalJavascript/WorkspaceToolbarIntegrationTest.php b/core/modules/workspaces/tests/src/FunctionalJavascript/WorkspaceToolbarIntegrationTest.php
index 65b9f3d163d..701d89ec906 100644
--- a/core/modules/workspaces/tests/src/FunctionalJavascript/WorkspaceToolbarIntegrationTest.php
+++ b/core/modules/workspaces/tests/src/FunctionalJavascript/WorkspaceToolbarIntegrationTest.php
@@ -39,7 +39,7 @@ class WorkspaceToolbarIntegrationTest extends OffCanvasTestBase {
/**
* Tests workspace canvas can be toggled with JavaScript.
*/
- public function testWorkspaceCanvasToggling() {
+ public function testWorkspaceCanvasToggling(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
@@ -63,7 +63,7 @@ class WorkspaceToolbarIntegrationTest extends OffCanvasTestBase {
/**
* Tests workspace switch and landing page behavior.
*/
- public function testWorkspaceSwitch() {
+ public function testWorkspaceSwitch(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
diff --git a/core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php b/core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php
index 9c805d3ce9f..4cfdfec0816 100644
--- a/core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php
+++ b/core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php
@@ -57,7 +57,7 @@ class EntityReferenceSupportedNewEntitiesConstraintValidatorTest extends KernelT
/**
* @covers ::validate
*/
- public function testNewEntitiesAllowedInDefaultWorkspace() {
+ public function testNewEntitiesAllowedInDefaultWorkspace(): void {
$entity = EntityTestMulRevPub::create([
'unsupported_reference' => [
'entity' => EntityTest::create([]),
@@ -72,7 +72,7 @@ class EntityReferenceSupportedNewEntitiesConstraintValidatorTest extends KernelT
/**
* @covers ::validate
*/
- public function testNewEntitiesForbiddenInNonDefaultWorkspace() {
+ public function testNewEntitiesForbiddenInNonDefaultWorkspace(): void {
$this->switchToWorkspace('stage');
$entity = EntityTestMulRevPub::create([
'unsupported_reference' => [
diff --git a/core/modules/workspaces/tests/src/Kernel/WorkspaceAccessTest.php b/core/modules/workspaces/tests/src/Kernel/WorkspaceAccessTest.php
index ac3051b718b..1193b2180eb 100644
--- a/core/modules/workspaces/tests/src/Kernel/WorkspaceAccessTest.php
+++ b/core/modules/workspaces/tests/src/Kernel/WorkspaceAccessTest.php
@@ -76,7 +76,7 @@ class WorkspaceAccessTest extends KernelTestBase {
*
* @dataProvider operationCases
*/
- public function testWorkspaceAccess($operation, $permission) {
+ public function testWorkspaceAccess($operation, $permission): void {
$user = $this->createUser();
$this->setCurrentUser($user);
$workspace = Workspace::create(['id' => 'oak']);
@@ -93,7 +93,7 @@ class WorkspaceAccessTest extends KernelTestBase {
/**
* Tests workspace publishing access.
*/
- public function testPublishWorkspaceAccess() {
+ public function testPublishWorkspaceAccess(): void {
$user = $this->createUser([
'view own workspace',
'edit own workspace',
@@ -116,7 +116,7 @@ class WorkspaceAccessTest extends KernelTestBase {
/**
* @covers \Drupal\workspaces\Plugin\EntityReferenceSelection\WorkspaceSelection::getReferenceableEntities
*/
- public function testWorkspaceSelection() {
+ public function testWorkspaceSelection(): void {
$own_permission_user = $this->createUser(['view own workspace']);
$any_permission_user = $this->createUser(['view any workspace']);
$admin_permission_user = $this->createUser(['administer workspaces']);
diff --git a/core/modules/workspaces/tests/src/Kernel/WorkspaceAssociationTest.php b/core/modules/workspaces/tests/src/Kernel/WorkspaceAssociationTest.php
index e22e2bf026c..4d7e8d80e62 100644
--- a/core/modules/workspaces/tests/src/Kernel/WorkspaceAssociationTest.php
+++ b/core/modules/workspaces/tests/src/Kernel/WorkspaceAssociationTest.php
@@ -83,7 +83,7 @@ class WorkspaceAssociationTest extends KernelTestBase {
* @covers ::getTrackedEntities
* @covers ::getAssociatedRevisions
*/
- public function testWorkspaceAssociation() {
+ public function testWorkspaceAssociation(): void {
$this->createNode(['title' => 'Test article 1 - live - unpublished', 'type' => 'article', 'status' => 0]);
$this->createNode(['title' => 'Test article 2 - live - published', 'type' => 'article']);
diff --git a/core/modules/workspaces/tests/src/Kernel/WorkspaceCRUDTest.php b/core/modules/workspaces/tests/src/Kernel/WorkspaceCRUDTest.php
index c8c9a5ba496..6c4ac5ef105 100644
--- a/core/modules/workspaces/tests/src/Kernel/WorkspaceCRUDTest.php
+++ b/core/modules/workspaces/tests/src/Kernel/WorkspaceCRUDTest.php
@@ -83,7 +83,7 @@ class WorkspaceCRUDTest extends KernelTestBase {
/**
* Tests the deletion of workspaces.
*/
- public function testDeletingWorkspaces() {
+ public function testDeletingWorkspaces(): void {
$admin = $this->createUser([
'administer nodes',
'create workspace',
@@ -209,7 +209,7 @@ class WorkspaceCRUDTest extends KernelTestBase {
/**
* Tests that deleting a workspace keeps its already published content.
*/
- public function testDeletingPublishedWorkspace() {
+ public function testDeletingPublishedWorkspace(): void {
$admin = $this->createUser([
'administer nodes',
'create workspace',
@@ -283,7 +283,7 @@ class WorkspaceCRUDTest extends KernelTestBase {
/**
* Tests that a workspace with children can not be deleted.
*/
- public function testDeletingWorkspaceWithChildren() {
+ public function testDeletingWorkspaceWithChildren(): void {
$stage = Workspace::create(['id' => 'stage', 'label' => 'Stage']);
$stage->save();
@@ -311,7 +311,7 @@ class WorkspaceCRUDTest extends KernelTestBase {
/**
* Tests loading the workspace tree when there are no workspaces available.
*/
- public function testEmptyWorkspaceTree() {
+ public function testEmptyWorkspaceTree(): void {
$tree = \Drupal::service('workspaces.repository')->loadTree();
$this->assertSame([], $tree);
}
diff --git a/core/modules/workspaces/tests/src/Kernel/WorkspaceInformationTest.php b/core/modules/workspaces/tests/src/Kernel/WorkspaceInformationTest.php
index 602d3b339f6..17e561ffe8d 100644
--- a/core/modules/workspaces/tests/src/Kernel/WorkspaceInformationTest.php
+++ b/core/modules/workspaces/tests/src/Kernel/WorkspaceInformationTest.php
@@ -79,7 +79,7 @@ class WorkspaceInformationTest extends KernelTestBase {
/**
* Tests fully supported entity types.
*/
- public function testSupportedEntityTypes() {
+ public function testSupportedEntityTypes(): void {
// Check a supported entity type.
$entity = $this->entityTypeManager->getStorage('entity_test_revpub')->create();
@@ -98,7 +98,7 @@ class WorkspaceInformationTest extends KernelTestBase {
/**
* Tests an entity type with a custom workspace handler.
*/
- public function testCustomSupportEntityTypes() {
+ public function testCustomSupportEntityTypes(): void {
$entity_type = clone $this->entityTypeManager->getDefinition('entity_test_revpub');
$entity_type->setHandlerClass('workspace', EntityTestRevPubWorkspaceHandler::class);
$this->state->set('entity_test_revpub.entity_type', $entity_type);
@@ -135,7 +135,7 @@ class WorkspaceInformationTest extends KernelTestBase {
/**
* Tests ignored entity types.
*/
- public function testIgnoredEntityTypes() {
+ public function testIgnoredEntityTypes(): void {
$entity_type = clone $this->entityTypeManager->getDefinition('entity_test_rev');
$entity_type->setHandlerClass('workspace', IgnoredWorkspaceHandler::class);
$this->state->set('entity_test_rev.entity_type', $entity_type);
@@ -158,7 +158,7 @@ class WorkspaceInformationTest extends KernelTestBase {
/**
* Tests unsupported entity types.
*/
- public function testUnsupportedEntityTypes() {
+ public function testUnsupportedEntityTypes(): void {
// Check an unsupported entity type.
$entity_test = $this->entityTypeManager->getDefinition('entity_test');
$this->assertFalse($entity_test->hasHandlerClass('workspace'));
diff --git a/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php b/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php
index 42c35e17012..718af2449d3 100644
--- a/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php
+++ b/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php
@@ -114,7 +114,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
/**
* Tests various scenarios for creating and publishing content in workspaces.
*/
- public function testWorkspaces() {
+ public function testWorkspaces(): void {
$this->initializeWorkspacesModule();
// Notes about the structure of the test scenarios:
@@ -377,7 +377,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
* @covers ::workspaces_entity_delete
* @covers ::workspaces_entity_revision_delete
*/
- public function testWorkspaceAssociationDataIntegrity() {
+ public function testWorkspaceAssociationDataIntegrity(): void {
$this->initializeWorkspacesModule();
// Check the initial empty state.
@@ -425,7 +425,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
/**
* Tests entity tracking in workspace descendants.
*/
- public function testWorkspaceHierarchy() {
+ public function testWorkspaceHierarchy(): void {
$this->initializeWorkspacesModule();
$this->createWorkspaceHierarchy();
@@ -540,7 +540,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
/**
* Tests workspace publishing as anonymous user, simulating a CLI request.
*/
- public function testCliPublishing() {
+ public function testCliPublishing(): void {
$this->initializeWorkspacesModule();
$this->switchToWorkspace('stage');
@@ -560,7 +560,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
/**
* Tests entity query overrides without any conditions.
*/
- public function testEntityQueryWithoutConditions() {
+ public function testEntityQueryWithoutConditions(): void {
$this->initializeWorkspacesModule();
$this->switchToWorkspace('stage');
@@ -587,7 +587,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
/**
* Tests the Entity Query relationship API with workspaces.
*/
- public function testEntityQueryRelationship() {
+ public function testEntityQueryRelationship(): void {
$this->initializeWorkspacesModule();
// Add an entity reference field that targets 'entity_test_mulrevpub'
@@ -674,7 +674,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
*
* @dataProvider providerTestAllowedEntityCrudInNonDefaultWorkspace
*/
- public function testDisallowedEntityCreateInNonDefaultWorkspace($entity_type_id, $allowed) {
+ public function testDisallowedEntityCreateInNonDefaultWorkspace($entity_type_id, $allowed): void {
$this->initializeWorkspacesModule();
/** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */
$storage = $this->entityTypeManager->getStorage($entity_type_id);
@@ -700,7 +700,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
*
* @dataProvider providerTestAllowedEntityCrudInNonDefaultWorkspace
*/
- public function testDisallowedEntityUpdateInNonDefaultWorkspace($entity_type_id, $allowed) {
+ public function testDisallowedEntityUpdateInNonDefaultWorkspace($entity_type_id, $allowed): void {
$this->initializeWorkspacesModule();
/** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */
$storage = $this->entityTypeManager->getStorage($entity_type_id);
@@ -731,7 +731,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
*
* @dataProvider providerTestAllowedEntityCrudInNonDefaultWorkspace
*/
- public function testDisallowedEntityDeleteInNonDefaultWorkspace($entity_type_id, $allowed) {
+ public function testDisallowedEntityDeleteInNonDefaultWorkspace($entity_type_id, $allowed): void {
$this->initializeWorkspacesModule();
/** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */
$storage = $this->entityTypeManager->getStorage($entity_type_id);
@@ -778,7 +778,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
/**
* @covers \Drupal\workspaces\WorkspaceManager::executeInWorkspace
*/
- public function testExecuteInWorkspaceContext() {
+ public function testExecuteInWorkspaceContext(): void {
$this->initializeWorkspacesModule();
// Create an entity in the default workspace.
@@ -1049,7 +1049,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
/**
* Tests that entity forms can be stored in the form cache.
*/
- public function testFormCacheForEntityForms() {
+ public function testFormCacheForEntityForms(): void {
$this->initializeWorkspacesModule();
$this->switchToWorkspace('stage');
@@ -1066,7 +1066,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
/**
* Tests that non-entity forms can be stored in the form cache.
*/
- public function testFormCacheForRegularForms() {
+ public function testFormCacheForRegularForms(): void {
$this->initializeWorkspacesModule();
$this->switchToWorkspace('stage');
@@ -1080,7 +1080,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
/**
* Tests publishing with fields in dedicated table storage.
*/
- public function testPublishWorkspaceDedicatedTableStorage() {
+ public function testPublishWorkspaceDedicatedTableStorage(): void {
$this->initializeWorkspacesModule();
$node_storage = $this->entityTypeManager->getStorage('node');
@@ -1114,7 +1114,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
* so enable it and test getDifferringRevisionIdsOnTarget() with an anonymous
* node.
*/
- public function testNodeAccessDifferringRevisionIdsOnTarget() {
+ public function testNodeAccessDifferringRevisionIdsOnTarget(): void {
$this->initializeWorkspacesModule();
\Drupal::service('module_installer')->install(['node_access_test']);
node_access_rebuild();
diff --git a/core/modules/workspaces/tests/src/Kernel/WorkspaceMergerTest.php b/core/modules/workspaces/tests/src/Kernel/WorkspaceMergerTest.php
index e46e1fab9c3..a026f5d93c1 100644
--- a/core/modules/workspaces/tests/src/Kernel/WorkspaceMergerTest.php
+++ b/core/modules/workspaces/tests/src/Kernel/WorkspaceMergerTest.php
@@ -78,7 +78,7 @@ class WorkspaceMergerTest extends KernelTestBase {
* @covers ::getDifferringRevisionIdsOnSource
* @covers ::getDifferringRevisionIdsOnTarget
*/
- public function testWorkspaceMerger() {
+ public function testWorkspaceMerger(): void {
$this->initializeWorkspacesModule();
$this->createWorkspaceHierarchy();
diff --git a/core/modules/workspaces/tests/src/Kernel/WorkspacePublishFormTest.php b/core/modules/workspaces/tests/src/Kernel/WorkspacePublishFormTest.php
index da55c8e963d..eb6696c2458 100644
--- a/core/modules/workspaces/tests/src/Kernel/WorkspacePublishFormTest.php
+++ b/core/modules/workspaces/tests/src/Kernel/WorkspacePublishFormTest.php
@@ -24,7 +24,7 @@ class WorkspacePublishFormTest extends KernelTestBase {
/**
* @covers ::submitForm
*/
- public function testSubmitFormWithException() {
+ public function testSubmitFormWithException(): void {
/** @var \Drupal\Core\Messenger\MessengerInterface $messenger */
$messenger = \Drupal::service('messenger');
diff --git a/core/modules/workspaces/tests/src/Unit/ActiveWorkspaceCheckTest.php b/core/modules/workspaces/tests/src/Unit/ActiveWorkspaceCheckTest.php
index 1105dcfd577..c87da448fa0 100644
--- a/core/modules/workspaces/tests/src/Unit/ActiveWorkspaceCheckTest.php
+++ b/core/modules/workspaces/tests/src/Unit/ActiveWorkspaceCheckTest.php
@@ -61,7 +61,7 @@ class ActiveWorkspaceCheckTest extends UnitTestCase {
* @covers ::access
* @dataProvider providerTestAccess
*/
- public function testAccess($requirements, $has_active_workspace, $access, array $contexts = []) {
+ public function testAccess($requirements, $has_active_workspace, $access, array $contexts = []): void {
$route = new Route('', [], $requirements);
$workspace_manager = $this->prophesize(WorkspaceManagerInterface::class);
diff --git a/core/modules/workspaces/tests/src/Unit/WorkspaceRequestSubscriberTest.php b/core/modules/workspaces/tests/src/Unit/WorkspaceRequestSubscriberTest.php
index df888ece36d..8de6d7bbc4c 100644
--- a/core/modules/workspaces/tests/src/Unit/WorkspaceRequestSubscriberTest.php
+++ b/core/modules/workspaces/tests/src/Unit/WorkspaceRequestSubscriberTest.php
@@ -41,7 +41,7 @@ class WorkspaceRequestSubscriberTest extends UnitTestCase {
/**
* @covers ::onKernelRequest
*/
- public function testOnKernelRequestWithCacheableRouteProvider() {
+ public function testOnKernelRequestWithCacheableRouteProvider(): void {
$route_provider = $this->prophesize(CacheableRouteProviderInterface::class);
$route_provider->addExtraCacheKeyPart('workspace', 'test')->shouldBeCalled();
@@ -56,7 +56,7 @@ class WorkspaceRequestSubscriberTest extends UnitTestCase {
/**
* @covers ::onKernelRequest
*/
- public function testOnKernelRequestWithoutCacheableRouteProvider() {
+ public function testOnKernelRequestWithoutCacheableRouteProvider(): void {
$route_provider = $this->prophesize(RouteProviderInterface::class);
// Check that WorkspaceRequestSubscriber::onKernelRequest() doesn't call
diff --git a/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php b/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
index 2ca37dc1006..b6a9906524b 100644
--- a/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
+++ b/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
@@ -42,7 +42,7 @@ class DemoUmamiProfileTest extends BrowserTestBase {
/**
* Tests some features specific to being a demonstration profile.
*/
- public function testDemoSpecificFeatures() {
+ public function testDemoSpecificFeatures(): void {
// This test coverage is organized into separate protected methods rather
// than individual test methods to avoid having to reinstall Umami for
// a handful of assertions each.
@@ -67,7 +67,7 @@ class DemoUmamiProfileTest extends BrowserTestBase {
/**
* Tests the profile supplied configuration is the same after installation.
*/
- public function testConfig() {
+ public function testConfig(): void {
// Just connect directly to the config table so we don't need to worry about
// the cache layer.
$active_config_storage = $this->container->get('config.storage');
@@ -160,7 +160,7 @@ class DemoUmamiProfileTest extends BrowserTestBase {
/**
* Tests the successful editing of nodes by admin.
*/
- public function testEditNodesByAdmin() {
+ public function testEditNodesByAdmin(): void {
$permissions = [
'administer nodes',
'edit any recipe content',
diff --git a/core/profiles/demo_umami/tests/src/Functional/UmamiMultilingualInstallTest.php b/core/profiles/demo_umami/tests/src/Functional/UmamiMultilingualInstallTest.php
index 088910834a0..b01f7d68c1b 100644
--- a/core/profiles/demo_umami/tests/src/Functional/UmamiMultilingualInstallTest.php
+++ b/core/profiles/demo_umami/tests/src/Functional/UmamiMultilingualInstallTest.php
@@ -26,7 +26,7 @@ class UmamiMultilingualInstallTest extends InstallerTestBase {
/**
* Ensures that Umami can be installed with Spanish as the default language.
*/
- public function testUmami() {
+ public function testUmami(): void {
$this->drupalGet('');
// cSpell:disable-next-line
$this->assertSession()->pageTextContains('Quiche mediterráneo profundo');
diff --git a/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php b/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php
index 141383657d6..f3ba232b09e 100644
--- a/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php
+++ b/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php
@@ -21,7 +21,7 @@ class AssetAggregationAcrossPagesTest extends PerformanceTestBase {
/**
* Checks the asset requests made when the front and recipe pages are visited.
*/
- public function testFrontAndRecipesPages() {
+ public function testFrontAndRecipesPages(): void {
$performance_data = $this->collectPerformanceData(function () {
$this->doRequests();
}, 'umamiFrontAndRecipePages');
@@ -34,7 +34,7 @@ class AssetAggregationAcrossPagesTest extends PerformanceTestBase {
/**
* Checks the asset requests made when the front and recipe pages are visited.
*/
- public function testFrontAndRecipesPagesAuthenticated() {
+ public function testFrontAndRecipesPagesAuthenticated(): void {
$user = $this->createUser();
$this->drupalLogin($user);
sleep(2);
diff --git a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php
index 108e09ec30c..9cdf35039f7 100644
--- a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php
+++ b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php
@@ -23,7 +23,7 @@ class OpenTelemetryFrontPagePerformanceTest extends PerformanceTestBase {
/**
* Logs front page tracing data with a cold cache.
*/
- public function testFrontPageColdCache() {
+ public function testFrontPageColdCache(): void {
// @todo Chromedriver doesn't collect tracing performance logs for the very
// first request in a test, so warm it up.
// https://www.drupal.org/project/drupal/issues/3379750
@@ -40,7 +40,7 @@ class OpenTelemetryFrontPagePerformanceTest extends PerformanceTestBase {
*
* Hot here means that all possible caches are warmed.
*/
- public function testFrontPageHotCache() {
+ public function testFrontPageHotCache(): void {
// Request the page twice so that asset aggregates and image derivatives are
// definitely cached in the browser cache. The first response builds the
// file and serves from PHP with private, no-store headers. The second
@@ -76,7 +76,7 @@ class OpenTelemetryFrontPagePerformanceTest extends PerformanceTestBase {
* Cool here means that 'global' site caches are warm but anything
* specific to the front page is cold.
*/
- public function testFrontPageCoolCache() {
+ public function testFrontPageCoolCache(): void {
// First of all visit the front page to ensure the image style exists.
$this->drupalGet('<front>');
$this->rebuildAll();
diff --git a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php
index 5c0c8563652..2e3597ea729 100644
--- a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php
+++ b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryNodePagePerformanceTest.php
@@ -23,7 +23,7 @@ class OpenTelemetryNodePagePerformanceTest extends PerformanceTestBase {
/**
* Logs node page tracing data with a cold cache.
*/
- public function testNodePageColdCache() {
+ public function testNodePageColdCache(): void {
// @todo Chromedriver doesn't collect tracing performance logs for the very
// first request in a test, so warm it up.
// https://www.drupal.org/project/drupal/issues/3379750
@@ -40,7 +40,7 @@ class OpenTelemetryNodePagePerformanceTest extends PerformanceTestBase {
*
* Hot here means that all possible caches are warmed.
*/
- public function testNodePageHotCache() {
+ public function testNodePageHotCache(): void {
// Request the page twice so that asset aggregates are definitely cached in
// the browser cache.
$this->drupalGet('node/1');
@@ -64,7 +64,7 @@ class OpenTelemetryNodePagePerformanceTest extends PerformanceTestBase {
* Cool here means that 'global' site caches are warm but anything
* specific to the route or path is cold.
*/
- public function testNodePageCoolCache() {
+ public function testNodePageCoolCache(): void {
// First of all visit the node page to ensure the image style exists.
$this->drupalGet('node/1');
$this->rebuildAll();
@@ -82,7 +82,7 @@ class OpenTelemetryNodePagePerformanceTest extends PerformanceTestBase {
* Warm here means that 'global' site caches and route-specific caches are
* warm but caches specific to this particular node/path are not.
*/
- public function testNodePageWarmCache() {
+ public function testNodePageWarmCache(): void {
// First of all visit the node page to ensure the image style exists.
$this->drupalGet('node/1');
$this->rebuildAll();
diff --git a/core/profiles/minimal/tests/src/Functional/MinimalTest.php b/core/profiles/minimal/tests/src/Functional/MinimalTest.php
index 365273dbc96..cfc5b65b9b1 100644
--- a/core/profiles/minimal/tests/src/Functional/MinimalTest.php
+++ b/core/profiles/minimal/tests/src/Functional/MinimalTest.php
@@ -29,7 +29,7 @@ class MinimalTest extends BrowserTestBase {
/**
* Tests Minimal installation profile.
*/
- public function testMinimal() {
+ public function testMinimal(): void {
$this->drupalGet('');
// Check the login block is present.
$this->assertSession()->buttonExists('Log in');
diff --git a/core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php b/core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php
index a7ed9e733c1..06a27eb787f 100644
--- a/core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php
+++ b/core/profiles/standard/tests/src/FunctionalJavascript/StandardJavascriptTest.php
@@ -22,7 +22,7 @@ class StandardJavascriptTest extends WebDriverTestBase {
/**
* Tests BigPipe accelerates particular Standard installation profile routes.
*/
- public function testBigPipe() {
+ public function testBigPipe(): void {
$this->drupalLogin($this->drupalCreateUser([
'access content',
'post comments',
diff --git a/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php b/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php
index 371ed6ed600..fa8ef92c070 100644
--- a/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php
+++ b/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php
@@ -46,7 +46,7 @@ class StandardPerformanceTest extends PerformanceTestBase {
/**
* Tests performance for anonymous users.
*/
- public function testAnonymous() {
+ public function testAnonymous(): void {
// Request the front page, then immediately clear all object caches, so that
// aggregates and image styles are created on disk but otherwise caches are
// empty.
diff --git a/core/profiles/standard/tests/src/Traits/StandardTestTrait.php b/core/profiles/standard/tests/src/Traits/StandardTestTrait.php
index 180f062c4fc..be8721bbe5f 100644
--- a/core/profiles/standard/tests/src/Traits/StandardTestTrait.php
+++ b/core/profiles/standard/tests/src/Traits/StandardTestTrait.php
@@ -37,7 +37,7 @@ trait StandardTestTrait {
/**
* Tests Standard installation profile or recipe.
*/
- public function testStandard() {
+ public function testStandard(): void {
$this->drupalGet('');
$this->assertSession()->pageTextContains('Powered by Drupal');
$this->assertSession()->pageTextContains('Congratulations and welcome to the Drupal community.');
diff --git a/core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php b/core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php
index 7ca3023207d..930f07e7edc 100644
--- a/core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php
+++ b/core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php
@@ -86,7 +86,7 @@ class GenerateThemeTest extends QuickStartTestBase {
/**
* Tests the generate-theme command.
*/
- public function test() {
+ public function test(): void {
// Do not rely on \Drupal::VERSION: change the version to a concrete version
// number, to simulate using a tagged core release.
$starterkit_info_yml = $this->getWorkspaceDirectory() . '/core/themes/starterkit_theme/starterkit_theme.info.yml';
@@ -134,7 +134,7 @@ class GenerateThemeTest extends QuickStartTestBase {
/**
* Tests generating a theme from another Starterkit enabled theme.
*/
- public function testGeneratingFromAnotherTheme() {
+ public function testGeneratingFromAnotherTheme(): void {
// Do not rely on \Drupal::VERSION: change the version to a concrete version
// number, to simulate using a tagged core release.
$starterkit_info_yml = $this->getWorkspaceDirectory() . '/core/themes/starterkit_theme/starterkit_theme.info.yml';
@@ -178,7 +178,7 @@ YAML
/**
* Tests the generate-theme command on a dev snapshot of Drupal core.
*/
- public function testDevSnapshot() {
+ public function testDevSnapshot(): void {
// Do not rely on \Drupal::VERSION: change the version to a development
// snapshot version number, to simulate using a branch snapshot of core.
$starterkit_info_yml = $this->getWorkspaceDirectory() . '/core/themes/starterkit_theme/starterkit_theme.info.yml';
diff --git a/core/tests/Drupal/BuildTests/Composer/ComposerValidateTest.php b/core/tests/Drupal/BuildTests/Composer/ComposerValidateTest.php
index c659d125724..661d159bf80 100644
--- a/core/tests/Drupal/BuildTests/Composer/ComposerValidateTest.php
+++ b/core/tests/Drupal/BuildTests/Composer/ComposerValidateTest.php
@@ -26,7 +26,7 @@ class ComposerValidateTest extends BuildTestBase {
/**
* @dataProvider provideComposerJson
*/
- public function testValidateComposer($path) {
+ public function testValidateComposer($path): void {
$this->executeCommand('composer validate --strict --no-check-all ' . $path);
$this->assertCommandSuccessful();
}
diff --git a/core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php b/core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php
index cfbd463ddb3..62fce914785 100644
--- a/core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php
+++ b/core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php
@@ -85,7 +85,7 @@ class ComposerProjectTemplatesTest extends ComposerBuildTestBase {
/**
* Make sure that static::MINIMUM_STABILITY is sufficiently strict.
*/
- public function testMinimumStabilityStrictness() {
+ public function testMinimumStabilityStrictness(): void {
// Ensure that static::MINIMUM_STABILITY is not less stable than the
// current core stability. For example, if we've already released a beta on
// the branch, ensure that we no longer allow alpha dependencies.
@@ -146,7 +146,7 @@ class ComposerProjectTemplatesTest extends ComposerBuildTestBase {
/**
* Make sure we've accounted for all the templates.
*/
- public function testVerifyTemplateTestProviderIsAccurate() {
+ public function testVerifyTemplateTestProviderIsAccurate(): void {
$root = $this->getDrupalRoot();
$data = $this->provideTemplateCreateProject();
@@ -174,7 +174,7 @@ class ComposerProjectTemplatesTest extends ComposerBuildTestBase {
/**
* @dataProvider provideTemplateCreateProject
*/
- public function testTemplateCreateProject($project, $package_dir, $docroot_dir) {
+ public function testTemplateCreateProject($project, $package_dir, $docroot_dir): void {
// Make a working COMPOSER_HOME directory for setting global composer config
$composer_home = $this->getWorkspaceDirectory() . '/composer-home';
mkdir($composer_home);
diff --git a/core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php b/core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php
index 4803397db44..119ec0c40cc 100644
--- a/core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php
+++ b/core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php
@@ -18,7 +18,7 @@ class BuildTestTest extends BuildTestBase {
/**
* Ensure that workspaces work.
*/
- public function testWorkspace() {
+ public function testWorkspace(): void {
$test_directory = 'test_directory';
// Execute an empty command through the shell to build out a working
@@ -36,7 +36,7 @@ class BuildTestTest extends BuildTestBase {
/**
* @covers ::copyCodebase
*/
- public function testCopyCodebase() {
+ public function testCopyCodebase(): void {
$test_directory = 'copied_codebase';
$this->copyCodebase(NULL, $test_directory);
$full_path = $this->getWorkspaceDirectory() . '/' . $test_directory;
@@ -58,7 +58,7 @@ class BuildTestTest extends BuildTestBase {
*
* @covers ::copyCodebase
*/
- public function testCopyCodebaseExclude() {
+ public function testCopyCodebaseExclude(): void {
// Create a virtual file system containing items that should be
// excluded. Exception being modules directory.
vfsStream::setup('drupal', NULL, [
@@ -131,7 +131,7 @@ class BuildTestTest extends BuildTestBase {
*
* @covers ::copyCodebase
*/
- public function testCopyCodebaseDocRoot() {
+ public function testCopyCodebaseDocRoot(): void {
// Create a virtual file system containing items that should be
// excluded. Exception being modules directory.
vfsStream::setup('drupal', NULL, [
@@ -208,7 +208,7 @@ class BuildTestTest extends BuildTestBase {
/**
* @covers ::findAvailablePort
*/
- public function testPortMany() {
+ public function testPortMany(): void {
$iterator = (new Finder())->in($this->getDrupalRoot())
->ignoreDotFiles(FALSE)
->exclude(['sites/simpletest'])
@@ -236,7 +236,7 @@ class BuildTestTest extends BuildTestBase {
/**
* @covers ::standUpServer
*/
- public function testStandUpServer() {
+ public function testStandUpServer(): void {
// Stand up a server with working directory 'first'.
$this->standUpServer('first');
diff --git a/core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php b/core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php
index 19c439c876d..f34f5e7f896 100644
--- a/core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php
+++ b/core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php
@@ -17,7 +17,7 @@ class HtRouterTest extends QuickStartTestBase {
/**
* @covers ::instantiateServer
*/
- public function testHtRouter() {
+ public function testHtRouter(): void {
$sqlite = (new \PDO('sqlite::memory:'))->query('select sqlite_version()')->fetch()[0];
if (version_compare($sqlite, Tasks::SQLITE_MINIMUM_VERSION) < 0) {
$this->markTestSkipped();
diff --git a/core/tests/Drupal/BuildTests/TestSiteApplication/InstallTest.php b/core/tests/Drupal/BuildTests/TestSiteApplication/InstallTest.php
index f16e3b15c38..bbcce3d2ca2 100644
--- a/core/tests/Drupal/BuildTests/TestSiteApplication/InstallTest.php
+++ b/core/tests/Drupal/BuildTests/TestSiteApplication/InstallTest.php
@@ -15,7 +15,7 @@ use Symfony\Component\Process\PhpExecutableFinder;
*/
class InstallTest extends BuildTestBase {
- public function testInstall() {
+ public function testInstall(): void {
$sqlite = (new \PDO('sqlite::memory:'))->query('select sqlite_version()')->fetch()[0];
if (version_compare($sqlite, Tasks::SQLITE_MINIMUM_VERSION) < 0) {
$this->markTestSkipped();
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxCallbacksTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxCallbacksTest.php
index dace985114b..d1c07c20124 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxCallbacksTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxCallbacksTest.php
@@ -26,7 +26,7 @@ class AjaxCallbacksTest extends WebDriverTestBase {
/**
* Tests if Ajax callback works on date element.
*/
- public function testDateAjaxCallback() {
+ public function testDateAjaxCallback(): void {
// Test Ajax callback when date changes.
$this->drupalGet('ajax_forms_test_ajax_element_form');
@@ -38,7 +38,7 @@ class AjaxCallbacksTest extends WebDriverTestBase {
/**
* Tests if Ajax callback works on datetime element.
*/
- public function testDateTimeAjaxCallback() {
+ public function testDateTimeAjaxCallback(): void {
// Test Ajax callback when datetime changes.
$this->drupalGet('ajax_forms_test_ajax_element_form');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormCacheTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormCacheTest.php
index ccad0ab51ad..b2ae9386bd0 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormCacheTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormCacheTest.php
@@ -27,7 +27,7 @@ class AjaxFormCacheTest extends WebDriverTestBase {
/**
* Tests the usage of form cache for AJAX forms.
*/
- public function testFormCacheUsage() {
+ public function testFormCacheUsage(): void {
/** @var \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface $key_value_expirable */
$key_value_expirable = \Drupal::service('keyvalue.expirable')->get('form');
$this->drupalLogin($this->rootUser);
@@ -48,7 +48,7 @@ class AjaxFormCacheTest extends WebDriverTestBase {
/**
* Tests AJAX forms in blocks.
*/
- public function testBlockForms() {
+ public function testBlockForms(): void {
$this->container->get('module_installer')->install(['block', 'search']);
$this->rebuildContainer();
$this->drupalLogin($this->rootUser);
@@ -83,7 +83,7 @@ class AjaxFormCacheTest extends WebDriverTestBase {
/**
* Tests AJAX forms on pages with a query string.
*/
- public function testQueryString() {
+ public function testQueryString(): void {
$this->container->get('module_installer')->install(['block']);
$this->drupalLogin($this->rootUser);
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php
index 4e4ff6f8d29..c9a4b3ef272 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormImageButtonTest.php
@@ -26,7 +26,7 @@ class AjaxFormImageButtonTest extends WebDriverTestBase {
/**
* Tests image buttons can be operated with the keyboard ENTER key.
*/
- public function testAjaxImageButtonKeypressEnter() {
+ public function testAjaxImageButtonKeypressEnter(): void {
// Get a Field UI manage-display page.
$this->drupalGet('ajax_forms_image_button_form');
$assertSession = $this->assertSession();
@@ -41,7 +41,7 @@ class AjaxFormImageButtonTest extends WebDriverTestBase {
/**
* Tests image buttons can be operated with the keyboard SPACE key.
*/
- public function testAjaxImageButtonKeypressSpace() {
+ public function testAjaxImageButtonKeypressSpace(): void {
// Get a Field UI manage-display page.
$this->drupalGet('ajax_forms_image_button_form');
$assertSession = $this->assertSession();
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php
index 622311c1143..a80a627a89c 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php
@@ -46,7 +46,7 @@ class AjaxFormPageCacheTest extends WebDriverTestBase {
/**
* Create a simple form, then submit the form via AJAX to change to it.
*/
- public function testSimpleAJAXFormValue() {
+ public function testSimpleAJAXFormValue(): void {
$this->drupalGet('ajax_forms_test_get_form');
$build_id_initial = $this->getFormBuildId();
@@ -116,7 +116,7 @@ class AjaxFormPageCacheTest extends WebDriverTestBase {
*
* @see \Drupal\system\Tests\Ajax\ElementValidationTest::testAjaxElementValidation()
*/
- public function testAjaxElementValidation() {
+ public function testAjaxElementValidation(): void {
$this->drupalGet('ajax_validation_test');
// Changing the value of the textfield will trigger an AJAX
// request/response.
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxInGroupTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxInGroupTest.php
index cd0b859bc59..a8282b2b6cf 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxInGroupTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxInGroupTest.php
@@ -35,7 +35,7 @@ class AjaxInGroupTest extends WebDriverTestBase {
/**
* Submits forms with select and checkbox elements via Ajax.
*/
- public function testSimpleAjaxFormValue() {
+ public function testSimpleAjaxFormValue(): void {
$this->drupalGet('/ajax_forms_test_get_form');
$assert_session = $this->assertSession();
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTest.php
index fab6190c61d..3d056401a2b 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTest.php
@@ -24,7 +24,7 @@ class AjaxTest extends WebDriverTestBase {
*/
protected $defaultTheme = 'stark';
- public function testAjaxWithAdminRoute() {
+ public function testAjaxWithAdminRoute(): void {
\Drupal::service('theme_installer')->install(['stable9', 'claro']);
$theme_config = \Drupal::configFactory()->getEditable('system.theme');
$theme_config->set('admin', 'claro');
@@ -55,7 +55,7 @@ class AjaxTest extends WebDriverTestBase {
*
* @see https://www.drupal.org/node/2647916
*/
- public function testDrupalSettingsCachingRegression() {
+ public function testDrupalSettingsCachingRegression(): void {
$this->drupalGet('ajax-test/dialog');
$assert = $this->assertSession();
$session = $this->getSession();
@@ -100,7 +100,7 @@ class AjaxTest extends WebDriverTestBase {
* reattached and all top-level elements of type Node.ELEMENT_NODE need to be
* part of the context.
*/
- public function testInsertAjaxResponse() {
+ public function testInsertAjaxResponse(): void {
$render_single_root = [
'pre-wrapped-div' => '<div class="pre-wrapped">pre-wrapped<script> var test;</script></div>',
'pre-wrapped-span' => '<span class="pre-wrapped">pre-wrapped<script> var test;</script></span>',
@@ -162,7 +162,7 @@ JS;
/**
* Tests that jQuery's global Ajax events are triggered at the correct time.
*/
- public function testGlobalEvents() {
+ public function testGlobalEvents(): void {
$session = $this->getSession();
$assert = $this->assertSession();
$expected_event_order = implode('', ['ajaxSuccess', 'ajaxComplete', 'ajaxStop']);
@@ -260,7 +260,7 @@ JS;
/**
* Tests that Ajax errors are visible in the UI.
*/
- public function testUiAjaxException() {
+ public function testUiAjaxException(): void {
$themes = [
'olivero',
'claro',
@@ -300,7 +300,7 @@ JS;
/**
* Tests ajax focus handling.
*/
- public function testAjaxFocus() {
+ public function testAjaxFocus(): void {
$this->markTestSkipped("Skipped due to frequent random test failures. See https://www.drupal.org/project/drupal/issues/3396536");
$this->drupalGet('/ajax_forms_test_get_form');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php
index 736f8351c69..612bfba7a62 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php
@@ -26,7 +26,7 @@ class CommandsTest extends WebDriverTestBase {
/**
* Tests the various Ajax Commands.
*/
- public function testAjaxCommands() {
+ public function testAjaxCommands(): void {
$session = $this->getSession();
$page = $this->getSession()->getPage();
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/DialogTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/DialogTest.php
index 7438e1af1ca..c42255d5404 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/DialogTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/DialogTest.php
@@ -28,7 +28,7 @@ class DialogTest extends WebDriverTestBase {
/**
* Tests sending non-JS and AJAX requests to open and manipulate modals.
*/
- public function testDialog() {
+ public function testDialog(): void {
$this->drupalLogin($this->drupalCreateUser(['administer contact forms']));
// Ensure the elements render without notices or exceptions.
$this->drupalGet('ajax-test/dialog');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/ElementValidationTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/ElementValidationTest.php
index 345cef2107d..60fd1f40b95 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/ElementValidationTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/ElementValidationTest.php
@@ -29,7 +29,7 @@ class ElementValidationTest extends WebDriverTestBase {
* Drupal AJAX commands update the DOM echoing back the validated values in
* the form of messages that appear on the page.
*/
- public function testAjaxElementValidation() {
+ public function testAjaxElementValidation(): void {
$this->drupalGet('ajax_validation_test');
$page = $this->getSession()->getPage();
$assert = $this->assertSession();
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/FocusFirstCommandTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/FocusFirstCommandTest.php
index 90175f1d7f0..7a9b91c52b9 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/FocusFirstCommandTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/FocusFirstCommandTest.php
@@ -25,7 +25,7 @@ class FocusFirstCommandTest extends WebDriverTestBase {
/**
* Tests AjaxFocusFirstCommand on a page.
*/
- public function testFocusFirst() {
+ public function testFocusFirst(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/FormValuesTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/FormValuesTest.php
index c2a1d3e5a88..2ee6b8ddb2c 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/FormValuesTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/FormValuesTest.php
@@ -36,7 +36,7 @@ class FormValuesTest extends WebDriverTestBase {
*
* @dataProvider formModeProvider
*/
- public function testSimpleAjaxFormValue($form_mode) {
+ public function testSimpleAjaxFormValue($form_mode): void {
$this->drupalGet('ajax_forms_test_get_form');
$session = $this->getSession();
@@ -78,7 +78,7 @@ class FormValuesTest extends WebDriverTestBase {
/**
* Tests that AJAX elements with invalid callbacks return error code 500.
*/
- public function testSimpleInvalidCallbacksAjaxFormValue() {
+ public function testSimpleInvalidCallbacksAjaxFormValue(): void {
$this->drupalGet('ajax_forms_test_get_form');
$session = $this->getSession();
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php
index ce9064118eb..ac347e8c45d 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MessageCommandTest.php
@@ -27,7 +27,7 @@ class MessageCommandTest extends WebDriverTestBase {
/**
* Tests AJAX MessageCommand use in a form.
*/
- public function testMessageCommand() {
+ public function testMessageCommand(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php
index 7d18e56aef6..238474e5ae7 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php
@@ -58,7 +58,7 @@ class MultiFormTest extends WebDriverTestBase {
/**
* Tests that pages with the 'node_page_form' included twice work correctly.
*/
- public function testMultiForm() {
+ public function testMultiForm(): void {
// HTML IDs for elements within the field are potentially modified with
// each Ajax submission, but these variables are stable and help target the
// desired elements.
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/ThrobberTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/ThrobberTest.php
index d6ecae566a7..0372ae1cd99 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/ThrobberTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/ThrobberTest.php
@@ -33,7 +33,7 @@ class ThrobberTest extends WebDriverTestBase {
/**
* Tests theming throbber element.
*/
- public function testThemingThrobberElement() {
+ public function testThemingThrobberElement(): void {
$session = $this->getSession();
$web_assert = $this->assertSession();
$page = $session->getPage();
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/BrowserWithJavascriptTest.php b/core/tests/Drupal/FunctionalJavascriptTests/BrowserWithJavascriptTest.php
index ecf579c8cb4..163a98e247b 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/BrowserWithJavascriptTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/BrowserWithJavascriptTest.php
@@ -25,7 +25,7 @@ class BrowserWithJavascriptTest extends WebDriverTestBase {
*/
protected $defaultTheme = 'stark';
- public function testJavascript() {
+ public function testJavascript(): void {
$this->drupalGet('<front>');
$session = $this->getSession();
@@ -48,7 +48,7 @@ JS;
$this->assertFalse($this->isTestUsingGuzzleClient());
}
- public function testAssertJsCondition() {
+ public function testAssertJsCondition(): void {
$this->drupalGet('<front>');
$session = $this->getSession();
@@ -74,7 +74,7 @@ JS;
/**
* Tests creating screenshots.
*/
- public function testCreateScreenshot() {
+ public function testCreateScreenshot(): void {
$this->drupalGet('<front>');
$this->createScreenshot('public://screenshot.jpg');
$this->assertFileExists('public://screenshot.jpg');
@@ -86,7 +86,7 @@ JS;
* @see \Drupal\Tests\WebAssert::assertNoEscaped()
* @see \Drupal\Tests\WebAssert::assertEscaped()
*/
- public function testEscapingAssertions() {
+ public function testEscapingAssertions(): void {
$assert = $this->assertSession();
$this->drupalGet('test-escaped-characters');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Components/ComponentRenderTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Components/ComponentRenderTest.php
index c479411006a..5b77de188aa 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Components/ComponentRenderTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Components/ComponentRenderTest.php
@@ -29,7 +29,7 @@ class ComponentRenderTest extends WebDriverTestBase {
* This also covers all the path translations necessary to produce the correct
* path to the assets.
*/
- public function testCssLibraryAttachesCorrectly() {
+ public function testCssLibraryAttachesCorrectly(): void {
$build = [
'#type' => 'inline_template',
'#template' => "{{ include('sdc_theme_test:lib-overrides') }}",
@@ -47,7 +47,7 @@ class ComponentRenderTest extends WebDriverTestBase {
* This also covers all the path translations necessary to produce the correct
* path to the assets.
*/
- public function testJsLibraryAttachesCorrectly() {
+ public function testJsLibraryAttachesCorrectly(): void {
$build = [
'#type' => 'inline_template',
'#template' => "{{ include('sdc_test:my-button', {
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/CsrfTokenRaceTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/CsrfTokenRaceTest.php
index f0208d6d2dd..f16b300441d 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Core/CsrfTokenRaceTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/CsrfTokenRaceTest.php
@@ -26,7 +26,7 @@ class CsrfTokenRaceTest extends WebDriverTestBase {
/**
* Tests race condition for CSRF tokens for simultaneous requests.
*/
- public function testCsrfRace() {
+ public function testCsrfRace(): void {
$user = $this->createUser(['access content']);
$this->drupalLogin($user);
$this->drupalGet('/csrf_race/test');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/FormGroupingElementsTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/FormGroupingElementsTest.php
index 57f139442ed..7c8af15a2e3 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/FormGroupingElementsTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/FormGroupingElementsTest.php
@@ -42,7 +42,7 @@ class FormGroupingElementsTest extends WebDriverTestBase {
* becomes visible when the tab is clicked, a fragment link to the child is
* clicked or when the URI fragment pointing to that child changes.
*/
- public function testVerticalTabChildVisibility() {
+ public function testVerticalTabChildVisibility(): void {
$session = $this->getSession();
$web_assert = $this->assertSession();
@@ -92,7 +92,7 @@ class FormGroupingElementsTest extends WebDriverTestBase {
* becomes visible when a fragment link to the child is clicked or when the
* URI fragment pointing to that child changes.
*/
- public function testDetailsChildVisibility() {
+ public function testDetailsChildVisibility(): void {
$session = $this->getSession();
$web_assert = $this->assertSession();
@@ -139,7 +139,7 @@ class FormGroupingElementsTest extends WebDriverTestBase {
/**
* Confirms tabs containing a field with a validation error are open.
*/
- public function testVerticalTabValidationVisibility() {
+ public function testVerticalTabValidationVisibility(): void {
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/JavascriptStatesTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/JavascriptStatesTest.php
index 3fb9f8feac8..179886e8b90 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/JavascriptStatesTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/JavascriptStatesTest.php
@@ -63,7 +63,7 @@ class JavascriptStatesTest extends WebDriverTestBase {
* this is a single public test method that invokes a series of protected
* methods to do assertions on specific kinds of triggering elements.
*/
- public function testJavascriptStates() {
+ public function testJavascriptStates(): void {
$this->doCheckboxTriggerTests();
$this->doCheckboxesTriggerTests();
$this->doTextfieldTriggerTests();
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/JsMessageTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/JsMessageTest.php
index bcd063ee434..ce4cf583cd8 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Core/JsMessageTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/JsMessageTest.php
@@ -40,7 +40,7 @@ class JsMessageTest extends WebDriverTestBase {
/**
* Tests click on links to show messages and remove messages.
*/
- public function testAddRemoveMessages() {
+ public function testAddRemoveMessages(): void {
$web_assert = $this->assertSession();
$this->drupalGet('js_message_test_link');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/MachineNameTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/MachineNameTest.php
index 57affeb98f6..31f04417586 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Core/MachineNameTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/MachineNameTest.php
@@ -46,7 +46,7 @@ class MachineNameTest extends WebDriverTestBase {
* Makes sure that the machine name field automatically provides a valid
* machine name and that the manual editing mode functions.
*/
- public function testMachineName() {
+ public function testMachineName(): void {
// Visit the machine name test page which contains two machine name fields.
$this->drupalGet('form-test/machine-name');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php
index d6b6241b1a8..8adf7a5685a 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php
@@ -50,7 +50,7 @@ class SessionTest extends WebDriverTestBase {
* performed by the Mink browser. The SIMPLETEST_USER_AGENT cookie must always
* be valid.
*/
- public function testSessionExpiration() {
+ public function testSessionExpiration(): void {
// Visit the front page and click the link back to the front page a large
// number of times.
$this->drupalGet('<front>');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Dialog/DialogPositionTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Dialog/DialogPositionTest.php
index c3f9dcd8f8c..ed73ac1ff70 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Dialog/DialogPositionTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Dialog/DialogPositionTest.php
@@ -26,7 +26,7 @@ class DialogPositionTest extends WebDriverTestBase {
/**
* Tests if the dialog UI works properly with block layout page.
*/
- public function testDialogOpenAndClose() {
+ public function testDialogOpenAndClose(): void {
$admin_user = $this->drupalCreateUser(['administer blocks']);
$this->drupalLogin($admin_user);
$this->drupalGet('admin/structure/block');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php b/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php
index a40e9915238..ecf77d322b8 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php
@@ -58,7 +58,7 @@ class EntityReferenceAutocompleteWidgetTest extends WebDriverTestBase {
/**
* Tests that the default autocomplete widget return the correct results.
*/
- public function testEntityReferenceAutocompleteWidget() {
+ public function testEntityReferenceAutocompleteWidget(): void {
/** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
$display_repository = \Drupal::service('entity_display.repository');
@@ -164,7 +164,7 @@ class EntityReferenceAutocompleteWidgetTest extends WebDriverTestBase {
* Ensures that the entity the autocomplete widget stores the entity it is
* rendered on, and is available in the autocomplete results' AJAX request.
*/
- public function testEntityReferenceAutocompleteWidgetAttachedEntity() {
+ public function testEntityReferenceAutocompleteWidgetAttachedEntity(): void {
$user = $this->drupalCreateUser([
'administer entity_test content',
]);
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptDeprecationTest.php b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptDeprecationTest.php
index ab4dba1be7c..7bdf7cd6415 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptDeprecationTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptDeprecationTest.php
@@ -22,7 +22,7 @@ class JavascriptDeprecationTest extends WebDriverTestBase {
/**
* Tests Javascript deprecation notices.
*/
- public function testJavascriptDeprecation() {
+ public function testJavascriptDeprecation(): void {
$this->expectDeprecation('Javascript Deprecation: This function is deprecated for testing purposes.');
$this->expectDeprecation('Javascript Deprecation: This property is deprecated for testing purposes.');
$this->drupalGet('js_deprecation_test');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptGetDrupalSettingsTest.php b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptGetDrupalSettingsTest.php
index c9ed7f1d3fc..31ec8c91675 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptGetDrupalSettingsTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptGetDrupalSettingsTest.php
@@ -26,7 +26,7 @@ class JavascriptGetDrupalSettingsTest extends WebDriverTestBase {
*
* @see \Drupal\FunctionalJavascriptTests\WebDriverTestBase::getDrupalSettings()
*/
- public function testGetDrupalSettings() {
+ public function testGetDrupalSettings(): void {
$this->drupalLogin($this->drupalCreateUser());
$this->drupalGet('test-page');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/MachineName/MachineNameTransliterationTest.php b/core/tests/Drupal/FunctionalJavascriptTests/MachineName/MachineNameTransliterationTest.php
index 74546cb8104..9cb079d954d 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/MachineName/MachineNameTransliterationTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/MachineName/MachineNameTransliterationTest.php
@@ -51,7 +51,7 @@ class MachineNameTransliterationTest extends WebDriverTestBase {
*
* @dataProvider machineNameInputOutput
*/
- public function testMachineNameTransliterations($langcode, $input, $output) {
+ public function testMachineNameTransliterations($langcode, $input, $output): void {
$page = $this->getSession()->getPage();
if ($langcode !== 'en') {
ConfigurableLanguage::createFromLangcode($langcode)->save();
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php b/core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
index 82ceebe341c..0a3dd44e6ab 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
@@ -63,7 +63,7 @@ class TableDragTest extends WebDriverTestBase {
/**
* Tests row weight switch.
*/
- public function testRowWeightSwitch() {
+ public function testRowWeightSwitch(): void {
$this->state->set('tabledrag_test_table', array_flip(range(1, 3)));
$this->drupalGet('tabledrag_test');
@@ -100,7 +100,7 @@ class TableDragTest extends WebDriverTestBase {
/**
* Tests draggable table drag'n'drop.
*/
- public function testDragAndDrop() {
+ public function testDragAndDrop(): void {
$this->state->set('tabledrag_test_table', array_flip(range(1, 3)));
$this->drupalGet('tabledrag_test');
@@ -147,7 +147,7 @@ class TableDragTest extends WebDriverTestBase {
/**
* Tests accessibility through keyboard of the tabledrag functionality.
*/
- public function testKeyboardAccessibility() {
+ public function testKeyboardAccessibility(): void {
$this->assertKeyboardAccessibility();
}
@@ -248,7 +248,7 @@ class TableDragTest extends WebDriverTestBase {
/**
* Tests the root and leaf behaviors for rows.
*/
- public function testRootLeafDraggableRowsWithKeyboard() {
+ public function testRootLeafDraggableRowsWithKeyboard(): void {
$this->state->set('tabledrag_test_table', [
1 => [],
2 => ['parent' => 1, 'depth' => 1, 'classes' => ['tabledrag-leaf']],
@@ -298,7 +298,7 @@ class TableDragTest extends WebDriverTestBase {
/**
* Tests the warning that appears upon making changes to a tabledrag table.
*/
- public function testTableDragChangedWarning() {
+ public function testTableDragChangedWarning(): void {
$this->drupalGet('tabledrag_test');
// By default no text is visible.
@@ -347,7 +347,7 @@ class TableDragTest extends WebDriverTestBase {
/**
* Tests nested draggable tables through keyboard.
*/
- public function testNestedDraggableTables() {
+ public function testNestedDraggableTables(): void {
$this->state->set('tabledrag_test_table', array_flip(range(1, 5)));
$this->drupalGet('tabledrag_test_nested');
$this->assertKeyboardAccessibility('');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Tests/DrupalSelenium2DriverTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Tests/DrupalSelenium2DriverTest.php
index 16089b7a26f..58182ab305f 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Tests/DrupalSelenium2DriverTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Tests/DrupalSelenium2DriverTest.php
@@ -47,7 +47,7 @@ class DrupalSelenium2DriverTest extends WebDriverTestBase {
/**
* Tests uploading remote files.
*/
- public function testGetRemoteFilePath() {
+ public function testGetRemoteFilePath(): void {
$web_driver = $this->getSession()->getDriver();
$this->assertInstanceOf(Selenium2Driver::class, $web_driver);
$this->assertFalse($web_driver->isW3C(), 'Driver is not operating in W3C mode');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Tests/JSInteractionTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Tests/JSInteractionTest.php
index 52289bc933a..866f04e3a72 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Tests/JSInteractionTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Tests/JSInteractionTest.php
@@ -29,7 +29,7 @@ class JSInteractionTest extends WebDriverTestBase {
/**
* Assert an exception is thrown when the blocker element is never removed.
*/
- public function testNotClickable() {
+ public function testNotClickable(): void {
$this->expectException(Exception::class);
$this->drupalGet('/js_interaction_test');
$this->assertSession()->elementExists('named', ['link', 'Target link'])->click();
@@ -38,7 +38,7 @@ class JSInteractionTest extends WebDriverTestBase {
/**
* Assert an exception is thrown when the field is never enabled.
*/
- public function testFieldValueNotSettable() {
+ public function testFieldValueNotSettable(): void {
$this->expectException(Exception::class);
$this->drupalGet('/js_interaction_test');
$this->assertSession()->fieldExists('target_field')->setValue('Test');
@@ -47,7 +47,7 @@ class JSInteractionTest extends WebDriverTestBase {
/**
* Assert no exception is thrown when elements become interactive.
*/
- public function testElementsInteraction() {
+ public function testElementsInteraction(): void {
$this->drupalGet('/js_interaction_test');
// Remove blocking element after 100 ms.
$this->clickLink('Remove Blocker Trigger');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Tests/JSWebAssertTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Tests/JSWebAssertTest.php
index 46b1ac5d01e..07d84d19fc4 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Tests/JSWebAssertTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Tests/JSWebAssertTest.php
@@ -31,7 +31,7 @@ class JSWebAssertTest extends WebDriverTestBase {
/**
* Tests that JSWebAssert assertions work correctly.
*/
- public function testJsWebAssert() {
+ public function testJsWebAssert(): void {
$this->drupalGet('js_webassert_test_form');
$session = $this->getSession();
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php
index df19a498621..6e3ac8113c3 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php
@@ -42,7 +42,7 @@ class ClaroEntityDisplayTest extends EntityDisplayTest {
* with a line changed to reflect row weight toggle being a link instead
* of a button.
*/
- public function testEntityForm() {
+ public function testEntityForm(): void {
$this->drupalGet('entity_test/manage/1/edit');
$this->assertSession()->fieldExists('field_test_text[0][value]');
@@ -68,7 +68,7 @@ class ClaroEntityDisplayTest extends EntityDisplayTest {
* with a line changed to reflect row weight toggle being a link instead
* of a button.
*/
- public function testEntityView() {
+ public function testEntityView(): void {
$this->drupalGet('entity_test/1');
$this->assertSession()->elementNotExists('css', '.field--name-field-test-text');
@@ -95,7 +95,7 @@ class ClaroEntityDisplayTest extends EntityDisplayTest {
* This is Drupal\Tests\field_ui\FunctionalJavascript\EntityDisplayTest::testExtraFields()
* with a line changed to reflect Claro's tabledrag selector.
*/
- public function testExtraFields() {
+ public function testExtraFields(): void {
entity_test_create_bundle('bundle_with_extra_fields');
$this->drupalGet('entity_test/structure/bundle_with_extra_fields/display');
$this->assertSession()->waitForElement('css', '.tabledrag-handle');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroMenuUiJavascriptTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroMenuUiJavascriptTest.php
index f8f4c950c58..32f6256396b 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroMenuUiJavascriptTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroMenuUiJavascriptTest.php
@@ -37,7 +37,7 @@ class ClaroMenuUiJavascriptTest extends MenuUiJavascriptTest {
* Contextual links do not work in admin themes, so this is empty to prevent
* this test running in the parent class.
*/
- public function testBlockContextualLinks() {
+ public function testBlockContextualLinks(): void {
}
}
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroModalDisplayTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroModalDisplayTest.php
index 7956989b4a2..c78ff99c80a 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroModalDisplayTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroModalDisplayTest.php
@@ -27,7 +27,7 @@ class ClaroModalDisplayTest extends MediaLibraryTestBase {
/**
* Tests the position f "add another" button in dialogs.
*/
- public function testModalAddAnother() {
+ public function testModalAddAnother(): void {
// Add unlimited field to the media type four.
$unlimited_field_storage = FieldStorageConfig::create([
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroPasswordConfirmWidgetTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroPasswordConfirmWidgetTest.php
index 57952ad7b50..af01db8d2a8 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroPasswordConfirmWidgetTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroPasswordConfirmWidgetTest.php
@@ -21,7 +21,7 @@ class ClaroPasswordConfirmWidgetTest extends PasswordConfirmWidgetTest {
/**
* Tests that password match message is invisible when widget is initialized.
*/
- public function testPasswordConfirmMessage() {
+ public function testPasswordConfirmMessage(): void {
$this->drupalGet($this->testUser->toUrl('edit-form'));
$password_confirm_widget_selector = '.js-form-type-password-confirm.js-form-item-pass';
$password_confirm_selector = '.js-form-item-pass-pass2';
@@ -36,7 +36,7 @@ class ClaroPasswordConfirmWidgetTest extends PasswordConfirmWidgetTest {
/**
* {@inheritdoc}
*/
- public function testFillConfirmOnly() {
+ public function testFillConfirmOnly(): void {
// This test is not applicable to Claro because confirm field is hidden
// until the password has been filled in the main field.
}
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroTableDragTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroTableDragTest.php
index 5872284d677..9938ad22d09 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroTableDragTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroTableDragTest.php
@@ -33,7 +33,7 @@ class ClaroTableDragTest extends TableDragTest {
/**
* Ensures that there are no duplicate tabledrag handles.
*/
- public function testNoDuplicates() {
+ public function testNoDuplicates(): void {
$this->drupalGet('tabledrag_test_nested');
$this->assertCount(1, $this->findRowById(1)->findAll('css', '.tabledrag-handle'));
}
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroViewsBulkOperationsTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroViewsBulkOperationsTest.php
index 058557e3cdd..e752b79a65a 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroViewsBulkOperationsTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroViewsBulkOperationsTest.php
@@ -51,7 +51,7 @@ class ClaroViewsBulkOperationsTest extends WebDriverTestBase {
/**
* Tests the dynamic Bulk Operations form.
*/
- public function testBulkOperationsUi() {
+ public function testBulkOperationsUi(): void {
$this->drupalGet('admin/content');
$page = $this->getSession()->getPage();
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroViewsUiTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroViewsUiTest.php
index 9b1a97e0c19..28b3c46a999 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroViewsUiTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroViewsUiTest.php
@@ -47,7 +47,7 @@ class ClaroViewsUiTest extends WebDriverTestBase {
* Ensures that the CSS classes added to display menu tabs are preserved when
* Views UI is updated with AJAX.
*/
- public function testViewsUiTabsCssClasses() {
+ public function testViewsUiTabsCssClasses(): void {
$this->drupalGet('admin/structure/views/view/who_s_online');
$assert_session = $this->assertSession();
$assert_session->elementExists('css', '#views-display-menu-tabs.views-tabs.views-tabs--secondary');
@@ -69,7 +69,7 @@ class ClaroViewsUiTest extends WebDriverTestBase {
* Ensures that the CSS classes added to the Views UI extra actions dropbutton
* in .views-display-top are preserved when Views UI is refreshed with AJAX.
*/
- public function testViewsUiDropButtonCssClasses() {
+ public function testViewsUiDropButtonCssClasses(): void {
$this->drupalGet('admin/structure/views/view/who_s_online');
$assert_session = $this->assertSession();
$extra_actions_dropbutton_list = $assert_session->elementExists('css', '#views-display-extra-actions.dropbutton--small');
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Theme/OliveroMessagesTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Theme/OliveroMessagesTest.php
index ac880f12223..6b0472702c0 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Theme/OliveroMessagesTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Theme/OliveroMessagesTest.php
@@ -46,7 +46,7 @@ class OliveroMessagesTest extends JsMessageTest {
/**
* Tests data-drupal-selector="messages" exists.
*/
- public function testDataDrupalSelectors() {
+ public function testDataDrupalSelectors(): void {
$web_assert = $this->assertSession();
$this->drupalGet('js_message_test_link');
diff --git a/core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php b/core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php
index 875f7f2bedc..113371ba5da 100644
--- a/core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php
+++ b/core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php
@@ -61,7 +61,7 @@ class UncaughtExceptionTest extends BrowserTestBase {
/**
* Tests uncaught exception handling when system is in a bad state.
*/
- public function testUncaughtException() {
+ public function testUncaughtException(): void {
$this->expectedExceptionMessage = 'Oh oh, bananas in the instruments.';
\Drupal::state()->set('error_service_test.break_bare_html_renderer', TRUE);
@@ -94,7 +94,7 @@ class UncaughtExceptionTest extends BrowserTestBase {
/**
* Tests displaying an uncaught fatal error.
*/
- public function testUncaughtFatalError() {
+ public function testUncaughtFatalError(): void {
$fatal_error = [
'%type' => 'TypeError',
'@message' => 'Drupal\error_test\Controller\ErrorTestController::Drupal\error_test\Controller\{closure}(): Argument #1 ($test) must be of type array, string given, called in ' . \Drupal::root() . '/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php on line 65',
@@ -113,7 +113,7 @@ class UncaughtExceptionTest extends BrowserTestBase {
/**
* Tests uncaught exception handling with custom exception handler.
*/
- public function testUncaughtExceptionCustomExceptionHandler() {
+ public function testUncaughtExceptionCustomExceptionHandler(): void {
$settings_filename = $this->siteDirectory . '/settings.php';
chmod($settings_filename, 0777);
$settings_php = file_get_contents($settings_filename);
@@ -136,7 +136,7 @@ class UncaughtExceptionTest extends BrowserTestBase {
/**
* Tests a missing dependency on a service.
*/
- public function testMissingDependency() {
+ public function testMissingDependency(): void {
$this->expectedExceptionMessage = 'Too few arguments to function Drupal\error_service_test\LonelyMonkeyClass::__construct(), 0 passed';
$this->drupalGet('broken-service-class');
$this->assertSession()->statusCodeEquals(500);
@@ -149,7 +149,7 @@ class UncaughtExceptionTest extends BrowserTestBase {
/**
* Tests a container which has an error.
*/
- public function testErrorContainer() {
+ public function testErrorContainer(): void {
$settings = [];
$settings['settings']['container_base_class'] = (object) [
'value' => '\Drupal\FunctionalTests\Bootstrap\ErrorContainer',
@@ -169,7 +169,7 @@ class UncaughtExceptionTest extends BrowserTestBase {
/**
* Tests a container which has an exception really early.
*/
- public function testExceptionContainer() {
+ public function testExceptionContainer(): void {
$settings = [];
$settings['settings']['container_base_class'] = (object) [
'value' => '\Drupal\FunctionalTests\Bootstrap\ExceptionContainer',
@@ -190,7 +190,7 @@ class UncaughtExceptionTest extends BrowserTestBase {
/**
* Tests the case when the database connection is gone.
*/
- public function testLostDatabaseConnection() {
+ public function testLostDatabaseConnection(): void {
$incorrect_username = $this->randomMachineName(16);
switch ($this->container->get('database')->driver()) {
case 'pgsql':
@@ -225,7 +225,7 @@ class UncaughtExceptionTest extends BrowserTestBase {
/**
* Tests fallback to PHP error log when an exception is thrown while logging.
*/
- public function testLoggerException() {
+ public function testLoggerException(): void {
// Ensure the test error log is empty before these tests.
$this->assertNoErrorsLogged();
diff --git a/core/tests/Drupal/FunctionalTests/Breadcrumb/Breadcrumb404Test.php b/core/tests/Drupal/FunctionalTests/Breadcrumb/Breadcrumb404Test.php
index c0814dd7b63..b38a93c2565 100644
--- a/core/tests/Drupal/FunctionalTests/Breadcrumb/Breadcrumb404Test.php
+++ b/core/tests/Drupal/FunctionalTests/Breadcrumb/Breadcrumb404Test.php
@@ -29,7 +29,7 @@ class Breadcrumb404Test extends BrowserTestBase {
/**
* Tests that different 404s don't create unnecessary cache entries.
*/
- public function testBreadcrumbOn404Pages() {
+ public function testBreadcrumbOn404Pages(): void {
$this->placeBlock('system_breadcrumb_block', ['id' => 'breadcrumb']);
// Prime the cache first.
diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
index 824ad1418a3..1cc4925b129 100644
--- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
+++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
@@ -47,7 +47,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Tests that JavaScript Drupal settings can be read.
*/
- public function testDrupalSettings() {
+ public function testDrupalSettings(): void {
// Trigger a 403 because those pages have very little else going on.
$this->drupalGet('admin');
$this->assertSame([], $this->getDrupalSettings());
@@ -63,7 +63,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Tests basic page test.
*/
- public function testGoTo() {
+ public function testGoTo(): void {
$account = $this->drupalCreateUser();
$this->drupalLogin($account);
@@ -113,7 +113,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Tests drupalGet().
*/
- public function testDrupalGet() {
+ public function testDrupalGet(): void {
$this->drupalGet('test-page');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->addressEquals('test-page');
@@ -141,7 +141,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Tests basic form functionality.
*/
- public function testForm() {
+ public function testForm(): void {
// Ensure the proper response code for a _form route.
$this->drupalGet('form-test/object-builder');
$this->assertSession()->statusCodeEquals(200);
@@ -209,7 +209,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Tests clickLink() functionality.
*/
- public function testClickLink() {
+ public function testClickLink(): void {
$this->drupalGet('test-page');
$this->clickLink('Visually identical test links');
$this->assertStringContainsString('user/login', $this->getSession()->getCurrentUrl());
@@ -221,7 +221,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
$this->assertStringContainsString('user/register', $this->getSession()->getCurrentUrl());
}
- public function testError() {
+ public function testError(): void {
$this->expectException('\Exception');
$this->expectExceptionMessage('User notice: foo');
$this->drupalGet('test-error');
@@ -230,7 +230,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Tests legacy field asserts which use xpath directly.
*/
- public function testXpathAsserts() {
+ public function testXpathAsserts(): void {
$this->drupalGet('test-field-xpath');
$this->assertSession()->elementTextContains('xpath', '//table/tbody/tr[2]/td[1]', 'one');
@@ -261,7 +261,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Tests field asserts using textfields.
*/
- public function testFieldAssertsForTextfields() {
+ public function testFieldAssertsForTextfields(): void {
$this->drupalGet('test-field-xpath');
// *** 1. fieldNotExists().
@@ -372,7 +372,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Tests legacy field asserts for checkbox field type.
*/
- public function testFieldAssertsForCheckbox() {
+ public function testFieldAssertsForCheckbox(): void {
$this->drupalGet('test-field-xpath');
// Part 1 - Test by name.
@@ -464,7 +464,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Tests the ::cronRun() method.
*/
- public function testCronRun() {
+ public function testCronRun(): void {
$last_cron_time = \Drupal::state()->get('system.cron_last');
$this->cronRun();
$this->assertSession()->statusCodeEquals(204);
@@ -476,7 +476,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Tests the Drupal install done in \Drupal\Tests\BrowserTestBase::setUp().
*/
- public function testInstall() {
+ public function testInstall(): void {
$htaccess_filename = $this->tempFilesDirectory . '/.htaccess';
$this->assertFileExists($htaccess_filename);
@@ -487,7 +487,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Tests the assumption that local time is in 'Australia/Sydney'.
*/
- public function testLocalTimeZone() {
+ public function testLocalTimeZone(): void {
$expected = 'Australia/Sydney';
// The 'Australia/Sydney' time zone is set in core/tests/bootstrap.php
$this->assertEquals($expected, date_default_timezone_get());
@@ -507,7 +507,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Tests the ::checkForMetaRefresh() method.
*/
- public function testCheckForMetaRefresh() {
+ public function testCheckForMetaRefresh(): void {
// Disable following redirects in the client.
$this->getSession()->getDriver()->getClient()->followRedirects(FALSE);
// Set the maximumMetaRefreshCount to zero to make sure the redirect doesn't
@@ -522,7 +522,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
$this->assertSession()->pageTextContains('Test page text.');
}
- public function testGetDefaultDriveInstance() {
+ public function testGetDefaultDriveInstance(): void {
putenv('MINK_DRIVER_ARGS=' . json_encode([NULL, ['key1' => ['key2' => ['key3' => 3, 'key3.1' => 3.1]]]]));
$this->getDefaultDriverInstance();
$this->assertEquals([NULL, ['key1' => ['key2' => ['key3' => 3, 'key3.1' => 3.1]]]], $this->minkDefaultDriverArgs);
@@ -531,7 +531,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Ensures we can't access modules we shouldn't be able to after install.
*/
- public function testProfileModules() {
+ public function testProfileModules(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('The module demo_umami_content does not exist.');
$this->assertFileExists('core/profiles/demo_umami/modules/demo_umami_content/demo_umami_content.info.yml');
@@ -541,7 +541,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Tests the protections provided by .htkey.
*/
- public function testHtKey() {
+ public function testHtKey(): void {
// Remove the Simpletest private key file so we can test the protection
// against requests that forge a valid testing user agent to gain access
// to the installer.
@@ -576,7 +576,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
*
* @see \Drupal\Core\Test\HttpClientMiddleware\TestHttpClientMiddleware::__invoke()
*/
- public function testDeprecationHeaders() {
+ public function testDeprecationHeaders(): void {
$this->drupalGet('/test-deprecations');
$deprecation_messages = [];
@@ -603,7 +603,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Tests the dump() function provided by the var-dumper Symfony component.
*/
- public function testVarDump() {
+ public function testVarDump(): void {
// Append the stream capturer to the STDERR stream, so that we can test the
// dump() output and also prevent it from actually outputting in this
// particular test.
@@ -638,7 +638,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
/**
* Test if setting an invalid scheme in SIMPLETEST_BASE_URL throws an exception.
*/
- public function testSimpleTestBaseUrlValidation() {
+ public function testSimpleTestBaseUrlValidation(): void {
putenv('SIMPLETEST_BASE_URL=mysql://user:pass@localhost/database');
$this->expectException(\Exception::class);
$this->expectExceptionMessage('You must provide valid scheme for the SIMPLETEST_BASE_URL environment variable. Valid schema are: http, https.');
diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseUserAgentTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseUserAgentTest.php
index 80de5219b26..ac65e81abe0 100644
--- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseUserAgentTest.php
+++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseUserAgentTest.php
@@ -28,7 +28,7 @@ class BrowserTestBaseUserAgentTest extends BrowserTestBase {
/**
* Tests validation of the User-Agent header we use to perform test requests.
*/
- public function testUserAgentValidation() {
+ public function testUserAgentValidation(): void {
$assert_session = $this->assertSession();
$system_path = $this->buildUrl(\Drupal::service('extension.list.module')->getPath('system'));
$http_path = $system_path . '/tests/http.php/user/login';
diff --git a/core/tests/Drupal/FunctionalTests/Core/Container/ServiceDeprecationTest.php b/core/tests/Drupal/FunctionalTests/Core/Container/ServiceDeprecationTest.php
index 43eab184a55..d441c23d307 100644
--- a/core/tests/Drupal/FunctionalTests/Core/Container/ServiceDeprecationTest.php
+++ b/core/tests/Drupal/FunctionalTests/Core/Container/ServiceDeprecationTest.php
@@ -33,7 +33,7 @@ class ServiceDeprecationTest extends BrowserTestBase {
/**
* @covers ::get
*/
- public function testGetDeprecated() {
+ public function testGetDeprecated(): void {
$this->expectDeprecation('The "deprecation_test.service" service is deprecated in drupal:9.0.0 and is removed from drupal:20.0.0. This is a test.');
$this->expectDeprecation('The "deprecation_test.alias" alias is deprecated in drupal:9.0.0 and is removed from drupal:20.0.0. This is a test.');
// @phpstan-ignore-next-line
diff --git a/core/tests/Drupal/FunctionalTests/Core/Test/ModuleInstallBatchTest.php b/core/tests/Drupal/FunctionalTests/Core/Test/ModuleInstallBatchTest.php
index 732df7743d1..a229a5d183e 100644
--- a/core/tests/Drupal/FunctionalTests/Core/Test/ModuleInstallBatchTest.php
+++ b/core/tests/Drupal/FunctionalTests/Core/Test/ModuleInstallBatchTest.php
@@ -33,7 +33,7 @@ class ModuleInstallBatchTest extends BrowserTestBase {
/**
* Tests loading entities created in a batch in test_batch_test_install().
*/
- public function testLoadingEntitiesCreatedInBatch() {
+ public function testLoadingEntitiesCreatedInBatch(): void {
foreach ([1, 2] as $id) {
$this->assertNotNull(EntityTest::load($id), 'Successfully loaded entity ' . $id);
}
diff --git a/core/tests/Drupal/FunctionalTests/Core/Test/PhpUnitBridgeTest.php b/core/tests/Drupal/FunctionalTests/Core/Test/PhpUnitBridgeTest.php
index a674fa7a8a5..c306529a02e 100644
--- a/core/tests/Drupal/FunctionalTests/Core/Test/PhpUnitBridgeTest.php
+++ b/core/tests/Drupal/FunctionalTests/Core/Test/PhpUnitBridgeTest.php
@@ -25,7 +25,7 @@ class PhpUnitBridgeTest extends BrowserTestBase {
/**
* Tests deprecation message from deprecation_test_function().
*/
- public function testSilencedError() {
+ public function testSilencedError(): void {
$this->expectDeprecation('This is the deprecation message for deprecation_test_function().');
$this->assertEquals('known_return_value', deprecation_test_function());
}
@@ -33,7 +33,7 @@ class PhpUnitBridgeTest extends BrowserTestBase {
/**
* Tests deprecation message from deprecated route.
*/
- public function testErrorOnSiteUnderTest() {
+ public function testErrorOnSiteUnderTest(): void {
$this->expectDeprecation('This is the deprecation message for deprecation_test_function().');
$this->drupalGet(Url::fromRoute('deprecation_test.route'));
}
diff --git a/core/tests/Drupal/FunctionalTests/Datetime/TimestampAgoFormatterTest.php b/core/tests/Drupal/FunctionalTests/Datetime/TimestampAgoFormatterTest.php
index 12d5fba2776..57b4191a7fd 100644
--- a/core/tests/Drupal/FunctionalTests/Datetime/TimestampAgoFormatterTest.php
+++ b/core/tests/Drupal/FunctionalTests/Datetime/TimestampAgoFormatterTest.php
@@ -104,7 +104,7 @@ class TimestampAgoFormatterTest extends BrowserTestBase {
/**
* Tests the formatter settings.
*/
- public function testSettings() {
+ public function testSettings(): void {
$this->drupalGet('entity_test/structure/entity_test/display');
$edit = [
diff --git a/core/tests/Drupal/FunctionalTests/Datetime/TimestampTest.php b/core/tests/Drupal/FunctionalTests/Datetime/TimestampTest.php
index 81383c79f57..d7e8a2342e1 100644
--- a/core/tests/Drupal/FunctionalTests/Datetime/TimestampTest.php
+++ b/core/tests/Drupal/FunctionalTests/Datetime/TimestampTest.php
@@ -106,7 +106,7 @@ class TimestampTest extends BrowserTestBase {
/**
* Tests the "datetime_timestamp" widget.
*/
- public function testWidget() {
+ public function testWidget(): void {
// Build up a date in the UTC timezone.
$value = '2012-12-31 00:00:00';
$date = new DrupalDateTime($value, 'UTC');
diff --git a/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormCorrectUserInputMappingOnFieldDeltaElementsTest.php b/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormCorrectUserInputMappingOnFieldDeltaElementsTest.php
index 87833a8b8bd..2109cf1a1b1 100644
--- a/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormCorrectUserInputMappingOnFieldDeltaElementsTest.php
+++ b/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormCorrectUserInputMappingOnFieldDeltaElementsTest.php
@@ -78,7 +78,7 @@ class ContentEntityFormCorrectUserInputMappingOnFieldDeltaElementsTest extends B
/**
* Tests the correct user input mapping on complex fields.
*/
- public function testCorrectUserInputMappingOnComplexFields() {
+ public function testCorrectUserInputMappingOnComplexFields(): void {
/** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */
$storage = $this->container->get('entity_type.manager')->getStorage($this->entityTypeId);
diff --git a/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php b/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php
index b299c82a890..7108b212bf1 100644
--- a/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php
+++ b/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php
@@ -130,7 +130,7 @@ class ContentEntityFormFieldValidationFilteringTest extends BrowserTestBase {
/**
* Tests field widgets with #limit_validation_errors.
*/
- public function testFieldWidgetsWithLimitedValidationErrors() {
+ public function testFieldWidgetsWithLimitedValidationErrors(): void {
$assert_session = $this->assertSession();
$this->drupalGet($this->entityTypeId . '/add');
diff --git a/core/tests/Drupal/FunctionalTests/Entity/DeleteMultipleFormTest.php b/core/tests/Drupal/FunctionalTests/Entity/DeleteMultipleFormTest.php
index 3afa1e01caa..e40b5fee04c 100644
--- a/core/tests/Drupal/FunctionalTests/Entity/DeleteMultipleFormTest.php
+++ b/core/tests/Drupal/FunctionalTests/Entity/DeleteMultipleFormTest.php
@@ -57,7 +57,7 @@ class DeleteMultipleFormTest extends BrowserTestBase {
/**
* Tests the delete form for translatable entities.
*/
- public function testTranslatableEntities() {
+ public function testTranslatableEntities(): void {
ConfigurableLanguage::createFromLangcode('es')->save();
ConfigurableLanguage::createFromLangcode('fr')->save();
@@ -117,7 +117,7 @@ class DeleteMultipleFormTest extends BrowserTestBase {
/**
* Tests the delete form for untranslatable entities.
*/
- public function testUntranslatableEntities() {
+ public function testUntranslatableEntities(): void {
$selection = [];
$entity1 = EntityTestRev::create(['type' => 'default', 'name' => 'entity1']);
diff --git a/core/tests/Drupal/FunctionalTests/Entity/EntityBundleListCacheTest.php b/core/tests/Drupal/FunctionalTests/Entity/EntityBundleListCacheTest.php
index aa5d0fbaacb..d81ccf2a3dc 100644
--- a/core/tests/Drupal/FunctionalTests/Entity/EntityBundleListCacheTest.php
+++ b/core/tests/Drupal/FunctionalTests/Entity/EntityBundleListCacheTest.php
@@ -49,7 +49,7 @@ class EntityBundleListCacheTest extends BrowserTestBase {
/**
* Tests that tags are invalidated when an entity with that bundle changes.
*/
- public function testBundleListingCache() {
+ public function testBundleListingCache(): void {
// Access to lists of test entities with each bundle.
$bundle_a_url = Url::fromRoute('cache_test_list.bundle_tags', ['entity_type_id' => 'entity_test_with_bundle', 'bundle' => 'bundle_a']);
$bundle_b_url = Url::fromRoute('cache_test_list.bundle_tags', ['entity_type_id' => 'entity_test_with_bundle', 'bundle' => 'bundle_b']);
diff --git a/core/tests/Drupal/FunctionalTests/ExistingDrupal8StyleDatabaseConnectionInSettingsPhpTest.php b/core/tests/Drupal/FunctionalTests/ExistingDrupal8StyleDatabaseConnectionInSettingsPhpTest.php
index 2989a378b39..01c694b4ef4 100644
--- a/core/tests/Drupal/FunctionalTests/ExistingDrupal8StyleDatabaseConnectionInSettingsPhpTest.php
+++ b/core/tests/Drupal/FunctionalTests/ExistingDrupal8StyleDatabaseConnectionInSettingsPhpTest.php
@@ -57,7 +57,7 @@ class ExistingDrupal8StyleDatabaseConnectionInSettingsPhpTest extends BrowserTes
/**
* Confirms that the site works with Drupal 8 style database connection array.
*/
- public function testExistingDrupal8StyleDatabaseConnectionInSettingsPhp() {
+ public function testExistingDrupal8StyleDatabaseConnectionInSettingsPhp(): void {
$this->drupalLogin($this->drupalCreateUser());
$this->assertSession()->addressEquals('user/2');
$this->assertSession()->statusCodeEquals(200);
@@ -75,7 +75,7 @@ class ExistingDrupal8StyleDatabaseConnectionInSettingsPhpTest extends BrowserTes
/**
* Confirms that the replica database connection works.
*/
- public function testReplicaDrupal8StyleDatabaseConnectionInSettingsPhp() {
+ public function testReplicaDrupal8StyleDatabaseConnectionInSettingsPhp(): void {
$this->drupalLogin($this->drupalCreateUser());
$replica = Database::getConnection('replica', 'default');
diff --git a/core/tests/Drupal/FunctionalTests/FolderTest.php b/core/tests/Drupal/FunctionalTests/FolderTest.php
index 131d1c0c053..1f1674306a6 100644
--- a/core/tests/Drupal/FunctionalTests/FolderTest.php
+++ b/core/tests/Drupal/FunctionalTests/FolderTest.php
@@ -27,7 +27,7 @@ class FolderTest extends BrowserTestBase {
*/
protected $defaultTheme = 'stark';
- public function testFolderSetup() {
+ public function testFolderSetup(): void {
$directory = 'public://styles';
$this->assertTrue(\Drupal::service('file_system')->prepareDirectory($directory, FALSE), 'Directory created.');
}
diff --git a/core/tests/Drupal/FunctionalTests/GetTestMethodCallerExtendsTest.php b/core/tests/Drupal/FunctionalTests/GetTestMethodCallerExtendsTest.php
index 1fc66bb0b71..f65c4951c0d 100644
--- a/core/tests/Drupal/FunctionalTests/GetTestMethodCallerExtendsTest.php
+++ b/core/tests/Drupal/FunctionalTests/GetTestMethodCallerExtendsTest.php
@@ -21,7 +21,7 @@ class GetTestMethodCallerExtendsTest extends GetTestMethodCallerTest {
/**
* A test method that is not present in the parent class.
*/
- public function testGetTestMethodCallerChildClass() {
+ public function testGetTestMethodCallerChildClass(): void {
$method_caller = $this->getTestMethodCaller();
$expected = [
'file' => __FILE__,
diff --git a/core/tests/Drupal/FunctionalTests/GetTestMethodCallerTest.php b/core/tests/Drupal/FunctionalTests/GetTestMethodCallerTest.php
index 51a61a7d83b..3966ebfe387 100644
--- a/core/tests/Drupal/FunctionalTests/GetTestMethodCallerTest.php
+++ b/core/tests/Drupal/FunctionalTests/GetTestMethodCallerTest.php
@@ -21,7 +21,7 @@ class GetTestMethodCallerTest extends BrowserTestBase {
/**
* Tests BrowserTestBase::getTestMethodCaller().
*/
- public function testGetTestMethodCaller() {
+ public function testGetTestMethodCaller(): void {
$method_caller = $this->getTestMethodCaller();
$expected = [
'file' => __FILE__,
diff --git a/core/tests/Drupal/FunctionalTests/HttpKernel/CorsIntegrationTest.php b/core/tests/Drupal/FunctionalTests/HttpKernel/CorsIntegrationTest.php
index 84d7f5c5230..07f7380a234 100644
--- a/core/tests/Drupal/FunctionalTests/HttpKernel/CorsIntegrationTest.php
+++ b/core/tests/Drupal/FunctionalTests/HttpKernel/CorsIntegrationTest.php
@@ -28,7 +28,7 @@ class CorsIntegrationTest extends BrowserTestBase {
*/
protected $defaultTheme = 'stark';
- public function testCrossSiteRequest() {
+ public function testCrossSiteRequest(): void {
// Test default parameters.
$cors_config = $this->container->getParameter('cors.config');
$this->assertFalse($cors_config['enabled']);
diff --git a/core/tests/Drupal/FunctionalTests/Image/ToolkitSetupFormTest.php b/core/tests/Drupal/FunctionalTests/Image/ToolkitSetupFormTest.php
index 2c2fac2822a..3e6ebe4e2ab 100644
--- a/core/tests/Drupal/FunctionalTests/Image/ToolkitSetupFormTest.php
+++ b/core/tests/Drupal/FunctionalTests/Image/ToolkitSetupFormTest.php
@@ -46,7 +46,7 @@ class ToolkitSetupFormTest extends BrowserTestBase {
/**
* Tests Image toolkit setup form.
*/
- public function testToolkitSetupForm() {
+ public function testToolkitSetupForm(): void {
// Get form.
$this->drupalGet('admin/config/media/image-toolkit');
diff --git a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php
index 3000e392717..ae9645dd0bd 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php
@@ -115,7 +115,7 @@ class DistributionProfileExistingSettingsTest extends InstallerTestBase {
/**
* Confirms that the installation succeeded.
*/
- public function testInstalled() {
+ public function testInstalled(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
// Confirm that we are logged-in after installation.
diff --git a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php
index 91ef89b3063..fbbe1b2728e 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php
@@ -72,7 +72,7 @@ class DistributionProfileTest extends InstallerTestBase {
/**
* Confirms that the installation succeeded.
*/
- public function testInstalled() {
+ public function testInstalled(): void {
$this->assertSession()->addressEquals('root-user');
$this->assertSession()->statusCodeEquals(200);
// Confirm that we are logged-in after installation.
diff --git a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
index 3b3b1cfac89..b895f7caa4b 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
@@ -111,7 +111,7 @@ class DistributionProfileTranslationQueryTest extends InstallerTestBase {
/**
* Confirms that the installation succeeded.
*/
- public function testInstalled() {
+ public function testInstalled(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
index 3e5124d4da1..0dd028e5ad0 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
@@ -101,7 +101,7 @@ class DistributionProfileTranslationTest extends InstallerTestBase {
/**
* Confirms that the installation succeeded.
*/
- public function testInstalled() {
+ public function testInstalled(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/tests/Drupal/FunctionalTests/Installer/DrupalFlushAllCachesInInstallerTest.php b/core/tests/Drupal/FunctionalTests/Installer/DrupalFlushAllCachesInInstallerTest.php
index a0a9a0d5046..fd868ee97b5 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/DrupalFlushAllCachesInInstallerTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/DrupalFlushAllCachesInInstallerTest.php
@@ -56,7 +56,7 @@ EOF;
/**
* Confirms that the installation succeeded.
*/
- public function testInstalled() {
+ public function testInstalled(): void {
$this->assertTrue(\Drupal::state()->get('cache_flush_test'));
}
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallProfileDependenciesTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallProfileDependenciesTest.php
index 7087cecf8fc..942555323be 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallProfileDependenciesTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallProfileDependenciesTest.php
@@ -27,7 +27,7 @@ class InstallProfileDependenciesTest extends BrowserTestBase {
/**
* Tests that an install profile can require modules.
*/
- public function testUninstallingModules() {
+ public function testUninstallingModules(): void {
$user = $this->drupalCreateUser(['administer modules']);
$this->drupalLogin($user);
$this->drupalGet('admin/modules/uninstall');
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerBrokenDatabaseCredentialsTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerBrokenDatabaseCredentialsTest.php
index df46df638f9..aa80899b826 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerBrokenDatabaseCredentialsTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerBrokenDatabaseCredentialsTest.php
@@ -56,7 +56,7 @@ class InstallerBrokenDatabaseCredentialsTest extends InstallerTestBase {
/**
* Tests the expected requirements problem.
*/
- public function testRequirementsProblem() {
+ public function testRequirementsProblem(): void {
$this->assertSession()->titleEquals('Requirements problem | Drupal');
$this->assertSession()->pageTextContains('Database settings');
$this->assertSession()->pageTextContains('Resolve all issues below to continue the installation. For help configuring your database server,');
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerBrokenDatabasePortSettingsTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerBrokenDatabasePortSettingsTest.php
index 3f976408886..6c706832f06 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerBrokenDatabasePortSettingsTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerBrokenDatabasePortSettingsTest.php
@@ -56,7 +56,7 @@ class InstallerBrokenDatabasePortSettingsTest extends InstallerTestBase {
/**
* Tests the expected requirements problem.
*/
- public function testRequirementsProblem() {
+ public function testRequirementsProblem(): void {
$this->assertSession()->titleEquals('Requirements problem | Drupal');
$this->assertSession()->pageTextContains('Database settings');
$this->assertSession()->pageTextContains('Resolve all issues below to continue the installation. For help configuring your database server,');
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerConfigDirectorySetNoDirectoryErrorTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerConfigDirectorySetNoDirectoryErrorTest.php
index 99a2524787b..b38dc25af6f 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerConfigDirectorySetNoDirectoryErrorTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerConfigDirectorySetNoDirectoryErrorTest.php
@@ -69,7 +69,7 @@ class InstallerConfigDirectorySetNoDirectoryErrorTest extends InstallerTestBase
/**
* Verifies that installation failed.
*/
- public function testError() {
+ public function testError(): void {
$this->assertSession()->pageTextContains("An automated attempt to create the directory {$this->configDirectory}/sync failed, possibly due to a permissions problem.");
$this->assertDirectoryDoesNotExist($this->configDirectory . '/sync');
}
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerConfigDirectorySetNoDirectoryTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerConfigDirectorySetNoDirectoryTest.php
index 8ebed8eb4c4..b8149ee6529 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerConfigDirectorySetNoDirectoryTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerConfigDirectorySetNoDirectoryTest.php
@@ -40,7 +40,7 @@ class InstallerConfigDirectorySetNoDirectoryTest extends InstallerTestBase {
/**
* Verifies that installation succeeded.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
$this->assertDirectoryExists($this->syncDirectory);
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerDatabaseErrorMessagesTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerDatabaseErrorMessagesTest.php
index 441d2fa0003..ab7258b4beb 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerDatabaseErrorMessagesTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerDatabaseErrorMessagesTest.php
@@ -50,7 +50,7 @@ class InstallerDatabaseErrorMessagesTest extends InstallerTestBase {
/**
* Verifies that the error message in the settings step is correct.
*/
- public function testSetUpSettingsErrorMessage() {
+ public function testSetUpSettingsErrorMessage(): void {
$this->assertSession()->responseContains('<ul><li>Failed to <strong>CREATE</strong> a test table');
}
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerEmptySettingsTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerEmptySettingsTest.php
index d158e865e8b..1b2ee2cb249 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerEmptySettingsTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerEmptySettingsTest.php
@@ -29,7 +29,7 @@ class InstallerEmptySettingsTest extends InstallerTestBase {
/**
* Verifies that installation succeeded.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
}
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingBrokenDatabaseSettingsTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingBrokenDatabaseSettingsTest.php
index 771e88ea99d..636300b1448 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingBrokenDatabaseSettingsTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingBrokenDatabaseSettingsTest.php
@@ -73,7 +73,7 @@ class InstallerExistingBrokenDatabaseSettingsTest extends InstallerTestBase {
/**
* Tests the expected requirements problem.
*/
- public function testRequirementsProblem() {
+ public function testRequirementsProblem(): void {
$this->assertSession()->titleEquals('Requirements problem | Drupal');
$this->assertSession()->pageTextContains('Database settings');
$this->assertSession()->pageTextContains('Resolve all issues below to continue the installation. For help configuring your database server,');
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigDirectoryTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigDirectoryTest.php
index 227f73e09db..e391e0f6692 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigDirectoryTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigDirectoryTest.php
@@ -39,7 +39,7 @@ class InstallerExistingConfigDirectoryTest extends InstallerTestBase {
/**
* Verifies that installation succeeded.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
$this->assertEquals($this->expectedFilePerms, fileperms($this->siteDirectory . '/config_read_only'));
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigMultilingualTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigMultilingualTest.php
index a02e75213b4..7b534dd06ba 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigMultilingualTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigMultilingualTest.php
@@ -28,7 +28,7 @@ class InstallerExistingConfigMultilingualTest extends InstallerExistingConfigTes
/**
* {@inheritdoc}
*/
- public function testConfigSync() {
+ public function testConfigSync(): void {
parent::testConfigSync();
// Ensure no warning, error, critical, alert or emergency messages have been
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoConfigTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoConfigTest.php
index 5fbdfd9d9b2..25d9287b3e3 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoConfigTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoConfigTest.php
@@ -35,7 +35,7 @@ class InstallerExistingConfigNoConfigTest extends InstallerExistingConfigTestBas
/**
* Tests that profiles with an empty config/sync directory do not work.
*/
- public function testConfigSync() {
+ public function testConfigSync(): void {
$this->assertSession()->titleEquals('Configuration validation | Drupal');
$this->assertSession()->pageTextContains('The configuration synchronization failed validation.');
$this->assertSession()->pageTextContains('This import is empty and if applied would delete all of your configuration, so has been rejected.');
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoSystemSiteTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoSystemSiteTest.php
index 02328983ca6..68aaa6282a0 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoSystemSiteTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoSystemSiteTest.php
@@ -30,7 +30,7 @@ class InstallerExistingConfigNoSystemSiteTest extends InstallerExistingConfigTes
/**
* Tests that profiles with no system.site do not work.
*/
- public function testConfigSync() {
+ public function testConfigSync(): void {
$this->htmlOutput(NULL);
$this->assertSession()->titleEquals('Configuration validation | Drupal');
$this->assertSession()->pageTextContains('The configuration synchronization failed validation.');
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigProfileHookInstall.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigProfileHookInstall.php
index 838e91e5124..d4283e8510a 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigProfileHookInstall.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigProfileHookInstall.php
@@ -64,7 +64,7 @@ EOF;
/**
* Confirms the installation has failed and the expected error is displayed.
*/
- public function testConfigSync() {
+ public function testConfigSync(): void {
$this->assertSession()->titleEquals('Requirements problem | Drupal');
$this->assertSession()->pageTextContains($this->profile);
$this->assertSession()->pageTextContains('The selected profile has a hook_install() implementation and therefore can not be installed from configuration.');
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryMultilingualTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryMultilingualTest.php
index 52e3ebe5a42..b998e8eafd5 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryMultilingualTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryMultilingualTest.php
@@ -65,7 +65,7 @@ class InstallerExistingConfigSyncDirectoryMultilingualTest extends InstallerExis
/**
* Confirms that the installation installed the configuration correctly.
*/
- public function testConfigSync() {
+ public function testConfigSync(): void {
$comparer = $this->configImporter()->getStorageComparer();
$expected_changelist_default_collection = [
'create' => [],
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryProfileHookInstall.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryProfileHookInstall.php
index 5d00a77adb1..8c16ee96932 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryProfileHookInstall.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryProfileHookInstall.php
@@ -81,7 +81,7 @@ EOF;
/**
* Tests installing from config is not available due to hook_INSTALL().
*/
- public function testConfigSync() {
+ public function testConfigSync(): void {
$this->assertSession()->titleEquals('Select an installation profile | Drupal');
$this->assertSession()->responseNotContains('Use existing configuration');
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryProfileMismatchTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryProfileMismatchTest.php
index dac5d25219e..fd7ade39a46 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryProfileMismatchTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDirectoryProfileMismatchTest.php
@@ -49,7 +49,7 @@ class InstallerExistingConfigSyncDirectoryProfileMismatchTest extends InstallerE
/**
* Tests that profile mismatch fails to install.
*/
- public function testConfigSync() {
+ public function testConfigSync(): void {
$this->htmlOutput(NULL);
$this->assertSession()->titleEquals('Configuration validation | Drupal');
$this->assertSession()->pageTextContains('The configuration synchronization failed validation.');
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php
index e3d42fe68f0..4404c0fa117 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php
@@ -134,7 +134,7 @@ abstract class InstallerExistingConfigTestBase extends InstallerTestBase {
/**
* Confirms that the installation installed the configuration correctly.
*/
- public function testConfigSync() {
+ public function testConfigSync(): void {
// After installation there is no snapshot and nothing to import.
$change_list = $this->configImporter()->getStorageComparer()->getChangelist();
$expected = [
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingDatabaseSettingsTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingDatabaseSettingsTest.php
index 5e1ca85dc99..7d896c1e1d2 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingDatabaseSettingsTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingDatabaseSettingsTest.php
@@ -59,7 +59,7 @@ class InstallerExistingDatabaseSettingsTest extends InstallerTestBase {
/**
* Verifies that installation succeeded.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
}
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingInstallationTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingInstallationTest.php
index 9ee4a4b691f..a932da76d33 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingInstallationTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingInstallationTest.php
@@ -19,7 +19,7 @@ class InstallerExistingInstallationTest extends InstallerTestBase {
/**
* Tests that Drupal fails to install when there is an existing installation.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
// Verify that Drupal can't be immediately reinstalled.
$this->visitInstaller();
$this->assertSession()->pageTextContains('Drupal already installed');
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingSettingsNoProfileTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingSettingsNoProfileTest.php
index cf7813321c6..03dc683e43c 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingSettingsNoProfileTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingSettingsNoProfileTest.php
@@ -65,7 +65,7 @@ class InstallerExistingSettingsNoProfileTest extends InstallerTestBase {
/**
* Verifies that installation succeeded.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
$this->assertEquals('testing', \Drupal::installProfile());
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingSettingsTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingSettingsTest.php
index 4425352b4be..8a44b6b70e6 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingSettingsTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingSettingsTest.php
@@ -78,7 +78,7 @@ class InstallerExistingSettingsTest extends InstallerTestBase {
/**
* Verifies that installation succeeded.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
$this->assertEquals('testing', \Drupal::installProfile());
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerLanguageDirectionTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerLanguageDirectionTest.php
index 7935aaf03a4..81dc3d974f7 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerLanguageDirectionTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerLanguageDirectionTest.php
@@ -44,7 +44,7 @@ class InstallerLanguageDirectionTest extends InstallerTestBase {
/**
* Confirms that the installation succeeded.
*/
- public function testInstalled() {
+ public function testInstalled(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
}
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerLanguagePageTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerLanguagePageTest.php
index 1338991438a..a1e1c1597dd 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerLanguagePageTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerLanguagePageTest.php
@@ -45,7 +45,7 @@ class InstallerLanguagePageTest extends InstallerTestBase {
/**
* Confirms that the installation succeeded.
*/
- public function testInstalled() {
+ public function testInstalled(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
}
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerNonDefaultDatabaseDriverTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerNonDefaultDatabaseDriverTest.php
index a0ddc15b33c..d15135cdbd0 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerNonDefaultDatabaseDriverTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerNonDefaultDatabaseDriverTest.php
@@ -57,7 +57,7 @@ class InstallerNonDefaultDatabaseDriverTest extends InstallerTestBase {
/**
* Confirms that the installation succeeded.
*/
- public function testInstalled() {
+ public function testInstalled(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerNonEnglishProfileWithoutLocaleModuleTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerNonEnglishProfileWithoutLocaleModuleTest.php
index aa395890a6b..b5152b56e69 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerNonEnglishProfileWithoutLocaleModuleTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerNonEnglishProfileWithoutLocaleModuleTest.php
@@ -61,7 +61,7 @@ class InstallerNonEnglishProfileWithoutLocaleModuleTest extends InstallerTestBas
/**
* Tests installing a profile with non-English language and no locale module.
*/
- public function testNonEnglishProfileWithoutLocaleModule() {
+ public function testNonEnglishProfileWithoutLocaleModule(): void {
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->addressEquals('user/1');
// Confirm that we are logged-in after installation.
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerPerformanceTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerPerformanceTest.php
index 8769c8ccbc4..37622c5e282 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerPerformanceTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerPerformanceTest.php
@@ -36,7 +36,7 @@ class InstallerPerformanceTest extends BrowserTestBase {
/**
* Ensures that the user page is available after installation.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
// Ensures that router is not rebuilt unnecessarily during the install.
// Currently it is built once during the install in install_finished().
$this->assertSame(1, \Drupal::service('core.performance.test.recorder')->getCount('event', RoutingEvents::FINISHED));
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerPostInstallTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerPostInstallTest.php
index 1e62de937c6..f527f52ece0 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerPostInstallTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerPostInstallTest.php
@@ -24,7 +24,7 @@ class InstallerPostInstallTest extends InstallerTestBase {
/**
* Confirms that visiting the installer does not break things post-install.
*/
- public function testVisitInstallerPostInstall() {
+ public function testVisitInstallerPostInstall(): void {
\Drupal::service('module_installer')->install(['system_test']);
// Clear caches to ensure that system_test's routes are available.
$this->resetAll();
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerProfileRequirementsTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerProfileRequirementsTest.php
index 8fc1d041dfc..f69a5ff0bb2 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerProfileRequirementsTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerProfileRequirementsTest.php
@@ -47,7 +47,7 @@ class InstallerProfileRequirementsTest extends InstallerTestBase {
/**
* Assert that the profile failed hook_requirements().
*/
- public function testHookRequirementsFailure() {
+ public function testHookRequirementsFailure(): void {
$this->assertSession()->pageTextContains('Testing requirements failed requirements.');
}
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerRouterTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerRouterTest.php
index 41839effe11..127ef7f919e 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerRouterTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerRouterTest.php
@@ -52,7 +52,7 @@ class InstallerRouterTest extends InstallerTestBase {
/**
* Confirms that the installation succeeded.
*/
- public function testInstalled() {
+ public function testInstalled(): void {
$this->assertSession()->statusCodeEquals(200);
// Ensures that router is not rebuilt unnecessarily during the install. It
// is rebuilt during:
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerSiteConfigProfileTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerSiteConfigProfileTest.php
index 5c46d446e52..7da75723dd4 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerSiteConfigProfileTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerSiteConfigProfileTest.php
@@ -61,7 +61,7 @@ class InstallerSiteConfigProfileTest extends InstallerTestBase {
/**
* Verify the correct site config was set.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
$this->assertEquals(self::EXPECTED_SITE_MAIL, $this->config('system.site')->get('mail'));
$this->assertEquals(self::EXPECTED_TIMEZONE, $this->config('system.date')->get('timezone.default'));
}
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerSkipPermissionHardeningTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerSkipPermissionHardeningTest.php
index 74750099f30..fe585c118f4 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerSkipPermissionHardeningTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerSkipPermissionHardeningTest.php
@@ -40,7 +40,7 @@ class InstallerSkipPermissionHardeningTest extends InstallerTestBase {
/**
* Verifies the expected behaviors of the installation result.
*/
- public function testInstalled() {
+ public function testInstalled(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
}
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php
index d70cf621e31..2793e16c9ef 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php
@@ -26,7 +26,7 @@ class InstallerTest extends InstallerTestBase {
/**
* Ensures that the user page is available after installation.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
$this->assertNotEquals('0', \Drupal::service('asset.query_string')->get(), 'The dummy query string should be set during install');
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
@@ -127,7 +127,7 @@ class InstallerTest extends InstallerTestBase {
/**
* Confirms that the installation succeeded.
*/
- public function testInstalled() {
+ public function testInstalled(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerThemesBlocksProfileTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerThemesBlocksProfileTest.php
index 8418b92566d..116028ecd4c 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerThemesBlocksProfileTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerThemesBlocksProfileTest.php
@@ -26,7 +26,7 @@ class InstallerThemesBlocksProfileTest extends InstallerTestBase {
/**
* Verify that there is no automatic block generation.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
// Account menu is a block that testing_theme_required_blocks provides,
// but not testing_theme_optional_blocks. There shouldn't be a account menu
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationExistingFileTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationExistingFileTest.php
index 9c2c4a2a4ea..77d4153f7d0 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationExistingFileTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationExistingFileTest.php
@@ -80,7 +80,7 @@ PO;
/**
* Ensures language selection has not failed.
*/
- public function testInstall() {
+ public function testInstall(): void {
// At this point we'll be on the profile selection or requirements screen.
$this->assertSession()->statusCodeEquals(200);
}
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageNonInteractiveTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageNonInteractiveTest.php
index 358ccfd9021..6c4ad5c6d83 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageNonInteractiveTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageNonInteractiveTest.php
@@ -79,7 +79,7 @@ PO;
/**
* Tests that translations ended up at the expected places.
*/
- public function testTranslationsLoaded() {
+ public function testTranslationsLoaded(): void {
$this->drupalLogin($this->createUser([], NULL, TRUE));
// Ensure the title is correct.
$this->assertEquals('SITE_NAME_en', \Drupal::config('system.site')->get('name'));
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php
index b019bd97430..bb2f5fb381c 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php
@@ -76,7 +76,7 @@ PO;
/**
* Tests that translations ended up at the expected places.
*/
- public function testTranslationsLoaded() {
+ public function testTranslationsLoaded(): void {
// Ensure the title is correct.
$this->assertEquals('SITE_NAME_' . $this->langcode, \Drupal::config('system.site')->get('name'));
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php
index e5ff25fadeb..f085ae3d034 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php
@@ -57,7 +57,7 @@ class InstallerTranslationQueryTest extends InstallerTestBase {
/**
* Verifies the expected behaviors of the installation result.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php
index fe9eac77f5a..fa9368b2e9d 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php
@@ -80,7 +80,7 @@ class InstallerTranslationTest extends InstallerTestBase {
/**
* Verifies the expected behaviors of the installation result.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/tests/Drupal/FunctionalTests/Installer/MinimalInstallerTest.php b/core/tests/Drupal/FunctionalTests/Installer/MinimalInstallerTest.php
index de134e757f9..3513ff168de 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/MinimalInstallerTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/MinimalInstallerTest.php
@@ -28,7 +28,7 @@ class MinimalInstallerTest extends ConfigAfterInstallerTestBase {
/**
* Ensures that the exported minimal configuration is up to date.
*/
- public function testMinimalConfig() {
+ public function testMinimalConfig(): void {
$this->assertInstalledConfig([]);
}
diff --git a/core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php b/core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php
index 37f60bcf31d..bcab6db5caf 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php
@@ -76,7 +76,7 @@ class MultipleDistributionsProfileTest extends InstallerTestBase {
/**
* Confirms that the installation succeeded.
*/
- public function testInstalled() {
+ public function testInstalled(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
// Confirm that we are logged-in after installation.
diff --git a/core/tests/Drupal/FunctionalTests/Installer/SingleVisibleProfileTest.php b/core/tests/Drupal/FunctionalTests/Installer/SingleVisibleProfileTest.php
index 0a7bb8d527a..7f2d7c35fa8 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/SingleVisibleProfileTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/SingleVisibleProfileTest.php
@@ -57,7 +57,7 @@ class SingleVisibleProfileTest extends InstallerTestBase {
/**
* Confirms that the installation succeeded.
*/
- public function testInstalled() {
+ public function testInstalled(): void {
$this->assertSession()->addressEquals('user/1');
$this->assertSession()->statusCodeEquals(200);
// Confirm that we are logged-in after installation.
diff --git a/core/tests/Drupal/FunctionalTests/Installer/SiteNameTest.php b/core/tests/Drupal/FunctionalTests/Installer/SiteNameTest.php
index 09e6bc6f961..fa513876d49 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/SiteNameTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/SiteNameTest.php
@@ -38,7 +38,7 @@ class SiteNameTest extends BrowserTestBase {
/**
* Tests that the desired site name appears on the page after installation.
*/
- public function testSiteName() {
+ public function testSiteName(): void {
$this->drupalGet('');
$this->assertSession()->pageTextContains($this->siteName);
}
diff --git a/core/tests/Drupal/FunctionalTests/Installer/SiteSettingsFormTest.php b/core/tests/Drupal/FunctionalTests/Installer/SiteSettingsFormTest.php
index eb157f6fd64..404fd7c8ac2 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/SiteSettingsFormTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/SiteSettingsFormTest.php
@@ -26,7 +26,7 @@ class SiteSettingsFormTest extends BrowserTestBase {
/**
* Confirms that the form is extensible.
*/
- public function testSiteSettingsForm() {
+ public function testSiteSettingsForm(): void {
// Test that the form page can be loaded without errors.
$this->drupalGet('test-form');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php b/core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php
index 5aba88177c5..ac997d6ab1e 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/StandardInstallerTest.php
@@ -19,7 +19,7 @@ class StandardInstallerTest extends ConfigAfterInstallerTestBase {
/**
* Ensures that the user page is available after installation.
*/
- public function testInstaller() {
+ public function testInstaller(): void {
// Verify that Olivero's default frontpage appears.
$this->assertSession()->pageTextContains('Congratulations and welcome to the Drupal community.');
$this->assertSession()->elementTextContains('css', '#block-olivero-powered', 'Powered by Drupal');
@@ -38,7 +38,7 @@ class StandardInstallerTest extends ConfigAfterInstallerTestBase {
/**
* Ensures that the exported standard configuration is up to date.
*/
- public function testStandardConfig() {
+ public function testStandardConfig(): void {
$skipped_config = [];
// FunctionalTestSetupTrait::installParameters() uses Drupal as site name
// and simpletest@example.com as mail address.
diff --git a/core/tests/Drupal/FunctionalTests/Installer/TestingProfileInstallTest.php b/core/tests/Drupal/FunctionalTests/Installer/TestingProfileInstallTest.php
index 2d1fc6e1738..ddfa20ca546 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/TestingProfileInstallTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/TestingProfileInstallTest.php
@@ -26,7 +26,7 @@ class TestingProfileInstallTest extends BrowserTestBase {
/**
* Ensure the Update module is installed.
*/
- public function testUpdateModuleInstall() {
+ public function testUpdateModuleInstall(): void {
$this->assertTrue(\Drupal::moduleHandler()->moduleExists('update'));
}
diff --git a/core/tests/Drupal/FunctionalTests/Libraries/JqueryUiLibraryAssetsTest.php b/core/tests/Drupal/FunctionalTests/Libraries/JqueryUiLibraryAssetsTest.php
index 1429d3d6ec3..f733aa13848 100644
--- a/core/tests/Drupal/FunctionalTests/Libraries/JqueryUiLibraryAssetsTest.php
+++ b/core/tests/Drupal/FunctionalTests/Libraries/JqueryUiLibraryAssetsTest.php
@@ -94,7 +94,7 @@ class JqueryUiLibraryAssetsTest extends BrowserTestBase {
* order. The necessary loading order was determined by the requirements
* specified in each jQuery UI JavaScript file.
*/
- public function testProperlySetWeights() {
+ public function testProperlySetWeights(): void {
$assets = [];
// Confirm that no asset is assigned multiple weights.
@@ -169,7 +169,7 @@ class JqueryUiLibraryAssetsTest extends BrowserTestBase {
/**
* Confirm that uses of a jQuery UI asset are configured with the same weight.
*/
- public function testSameAssetSameWeight() {
+ public function testSameAssetSameWeight(): void {
$asset_weights = [];
$libraries_to_check = $this->coreLibrariesWithJqueryUiAssets;
@@ -218,7 +218,7 @@ class JqueryUiLibraryAssetsTest extends BrowserTestBase {
*
* @dataProvider providerTestAssetLoading
*/
- public function testLibraryAssetLoadingOrder($library, array $expected_css, array $expected_js) {
+ public function testLibraryAssetLoadingOrder($library, array $expected_css, array $expected_js): void {
$this->drupalGet("jqueryui_library_assets_test/$library");
$this->assertSession()->statusCodeEquals(200);
@@ -299,7 +299,7 @@ class JqueryUiLibraryAssetsTest extends BrowserTestBase {
*
* @dataProvider providerTestAssetLoading
*/
- public function testAssetLoadingUnchanged($library, array $expected_css, array $expected_js) {
+ public function testAssetLoadingUnchanged($library, array $expected_css, array $expected_js): void {
$this->drupalGet("jqueryui_library_assets_test/$library");
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/tests/Drupal/FunctionalTests/Libraries/ManyAssetsLoadOrderTest.php b/core/tests/Drupal/FunctionalTests/Libraries/ManyAssetsLoadOrderTest.php
index 7951249f23f..c128587612f 100644
--- a/core/tests/Drupal/FunctionalTests/Libraries/ManyAssetsLoadOrderTest.php
+++ b/core/tests/Drupal/FunctionalTests/Libraries/ManyAssetsLoadOrderTest.php
@@ -28,7 +28,7 @@ class ManyAssetsLoadOrderTest extends BrowserTestBase {
*
* Confirms the load order reflects the configured weights for each asset.
*/
- public function testLoadOrder() {
+ public function testLoadOrder(): void {
$this->drupalGet('many_assets_test');
$js = $this->getSession()->getPage()->findAll('css', 'script[data-weight]');
diff --git a/core/tests/Drupal/FunctionalTests/MailCaptureTest.php b/core/tests/Drupal/FunctionalTests/MailCaptureTest.php
index b6d5c4f147b..bea51a83645 100644
--- a/core/tests/Drupal/FunctionalTests/MailCaptureTest.php
+++ b/core/tests/Drupal/FunctionalTests/MailCaptureTest.php
@@ -28,7 +28,7 @@ class MailCaptureTest extends BrowserTestBase {
/**
* Tests to see if the wrapper function is executed correctly.
*/
- public function testMailSend() {
+ public function testMailSend(): void {
// Create an email.
$subject = $this->randomString(64);
$body = $this->randomString(128);
diff --git a/core/tests/Drupal/FunctionalTests/Menu/MenuActiveTrail403Test.php b/core/tests/Drupal/FunctionalTests/Menu/MenuActiveTrail403Test.php
index 5a151815efc..2a7e446e348 100644
--- a/core/tests/Drupal/FunctionalTests/Menu/MenuActiveTrail403Test.php
+++ b/core/tests/Drupal/FunctionalTests/Menu/MenuActiveTrail403Test.php
@@ -86,7 +86,7 @@ class MenuActiveTrail403Test extends BrowserTestBase {
/**
* Tests that visiting 403 page does not override original active trail.
*/
- public function testMenuActiveTrail403Cache() {
+ public function testMenuActiveTrail403Cache(): void {
$this->drupalLogin($this->privilegedUser);
$system_status_url = Url::fromRoute('system.status');
$this->drupalGet($system_status_url);
diff --git a/core/tests/Drupal/FunctionalTests/Routing/CaseInsensitivePathTest.php b/core/tests/Drupal/FunctionalTests/Routing/CaseInsensitivePathTest.php
index f4773b3c595..447224e931f 100644
--- a/core/tests/Drupal/FunctionalTests/Routing/CaseInsensitivePathTest.php
+++ b/core/tests/Drupal/FunctionalTests/Routing/CaseInsensitivePathTest.php
@@ -37,7 +37,7 @@ class CaseInsensitivePathTest extends BrowserTestBase {
/**
* Tests mixed case paths.
*/
- public function testMixedCasePaths() {
+ public function testMixedCasePaths(): void {
// Tests paths defined by routes from standard modules as anonymous.
$this->drupalGet('user/login');
$this->assertSession()->statusCodeEquals(200);
@@ -103,7 +103,7 @@ class CaseInsensitivePathTest extends BrowserTestBase {
/**
* Tests paths with slugs.
*/
- public function testPathsWithArguments() {
+ public function testPathsWithArguments(): void {
$this->drupalGet('system-test/echo/foobarbaz');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextMatches('/foobarbaz/');
diff --git a/core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php b/core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php
index 8a3cea331cd..734058c0c4e 100644
--- a/core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php
+++ b/core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php
@@ -21,7 +21,7 @@ class DefaultFormatTest extends BrowserTestBase {
*/
protected $defaultTheme = 'stark';
- public function testFoo() {
+ public function testFoo(): void {
$this->drupalGet('/default_format_test/human');
$this->assertSame('format:html', $this->getSession()->getPage()->getContent());
$this->assertSession()->responseHeaderEquals('X-Drupal-Cache', 'MISS');
@@ -37,7 +37,7 @@ class DefaultFormatTest extends BrowserTestBase {
$this->assertSession()->responseHeaderEquals('X-Drupal-Cache', 'HIT');
}
- public function testMultipleRoutesWithSameSingleFormat() {
+ public function testMultipleRoutesWithSameSingleFormat(): void {
$this->drupalGet('/default_format_test/machine');
$this->assertSame('format:json', $this->getSession()->getPage()->getContent());
}
diff --git a/core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php b/core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php
index b5ec69f803b..e344c7d4190 100644
--- a/core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php
+++ b/core/tests/Drupal/FunctionalTests/Routing/LazyRouteProviderInstallTest.php
@@ -24,7 +24,7 @@ class LazyRouteProviderInstallTest extends BrowserTestBase {
/**
* Tests that the lazy route provider is used during a module install.
*/
- public function testInstallation() {
+ public function testInstallation(): void {
$this->container->get('module_installer')->install(['router_test']);
// Note that on DrupalCI the test site is installed in a sub directory so
// we cannot use ::assertEquals().
diff --git a/core/tests/Drupal/FunctionalTests/Routing/PathEncodedTest.php b/core/tests/Drupal/FunctionalTests/Routing/PathEncodedTest.php
index fd5e94a6f95..0ac2339a810 100644
--- a/core/tests/Drupal/FunctionalTests/Routing/PathEncodedTest.php
+++ b/core/tests/Drupal/FunctionalTests/Routing/PathEncodedTest.php
@@ -28,7 +28,7 @@ class PathEncodedTest extends BrowserTestBase {
*/
protected $defaultTheme = 'stark';
- public function testGetEncoded() {
+ public function testGetEncoded(): void {
$route_paths = [
'path_encoded_test.colon' => '/hi/llama:party',
'path_encoded_test.at_sign' => '/blog/@Dries',
@@ -40,7 +40,7 @@ class PathEncodedTest extends BrowserTestBase {
}
}
- public function testAliasToEncoded() {
+ public function testAliasToEncoded(): void {
$route_paths = [
'path_encoded_test.colon' => '/hi/llama:party',
'path_encoded_test.at_sign' => '/blog/@Dries',
diff --git a/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php b/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php
index 3df21995346..9e6e8b91af8 100644
--- a/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php
+++ b/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php
@@ -129,7 +129,7 @@ class RouteCachingLanguageTest extends BrowserTestBase {
*
* @dataProvider providerLanguage
*/
- public function testLinkTranslationWithAlias($source_langcode) {
+ public function testLinkTranslationWithAlias($source_langcode): void {
$source_url_options = [
'language' => ConfigurableLanguage::load($source_langcode),
];
diff --git a/core/tests/Drupal/FunctionalTests/Routing/RouteCachingNonPathLanguageNegotiationTest.php b/core/tests/Drupal/FunctionalTests/Routing/RouteCachingNonPathLanguageNegotiationTest.php
index 0eeb7e4358b..97cf9f8abf2 100644
--- a/core/tests/Drupal/FunctionalTests/Routing/RouteCachingNonPathLanguageNegotiationTest.php
+++ b/core/tests/Drupal/FunctionalTests/Routing/RouteCachingNonPathLanguageNegotiationTest.php
@@ -81,7 +81,7 @@ class RouteCachingNonPathLanguageNegotiationTest extends BrowserTestBase {
/**
* Tests aliases when the negotiated language is not in the path.
*/
- public function testAliases() {
+ public function testAliases(): void {
// Switch to French and try to access the now inaccessible block.
$this->drupalGet('');
diff --git a/core/tests/Drupal/FunctionalTests/Routing/RouteCachingQueryAlteredTest.php b/core/tests/Drupal/FunctionalTests/Routing/RouteCachingQueryAlteredTest.php
index 030e7a12d9f..3e099fa46fc 100644
--- a/core/tests/Drupal/FunctionalTests/Routing/RouteCachingQueryAlteredTest.php
+++ b/core/tests/Drupal/FunctionalTests/Routing/RouteCachingQueryAlteredTest.php
@@ -47,7 +47,7 @@ class RouteCachingQueryAlteredTest extends BrowserTestBase {
/**
* Tests route collection cache after an exception.
*/
- public function testRouteCollectionCacheAfterException() {
+ public function testRouteCollectionCacheAfterException(): void {
// Force an exception early in the Kernel middleware on a cold cache by
// simulating bad Bearer authentication.
$this->drupalGet('/router-test/rejects-query-strings', [], [
diff --git a/core/tests/Drupal/FunctionalTests/Theme/ClaroLayoutBuilderTest.php b/core/tests/Drupal/FunctionalTests/Theme/ClaroLayoutBuilderTest.php
index 49e4fabb261..99e4974e3fc 100644
--- a/core/tests/Drupal/FunctionalTests/Theme/ClaroLayoutBuilderTest.php
+++ b/core/tests/Drupal/FunctionalTests/Theme/ClaroLayoutBuilderTest.php
@@ -71,7 +71,7 @@ class ClaroLayoutBuilderTest extends BrowserTestBase {
*
* @see claro.theme
*/
- public function testContextualLinks() {
+ public function testContextualLinks(): void {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
diff --git a/core/tests/Drupal/FunctionalTests/Theme/ClaroTest.php b/core/tests/Drupal/FunctionalTests/Theme/ClaroTest.php
index 94d2a182bd6..53a038af263 100644
--- a/core/tests/Drupal/FunctionalTests/Theme/ClaroTest.php
+++ b/core/tests/Drupal/FunctionalTests/Theme/ClaroTest.php
@@ -36,7 +36,7 @@ class ClaroTest extends BrowserTestBase {
*
* @see claro.info.yml
*/
- public function testRegressionMissingElementsCss() {
+ public function testRegressionMissingElementsCss(): void {
$this->drupalGet('');
$this->assertSession()->statusCodeEquals(200);
// This can be any CSS file from the global library.
@@ -46,7 +46,7 @@ class ClaroTest extends BrowserTestBase {
/**
* Tests Claro's configuration schema.
*/
- public function testConfigSchema() {
+ public function testConfigSchema(): void {
$permissions = [
'administer modules',
];
@@ -66,7 +66,7 @@ class ClaroTest extends BrowserTestBase {
/**
* Tests that the Claro theme can be uninstalled.
*/
- public function testIsUninstallable() {
+ public function testIsUninstallable(): void {
$this->drupalLogin($this->drupalCreateUser(['access administration pages', 'administer themes']));
$this->drupalGet('admin/appearance');
diff --git a/core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php b/core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php
index c9e42bcc49b..a6e2a81482d 100644
--- a/core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php
+++ b/core/tests/Drupal/FunctionalTests/Theme/OliveroTest.php
@@ -39,7 +39,7 @@ class OliveroTest extends BrowserTestBase {
*
* @see olivero.libraries.yml
*/
- public function testBaseLibraryAvailable() {
+ public function testBaseLibraryAvailable(): void {
$this->drupalGet('');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->responseContains('olivero/css/base/base.css');
@@ -49,7 +49,7 @@ class OliveroTest extends BrowserTestBase {
/**
* Test Olivero's configuration schema.
*/
- public function testConfigSchema() {
+ public function testConfigSchema(): void {
// Required configuration.
$this->drupalGet('');
$this->assertSession()->statusCodeEquals(200);
@@ -74,7 +74,7 @@ class OliveroTest extends BrowserTestBase {
*
* @see olivero.libraries.yml
*/
- public function testPreprocessBlock() {
+ public function testPreprocessBlock(): void {
$this->drupalGet('');
$this->assertSession()->statusCodeEquals(200);
@@ -122,7 +122,7 @@ class OliveroTest extends BrowserTestBase {
/**
* Tests that the Olivero theme can be uninstalled.
*/
- public function testIsUninstallable() {
+ public function testIsUninstallable(): void {
$this->drupalLogin($this->drupalCreateUser([
'access administration pages',
'administer themes',
diff --git a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php
index e74802e8513..9bf75311d59 100644
--- a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php
+++ b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php
@@ -32,14 +32,14 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase {
/**
* Tests that the database was properly loaded.
*/
- public function testDatabaseProperlyLoaded() {
+ public function testDatabaseProperlyLoaded(): void {
$this->testDatabaseLoaded();
}
/**
* Tests that updates are properly run.
*/
- public function testUpdateHookN() {
+ public function testUpdateHookN(): void {
$connection = Database::getConnection();
// Increment the schema version.
@@ -76,7 +76,7 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase {
/**
* Tests that path aliases are not processed during database updates.
*/
- public function testPathAliasProcessing() {
+ public function testPathAliasProcessing(): void {
// Add a path alias for the '/admin' system path.
$values = [
'path' => '/admin/structure',
@@ -122,7 +122,7 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase {
*
* @see update_test_schema_update_8003()
*/
- public function testModuleListChange() {
+ public function testModuleListChange(): void {
// Set a value in the cache to prove caches are cleared.
\Drupal::service('cache.default')->set(__CLASS__, 'Test');
@@ -169,7 +169,7 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase {
* @see \Drupal\FunctionalTests\Update\UpdatePathTestBase::runUpdates()
* @see \Drupal\Core\Test\TestSetupTrait::$configSchemaCheckerExclusions
*/
- public function testSchemaChecking() {
+ public function testSchemaChecking(): void {
// Create some configuration that should be skipped.
$this->config('config_schema_test.no_schema')->set('foo', 'bar')->save();
$this->runUpdates();
@@ -180,7 +180,7 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase {
/**
* Tests that setup is done correctly.
*/
- public function testSetup() {
+ public function testSetup(): void {
$this->assertCount(3, $this->databaseDumpFiles);
$this->assertSame(1, Settings::get('entity_update_batch_size'));
}
diff --git a/core/tests/Drupal/FunctionalTests/UserHelpersTest.php b/core/tests/Drupal/FunctionalTests/UserHelpersTest.php
index d69d619058f..151a0827246 100644
--- a/core/tests/Drupal/FunctionalTests/UserHelpersTest.php
+++ b/core/tests/Drupal/FunctionalTests/UserHelpersTest.php
@@ -21,7 +21,7 @@ class UserHelpersTest extends BrowserTestBase {
/**
* Tests BrowserTestBase::drupalUserIsLoggedIn().
*/
- public function testDrupalUserIsLoggedIn() {
+ public function testDrupalUserIsLoggedIn(): void {
$first_user = $this->drupalCreateUser();
$second_user = $this->drupalCreateUser();
diff --git a/core/tests/Drupal/FunctionalTests/WebAssertTest.php b/core/tests/Drupal/FunctionalTests/WebAssertTest.php
index d5b42bd6a6b..a8ca8bcac10 100644
--- a/core/tests/Drupal/FunctionalTests/WebAssertTest.php
+++ b/core/tests/Drupal/FunctionalTests/WebAssertTest.php
@@ -37,7 +37,7 @@ class WebAssertTest extends BrowserTestBase {
*
* @covers ::responseHeaderExists
*/
- public function testResponseHeaderExists() {
+ public function testResponseHeaderExists(): void {
$this->drupalGet('test-null-header');
$this->assertSession()->responseHeaderExists('Null-Header');
@@ -51,7 +51,7 @@ class WebAssertTest extends BrowserTestBase {
*
* @covers ::responseHeaderDoesNotExist
*/
- public function testResponseHeaderDoesNotExist() {
+ public function testResponseHeaderDoesNotExist(): void {
$this->drupalGet('test-null-header');
$this->assertSession()->responseHeaderDoesNotExist('does-not-exist');
@@ -63,7 +63,7 @@ class WebAssertTest extends BrowserTestBase {
/**
* @covers ::pageTextMatchesCount
*/
- public function testPageTextMatchesCount() {
+ public function testPageTextMatchesCount(): void {
$this->drupalLogin($this->drupalCreateUser());
// Visit a Drupal page that requires login.
@@ -78,7 +78,7 @@ class WebAssertTest extends BrowserTestBase {
/**
* @covers ::pageTextContainsOnce
*/
- public function testPageTextContainsOnce() {
+ public function testPageTextContainsOnce(): void {
$this->drupalLogin($this->drupalCreateUser());
// Visit a Drupal page that requires login.
@@ -142,7 +142,7 @@ class WebAssertTest extends BrowserTestBase {
*
* @covers ::linkExists
*/
- public function testPipeCharInLocator() {
+ public function testPipeCharInLocator(): void {
$this->drupalGet('test-pipe-char');
$this->assertSession()->linkExists('foo|bar|baz');
}
@@ -152,7 +152,7 @@ class WebAssertTest extends BrowserTestBase {
*
* @covers ::linkExistsExact
*/
- public function testLinkExistsExact() {
+ public function testLinkExistsExact(): void {
$this->drupalGet('test-pipe-char');
$this->assertSession()->linkExistsExact('foo|bar|baz');
}
@@ -162,7 +162,7 @@ class WebAssertTest extends BrowserTestBase {
*
* @covers ::linkExistsExact
*/
- public function testInvalidLinkExistsExact() {
+ public function testInvalidLinkExistsExact(): void {
$this->drupalGet('test-pipe-char');
$this->expectException(ExpectationException::class);
$this->expectExceptionMessage('Link with label foo|bar not found');
@@ -174,7 +174,7 @@ class WebAssertTest extends BrowserTestBase {
*
* @covers ::linkNotExistsExact
*/
- public function testLinkNotExistsExact() {
+ public function testLinkNotExistsExact(): void {
$this->drupalGet('test-pipe-char');
$this->assertSession()->linkNotExistsExact('foo|bar');
}
@@ -184,7 +184,7 @@ class WebAssertTest extends BrowserTestBase {
*
* @covers ::linkNotExistsExact
*/
- public function testInvalidLinkNotExistsExact() {
+ public function testInvalidLinkNotExistsExact(): void {
$this->drupalGet('test-pipe-char');
$this->expectException(ExpectationException::class);
$this->expectExceptionMessage('Link with label foo|bar|baz found');
@@ -295,7 +295,7 @@ class WebAssertTest extends BrowserTestBase {
* @covers ::responseContains
* @covers ::responseNotContains
*/
- public function testTextAsserts() {
+ public function testTextAsserts(): void {
$this->drupalGet('test-encoded');
$dangerous = 'Bad html <script>alert(123);</script>';
$sanitized = Html::escape($dangerous);
@@ -309,7 +309,7 @@ class WebAssertTest extends BrowserTestBase {
* @covers ::buttonExists
* @covers ::buttonNotExists
*/
- public function testFieldAssertsForButton() {
+ public function testFieldAssertsForButton(): void {
$this->drupalGet('test-field-xpath');
// Verify if the test passes with button ID.
@@ -346,7 +346,7 @@ class WebAssertTest extends BrowserTestBase {
*
* @covers ::pageContainsNoDuplicateId
*/
- public function testPageContainsNoDuplicateId() {
+ public function testPageContainsNoDuplicateId(): void {
$assert_session = $this->assertSession();
$this->drupalGet(Url::fromRoute('test_page_test.page_without_duplicate_ids'));
$assert_session->pageContainsNoDuplicateId();
@@ -363,7 +363,7 @@ class WebAssertTest extends BrowserTestBase {
* @covers ::assertNoEscaped
* @covers ::assertEscaped
*/
- public function testEscapingAssertions() {
+ public function testEscapingAssertions(): void {
$assert = $this->assertSession();
$this->drupalGet('test-escaped-characters');
diff --git a/core/tests/Drupal/KernelTests/Component/Render/FormattableMarkupKernelTest.php b/core/tests/Drupal/KernelTests/Component/Render/FormattableMarkupKernelTest.php
index cfbb121e387..4c9e7b1717b 100644
--- a/core/tests/Drupal/KernelTests/Component/Render/FormattableMarkupKernelTest.php
+++ b/core/tests/Drupal/KernelTests/Component/Render/FormattableMarkupKernelTest.php
@@ -44,7 +44,7 @@ class FormattableMarkupKernelTest extends KernelTestBase {
*
* @dataProvider providerTestFormattableMarkupUri
*/
- public function testFormattableMarkupUri($string, $uri, $options, $expected) {
+ public function testFormattableMarkupUri($string, $uri, $options, $expected): void {
$args = self::getFormattableMarkupUriArgs($uri, $options);
$this->assertSame($expected, (string) new FormattableMarkup($string, $args));
}
@@ -103,7 +103,7 @@ class FormattableMarkupKernelTest extends KernelTestBase {
/**
* @dataProvider providerTestFormattableMarkupUriWithException
*/
- public function testFormattableMarkupUriWithExceptionUri($string, $uri) {
+ public function testFormattableMarkupUriWithExceptionUri($string, $uri): void {
// Should throw an \InvalidArgumentException, due to Uri::toString().
$this->expectException(\InvalidArgumentException::class);
$args = self::getFormattableMarkupUriArgs($uri);
diff --git a/core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php b/core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php
index a1973722aba..853d3e3afe0 100644
--- a/core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php
+++ b/core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php
@@ -60,7 +60,7 @@ class DefaultConfigTest extends KernelTestBase {
*
* @dataProvider themeListDataProvider
*/
- public function testThemeConfig($theme) {
+ public function testThemeConfig($theme): void {
$this->assertExtensionConfig($theme, 'theme');
}
diff --git a/core/tests/Drupal/KernelTests/Config/TypedConfigTest.php b/core/tests/Drupal/KernelTests/Config/TypedConfigTest.php
index 44c6b7d87f1..db02ae73b14 100644
--- a/core/tests/Drupal/KernelTests/Config/TypedConfigTest.php
+++ b/core/tests/Drupal/KernelTests/Config/TypedConfigTest.php
@@ -43,7 +43,7 @@ class TypedConfigTest extends KernelTestBase {
/**
* Verifies that the Typed Data API is implemented correctly.
*/
- public function testTypedDataAPI() {
+ public function testTypedDataAPI(): void {
/** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager */
$typed_config_manager = \Drupal::service('config.typed');
@@ -144,7 +144,7 @@ class TypedConfigTest extends KernelTestBase {
/**
* Tests config validation via the Typed Data API.
*/
- public function testSimpleConfigValidation() {
+ public function testSimpleConfigValidation(): void {
$config = \Drupal::configFactory()->getEditable('config_test.validation');
/** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager */
$typed_config_manager = \Drupal::service('config.typed');
diff --git a/core/tests/Drupal/KernelTests/ConfigFormTestBase.php b/core/tests/Drupal/KernelTests/ConfigFormTestBase.php
index 9cad9328d85..b588372865b 100644
--- a/core/tests/Drupal/KernelTests/ConfigFormTestBase.php
+++ b/core/tests/Drupal/KernelTests/ConfigFormTestBase.php
@@ -42,7 +42,7 @@ abstract class ConfigFormTestBase extends KernelTestBase {
/**
* Submit the system_config_form ensure the configuration has expected values.
*/
- public function testConfigForm() {
+ public function testConfigForm(): void {
// Programmatically submit the given values.
$values = [];
foreach ($this->values as $form_key => $data) {
diff --git a/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php b/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php
index 4626a6af43f..9ce189b5df1 100644
--- a/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php
@@ -41,7 +41,7 @@ class DeleteActionTest extends KernelTestBase {
/**
* @covers \Drupal\Core\Action\Plugin\Action\Derivative\EntityDeleteActionDeriver::getDerivativeDefinitions
*/
- public function testGetDerivativeDefinitions() {
+ public function testGetDerivativeDefinitions(): void {
$deriver = new EntityDeleteActionDeriver(\Drupal::entityTypeManager(), \Drupal::translation());
$this->assertEquals([
'entity_test_mulrevpub' => [
@@ -70,7 +70,7 @@ class DeleteActionTest extends KernelTestBase {
/**
* @covers \Drupal\Core\Action\Plugin\Action\DeleteAction::execute
*/
- public function testDeleteAction() {
+ public function testDeleteAction(): void {
$entity = EntityTestMulRevPub::create(['name' => 'test']);
$entity->save();
diff --git a/core/tests/Drupal/KernelTests/Core/Action/EmailActionTest.php b/core/tests/Drupal/KernelTests/Core/Action/EmailActionTest.php
index faf116ec8f5..34bf7a5a379 100644
--- a/core/tests/Drupal/KernelTests/Core/Action/EmailActionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Action/EmailActionTest.php
@@ -32,7 +32,7 @@ class EmailActionTest extends KernelTestBase {
/**
* Tests the email action plugin.
*/
- public function testEmailAction() {
+ public function testEmailAction(): void {
$this->config('system.site')->set('mail', 'test@example.com')->save();
/** @var \Drupal\Core\Action\ActionManager $plugin_manager */
diff --git a/core/tests/Drupal/KernelTests/Core/Action/PublishActionTest.php b/core/tests/Drupal/KernelTests/Core/Action/PublishActionTest.php
index 09d63e96ba7..09c62d5d9dc 100644
--- a/core/tests/Drupal/KernelTests/Core/Action/PublishActionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Action/PublishActionTest.php
@@ -30,7 +30,7 @@ class PublishActionTest extends KernelTestBase {
/**
* @covers \Drupal\Core\Action\Plugin\Action\Derivative\EntityPublishedActionDeriver::getDerivativeDefinitions
*/
- public function testGetDerivativeDefinitions() {
+ public function testGetDerivativeDefinitions(): void {
$deriver = new EntityPublishedActionDeriver(\Drupal::entityTypeManager(), \Drupal::translation());
$definitions = $deriver->getDerivativeDefinitions([
'action_label' => 'Save',
@@ -45,7 +45,7 @@ class PublishActionTest extends KernelTestBase {
/**
* @covers \Drupal\Core\Action\Plugin\Action\PublishAction::execute
*/
- public function testPublishAction() {
+ public function testPublishAction(): void {
$entity = EntityTestMulRevPub::create(['name' => 'test']);
$entity->setUnpublished()->save();
@@ -63,7 +63,7 @@ class PublishActionTest extends KernelTestBase {
/**
* @covers \Drupal\Core\Action\Plugin\Action\UnpublishAction::execute
*/
- public function testUnpublishAction() {
+ public function testUnpublishAction(): void {
$entity = EntityTestMulRevPub::create(['name' => 'test']);
$entity->setPublished()->save();
diff --git a/core/tests/Drupal/KernelTests/Core/Action/SaveActionTest.php b/core/tests/Drupal/KernelTests/Core/Action/SaveActionTest.php
index 54453e1ab72..586523d1869 100644
--- a/core/tests/Drupal/KernelTests/Core/Action/SaveActionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Action/SaveActionTest.php
@@ -30,7 +30,7 @@ class SaveActionTest extends KernelTestBase {
/**
* @covers \Drupal\Core\Action\Plugin\Action\Derivative\EntityChangedActionDeriver::getDerivativeDefinitions
*/
- public function testGetDerivativeDefinitions() {
+ public function testGetDerivativeDefinitions(): void {
$deriver = new EntityChangedActionDeriver(\Drupal::entityTypeManager(), \Drupal::translation());
$definitions = $deriver->getDerivativeDefinitions([
'action_label' => 'Save',
@@ -45,7 +45,7 @@ class SaveActionTest extends KernelTestBase {
/**
* @covers \Drupal\Core\Action\Plugin\Action\SaveAction::execute
*/
- public function testSaveAction() {
+ public function testSaveAction(): void {
$entity = EntityTestMulChanged::create(['name' => 'test']);
$entity->save();
$saved_time = $entity->getChangedTime();
diff --git a/core/tests/Drupal/KernelTests/Core/Ajax/CommandsTest.php b/core/tests/Drupal/KernelTests/Core/Ajax/CommandsTest.php
index 90cfefbcd4c..4571f2d025e 100644
--- a/core/tests/Drupal/KernelTests/Core/Ajax/CommandsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Ajax/CommandsTest.php
@@ -32,7 +32,7 @@ class CommandsTest extends KernelTestBase {
/**
* Regression test: Settings command exists regardless of JS aggregation.
*/
- public function testAttachedSettings() {
+ public function testAttachedSettings(): void {
$assert = function ($message) {
$response = new AjaxResponse();
$response->setAttachments([
@@ -69,7 +69,7 @@ class CommandsTest extends KernelTestBase {
*
* @doesNotPerformAssertions
*/
- public function testEmptyInsertCommand() {
+ public function testEmptyInsertCommand(): void {
(new InsertCommand('foobar', []))->render();
}
diff --git a/core/tests/Drupal/KernelTests/Core/Archiver/TarTest.php b/core/tests/Drupal/KernelTests/Core/Archiver/TarTest.php
index a3d300edb63..ba7e84587c4 100644
--- a/core/tests/Drupal/KernelTests/Core/Archiver/TarTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Archiver/TarTest.php
@@ -19,7 +19,7 @@ class TarTest extends ArchiverTestBase {
/**
* Tests that the Tar archive is created if it does not exist.
*/
- public function testCreateArchive() {
+ public function testCreateArchive(): void {
$textFile = current($this->getTestFiles('text'));
$archiveFilename = $this->fileSystem->realpath('public://' . $this->randomMachineName() . '.tar');
$tar = new Tar($archiveFilename);
diff --git a/core/tests/Drupal/KernelTests/Core/Archiver/ZipTest.php b/core/tests/Drupal/KernelTests/Core/Archiver/ZipTest.php
index 689f76e9a1d..2bc2fda371d 100644
--- a/core/tests/Drupal/KernelTests/Core/Archiver/ZipTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Archiver/ZipTest.php
@@ -19,7 +19,7 @@ class ZipTest extends ArchiverTestBase {
/**
* Tests that the Zip archive is created if it does not exist.
*/
- public function testCreateArchive() {
+ public function testCreateArchive(): void {
$textFile = current($this->getTestFiles('text'));
$archiveFilename = $this->fileSystem->realpath('public://' . $this->randomMachineName() . '.zip');
$zip = new Zip($archiveFilename, [
@@ -35,7 +35,7 @@ class ZipTest extends ArchiverTestBase {
/**
* Tests that the Zip archiver is created and overwritten.
*/
- public function testOverwriteArchive() {
+ public function testOverwriteArchive(): void {
// Create an archive similarly to how it's done in ::testCreateArchive.
$files = $this->getTestFiles('text');
$textFile = current($files);
diff --git a/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php b/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php
index 1a8fa790333..60f18afa57c 100644
--- a/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php
@@ -63,7 +63,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Tests that default CSS and JavaScript is empty.
*/
- public function testDefault() {
+ public function testDefault(): void {
$assets = new AttachedAssets();
$this->assertEquals([], $this->assetResolver->getCssAssets($assets, FALSE, \Drupal::languageManager()->getCurrentLanguage()), 'Default CSS is empty.');
[$js_assets_header, $js_assets_footer] = $this->assetResolver->getJsAssets($assets, FALSE, \Drupal::languageManager()->getCurrentLanguage());
@@ -74,7 +74,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Tests non-existing libraries.
*/
- public function testLibraryUnknown() {
+ public function testLibraryUnknown(): void {
$build['#attached']['library'][] = 'core/unknown';
$assets = AttachedAssets::createFromRenderArray($build);
@@ -84,7 +84,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Tests adding a CSS and a JavaScript file.
*/
- public function testAddFiles() {
+ public function testAddFiles(): void {
$build['#attached']['library'][] = 'common_test/files';
$assets = AttachedAssets::createFromRenderArray($build);
@@ -105,7 +105,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Tests adding JavaScript settings.
*/
- public function testAddJsSettings() {
+ public function testAddJsSettings(): void {
// Add a file in order to test default settings.
$build['#attached']['library'][] = 'core/drupalSettings';
$assets = AttachedAssets::createFromRenderArray($build);
@@ -124,7 +124,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Tests adding external CSS and JavaScript files.
*/
- public function testAddExternalFiles() {
+ public function testAddExternalFiles(): void {
$build['#attached']['library'][] = 'common_test/external';
$assets = AttachedAssets::createFromRenderArray($build);
@@ -144,7 +144,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Tests adding JavaScript files with additional attributes.
*/
- public function testAttributes() {
+ public function testAttributes(): void {
$build['#attached']['library'][] = 'common_test/js-attributes';
$assets = AttachedAssets::createFromRenderArray($build);
@@ -160,7 +160,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Tests that attributes are maintained when JS aggregation is enabled.
*/
- public function testAggregatedAttributes() {
+ public function testAggregatedAttributes(): void {
$build['#attached']['library'][] = 'common_test/js-attributes';
$assets = AttachedAssets::createFromRenderArray($build);
@@ -176,7 +176,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Integration test for CSS/JS aggregation.
*/
- public function testAggregation() {
+ public function testAggregation(): void {
$build['#attached']['library'][] = 'core/drupal.timezone';
$build['#attached']['library'][] = 'core/drupal.vertical-tabs';
$assets = AttachedAssets::createFromRenderArray($build);
@@ -194,7 +194,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Tests JavaScript settings.
*/
- public function testSettings() {
+ public function testSettings(): void {
$build = [];
$build['#attached']['library'][] = 'core/drupalSettings';
// Nonsensical value to verify if it's possible to override path settings.
@@ -234,7 +234,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Tests JS assets depending on the 'core/<head>' virtual library.
*/
- public function testHeaderHTML() {
+ public function testHeaderHTML(): void {
$build['#attached']['library'][] = 'common_test/js-header';
$assets = AttachedAssets::createFromRenderArray($build);
@@ -250,7 +250,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Tests that for assets with cache = FALSE, Drupal sets preprocess = FALSE.
*/
- public function testNoCache() {
+ public function testNoCache(): void {
$build['#attached']['library'][] = 'common_test/no-cache';
$assets = AttachedAssets::createFromRenderArray($build);
@@ -261,7 +261,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Tests JavaScript versioning.
*/
- public function testVersionQueryString() {
+ public function testVersionQueryString(): void {
$build['#attached']['library'][] = 'core/once';
$assets = AttachedAssets::createFromRenderArray($build);
@@ -275,7 +275,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Tests JavaScript and CSS asset ordering.
*/
- public function testRenderOrder() {
+ public function testRenderOrder(): void {
$build['#attached']['library'][] = 'common_test/order';
$assets = AttachedAssets::createFromRenderArray($build);
@@ -353,7 +353,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Tests rendering the JavaScript with a file's weight above jQuery's.
*/
- public function testRenderDifferentWeight() {
+ public function testRenderDifferentWeight(): void {
// If a library contains assets A and B, and A is listed first, then B can
// still make itself appear first by defining a lower weight.
$build['#attached']['library'][] = 'core/jquery';
@@ -376,7 +376,7 @@ class AttachedAssetsTest extends KernelTestBase {
*
* @see common_test_js_alter()
*/
- public function testAlter() {
+ public function testAlter(): void {
// Add both tableselect.js and alter.js.
$build['#attached']['library'][] = 'core/drupal.tableselect';
$build['#attached']['library'][] = 'common_test/hook_js_alter';
@@ -397,7 +397,7 @@ class AttachedAssetsTest extends KernelTestBase {
*
* @see common_test_library_info_alter()
*/
- public function testLibraryAlter() {
+ public function testLibraryAlter(): void {
// Verify that common_test altered the title of loadjs.
/** @var \Drupal\Core\Asset\LibraryDiscoveryInterface $library_discovery */
$library_discovery = \Drupal::service('library.discovery');
@@ -416,7 +416,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Dynamically defines an asset library and alters it.
*/
- public function testDynamicLibrary() {
+ public function testDynamicLibrary(): void {
/** @var \Drupal\Core\Asset\LibraryDiscoveryInterface $library_discovery */
$library_discovery = \Drupal::service('library.discovery');
// Retrieve a dynamic library definition.
@@ -438,7 +438,7 @@ class AttachedAssetsTest extends KernelTestBase {
*
* @see common_test.library.yml
*/
- public function testLibraryNameConflicts() {
+ public function testLibraryNameConflicts(): void {
/** @var \Drupal\Core\Asset\LibraryDiscoveryInterface $library_discovery */
$library_discovery = \Drupal::service('library.discovery');
$loadjs = $library_discovery->getLibraryByName('common_test', 'loadjs');
@@ -448,7 +448,7 @@ class AttachedAssetsTest extends KernelTestBase {
/**
* Tests JavaScript files that have query strings attached get added right.
*/
- public function testAddJsFileWithQueryString() {
+ public function testAddJsFileWithQueryString(): void {
$build['#attached']['library'][] = 'common_test/querystring';
$assets = AttachedAssets::createFromRenderArray($build);
diff --git a/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php
index 9fd06a29d39..6c3096ff5df 100644
--- a/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Asset/LibraryDiscoveryIntegrationTest.php
@@ -40,7 +40,7 @@ class LibraryDiscoveryIntegrationTest extends KernelTestBase {
/**
* Tests that hook_library_info is invoked and the cache is cleared.
*/
- public function testHookLibraryInfoByTheme() {
+ public function testHookLibraryInfoByTheme(): void {
// Activate test_theme and verify that the library 'kitten' is added using
// hook_library_info_alter().
$this->activateTheme('test_theme');
@@ -55,7 +55,7 @@ class LibraryDiscoveryIntegrationTest extends KernelTestBase {
/**
* Tests that libraries-override are applied to library definitions.
*/
- public function testLibrariesOverride() {
+ public function testLibrariesOverride(): void {
// Assert some starterkit_theme libraries that will be overridden or
// removed.
$this->activateTheme('starterkit_theme');
@@ -96,7 +96,7 @@ class LibraryDiscoveryIntegrationTest extends KernelTestBase {
/**
* Tests libraries-override on drupalSettings.
*/
- public function testLibrariesOverrideDrupalSettings() {
+ public function testLibrariesOverrideDrupalSettings(): void {
// Activate test theme that attempts to override drupalSettings.
$this->activateTheme('test_theme_libraries_override_with_drupal_settings');
@@ -114,7 +114,7 @@ class LibraryDiscoveryIntegrationTest extends KernelTestBase {
/**
* Tests libraries-override on malformed assets.
*/
- public function testLibrariesOverrideMalformedAsset() {
+ public function testLibrariesOverrideMalformedAsset(): void {
// Activate test theme that overrides with a malformed asset.
$this->activateTheme('test_theme_libraries_override_with_invalid_asset');
@@ -132,7 +132,7 @@ class LibraryDiscoveryIntegrationTest extends KernelTestBase {
/**
* Tests libraries overrides with multiple parent themes.
*/
- public function testLibrariesOverridesMultiple() {
+ public function testLibrariesOverridesMultiple(): void {
/** @var \Drupal\Core\Extension\ThemeInstallerInterface $theme_installer */
$theme_installer = $this->container->get('theme_installer');
$theme_installer->install(['test_basetheme']);
@@ -155,7 +155,7 @@ class LibraryDiscoveryIntegrationTest extends KernelTestBase {
/**
* Tests library assets with other ways for specifying paths.
*/
- public function testLibrariesOverrideOtherAssetLibraryNames() {
+ public function testLibrariesOverrideOtherAssetLibraryNames(): void {
// Activate a test theme that defines libraries overrides on other types of
// assets.
$this->activateTheme('test_theme');
@@ -176,7 +176,7 @@ class LibraryDiscoveryIntegrationTest extends KernelTestBase {
/**
* Tests that base theme libraries-override still apply in sub themes.
*/
- public function testBaseThemeLibrariesOverrideInSubTheme() {
+ public function testBaseThemeLibrariesOverrideInSubTheme(): void {
// Activate a test theme that has subthemes.
$this->activateTheme('test_subtheme');
@@ -189,7 +189,7 @@ class LibraryDiscoveryIntegrationTest extends KernelTestBase {
/**
* Tests libraries-extend.
*/
- public function testLibrariesExtend() {
+ public function testLibrariesExtend(): void {
// Simulate starterkit_theme defining the test-navigation library.
// @see theme_test_library_info_alter()
$this->container->get('state')
@@ -253,7 +253,7 @@ class LibraryDiscoveryIntegrationTest extends KernelTestBase {
*
* @group legacy
*/
- public function testDeprecatedLibrary() {
+ public function testDeprecatedLibrary(): void {
$this->expectDeprecation('Targeting theme_test/moved_from css/foo.css from test_theme_with_deprecated_libraries library_overrides is deprecated in drupal:X.0.0 and will be removed in drupal:Y.0.0. Target theme_test/moved_to css/base-remove.css instead. See https://example.com');
$this->expectDeprecation('Targeting theme_test/moved_from js/bar.js from test_theme_with_deprecated_libraries library_overrides is deprecated in drupal:X.0.0 and will be removed in drupal:Y.0.0. Target theme_test/moved_to js/foo.js instead. See https://example.com');
$this->expectDeprecation('Theme "theme_test" is overriding a deprecated library. The "theme_test/deprecated_library" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com');
diff --git a/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php b/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php
index dea01689cc5..3a7e1328ec1 100644
--- a/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php
@@ -154,7 +154,7 @@ class ResolvedLibraryDefinitionsFilesMatchTest extends KernelTestBase {
/**
* Ensures that all core module and theme library files exist.
*/
- public function testCoreLibraryCompleteness() {
+ public function testCoreLibraryCompleteness(): void {
// First verify all libraries with no active theme.
$this->verifyLibraryFilesExist($this->getAllLibraries());
diff --git a/core/tests/Drupal/KernelTests/Core/Batch/BatchKernelTest.php b/core/tests/Drupal/KernelTests/Core/Batch/BatchKernelTest.php
index e625b1861c0..a8c8af5fe7b 100644
--- a/core/tests/Drupal/KernelTests/Core/Batch/BatchKernelTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Batch/BatchKernelTest.php
@@ -25,7 +25,7 @@ class BatchKernelTest extends KernelTestBase {
/**
* Tests _batch_needs_update().
*/
- public function testNeedsUpdate() {
+ public function testNeedsUpdate(): void {
// Before ever being called, the return value should be FALSE.
$this->assertEquals(FALSE, _batch_needs_update());
diff --git a/core/tests/Drupal/KernelTests/Core/Batch/BatchNegotiatorTest.php b/core/tests/Drupal/KernelTests/Core/Batch/BatchNegotiatorTest.php
index 466bc216aad..98ebeffd8fe 100644
--- a/core/tests/Drupal/KernelTests/Core/Batch/BatchNegotiatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Batch/BatchNegotiatorTest.php
@@ -25,7 +25,7 @@ class BatchNegotiatorTest extends KernelTestBase {
/**
* Test that the negotiator applies to the batch route.
*/
- public function testApplies() {
+ public function testApplies(): void {
$request = Request::create('/batch');
// Use the router to enhance the object so that a RouteMatch can be created.
$this->container->get('router')->matchRequest($request);
diff --git a/core/tests/Drupal/KernelTests/Core/Block/MultipleBlockFormTest.php b/core/tests/Drupal/KernelTests/Core/Block/MultipleBlockFormTest.php
index 0938a7d5767..07237a966f3 100644
--- a/core/tests/Drupal/KernelTests/Core/Block/MultipleBlockFormTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Block/MultipleBlockFormTest.php
@@ -22,7 +22,7 @@ class MultipleBlockFormTest extends KernelTestBase {
/**
* Tests that blocks can have multiple forms.
*/
- public function testMultipleForms() {
+ public function testMultipleForms(): void {
$configuration = ['label' => 'A very cool block'];
$block = \Drupal::service('plugin.manager.block')->createInstance('test_multiple_forms_block', $configuration);
diff --git a/core/tests/Drupal/KernelTests/Core/Bootstrap/ExtensionPathResolverTest.php b/core/tests/Drupal/KernelTests/Core/Bootstrap/ExtensionPathResolverTest.php
index 8773c449dc0..f143ef109da 100644
--- a/core/tests/Drupal/KernelTests/Core/Bootstrap/ExtensionPathResolverTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Bootstrap/ExtensionPathResolverTest.php
@@ -96,7 +96,7 @@ class ExtensionPathResolverTest extends KernelTestBase {
/**
* Tests the getPath() method with an unknown extension.
*/
- public function testUnknownExtension() {
+ public function testUnknownExtension(): void {
$module_extension_list = $this->prophesize(ModuleExtensionList::class);
$profile_extension_list = $this->prophesize(ProfileExtensionList::class);
$theme_extension_list = $this->prophesize(ThemeExtensionList::class);
diff --git a/core/tests/Drupal/KernelTests/Core/Bootstrap/ResettableStaticTest.php b/core/tests/Drupal/KernelTests/Core/Bootstrap/ResettableStaticTest.php
index 72b973c67d1..b3b4617de11 100644
--- a/core/tests/Drupal/KernelTests/Core/Bootstrap/ResettableStaticTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Bootstrap/ResettableStaticTest.php
@@ -19,7 +19,7 @@ class ResettableStaticTest extends KernelTestBase {
* Tests that a variable reference returned by drupal_static() gets reset when
* drupal_static_reset() is called.
*/
- public function testDrupalStatic() {
+ public function testDrupalStatic(): void {
$name = __CLASS__ . '_' . __METHOD__;
$var = &drupal_static($name, 'foo');
$this->assertEquals('foo', $var, 'Variable returned by drupal_static() was set to its default.');
diff --git a/core/tests/Drupal/KernelTests/Core/Bootstrap/ShutdownFunctionTest.php b/core/tests/Drupal/KernelTests/Core/Bootstrap/ShutdownFunctionTest.php
index 04d94108934..ab4223b0193 100644
--- a/core/tests/Drupal/KernelTests/Core/Bootstrap/ShutdownFunctionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Bootstrap/ShutdownFunctionTest.php
@@ -30,7 +30,7 @@ class ShutdownFunctionTest extends KernelTestBase {
/**
* Tests that shutdown functions can be added by other shutdown functions.
*/
- public function testShutdownFunctionInShutdownFunction() {
+ public function testShutdownFunctionInShutdownFunction(): void {
// Ensure there are no shutdown functions registered before starting the
// test.
$this->assertEmpty(drupal_register_shutdown_function());
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/ApcuBackendTest.php b/core/tests/Drupal/KernelTests/Core/Cache/ApcuBackendTest.php
index c28e77b3e71..33a7d71de93 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/ApcuBackendTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/ApcuBackendTest.php
@@ -35,7 +35,7 @@ class ApcuBackendTest extends GenericCacheBackendUnitTestBase {
/**
* {@inheritdoc}
*/
- public function testSetGet() {
+ public function testSetGet(): void {
parent::testSetGet();
// Make sure entries are permanent (i.e. no TTL).
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/CacheCollectorTest.php b/core/tests/Drupal/KernelTests/Core/Cache/CacheCollectorTest.php
index 7b2040f79ba..a6e24cddbd1 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/CacheCollectorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/CacheCollectorTest.php
@@ -39,7 +39,7 @@ class CacheCollectorTest extends KernelTestBase {
*
* @dataProvider providerTestInvalidCharacters
*/
- public function testCacheCollector($cid, $key, $value) {
+ public function testCacheCollector($cid, $key, $value): void {
$collector = new CacheCollectorHelper($cid, $this->container->get('cache.default'), $this->container->get('lock'));
$this->assertNull($collector->get($key));
$collector->set($key, $value);
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/CacheContextOptimizationTest.php b/core/tests/Drupal/KernelTests/Core/Cache/CacheContextOptimizationTest.php
index 05a7f643809..fc88361463f 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/CacheContextOptimizationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/CacheContextOptimizationTest.php
@@ -36,7 +36,7 @@ class CacheContextOptimizationTest extends KernelTestBase {
/**
* Ensures that 'user.permissions' cache context is able to define cache tags.
*/
- public function testUserPermissionCacheContextOptimization() {
+ public function testUserPermissionCacheContextOptimization(): void {
$user1 = $this->createUser();
$this->assertEquals(1, $user1->id());
@@ -79,7 +79,7 @@ class CacheContextOptimizationTest extends KernelTestBase {
/**
* Ensures that 'user.roles' still works when it is optimized away.
*/
- public function testUserRolesCacheContextOptimization() {
+ public function testUserRolesCacheContextOptimization(): void {
$root_user = $this->createUser();
$this->assertEquals(1, $root_user->id());
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php b/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php
index 934042aac10..98d6e6ca66a 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php
@@ -36,7 +36,7 @@ class DatabaseBackendTagTest extends KernelTestBase {
->addMethodCall('setContainer', [new Reference('service_container')]);
}
- public function testTagInvalidations() {
+ public function testTagInvalidations(): void {
// Create cache entry in multiple bins.
$tags = ['test_tag:1', 'test_tag:2', 'test_tag:3'];
$bins = ['data', 'bootstrap', 'render'];
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php b/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php
index 3fd81fb6027..5183e59f80b 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php
@@ -48,7 +48,7 @@ class DatabaseBackendTest extends GenericCacheBackendUnitTestBase {
/**
* {@inheritdoc}
*/
- public function testSetGet() {
+ public function testSetGet(): void {
parent::testSetGet();
$backend = $this->getCacheBackend();
@@ -77,7 +77,7 @@ class DatabaseBackendTest extends GenericCacheBackendUnitTestBase {
/**
* Tests the row count limiting of cache bin database tables.
*/
- public function testGarbageCollection() {
+ public function testGarbageCollection(): void {
$backend = $this->getCacheBackend();
$max_rows = static::$maxRows;
@@ -125,7 +125,7 @@ class DatabaseBackendTest extends GenericCacheBackendUnitTestBase {
/**
* Test that the service "cache_tags.invalidator.checksum" is backend overridable.
*/
- public function testCacheTagsInvalidatorChecksumIsBackendOverridable() {
+ public function testCacheTagsInvalidatorChecksumIsBackendOverridable(): void {
$definition = $this->container->getDefinition('cache_tags.invalidator.checksum');
$this->assertTrue($definition->hasTag('backend_overridable'));
}
@@ -133,7 +133,7 @@ class DatabaseBackendTest extends GenericCacheBackendUnitTestBase {
/**
* Test that the service "cache.backend.database" is backend overridable.
*/
- public function testCacheBackendDatabaseIsBackendOverridable() {
+ public function testCacheBackendDatabaseIsBackendOverridable(): void {
$definition = $this->container->getDefinition('cache.backend.database');
$this->assertTrue($definition->hasTag('backend_overridable'));
}
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php b/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php
index 00a105175ab..88888b99735 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php
@@ -135,7 +135,7 @@ abstract class GenericCacheBackendUnitTestBase extends KernelTestBase {
/**
* Tests the get and set methods of Drupal\Core\Cache\CacheBackendInterface.
*/
- public function testSetGet() {
+ public function testSetGet(): void {
$backend = $this->getCacheBackend();
$this->assertFalse($backend->get('test1'), "Backend does not contain data for cache id test1.");
@@ -239,7 +239,7 @@ abstract class GenericCacheBackendUnitTestBase extends KernelTestBase {
/**
* Tests Drupal\Core\Cache\CacheBackendInterface::delete().
*/
- public function testDelete() {
+ public function testDelete(): void {
$backend = $this->getCacheBackend();
$this->assertFalse($backend->get('test1'), "Backend does not contain data for cache id test1.");
@@ -267,7 +267,7 @@ abstract class GenericCacheBackendUnitTestBase extends KernelTestBase {
/**
* Tests data type preservation.
*/
- public function testValueTypeIsKept() {
+ public function testValueTypeIsKept(): void {
$backend = $this->getCacheBackend();
$variables = [
@@ -295,7 +295,7 @@ abstract class GenericCacheBackendUnitTestBase extends KernelTestBase {
/**
* Tests Drupal\Core\Cache\CacheBackendInterface::getMultiple().
*/
- public function testGetMultiple() {
+ public function testGetMultiple(): void {
$backend = $this->getCacheBackend();
// Set numerous testing keys.
@@ -389,7 +389,7 @@ abstract class GenericCacheBackendUnitTestBase extends KernelTestBase {
/**
* Tests \Drupal\Core\Cache\CacheBackendInterface::setMultiple().
*/
- public function testSetMultiple() {
+ public function testSetMultiple(): void {
$backend = $this->getCacheBackend();
$future_expiration = \Drupal::time()->getRequestTime() + 100;
@@ -454,7 +454,7 @@ abstract class GenericCacheBackendUnitTestBase extends KernelTestBase {
* @covers \Drupal\Core\Cache\MemoryBackend::deleteMultiple
* @covers \Drupal\Core\Cache\PhpBackend::deleteMultiple
*/
- public function testDeleteMultiple() {
+ public function testDeleteMultiple(): void {
$backend = $this->getCacheBackend();
// Set numerous testing keys.
@@ -501,7 +501,7 @@ abstract class GenericCacheBackendUnitTestBase extends KernelTestBase {
/**
* Tests Drupal\Core\Cache\CacheBackendInterface::deleteAll().
*/
- public function testDeleteAll() {
+ public function testDeleteAll(): void {
$backend_a = $this->getCacheBackend();
$backend_b = $this->getCacheBackend('bootstrap');
@@ -531,7 +531,7 @@ abstract class GenericCacheBackendUnitTestBase extends KernelTestBase {
* @covers \Drupal\Core\Cache\MemoryBackend::invalidateMultiple
* @covers \Drupal\Core\Cache\PhpBackend::invalidateMultiple
*/
- public function testInvalidate() {
+ public function testInvalidate(): void {
$backend = $this->getCacheBackend();
$backend->set('test1', 1);
$backend->set('test2', 2);
@@ -563,7 +563,7 @@ abstract class GenericCacheBackendUnitTestBase extends KernelTestBase {
/**
* Tests Drupal\Core\Cache\CacheBackendInterface::invalidateTags().
*/
- public function testInvalidateTags() {
+ public function testInvalidateTags(): void {
$backend = $this->getCacheBackend();
// Create two cache entries with the same tag and tag value.
@@ -630,7 +630,7 @@ abstract class GenericCacheBackendUnitTestBase extends KernelTestBase {
/**
* Tests Drupal\Core\Cache\CacheBackendInterface::invalidateAll().
*/
- public function testInvalidateAll() {
+ public function testInvalidateAll(): void {
$backend_a = $this->getCacheBackend();
$backend_b = $this->getCacheBackend('bootstrap');
@@ -651,7 +651,7 @@ abstract class GenericCacheBackendUnitTestBase extends KernelTestBase {
/**
* Tests Drupal\Core\Cache\CacheBackendInterface::removeBin().
*/
- public function testRemoveBin() {
+ public function testRemoveBin(): void {
$backend_a = $this->getCacheBackend();
$backend_b = $this->getCacheBackend('bootstrap');
diff --git a/core/tests/Drupal/KernelTests/Core/Common/DrupalFlushAllCachesTest.php b/core/tests/Drupal/KernelTests/Core/Common/DrupalFlushAllCachesTest.php
index b4f8536e560..bacbc6d1d1f 100644
--- a/core/tests/Drupal/KernelTests/Core/Common/DrupalFlushAllCachesTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Common/DrupalFlushAllCachesTest.php
@@ -28,7 +28,7 @@ class DrupalFlushAllCachesTest extends KernelTestBase {
/**
* Tests that drupal_flush_all_caches() uses core.extension properly.
*/
- public function testDrupalFlushAllCachesModuleList() {
+ public function testDrupalFlushAllCachesModuleList(): void {
$this->assertFalse(function_exists('system_test_help'));
$core_extension = \Drupal::configFactory()->getEditable('core.extension');
$module = $core_extension->get('module');
diff --git a/core/tests/Drupal/KernelTests/Core/Common/XssUnitTest.php b/core/tests/Drupal/KernelTests/Core/Common/XssUnitTest.php
index 36f73adac43..1c76f8c6332 100644
--- a/core/tests/Drupal/KernelTests/Core/Common/XssUnitTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Common/XssUnitTest.php
@@ -36,7 +36,7 @@ class XssUnitTest extends KernelTestBase {
/**
* Tests t() functionality.
*/
- public function testT() {
+ public function testT(): void {
$text = t('Simple text');
$this->assertSame('Simple text', (string) $text, 't leaves simple text alone.');
$text = t('Escaped text: @value', ['@value' => '<script>']);
@@ -48,7 +48,7 @@ class XssUnitTest extends KernelTestBase {
/**
* Checks that harmful protocols are stripped.
*/
- public function testBadProtocolStripping() {
+ public function testBadProtocolStripping(): void {
// Ensure that check_url() strips out harmful protocols, and encodes for
// HTML.
// Ensure \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() can
diff --git a/core/tests/Drupal/KernelTests/Core/Config/CacheabilityMetadataConfigOverrideTest.php b/core/tests/Drupal/KernelTests/Core/Config/CacheabilityMetadataConfigOverrideTest.php
index bb0b194dd7c..6234e106a46 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/CacheabilityMetadataConfigOverrideTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/CacheabilityMetadataConfigOverrideTest.php
@@ -40,7 +40,7 @@ class CacheabilityMetadataConfigOverrideTest extends KernelTestBase {
/**
* Tests if config overrides correctly set cacheability metadata.
*/
- public function testConfigOverride() {
+ public function testConfigOverride(): void {
// It's pirate day today!
$GLOBALS['it_is_pirate_day'] = TRUE;
@@ -60,7 +60,7 @@ class CacheabilityMetadataConfigOverrideTest extends KernelTestBase {
/**
* Tests if config overrides set cacheability metadata on config entities.
*/
- public function testConfigEntityOverride() {
+ public function testConfigEntityOverride(): void {
// It's pirate day today!
$GLOBALS['it_is_pirate_day'] = TRUE;
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php
index fec1d336a2e..c337f574d62 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php
@@ -38,7 +38,7 @@ class ConfigCRUDTest extends KernelTestBase {
/**
* Tests CRUD operations.
*/
- public function testCRUD() {
+ public function testCRUD(): void {
$event_dispatcher = $this->container->get('event_dispatcher');
$typed_config_manager = $this->container->get('config.typed');
@@ -190,7 +190,7 @@ class ConfigCRUDTest extends KernelTestBase {
/**
* Tests the validation of configuration object names.
*/
- public function testNameValidation() {
+ public function testNameValidation(): void {
// Verify that an object name without namespace causes an exception.
$name = 'no_namespace';
try {
@@ -240,7 +240,7 @@ class ConfigCRUDTest extends KernelTestBase {
/**
* Tests the validation of configuration object values.
*/
- public function testValueValidation() {
+ public function testValueValidation(): void {
// Verify that setData() will catch dotted keys.
try {
$this->config('namespace.object')->setData(['key.value' => 12])->save();
@@ -263,7 +263,7 @@ class ConfigCRUDTest extends KernelTestBase {
/**
* Tests data type handling.
*/
- public function testDataTypes() {
+ public function testDataTypes(): void {
\Drupal::service('module_installer')->install(['config_test']);
$storage = new DatabaseStorage($this->container->get('database'), 'config');
$name = 'config_test.types';
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php
index f08353a9516..15dd093d763 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php
@@ -28,7 +28,7 @@ class ConfigDependencyTest extends EntityKernelTestBase {
/**
* Tests that calculating dependencies for system module.
*/
- public function testNonEntity() {
+ public function testNonEntity(): void {
$this->installConfig(['system']);
$config_manager = \Drupal::service('config.manager');
$dependents = $config_manager->findConfigEntityDependencies('module', ['system']);
@@ -42,7 +42,7 @@ class ConfigDependencyTest extends EntityKernelTestBase {
/**
* Tests creating dependencies on configuration entities.
*/
- public function testDependencyManagement() {
+ public function testDependencyManagement(): void {
/** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */
$config_manager = \Drupal::service('config.manager');
$storage = $this->container->get('entity_type.manager')->getStorage('config_test');
@@ -190,7 +190,7 @@ class ConfigDependencyTest extends EntityKernelTestBase {
/**
* Tests ConfigManager::uninstall() and config entity dependency management.
*/
- public function testConfigEntityUninstall() {
+ public function testConfigEntityUninstall(): void {
/** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */
$config_manager = \Drupal::service('config.manager');
/** @var \Drupal\Core\Config\Entity\ConfigEntityStorage $storage */
@@ -250,7 +250,7 @@ class ConfigDependencyTest extends EntityKernelTestBase {
*
* @dataProvider providerConfigEntityUninstallComplex
*/
- public function testConfigEntityUninstallComplex(array $entity_id_suffixes) {
+ public function testConfigEntityUninstallComplex(array $entity_id_suffixes): void {
/** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */
$config_manager = \Drupal::service('config.manager');
/** @var \Drupal\Core\Config\Entity\ConfigEntityStorage $storage */
@@ -375,7 +375,7 @@ class ConfigDependencyTest extends EntityKernelTestBase {
* @covers ::uninstall
* @covers ::getConfigEntitiesToChangeOnDependencyRemoval
*/
- public function testConfigEntityUninstallThirdParty() {
+ public function testConfigEntityUninstallThirdParty(): void {
/** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */
$config_manager = \Drupal::service('config.manager');
/** @var \Drupal\Core\Config\Entity\ConfigEntityStorage $storage */
@@ -490,7 +490,7 @@ class ConfigDependencyTest extends EntityKernelTestBase {
/**
* Tests deleting a configuration entity and dependency management.
*/
- public function testConfigEntityDelete() {
+ public function testConfigEntityDelete(): void {
/** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */
$config_manager = \Drupal::service('config.manager');
/** @var \Drupal\Core\Config\Entity\ConfigEntityStorage $storage */
@@ -597,7 +597,7 @@ class ConfigDependencyTest extends EntityKernelTestBase {
*
* @see \Drupal\Core\Config\ConfigManager::getConfigEntitiesToChangeOnDependencyRemoval()
*/
- public function testContentEntityDelete() {
+ public function testContentEntityDelete(): void {
$this->installEntitySchema('entity_test');
/** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */
$config_manager = \Drupal::service('config.manager');
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigDiffTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigDiffTest.php
index 3e046f4ce8f..486b3b988f9 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigDiffTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigDiffTest.php
@@ -23,7 +23,7 @@ class ConfigDiffTest extends KernelTestBase {
/**
* Tests calculating the difference between two sets of configuration.
*/
- public function testDiff() {
+ public function testDiff(): void {
$active = $this->container->get('config.storage');
$sync = $this->container->get('config.storage.sync');
$config_name = 'config_test.system';
@@ -110,7 +110,7 @@ class ConfigDiffTest extends KernelTestBase {
/**
* Tests calculating the difference between two sets of config collections.
*/
- public function testCollectionDiff() {
+ public function testCollectionDiff(): void {
/** @var \Drupal\Core\Config\StorageInterface $active */
$active = $this->container->get('config.storage');
/** @var \Drupal\Core\Config\StorageInterface $sync */
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityNormalizeTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityNormalizeTest.php
index 72bfd31c6cc..6b8e09b9384 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityNormalizeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityNormalizeTest.php
@@ -28,7 +28,7 @@ class ConfigEntityNormalizeTest extends KernelTestBase {
$this->installConfig(static::$modules);
}
- public function testNormalize() {
+ public function testNormalize(): void {
$config_entity = \Drupal::entityTypeManager()->getStorage('config_test')->create(['id' => 'system', 'label' => 'foobar', 'weight' => 1]);
$config_entity->save();
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStaticCacheTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStaticCacheTest.php
index c3187283a52..faf68e746d5 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStaticCacheTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStaticCacheTest.php
@@ -54,7 +54,7 @@ class ConfigEntityStaticCacheTest extends KernelTestBase {
/**
* Tests that the static cache is working.
*/
- public function testCacheHit() {
+ public function testCacheHit(): void {
$storage = $this->container->get('entity_type.manager')
->getStorage($this->entityTypeId);
$entity_1 = $storage->load($this->entityId);
@@ -68,7 +68,7 @@ class ConfigEntityStaticCacheTest extends KernelTestBase {
/**
* Tests that the static cache is reset on entity save and delete.
*/
- public function testReset() {
+ public function testReset(): void {
$storage = $this->container->get('entity_type.manager')
->getStorage($this->entityTypeId);
$entity = $storage->load($this->entityId);
@@ -89,7 +89,7 @@ class ConfigEntityStaticCacheTest extends KernelTestBase {
/**
* Tests that the static cache is sensitive to config overrides.
*/
- public function testConfigOverride() {
+ public function testConfigOverride(): void {
/** @var \Drupal\Core\Config\Entity\ConfigEntityStorage $storage */
$storage = \Drupal::entityTypeManager()->getStorage($this->entityTypeId);
// Prime the cache prior to adding a config override.
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php
index b97afec1329..6d0fd3cb5f1 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php
@@ -23,7 +23,7 @@ class ConfigEntityStatusTest extends KernelTestBase {
/**
* Tests the enabling/disabling of entities.
*/
- public function testCRUD() {
+ public function testCRUD(): void {
$entity = \Drupal::entityTypeManager()->getStorage('config_test')->create([
'id' => $this->randomMachineName(),
]);
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStorageTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStorageTest.php
index aaa68aec21a..981e1b451a4 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStorageTest.php
@@ -24,7 +24,7 @@ class ConfigEntityStorageTest extends KernelTestBase {
/**
* Tests creating configuration entities with changed UUIDs.
*/
- public function testUUIDConflict() {
+ public function testUUIDConflict(): void {
$entity_type = 'config_test';
$id = 'test_1';
// Load the original configuration entity.
@@ -57,7 +57,7 @@ class ConfigEntityStorageTest extends KernelTestBase {
*
* @covers \Drupal\Core\Config\Entity\ConfigEntityStorage::hasData
*/
- public function testHasData() {
+ public function testHasData(): void {
$storage = \Drupal::entityTypeManager()->getStorage('config_test');
$this->assertFalse($storage->hasData());
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityUnitTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityUnitTest.php
index 26c98c8ec42..2195b56e5b8 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityUnitTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityUnitTest.php
@@ -47,7 +47,7 @@ class ConfigEntityUnitTest extends KernelTestBase {
/**
* Tests storage methods.
*/
- public function testStorageMethods() {
+ public function testStorageMethods(): void {
$entity_type = \Drupal::entityTypeManager()->getDefinition('config_test');
// Test the static extractID() method.
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigEventsTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigEventsTest.php
index ce8bbacd0b1..338de54aedb 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEventsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEventsTest.php
@@ -25,7 +25,7 @@ class ConfigEventsTest extends KernelTestBase {
/**
* Tests configuration events.
*/
- public function testConfigEvents() {
+ public function testConfigEvents(): void {
$name = 'config_events_test.test';
$config = new Config($name, \Drupal::service('config.storage'), \Drupal::service('event_dispatcher'), \Drupal::service('config.typed'));
@@ -57,7 +57,7 @@ class ConfigEventsTest extends KernelTestBase {
/**
* Tests configuration rename event that is fired from the ConfigFactory.
*/
- public function testConfigRenameEvent() {
+ public function testConfigRenameEvent(): void {
$name = 'config_events_test.test';
$new_name = 'config_events_test.test_rename';
$GLOBALS['config'][$name] = ['key' => 'overridden'];
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigExportStorageTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigExportStorageTest.php
index da1af33e63e..1c559822b03 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigExportStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigExportStorageTest.php
@@ -31,7 +31,7 @@ class ConfigExportStorageTest extends KernelTestBase {
/**
* Tests configuration override.
*/
- public function testExportStorage() {
+ public function testExportStorage(): void {
/** @var \Drupal\Core\Config\StorageInterface $active */
$active = $this->container->get('config.storage');
/** @var \Drupal\Core\Config\StorageInterface $export */
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php
index a68d87435ea..6de861d7945 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php
@@ -27,7 +27,7 @@ class ConfigFileContentTest extends KernelTestBase {
/**
* Tests setting, writing, and reading of a configuration setting.
*/
- public function testReadWriteConfig() {
+ public function testReadWriteConfig(): void {
$storage = $this->container->get('config.storage');
$name = 'foo.bar';
@@ -190,7 +190,7 @@ class ConfigFileContentTest extends KernelTestBase {
/**
* Tests serialization of configuration to file.
*/
- public function testSerialization() {
+ public function testSerialization(): void {
$name = $this->randomMachineName(10) . '.' . $this->randomMachineName(10);
$config_data = [
// Indexed arrays; the order of elements is essential.
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php
index cdb689f013f..48aa85b29a6 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php
@@ -61,7 +61,7 @@ class ConfigImportRecreateTest extends KernelTestBase {
);
}
- public function testRecreateEntity() {
+ public function testRecreateEntity(): void {
$type_name = $this->randomMachineName(16);
$content_type = NodeType::create([
'type' => $type_name,
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php
index 7dce04602ea..326e2a823d9 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php
@@ -73,7 +73,7 @@ class ConfigImportRenameValidationTest extends KernelTestBase {
/**
* Tests configuration renaming validation.
*/
- public function testRenameValidation() {
+ public function testRenameValidation(): void {
// Create a test entity.
$test_entity_id = $this->randomMachineName();
$test_entity = \Drupal::entityTypeManager()->getStorage('config_test')->create([
@@ -123,7 +123,7 @@ class ConfigImportRenameValidationTest extends KernelTestBase {
/**
* Tests configuration renaming validation for simple configuration.
*/
- public function testRenameSimpleConfigValidation() {
+ public function testRenameSimpleConfigValidation(): void {
$uuid = new Php();
// Create a simple configuration with a UUID.
$config = $this->config('config_test.new');
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterMissingContentTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterMissingContentTest.php
index b76e2e00fce..2ab178cbaf6 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterMissingContentTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterMissingContentTest.php
@@ -105,7 +105,7 @@ class ConfigImporterMissingContentTest extends KernelTestBase implements LoggerI
* @see \Drupal\Core\Config\ConfigImporter::processMissingContent()
* @see \Drupal\config_import_test\EventSubscriber
*/
- public function testMissingContent() {
+ public function testMissingContent(): void {
\Drupal::state()->set('config_import_test.config_import_missing_content', TRUE);
// Update a configuration entity in the sync directory to have a dependency
@@ -143,7 +143,7 @@ class ConfigImporterMissingContentTest extends KernelTestBase implements LoggerI
* @see \Drupal\Core\Config\ConfigImporter::processMissingContent()
* @see \Drupal\config_import_test\EventSubscriber
*/
- public function testMissingBlockContent() {
+ public function testMissingBlockContent(): void {
$this->enableModules([
'block',
'block_content',
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php
index 2f588e3fff9..620126e5012 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php
@@ -49,7 +49,7 @@ class ConfigImporterTest extends KernelTestBase {
/**
* Tests omission of module APIs for bare configuration operations.
*/
- public function testNoImport() {
+ public function testNoImport(): void {
$dynamic_name = 'config_test.dynamic.dotted.default';
// Verify the default configuration values exist.
@@ -63,7 +63,7 @@ class ConfigImporterTest extends KernelTestBase {
/**
* Tests that trying to import from empty sync configuration directory fails.
*/
- public function testEmptyImportFails() {
+ public function testEmptyImportFails(): void {
$this->expectException(ConfigImporterException::class);
$this->container->get('config.storage.sync')->deleteAll();
$this->configImporter()->import();
@@ -72,7 +72,7 @@ class ConfigImporterTest extends KernelTestBase {
/**
* Tests verification of site UUID before importing configuration.
*/
- public function testSiteUuidValidate() {
+ public function testSiteUuidValidate(): void {
$sync = \Drupal::service('config.storage.sync');
// Create updated configuration object.
$config_data = $this->config('system.site')->get();
@@ -102,7 +102,7 @@ class ConfigImporterTest extends KernelTestBase {
/**
* Tests deletion of configuration during import.
*/
- public function testDeleted() {
+ public function testDeleted(): void {
$dynamic_name = 'config_test.dynamic.dotted.default';
$storage = $this->container->get('config.storage');
$sync = $this->container->get('config.storage.sync');
@@ -140,7 +140,7 @@ class ConfigImporterTest extends KernelTestBase {
/**
* Tests creation of configuration during import.
*/
- public function testNew() {
+ public function testNew(): void {
$dynamic_name = 'config_test.dynamic.new';
$storage = $this->container->get('config.storage');
$sync = $this->container->get('config.storage.sync');
@@ -195,7 +195,7 @@ class ConfigImporterTest extends KernelTestBase {
/**
* Tests that secondary writes are overwritten.
*/
- public function testSecondaryWritePrimaryFirst() {
+ public function testSecondaryWritePrimaryFirst(): void {
$name_primary = 'config_test.dynamic.primary';
$name_secondary = 'config_test.dynamic.secondary';
$sync = $this->container->get('config.storage.sync');
@@ -242,7 +242,7 @@ class ConfigImporterTest extends KernelTestBase {
/**
* Tests that secondary writes are overwritten.
*/
- public function testSecondaryWriteSecondaryFirst() {
+ public function testSecondaryWriteSecondaryFirst(): void {
$name_primary = 'config_test.dynamic.primary';
$name_secondary = 'config_test.dynamic.secondary';
$sync = $this->container->get('config.storage.sync');
@@ -289,7 +289,7 @@ class ConfigImporterTest extends KernelTestBase {
/**
* Tests that secondary updates for deleted files work as expected.
*/
- public function testSecondaryUpdateDeletedParentFirst() {
+ public function testSecondaryUpdateDeletedParentFirst(): void {
$name_dependency = 'config_test.dynamic.dependency';
$name_dependent = 'config_test.dynamic.dependent';
$name_other = 'config_test.dynamic.other';
@@ -376,7 +376,7 @@ class ConfigImporterTest extends KernelTestBase {
* configuration tree imports. Therefore, any configuration updates that cause
* secondary deletes should be reflected already in the staged configuration.
*/
- public function testSecondaryUpdateDeletedChildFirst() {
+ public function testSecondaryUpdateDeletedChildFirst(): void {
$name_dependency = 'config_test.dynamic.dependency';
$name_dependent = 'config_test.dynamic.dependent';
$storage = $this->container->get('config.storage');
@@ -423,7 +423,7 @@ class ConfigImporterTest extends KernelTestBase {
/**
* Tests that secondary deletes for deleted files work as expected.
*/
- public function testSecondaryDeletedChildSecond() {
+ public function testSecondaryDeletedChildSecond(): void {
$name_dependency = 'config_test.dynamic.dependency';
$name_dependent = 'config_test.dynamic.dependent';
$storage = $this->container->get('config.storage');
@@ -466,7 +466,7 @@ class ConfigImporterTest extends KernelTestBase {
/**
* Tests updating of configuration during import.
*/
- public function testUpdated() {
+ public function testUpdated(): void {
$name = 'config_test.system';
$dynamic_name = 'config_test.dynamic.dotted.default';
$storage = $this->container->get('config.storage');
@@ -524,7 +524,7 @@ class ConfigImporterTest extends KernelTestBase {
/**
* Tests the isInstallable method()
*/
- public function testIsInstallable() {
+ public function testIsInstallable(): void {
$config_name = 'config_test.dynamic.isinstallable';
$this->assertFalse($this->container->get('config.storage')->exists($config_name));
\Drupal::state()->set('config_test.isinstallable', TRUE);
@@ -538,7 +538,7 @@ class ConfigImporterTest extends KernelTestBase {
* @see \Drupal\Core\EventSubscriber\ConfigImportSubscriber
* @see \Drupal\Core\Config\ConfigImporter::createExtensionChangelist()
*/
- public function testUnmetDependency() {
+ public function testUnmetDependency(): void {
$storage = $this->container->get('config.storage');
$sync = $this->container->get('config.storage.sync');
@@ -650,7 +650,7 @@ class ConfigImporterTest extends KernelTestBase {
*
* @see \Drupal\Core\EventSubscriber\ConfigImportSubscriber
*/
- public function testMissingCoreExtension() {
+ public function testMissingCoreExtension(): void {
$sync = $this->container->get('config.storage.sync');
$sync->delete('core.extension');
$config_importer = $this->configImporter();
@@ -671,7 +671,7 @@ class ConfigImporterTest extends KernelTestBase {
*
* @see \Drupal\Core\EventSubscriber\ConfigImportSubscriber
*/
- public function testRequiredModuleValidation() {
+ public function testRequiredModuleValidation(): void {
$sync = $this->container->get('config.storage.sync');
$extensions = $sync->read('core.extension');
@@ -695,7 +695,7 @@ class ConfigImporterTest extends KernelTestBase {
*
* @see \Drupal\Core\EventSubscriber\ConfigImportSubscriber
*/
- public function testInstallBaseAndSubThemes() {
+ public function testInstallBaseAndSubThemes(): void {
$sync = $this->container->get('config.storage.sync');
$extensions = $sync->read('core.extension');
$extensions['theme']['test_basetheme'] = 0;
@@ -726,7 +726,7 @@ class ConfigImporterTest extends KernelTestBase {
*
* @see \Drupal\Core\EventSubscriber\ConfigImportSubscriber
*/
- public function testInstallProfile() {
+ public function testInstallProfile(): void {
$sync = $this->container->get('config.storage.sync');
$extensions = $sync->read('core.extension');
@@ -753,7 +753,7 @@ class ConfigImporterTest extends KernelTestBase {
*
* @see \Drupal\Core\EventSubscriber\ConfigImportSubscriber
*/
- public function testInstallProfileMisMatch() {
+ public function testInstallProfileMisMatch(): void {
// Install profiles can not be changed. They can only be uninstalled. We
// need to set an install profile prior to testing because KernelTestBase
// tests do not use one.
@@ -781,7 +781,7 @@ class ConfigImporterTest extends KernelTestBase {
/**
* Tests the isSyncing flags.
*/
- public function testIsSyncingInHooks() {
+ public function testIsSyncingInHooks(): void {
$dynamic_name = 'config_test.dynamic.dotted.default';
$storage = $this->container->get('config.storage');
@@ -880,7 +880,7 @@ class ConfigImporterTest extends KernelTestBase {
/**
* Tests that the isConfigSyncing flag is cleanup after an invalid step.
*/
- public function testInvalidStep() {
+ public function testInvalidStep(): void {
$this->assertFalse(\Drupal::isConfigSyncing(), 'Before an import \Drupal::isConfigSyncing() returns FALSE');
$context = [];
$config_importer = $this->configImporter();
@@ -897,7 +897,7 @@ class ConfigImporterTest extends KernelTestBase {
/**
* Tests that the isConfigSyncing flag is set correctly during a custom step.
*/
- public function testCustomStep() {
+ public function testCustomStep(): void {
$this->assertFalse(\Drupal::isConfigSyncing(), 'Before an import \Drupal::isConfigSyncing() returns FALSE');
$context = [];
$this->configImporter()->doSyncStep(self::customStep(...), $context);
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigInstallTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigInstallTest.php
index 5587ff1daca..66c977c4414 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigInstallTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigInstallTest.php
@@ -37,7 +37,7 @@ class ConfigInstallTest extends KernelTestBase {
/**
* Tests module installation.
*/
- public function testModuleInstallation() {
+ public function testModuleInstallation(): void {
$default_config = 'config_test.system';
$default_configuration_entity = 'config_test.dynamic.dotted.default';
@@ -87,7 +87,7 @@ class ConfigInstallTest extends KernelTestBase {
/**
* Tests that collections are ignored if the event does not return anything.
*/
- public function testCollectionInstallationNoCollections() {
+ public function testCollectionInstallationNoCollections(): void {
// Install the test module.
$this->enableModules(['config_collection_install_test']);
$this->installConfig(['config_collection_install_test']);
@@ -99,7 +99,7 @@ class ConfigInstallTest extends KernelTestBase {
/**
* Tests config objects in collections are installed as expected.
*/
- public function testCollectionInstallationCollections() {
+ public function testCollectionInstallationCollections(): void {
$collections = [
'another_collection',
'collection.test1',
@@ -178,7 +178,7 @@ class ConfigInstallTest extends KernelTestBase {
* matching name but does not support config entities it should be created
* using simple configuration.
*/
- public function testCollectionInstallationCollectionConfigEntity() {
+ public function testCollectionInstallationCollectionConfigEntity(): void {
$collections = [
'entity',
];
@@ -205,7 +205,7 @@ class ConfigInstallTest extends KernelTestBase {
/**
* Tests the configuration with unmet dependencies is not installed.
*/
- public function testDependencyChecking() {
+ public function testDependencyChecking(): void {
$this->installModules(['config_test']);
try {
$this->installModules(['config_install_dependency_test']);
@@ -247,7 +247,7 @@ class ConfigInstallTest extends KernelTestBase {
/**
* Tests imported configuration entities with/without language information.
*/
- public function testLanguage() {
+ public function testLanguage(): void {
$this->installModules(['config_test_language']);
// Test imported configuration with implicit language code.
$storage = new InstallStorage();
@@ -264,7 +264,7 @@ class ConfigInstallTest extends KernelTestBase {
/**
* Tests installing configuration where the filename and ID do not match.
*/
- public function testIdMisMatch() {
+ public function testIdMisMatch(): void {
$this->expectException(\LogicException::class);
$this->expectExceptionMessage('The configuration name "config_test.dynamic.no_id_match" does not match the ID "does_not_match"');
$this->installModules(['config_test_id_mismatch']);
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigLanguageOverrideTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigLanguageOverrideTest.php
index 3b49870ef1b..fc72ccf4258 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigLanguageOverrideTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigLanguageOverrideTest.php
@@ -38,7 +38,7 @@ class ConfigLanguageOverrideTest extends KernelTestBase {
/**
* Tests locale override based on language.
*/
- public function testConfigLanguageOverride() {
+ public function testConfigLanguageOverride(): void {
// The language module implements a config factory override object that
// overrides configuration when the Language module is enabled. This test ensures that
// English overrides work.
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigModuleOverridesTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigModuleOverridesTest.php
index 12cb8e35a9e..a1dbb2ca6c2 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigModuleOverridesTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigModuleOverridesTest.php
@@ -20,7 +20,7 @@ class ConfigModuleOverridesTest extends KernelTestBase {
*/
protected static $modules = ['system', 'config', 'config_override_test'];
- public function testSimpleModuleOverrides() {
+ public function testSimpleModuleOverrides(): void {
$GLOBALS['config_test_run_module_overrides'] = TRUE;
$name = 'system.site';
$overridden_name = 'Wow overridden site name';
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigOverrideTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigOverrideTest.php
index ea595dc3360..85117c48843 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigOverrideTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigOverrideTest.php
@@ -32,7 +32,7 @@ class ConfigOverrideTest extends KernelTestBase {
/**
* Tests configuration override.
*/
- public function testConfOverride() {
+ public function testConfOverride(): void {
$expected_original_data = [
'foo' => 'bar',
'baz' => NULL,
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigOverridesPriorityTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigOverridesPriorityTest.php
index 3e4e5bc0af5..67fcaacd2b4 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigOverridesPriorityTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigOverridesPriorityTest.php
@@ -32,7 +32,7 @@ class ConfigOverridesPriorityTest extends KernelTestBase {
'language',
];
- public function testOverridePriorities() {
+ public function testOverridePriorities(): void {
$GLOBALS['config_test_run_module_overrides'] = FALSE;
$non_overridden_mail = 'site@example.com';
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaDeprecationTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaDeprecationTest.php
index d2068e1696c..d09ee7846ec 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaDeprecationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaDeprecationTest.php
@@ -24,7 +24,7 @@ class ConfigSchemaDeprecationTest extends KernelTestBase {
/**
* Tests config schema deprecation.
*/
- public function testConfigSchemaDeprecation() {
+ public function testConfigSchemaDeprecation(): void {
$this->expectDeprecation('The \'complex_structure_deprecated\' config schema is deprecated in drupal:9.1.0 and is removed from drupal 10.0.0. Use the \'complex_structure\' config schema instead. See http://drupal.org/node/the-change-notice-nid.');
$config = $this->config('config_schema_deprecated_test.settings');
$config
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
index 90763605718..5de26c1c230 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
@@ -48,7 +48,7 @@ class ConfigSchemaTest extends KernelTestBase {
/**
* Tests the basic metadata retrieval layer.
*/
- public function testSchemaMapping() {
+ public function testSchemaMapping(): void {
// Nonexistent configuration key will have Undefined as metadata.
$this->assertFalse(\Drupal::service('config.typed')->hasConfigSchema('config_schema_test.no_such_key'));
$definition = \Drupal::service('config.typed')->getDefinition('config_schema_test.no_such_key');
@@ -320,7 +320,7 @@ class ConfigSchemaTest extends KernelTestBase {
/**
* Tests metadata retrieval with several levels of %parent indirection.
*/
- public function testSchemaMappingWithParents() {
+ public function testSchemaMappingWithParents(): void {
$config_data = \Drupal::service('config.typed')->get('config_schema_test.some_schema.with_parents');
// Test fetching parent one level up.
@@ -366,7 +366,7 @@ class ConfigSchemaTest extends KernelTestBase {
/**
* Tests metadata applied to configuration objects.
*/
- public function testSchemaData() {
+ public function testSchemaData(): void {
// Try a simple property.
$meta = \Drupal::service('config.typed')->get('system.site');
$property = $meta->get('page')->get('front');
@@ -414,7 +414,7 @@ class ConfigSchemaTest extends KernelTestBase {
/**
* Tests configuration value data type enforcement using schemas.
*/
- public function testConfigSaveWithSchema() {
+ public function testConfigSaveWithSchema(): void {
$untyped_values = [
// Test a custom type.
'config_schema_test_integer' => '1',
@@ -484,7 +484,7 @@ class ConfigSchemaTest extends KernelTestBase {
/**
* Test configuration value data type enforcement using schemas.
*/
- public function testConfigSaveMappingSort() {
+ public function testConfigSaveMappingSort(): void {
// Top level map sorting.
$data = [
'foo' => '1',
@@ -502,7 +502,7 @@ class ConfigSchemaTest extends KernelTestBase {
/**
* Tests configuration sequence sorting using schemas.
*/
- public function testConfigSaveWithSequenceSorting() {
+ public function testConfigSaveWithSequenceSorting(): void {
$data = [
'keyed_sort' => [
'b' => '1',
@@ -572,7 +572,7 @@ class ConfigSchemaTest extends KernelTestBase {
/**
* Tests fallback to a greedy wildcard.
*/
- public function testSchemaFallback() {
+ public function testSchemaFallback(): void {
$definition = \Drupal::service('config.typed')->getDefinition('config_schema_test.wildcard_fallback.something');
// This should be the schema of config_schema_test.wildcard_fallback.*.
$expected = [];
@@ -607,7 +607,7 @@ class ConfigSchemaTest extends KernelTestBase {
*
* @see \Drupal\Core\Config\TypedConfigManager::getFallbackName()
*/
- public function testColonsInSchemaTypeDetermination() {
+ public function testColonsInSchemaTypeDetermination(): void {
$tests = \Drupal::service('config.typed')->get('config_schema_test.plugin_types')->get('tests')->getElements();
$definition = $tests[0]->getDataDefinition()->toArray();
$this->assertEquals('test.plugin_types.boolean', $definition['type']);
@@ -638,7 +638,7 @@ class ConfigSchemaTest extends KernelTestBase {
/**
* Tests hook_config_schema_info_alter().
*/
- public function testConfigSchemaInfoAlter() {
+ public function testConfigSchemaInfoAlter(): void {
/** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config */
$typed_config = \Drupal::service('config.typed');
$typed_config->clearCachedDefinitions();
@@ -682,7 +682,7 @@ class ConfigSchemaTest extends KernelTestBase {
/**
* Tests saving config when the type is wrapped by a dynamic type.
*/
- public function testConfigSaveWithWrappingSchema() {
+ public function testConfigSaveWithWrappingSchema(): void {
$untyped_values = [
'tests' => [
[
@@ -713,7 +713,7 @@ class ConfigSchemaTest extends KernelTestBase {
/**
* Tests dynamic config schema type with multiple sub-key references.
*/
- public function testConfigSaveWithWrappingSchemaDoubleBrackets() {
+ public function testConfigSaveWithWrappingSchemaDoubleBrackets(): void {
$untyped_values = [
'tests' => [
[
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigSnapshotTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigSnapshotTest.php
index d28e8a342cc..12f87482d90 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigSnapshotTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSnapshotTest.php
@@ -36,7 +36,7 @@ class ConfigSnapshotTest extends KernelTestBase {
/**
* Tests config snapshot creation and updating.
*/
- public function testSnapshot() {
+ public function testSnapshot(): void {
$active = $this->container->get('config.storage');
$sync = $this->container->get('config.storage.sync');
$snapshot = $this->container->get('config.storage.snapshot');
diff --git a/core/tests/Drupal/KernelTests/Core/Config/Entity/ConfigEntityUpdaterTest.php b/core/tests/Drupal/KernelTests/Core/Config/Entity/ConfigEntityUpdaterTest.php
index 4ba44d26d07..142c1b97586 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/Entity/ConfigEntityUpdaterTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/Entity/ConfigEntityUpdaterTest.php
@@ -26,7 +26,7 @@ class ConfigEntityUpdaterTest extends KernelTestBase {
/**
* @covers ::update
*/
- public function testUpdate() {
+ public function testUpdate(): void {
// Create some entities to update.
$storage = $this->container->get('entity_type.manager')->getStorage('config_test');
for ($i = 0; $i < 15; $i++) {
@@ -79,7 +79,7 @@ class ConfigEntityUpdaterTest extends KernelTestBase {
/**
* @covers ::update
*/
- public function testUpdateDefaultCallback() {
+ public function testUpdateDefaultCallback(): void {
// Create some entities to update.
$storage = $this->container->get('entity_type.manager')->getStorage('config_test');
for ($i = 0; $i < 15; $i++) {
@@ -119,7 +119,7 @@ class ConfigEntityUpdaterTest extends KernelTestBase {
/**
* @covers ::update
*/
- public function testUpdateException() {
+ public function testUpdateException(): void {
$this->enableModules(['entity_test']);
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('The provided entity type ID \'entity_test_mul_changed\' is not a configuration entity type');
@@ -131,7 +131,7 @@ class ConfigEntityUpdaterTest extends KernelTestBase {
/**
* @covers ::update
*/
- public function testUpdateOncePerUpdateException() {
+ public function testUpdateOncePerUpdateException(): void {
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('Updating multiple entity types in the same update function is not supported');
$updater = $this->container->get('class_resolver')->getInstanceFromDefinition(ConfigEntityUpdater::class);
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ExcludedModulesEventSubscriberTest.php b/core/tests/Drupal/KernelTests/Core/Config/ExcludedModulesEventSubscriberTest.php
index ed778a83a57..469c6e76478 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ExcludedModulesEventSubscriberTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ExcludedModulesEventSubscriberTest.php
@@ -34,7 +34,7 @@ class ExcludedModulesEventSubscriberTest extends KernelTestBase {
/**
* Tests excluding modules from the config export.
*/
- public function testExcludedModules() {
+ public function testExcludedModules(): void {
// Assert that config_test is in the active config.
$active = $this->container->get('config.storage');
$this->assertNotEmpty($active->listAll('config_test.'));
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ExportStorageManagerTest.php b/core/tests/Drupal/KernelTests/Core/Config/ExportStorageManagerTest.php
index b71c69d82bd..2a2c549bf89 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ExportStorageManagerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ExportStorageManagerTest.php
@@ -37,7 +37,7 @@ class ExportStorageManagerTest extends KernelTestBase {
/**
* Tests getting the export storage.
*/
- public function testGetStorage() {
+ public function testGetStorage(): void {
// Get the raw system.site config and set it in the sync storage.
$rawConfig = $this->config('system.site')->getRawData();
$this->container->get('config.storage.sync')->write('system.site', $rawConfig);
@@ -81,7 +81,7 @@ class ExportStorageManagerTest extends KernelTestBase {
/**
* Tests the export storage when it is locked.
*/
- public function testGetStorageLock() {
+ public function testGetStorageLock(): void {
$lock = $this->createMock('Drupal\Core\Lock\LockBackendInterface');
$lock->expects($this->exactly(2))
->method('acquire')
diff --git a/core/tests/Drupal/KernelTests/Core/Config/FileStorageFactoryTest.php b/core/tests/Drupal/KernelTests/Core/Config/FileStorageFactoryTest.php
index 3fa20b39f81..306ebe7359c 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/FileStorageFactoryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/FileStorageFactoryTest.php
@@ -19,7 +19,7 @@ class FileStorageFactoryTest extends KernelTestBase {
/**
* @covers ::getSync
*/
- public function testGetSync() {
+ public function testGetSync(): void {
// Write some random data to the sync storage.
$name = $this->randomMachineName();
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ImportStorageTransformerTest.php b/core/tests/Drupal/KernelTests/Core/Config/ImportStorageTransformerTest.php
index f88cd03242c..af87421ca55 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ImportStorageTransformerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ImportStorageTransformerTest.php
@@ -39,7 +39,7 @@ class ImportStorageTransformerTest extends KernelTestBase {
/**
* Tests the import transformation.
*/
- public function testTransform() {
+ public function testTransform(): void {
// Get the raw system.site config and set it in the sync storage.
$rawConfig = $this->config('system.site')->getRawData();
@@ -67,7 +67,7 @@ class ImportStorageTransformerTest extends KernelTestBase {
/**
* Tests that the import transformer throws an exception.
*/
- public function testTransformLocked() {
+ public function testTransformLocked(): void {
// Mock the request lock not being available.
$lock = $this->createMock('Drupal\Core\Lock\LockBackendInterface');
$lock->expects($this->exactly(2))
@@ -94,7 +94,7 @@ class ImportStorageTransformerTest extends KernelTestBase {
/**
* Tests the import transformer during a running config import.
*/
- public function testTransformWhileImporting() {
+ public function testTransformWhileImporting(): void {
// Set up the database table with the current active config.
// This simulates the config importer having its transformation done.
$storage = $this->container->get('config.import_transformer')->transform($this->container->get('config.storage'));
diff --git a/core/tests/Drupal/KernelTests/Core/Config/SchemaCheckTraitTest.php b/core/tests/Drupal/KernelTests/Core/Config/SchemaCheckTraitTest.php
index e4e551f72d3..5fa03772474 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/SchemaCheckTraitTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/SchemaCheckTraitTest.php
@@ -44,7 +44,7 @@ class SchemaCheckTraitTest extends KernelTestBase {
*
* @dataProvider providerCheckConfigSchema
*/
- public function testCheckConfigSchema(string $type_to_validate_against, bool $validate_constraints, array|bool $nulled_expectations, array|bool $no_data_expectations, array $expectations) {
+ public function testCheckConfigSchema(string $type_to_validate_against, bool $validate_constraints, array|bool $nulled_expectations, array|bool $no_data_expectations, array $expectations): void {
// Test a non existing schema.
$ret = $this->checkConfigSchema($this->typedConfig, 'config_schema_test.no_schema', $this->config('config_schema_test.no_schema')->get());
$this->assertFalse($ret);
diff --git a/core/tests/Drupal/KernelTests/Core/Config/Storage/CachedStorageTest.php b/core/tests/Drupal/KernelTests/Core/Config/Storage/CachedStorageTest.php
index b78fcb1a556..f3a06135d9d 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/Storage/CachedStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/Storage/CachedStorageTest.php
@@ -44,7 +44,7 @@ class CachedStorageTest extends ConfigStorageTestBase {
/**
* {@inheritdoc}
*/
- public function testInvalidStorage() {
+ public function testInvalidStorage(): void {
$this->markTestSkipped('No-op as this test does not make sense');
}
diff --git a/core/tests/Drupal/KernelTests/Core/Config/Storage/ConfigStorageTestBase.php b/core/tests/Drupal/KernelTests/Core/Config/Storage/ConfigStorageTestBase.php
index 0879e06ffc5..6b8c3105172 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/Storage/ConfigStorageTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/Storage/ConfigStorageTestBase.php
@@ -35,7 +35,7 @@ abstract class ConfigStorageTestBase extends KernelTestBase {
*
* @todo Coverage: Trigger PDOExceptions / Database exceptions.
*/
- public function testCRUD() {
+ public function testCRUD(): void {
$name = 'config_test.storage';
// Checking whether a non-existing name exists returns FALSE.
@@ -122,7 +122,7 @@ abstract class ConfigStorageTestBase extends KernelTestBase {
/**
* Tests an invalid storage.
*/
- public function testInvalidStorage() {
+ public function testInvalidStorage(): void {
$name = 'config_test.storage';
// Write something to the valid storage to prove that the storages do not
@@ -164,7 +164,7 @@ abstract class ConfigStorageTestBase extends KernelTestBase {
/**
* Tests storage writing and reading data preserving data type.
*/
- public function testDataTypes() {
+ public function testDataTypes(): void {
$name = 'config_test.types';
$data = [
'array' => [],
@@ -188,7 +188,7 @@ abstract class ConfigStorageTestBase extends KernelTestBase {
/**
* Tests that the storage supports collections.
*/
- public function testCollection() {
+ public function testCollection(): void {
$name = 'config_test.storage';
$data = ['foo' => 'bar'];
$result = $this->storage->write($name, $data);
diff --git a/core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php b/core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php
index 813b49a97fd..e8c1f674950 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php
@@ -45,7 +45,7 @@ class DatabaseStorageTest extends ConfigStorageTestBase {
/**
* Tests that operations throw exceptions if the query fails.
*/
- public function testExceptionIsThrownIfQueryFails() {
+ public function testExceptionIsThrownIfQueryFails(): void {
$connection = Database::getConnection();
if ($connection->databaseType() === 'sqlite') {
// See: https://www.drupal.org/project/drupal/issues/3349286
diff --git a/core/tests/Drupal/KernelTests/Core/Config/Storage/FileStorageTest.php b/core/tests/Drupal/KernelTests/Core/Config/Storage/FileStorageTest.php
index 6438cf00df9..8d63645761e 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/Storage/FileStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/Storage/FileStorageTest.php
@@ -58,7 +58,7 @@ class FileStorageTest extends ConfigStorageTestBase {
/**
* Tests the FileStorage::listAll method with a relative and absolute path.
*/
- public function testListAll() {
+ public function testListAll(): void {
$expected_files = [
'core.extension',
'system.performance',
@@ -77,7 +77,7 @@ class FileStorageTest extends ConfigStorageTestBase {
/**
* Tests UnsupportedDataTypeConfigException.
*/
- public function testUnsupportedDataTypeConfigException() {
+ public function testUnsupportedDataTypeConfigException(): void {
$name = 'core.extension';
$path = $this->storage->getFilePath($name);
$this->expectException(UnsupportedDataTypeConfigException::class);
diff --git a/core/tests/Drupal/KernelTests/Core/Config/Storage/ManagedStorageTest.php b/core/tests/Drupal/KernelTests/Core/Config/Storage/ManagedStorageTest.php
index 4999fedd548..094f08b8454 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/Storage/ManagedStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/Storage/ManagedStorageTest.php
@@ -63,7 +63,7 @@ class ManagedStorageTest extends ConfigStorageTestBase implements StorageManager
/**
* {@inheritdoc}
*/
- public function testInvalidStorage() {
+ public function testInvalidStorage(): void {
$this->markTestSkipped('ManagedStorage cannot be invalid.');
}
diff --git a/core/tests/Drupal/KernelTests/Core/Config/Storage/MemoryStorageTest.php b/core/tests/Drupal/KernelTests/Core/Config/Storage/MemoryStorageTest.php
index 8ed48541225..3848b8eacc7 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/Storage/MemoryStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/Storage/MemoryStorageTest.php
@@ -52,7 +52,7 @@ class MemoryStorageTest extends ConfigStorageTestBase {
/**
* {@inheritdoc}
*/
- public function testInvalidStorage() {
+ public function testInvalidStorage(): void {
$this->markTestSkipped('MemoryStorage cannot be invalid.');
}
diff --git a/core/tests/Drupal/KernelTests/Core/Config/Storage/StorageReplaceDataWrapperTest.php b/core/tests/Drupal/KernelTests/Core/Config/Storage/StorageReplaceDataWrapperTest.php
index 15c287e45b3..0688e3e3df7 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/Storage/StorageReplaceDataWrapperTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/Storage/StorageReplaceDataWrapperTest.php
@@ -53,7 +53,7 @@ class StorageReplaceDataWrapperTest extends ConfigStorageTestBase {
/**
* {@inheritdoc}
*/
- public function testInvalidStorage() {
+ public function testInvalidStorage(): void {
$this->markTestSkipped('No-op as this test does not make sense');
}
@@ -65,7 +65,7 @@ class StorageReplaceDataWrapperTest extends ConfigStorageTestBase {
*
* @dataProvider providerCollections
*/
- public function testCreateCollection($collection) {
+ public function testCreateCollection($collection): void {
$initial_collection_name = $this->storage->getCollectionName();
// Create new storage with given collection and check it is set correctly.
diff --git a/core/tests/Drupal/KernelTests/Core/Controller/ControllerBaseTest.php b/core/tests/Drupal/KernelTests/Core/Controller/ControllerBaseTest.php
index d463740e17c..499b6efd87c 100644
--- a/core/tests/Drupal/KernelTests/Core/Controller/ControllerBaseTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Controller/ControllerBaseTest.php
@@ -27,7 +27,7 @@ class ControllerBaseTest extends KernelTestBase {
/**
* @covers ::create
*/
- public function testCreate() {
+ public function testCreate(): void {
/** @var \Drupal\system_test\Controller\SystemTestController $controller */
$controller = $this->container->get('class_resolver')->getInstanceFromDefinition(SystemTestController::class);
@@ -48,7 +48,7 @@ class ControllerBaseTest extends KernelTestBase {
/**
* @covers ::create
*/
- public function testCreateException() {
+ public function testCreateException(): void {
$this->expectException(AutowiringFailedException::class);
$this->expectExceptionMessage('Cannot autowire service "Drupal\Core\Lock\LockBackendInterface": argument "$lock" of method "Drupal\system_test\Controller\BrokenSystemTestController::_construct()", you should configure its value explicitly.');
$this->container->get('class_resolver')->getInstanceFromDefinition(BrokenSystemTestController::class);
diff --git a/core/tests/Drupal/KernelTests/Core/Database/AlterTest.php b/core/tests/Drupal/KernelTests/Core/Database/AlterTest.php
index 0c69abec2a4..d091a5bac80 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/AlterTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/AlterTest.php
@@ -15,7 +15,7 @@ class AlterTest extends DatabaseTestBase {
/**
* Tests that we can do basic alters.
*/
- public function testSimpleAlter() {
+ public function testSimpleAlter(): void {
$query = $this->connection->select('test');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
@@ -29,7 +29,7 @@ class AlterTest extends DatabaseTestBase {
/**
* Tests that we can alter the joins on a query.
*/
- public function testAlterWithJoin() {
+ public function testAlterWithJoin(): void {
$query = $this->connection->select('test_task');
$tid_field = $query->addField('test_task', 'tid');
$task_field = $query->addField('test_task', 'task');
@@ -53,7 +53,7 @@ class AlterTest extends DatabaseTestBase {
/**
* Tests that we can alter a query's conditionals.
*/
- public function testAlterChangeConditional() {
+ public function testAlterChangeConditional(): void {
$query = $this->connection->select('test_task');
$tid_field = $query->addField('test_task', 'tid');
$pid_field = $query->addField('test_task', 'pid');
@@ -78,7 +78,7 @@ class AlterTest extends DatabaseTestBase {
/**
* Tests that we can alter the fields of a query.
*/
- public function testAlterChangeFields() {
+ public function testAlterChangeFields(): void {
$query = $this->connection->select('test');
$name_field = $query->addField('test', 'name');
$age_field = $query->addField('test', 'age', 'age');
@@ -93,7 +93,7 @@ class AlterTest extends DatabaseTestBase {
/**
* Tests that we can alter expressions in the query.
*/
- public function testAlterExpression() {
+ public function testAlterExpression(): void {
$query = $this->connection->select('test');
$name_field = $query->addField('test', 'name');
$age_field = $query->addExpression("[age]*2", 'double_age');
@@ -113,7 +113,7 @@ class AlterTest extends DatabaseTestBase {
*
* This also tests hook_query_TAG_alter().
*/
- public function testAlterRemoveRange() {
+ public function testAlterRemoveRange(): void {
$query = $this->connection->select('test');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
@@ -128,7 +128,7 @@ class AlterTest extends DatabaseTestBase {
/**
* Tests that we can do basic alters on subqueries.
*/
- public function testSimpleAlterSubquery() {
+ public function testSimpleAlterSubquery(): void {
// Create a sub-query with an alter tag.
$subquery = $this->connection->select('test', 'p');
$subquery->addField('p', 'name');
diff --git a/core/tests/Drupal/KernelTests/Core/Database/BasicSyntaxTest.php b/core/tests/Drupal/KernelTests/Core/Database/BasicSyntaxTest.php
index 1e7abebfe50..079009dc7a5 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/BasicSyntaxTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/BasicSyntaxTest.php
@@ -18,7 +18,7 @@ class BasicSyntaxTest extends DatabaseTestBase {
/**
* Tests string concatenation.
*/
- public function testConcatLiterals() {
+ public function testConcatLiterals(): void {
$result = $this->connection->query('SELECT CONCAT(:a1, CONCAT(:a2, CONCAT(:a3, CONCAT(:a4, :a5))))', [
':a1' => 'This',
':a2' => ' ',
@@ -37,7 +37,7 @@ class BasicSyntaxTest extends DatabaseTestBase {
* since its type 'varchar_ascii' may lead to using field-level collations not
* compatible with the other fields.
*/
- public function testConcatFields() {
+ public function testConcatFields(): void {
$result = $this->connection->query(
'SELECT CONCAT(:a1, CONCAT([job], CONCAT(:a2, CONCAT([age], :a3)))) FROM {test} WHERE [age] = :age', [
':a1' => 'The age of ',
@@ -52,7 +52,7 @@ class BasicSyntaxTest extends DatabaseTestBase {
/**
* Tests string concatenation with separator.
*/
- public function testConcatWsLiterals() {
+ public function testConcatWsLiterals(): void {
$result = $this->connection->query("SELECT CONCAT_WS(', ', :a1, NULL, :a2, :a3, :a4)", [
':a1' => 'Hello',
':a2' => NULL,
@@ -65,7 +65,7 @@ class BasicSyntaxTest extends DatabaseTestBase {
/**
* Tests string concatenation with separator, with field values.
*/
- public function testConcatWsFields() {
+ public function testConcatWsFields(): void {
$result = $this->connection->query("SELECT CONCAT_WS('-', :a1, [name], :a2, [age]) FROM {test} WHERE [age] = :age", [
':a1' => 'name',
':a2' => 'age',
@@ -77,7 +77,7 @@ class BasicSyntaxTest extends DatabaseTestBase {
/**
* Tests escaping of LIKE wildcards.
*/
- public function testLikeEscape() {
+ public function testLikeEscape(): void {
$this->connection->insert('test')
->fields([
'name' => 'Ring_',
@@ -103,7 +103,7 @@ class BasicSyntaxTest extends DatabaseTestBase {
/**
* Tests a LIKE query containing a backslash.
*/
- public function testLikeBackslash() {
+ public function testLikeBackslash(): void {
$this->connection->insert('test')
->fields(['name'])
->values([
@@ -134,7 +134,7 @@ class BasicSyntaxTest extends DatabaseTestBase {
/**
* Tests \Drupal\Core\Database\Connection::getFullQualifiedTableName().
*/
- public function testGetFullQualifiedTableName() {
+ public function testGetFullQualifiedTableName(): void {
$database = \Drupal::database();
$num_matches = $database->select($database->getFullQualifiedTableName('test'), 't')
->countQuery()
diff --git a/core/tests/Drupal/KernelTests/Core/Database/CaseSensitivityTest.php b/core/tests/Drupal/KernelTests/Core/Database/CaseSensitivityTest.php
index c837534147a..cd20af22f0f 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/CaseSensitivityTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/CaseSensitivityTest.php
@@ -14,7 +14,7 @@ class CaseSensitivityTest extends DatabaseTestBase {
/**
* Tests BINARY collation in MySQL.
*/
- public function testCaseSensitiveInsert() {
+ public function testCaseSensitiveInsert(): void {
$num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test}')->fetchField();
$this->connection->insert('test')
diff --git a/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php b/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php
index 86f4701b57c..ef8ce03f1c1 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php
@@ -17,7 +17,7 @@ class ConnectionTest extends DatabaseTestBase {
/**
* Tests that connections return appropriate connection objects.
*/
- public function testConnectionRouting() {
+ public function testConnectionRouting(): void {
// Clone the primary credentials to a replica connection.
// Note this will result in two independent connection objects that happen
// to point to the same place.
@@ -51,7 +51,7 @@ class ConnectionTest extends DatabaseTestBase {
/**
* Tests that connections return appropriate connection objects.
*/
- public function testConnectionRoutingOverride() {
+ public function testConnectionRoutingOverride(): void {
// Clone the primary credentials to a replica connection.
// Note this will result in two independent connection objects that happen
// to point to the same place.
@@ -69,7 +69,7 @@ class ConnectionTest extends DatabaseTestBase {
/**
* Tests the closing of a database connection.
*/
- public function testConnectionClosing() {
+ public function testConnectionClosing(): void {
// Open the default target so we have an object to compare.
$db1 = Database::getConnection('default', 'default');
@@ -84,7 +84,7 @@ class ConnectionTest extends DatabaseTestBase {
/**
* Tests the connection options of the active database.
*/
- public function testConnectionOptions() {
+ public function testConnectionOptions(): void {
$connection_info = Database::getConnectionInfo('default');
// Be sure we're connected to the default database.
@@ -119,7 +119,7 @@ class ConnectionTest extends DatabaseTestBase {
/**
* Tests per-table prefix connection option.
*/
- public function testPerTablePrefixOption() {
+ public function testPerTablePrefixOption(): void {
$connection_info = Database::getConnectionInfo('default');
$new_connection_info = $connection_info['default'];
$new_connection_info['prefix'] = [
@@ -134,7 +134,7 @@ class ConnectionTest extends DatabaseTestBase {
/**
* Tests the prefix connection option in array form.
*/
- public function testPrefixArrayOption() {
+ public function testPrefixArrayOption(): void {
$connection_info = Database::getConnectionInfo('default');
$new_connection_info = $connection_info['default'];
$new_connection_info['prefix'] = [
@@ -148,7 +148,7 @@ class ConnectionTest extends DatabaseTestBase {
/**
* Ensure that you cannot execute multiple statements in a query.
*/
- public function testMultipleStatementsQuery() {
+ public function testMultipleStatementsQuery(): void {
$this->expectException(\InvalidArgumentException::class);
Database::getConnection('default', 'default')->query('SELECT * FROM {test}; SELECT * FROM {test_people}');
}
@@ -156,7 +156,7 @@ class ConnectionTest extends DatabaseTestBase {
/**
* Ensure that you cannot prepare multiple statements.
*/
- public function testMultipleStatements() {
+ public function testMultipleStatements(): void {
$this->expectException(\InvalidArgumentException::class);
Database::getConnection('default', 'default')->prepareStatement('SELECT * FROM {test}; SELECT * FROM {test_people}', []);
}
@@ -164,7 +164,7 @@ class ConnectionTest extends DatabaseTestBase {
/**
* Tests that the method ::condition() returns a Condition object.
*/
- public function testCondition() {
+ public function testCondition(): void {
$connection = Database::getConnection('default', 'default');
$namespace = (new \ReflectionObject($connection))->getNamespaceName() . "\\Condition";
if (!class_exists($namespace)) {
@@ -177,7 +177,7 @@ class ConnectionTest extends DatabaseTestBase {
/**
* Tests that the method ::hasJson() returns TRUE.
*/
- public function testHasJson() {
+ public function testHasJson(): void {
$this->assertTrue($this->connection->hasJson());
}
diff --git a/core/tests/Drupal/KernelTests/Core/Database/DatabaseExceptionWrapperTest.php b/core/tests/Drupal/KernelTests/Core/Database/DatabaseExceptionWrapperTest.php
index 746bf12e8f6..41234f3ef4b 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/DatabaseExceptionWrapperTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/DatabaseExceptionWrapperTest.php
@@ -18,7 +18,7 @@ class DatabaseExceptionWrapperTest extends KernelTestBase {
/**
* Tests the expected database exception thrown for inexistent tables.
*/
- public function testQueryThrowsDatabaseExceptionWrapperException() {
+ public function testQueryThrowsDatabaseExceptionWrapperException(): void {
$this->expectException(DatabaseExceptionWrapper::class);
Database::getConnection()->query('SELECT * FROM {does_not_exist}');
}
diff --git a/core/tests/Drupal/KernelTests/Core/Database/DeleteTruncateTest.php b/core/tests/Drupal/KernelTests/Core/Database/DeleteTruncateTest.php
index cfe18af5a43..4a40641a92b 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/DeleteTruncateTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/DeleteTruncateTest.php
@@ -24,7 +24,7 @@ class DeleteTruncateTest extends DatabaseTestBase {
/**
* Confirms that we can use a subselect in a delete successfully.
*/
- public function testSubselectDelete() {
+ public function testSubselectDelete(): void {
$num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test_task}')->fetchField();
$pid_to_delete = $this->connection->query("SELECT * FROM {test_task} WHERE [task] = 'sleep' ORDER BY [tid]")->fetchField();
@@ -45,7 +45,7 @@ class DeleteTruncateTest extends DatabaseTestBase {
/**
* Confirms that we can delete a single record successfully.
*/
- public function testSimpleDelete() {
+ public function testSimpleDelete(): void {
$num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test}')->fetchField();
$num_deleted = $this->connection->delete('test')
@@ -60,7 +60,7 @@ class DeleteTruncateTest extends DatabaseTestBase {
/**
* Confirms that we can truncate a whole table successfully.
*/
- public function testTruncate() {
+ public function testTruncate(): void {
$num_records_before = $this->connection->query("SELECT COUNT(*) FROM {test}")->fetchField();
$this->assertNotEmpty($num_records_before);
@@ -73,7 +73,7 @@ class DeleteTruncateTest extends DatabaseTestBase {
/**
* Confirms that we can truncate a whole table while in transaction.
*/
- public function testTruncateInTransaction() {
+ public function testTruncateInTransaction(): void {
$num_records_before = $this->connection->select('test')->countQuery()->execute()->fetchField();
$this->assertGreaterThan(0, $num_records_before, 'The table is not empty.');
@@ -107,7 +107,7 @@ class DeleteTruncateTest extends DatabaseTestBase {
/**
* Confirms that transaction rollback voids a truncate operation.
*/
- public function testTruncateTransactionRollback() {
+ public function testTruncateTransactionRollback(): void {
$num_records_before = $this->connection->select('test')->countQuery()->execute()->fetchField();
$this->assertGreaterThan(0, $num_records_before, 'The table is not empty.');
@@ -141,7 +141,7 @@ class DeleteTruncateTest extends DatabaseTestBase {
/**
* Confirms that we can delete a single special column name record successfully.
*/
- public function testSpecialColumnDelete() {
+ public function testSpecialColumnDelete(): void {
$num_records_before = $this->connection->query('SELECT COUNT(*) FROM {select}')->fetchField();
$num_deleted = $this->connection->delete('select')
diff --git a/core/tests/Drupal/KernelTests/Core/Database/DriverSpecificConnectionUnitTestBase.php b/core/tests/Drupal/KernelTests/Core/Database/DriverSpecificConnectionUnitTestBase.php
index 87cabe89026..f2c94ef04e2 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/DriverSpecificConnectionUnitTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/DriverSpecificConnectionUnitTestBase.php
@@ -178,7 +178,7 @@ abstract class DriverSpecificConnectionUnitTestBase extends DriverSpecificKernel
/**
* Tests pdo options override.
*/
- public function testConnectionOpen() {
+ public function testConnectionOpen(): void {
$reflection = new \ReflectionObject($this->connection);
$connection_property = $reflection->getProperty('connection');
$error_mode = $connection_property->getValue($this->connection)
diff --git a/core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSyntaxTestBase.php b/core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSyntaxTestBase.php
index aa58043022c..7723d872cc1 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSyntaxTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSyntaxTestBase.php
@@ -19,7 +19,7 @@ abstract class DriverSpecificSyntaxTestBase extends DriverSpecificDatabaseTestBa
*
* @see \Drupal\Core\Database\Connection::prepareQuery()
*/
- public function testAllowSquareBrackets() {
+ public function testAllowSquareBrackets(): void {
$this->connection->insert('test')
->fields(['name'])
->values([
diff --git a/core/tests/Drupal/KernelTests/Core/Database/FetchTest.php b/core/tests/Drupal/KernelTests/Core/Database/FetchTest.php
index dd2b382e6a3..dcea763eccb 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/FetchTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/FetchTest.php
@@ -20,7 +20,7 @@ class FetchTest extends DatabaseTestBase {
/**
* Confirms that we can fetch a record properly in default object mode.
*/
- public function testQueryFetchDefault() {
+ public function testQueryFetchDefault(): void {
$records = [];
$result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25]);
$this->assertInstanceOf(StatementInterface::class, $result);
@@ -36,7 +36,7 @@ class FetchTest extends DatabaseTestBase {
/**
* Confirms that we can fetch a record to an object explicitly.
*/
- public function testQueryFetchObject() {
+ public function testQueryFetchObject(): void {
$records = [];
$result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => \PDO::FETCH_OBJ]);
foreach ($result as $record) {
@@ -51,7 +51,7 @@ class FetchTest extends DatabaseTestBase {
/**
* Confirms that we can fetch a record to an associative array explicitly.
*/
- public function testQueryFetchArray() {
+ public function testQueryFetchArray(): void {
$records = [];
$result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => \PDO::FETCH_ASSOC]);
foreach ($result as $record) {
@@ -69,7 +69,7 @@ class FetchTest extends DatabaseTestBase {
*
* @see \Drupal\system\Tests\Database\FakeRecord
*/
- public function testQueryFetchClass() {
+ public function testQueryFetchClass(): void {
$records = [];
$result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => FakeRecord::class]);
foreach ($result as $record) {
@@ -87,7 +87,7 @@ class FetchTest extends DatabaseTestBase {
* @see \Drupal\Tests\system\Functional\Database\FakeRecord
* @see \Drupal\Core\Database\StatementPrefetch::fetchObject
*/
- public function testQueryFetchObjectClass() {
+ public function testQueryFetchObjectClass(): void {
$records = 0;
$query = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25]);
while ($result = $query->fetchObject(FakeRecord::class, [1])) {
@@ -120,7 +120,7 @@ class FetchTest extends DatabaseTestBase {
/**
* Confirms that we can fetch a record into an indexed array explicitly.
*/
- public function testQueryFetchNum() {
+ public function testQueryFetchNum(): void {
$records = [];
$result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25], ['fetch' => \PDO::FETCH_NUM]);
foreach ($result as $record) {
@@ -136,7 +136,7 @@ class FetchTest extends DatabaseTestBase {
/**
* Confirms that we can fetch all records into an array explicitly.
*/
- public function testQueryFetchAllColumn() {
+ public function testQueryFetchAllColumn(): void {
$query = $this->connection->select('test');
$query->addField('test', 'name');
$query->orderBy('name');
@@ -149,7 +149,7 @@ class FetchTest extends DatabaseTestBase {
/**
* Confirms that we can fetch an entire column of a result set at once.
*/
- public function testQueryFetchCol() {
+ public function testQueryFetchCol(): void {
$result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] > :age', [':age' => 25]);
$column = $result->fetchCol();
$this->assertCount(3, $column, 'fetchCol() returns the right number of records.');
@@ -233,7 +233,7 @@ class FetchTest extends DatabaseTestBase {
/**
* Tests that rowCount() throws exception on SELECT query.
*/
- public function testRowCount() {
+ public function testRowCount(): void {
$result = $this->connection->query('SELECT [name] FROM {test}');
try {
$result->rowCount();
diff --git a/core/tests/Drupal/KernelTests/Core/Database/InsertDefaultsTest.php b/core/tests/Drupal/KernelTests/Core/Database/InsertDefaultsTest.php
index b5aeb6af144..2aa2ff497af 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/InsertDefaultsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/InsertDefaultsTest.php
@@ -18,7 +18,7 @@ class InsertDefaultsTest extends DatabaseTestBase {
*
* @see \database_test_schema()
*/
- public function testDefaultInsert() {
+ public function testDefaultInsert(): void {
$query = $this->connection->insert('test')->useDefaults(['job']);
$id = $query->execute();
$job = $this->connection->query('SELECT [job] FROM {test} WHERE [id] = :id', [':id' => $id])->fetchField();
@@ -28,7 +28,7 @@ class InsertDefaultsTest extends DatabaseTestBase {
/**
* Tests that no action will be preformed if no fields are specified.
*/
- public function testDefaultEmptyInsert() {
+ public function testDefaultEmptyInsert(): void {
$num_records_before = (int) $this->connection->query('SELECT COUNT(*) FROM {test}')->fetchField();
try {
@@ -49,7 +49,7 @@ class InsertDefaultsTest extends DatabaseTestBase {
*
* @see \database_test_schema()
*/
- public function testDefaultInsertWithFields() {
+ public function testDefaultInsertWithFields(): void {
$query = $this->connection->insert('test')
->fields(['name' => 'Bob'])
->useDefaults(['job']);
diff --git a/core/tests/Drupal/KernelTests/Core/Database/InsertLobTest.php b/core/tests/Drupal/KernelTests/Core/Database/InsertLobTest.php
index 9c417a1b6ca..2859a303878 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/InsertLobTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/InsertLobTest.php
@@ -14,7 +14,7 @@ class InsertLobTest extends DatabaseTestBase {
/**
* Tests that we can insert a single blob field successfully.
*/
- public function testInsertOneBlob() {
+ public function testInsertOneBlob(): void {
$data = "This is\000a test.";
$this->assertSame(15, strlen($data), 'Test data contains a NULL.');
$id = $this->connection->insert('test_one_blob')
@@ -27,7 +27,7 @@ class InsertLobTest extends DatabaseTestBase {
/**
* Tests that we can insert a null into blob field.
*/
- public function testInsertNullBlob() {
+ public function testInsertNullBlob(): void {
$id = $this->connection->insert('test_one_blob')
->fields(['blob1' => NULL])
->execute();
@@ -38,7 +38,7 @@ class InsertLobTest extends DatabaseTestBase {
/**
* Tests that we can insert multiple blob fields in the same query.
*/
- public function testInsertMultipleBlob() {
+ public function testInsertMultipleBlob(): void {
$id = $this->connection->insert('test_two_blobs')
->fields([
'blob1' => 'This is',
diff --git a/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php b/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php
index 41b384e3f49..2a0f685d2ac 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php
@@ -16,7 +16,7 @@ class InsertTest extends DatabaseTestBase {
/**
* Tests very basic insert functionality.
*/
- public function testSimpleInsert() {
+ public function testSimpleInsert(): void {
$num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test}')->fetchField();
$query = $this->connection->insert('test');
@@ -38,7 +38,7 @@ class InsertTest extends DatabaseTestBase {
/**
* Tests that we can insert multiple records in one query object.
*/
- public function testMultiInsert() {
+ public function testMultiInsert(): void {
$num_records_before = (int) $this->connection->query('SELECT COUNT(*) FROM {test}')->fetchField();
$query = $this->connection->insert('test');
@@ -77,7 +77,7 @@ class InsertTest extends DatabaseTestBase {
/**
* Tests that an insert object can be reused with new data after it executes.
*/
- public function testRepeatedInsert() {
+ public function testRepeatedInsert(): void {
$num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test}')->fetchField();
$query = $this->connection->insert('test');
@@ -120,7 +120,7 @@ class InsertTest extends DatabaseTestBase {
/**
* Tests that we can specify fields without values and specify values later.
*/
- public function testInsertFieldOnlyDefinition() {
+ public function testInsertFieldOnlyDefinition(): void {
// This is useful for importers, when we want to create a query and define
// its fields once, then loop over a multi-insert execution.
$this->connection->insert('test')
@@ -140,7 +140,7 @@ class InsertTest extends DatabaseTestBase {
/**
* Tests that inserts return the proper auto-increment ID.
*/
- public function testInsertLastInsertID() {
+ public function testInsertLastInsertID(): void {
$id = $this->connection->insert('test')
->fields([
'name' => 'Larry',
@@ -154,7 +154,7 @@ class InsertTest extends DatabaseTestBase {
/**
* Tests that the INSERT INTO ... SELECT (fields) ... syntax works.
*/
- public function testInsertSelectFields() {
+ public function testInsertSelectFields(): void {
$query = $this->connection->select('test_people', 'tp');
// The query builder will always append expressions after fields.
// Add the expression first to test that the insert fields are correctly
@@ -180,7 +180,7 @@ class InsertTest extends DatabaseTestBase {
/**
* Tests that the INSERT INTO ... SELECT * ... syntax works.
*/
- public function testInsertSelectAll() {
+ public function testInsertSelectAll(): void {
$query = $this->connection->select('test_people', 'tp')
->fields('tp')
->condition('tp.name', 'Meredith');
@@ -201,7 +201,7 @@ class InsertTest extends DatabaseTestBase {
/**
* Tests that we can INSERT INTO a special named column.
*/
- public function testSpecialColumnInsert() {
+ public function testSpecialColumnInsert(): void {
$this->connection->insert('select')
->fields([
'id' => 2,
@@ -215,7 +215,7 @@ class InsertTest extends DatabaseTestBase {
/**
* Tests insertion integrity violation with no default value for a column.
*/
- public function testInsertIntegrityViolation() {
+ public function testInsertIntegrityViolation(): void {
// Remove the default from the 'age' column, so that inserting a record
// without its value specified will lead to integrity failure.
$this->connection->schema()->changeField('test', 'age', 'age', [
diff --git a/core/tests/Drupal/KernelTests/Core/Database/InvalidDataTest.php b/core/tests/Drupal/KernelTests/Core/Database/InvalidDataTest.php
index 7a6bd9c987a..85c50dd2e4a 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/InvalidDataTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/InvalidDataTest.php
@@ -16,7 +16,7 @@ class InvalidDataTest extends DatabaseTestBase {
/**
* Tests aborting of traditional SQL database systems with invalid data.
*/
- public function testInsertDuplicateData() {
+ public function testInsertDuplicateData(): void {
// Try to insert multiple records where at least one has bad data.
$this->expectException(IntegrityConstraintViolationException::class);
try {
@@ -55,7 +55,7 @@ class InvalidDataTest extends DatabaseTestBase {
/**
* Tests inserting with invalid data from a select query.
*/
- public function testInsertDuplicateDataFromSelect() {
+ public function testInsertDuplicateDataFromSelect(): void {
// Insert multiple records in 'test_people' where one has bad data
// (duplicate key). A 'Meredith' record has already been inserted
// in ::setUp.
diff --git a/core/tests/Drupal/KernelTests/Core/Database/LoggingTest.php b/core/tests/Drupal/KernelTests/Core/Database/LoggingTest.php
index b27fef00955..87abede275a 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/LoggingTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/LoggingTest.php
@@ -18,7 +18,7 @@ class LoggingTest extends DatabaseTestBase {
/**
* Tests that we can log the existence of a query.
*/
- public function testEnableLogging() {
+ public function testEnableLogging(): void {
Database::startLog('testing');
$start = microtime(TRUE);
@@ -42,7 +42,7 @@ class LoggingTest extends DatabaseTestBase {
/**
* Tests that we can run two logs in parallel.
*/
- public function testEnableMultiLogging() {
+ public function testEnableMultiLogging(): void {
Database::startLog('testing1');
$this->connection->query('SELECT [name] FROM {test} WHERE [age] > :age', [':age' => 25])->fetchCol();
@@ -61,7 +61,7 @@ class LoggingTest extends DatabaseTestBase {
/**
* Tests logging queries against multiple targets on the same connection.
*/
- public function testEnableTargetLogging() {
+ public function testEnableTargetLogging(): void {
// Clone the primary credentials to a replica connection and to another fake
// connection.
$connection_info = Database::getConnectionInfo('default');
@@ -87,7 +87,7 @@ class LoggingTest extends DatabaseTestBase {
* a fake target so the query should fall back to running on the default
* target.
*/
- public function testEnableTargetLoggingNoTarget() {
+ public function testEnableTargetLoggingNoTarget(): void {
Database::startLog('testing1');
$this->connection->query('SELECT [name] FROM {test} WHERE [age] > :age', [':age' => 25])->fetchCol();
@@ -109,7 +109,7 @@ class LoggingTest extends DatabaseTestBase {
/**
* Tests that we can log queries separately on different connections.
*/
- public function testEnableMultiConnectionLogging() {
+ public function testEnableMultiConnectionLogging(): void {
// Clone the primary credentials to a fake connection.
// That both connections point to the same physical database is irrelevant.
$connection_info = Database::getConnectionInfo('default');
@@ -136,7 +136,7 @@ class LoggingTest extends DatabaseTestBase {
/**
* Tests that getLog with a wrong key return an empty array.
*/
- public function testGetLoggingWrongKey() {
+ public function testGetLoggingWrongKey(): void {
$result = Database::getLog('wrong');
$this->assertEquals([], $result, 'The function getLog with a wrong key returns an empty array.');
diff --git a/core/tests/Drupal/KernelTests/Core/Database/MergeTest.php b/core/tests/Drupal/KernelTests/Core/Database/MergeTest.php
index 92e99ea0121..b8da5e18366 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/MergeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/MergeTest.php
@@ -17,7 +17,7 @@ class MergeTest extends DatabaseTestBase {
/**
* Confirms that we can merge-insert a record successfully.
*/
- public function testMergeInsert() {
+ public function testMergeInsert(): void {
$num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();
$result = $this->connection->merge('test_people')
@@ -42,7 +42,7 @@ class MergeTest extends DatabaseTestBase {
/**
* Confirms that we can merge-update a record successfully.
*/
- public function testMergeUpdate() {
+ public function testMergeUpdate(): void {
$num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();
$result = $this->connection->merge('test_people')
@@ -70,7 +70,7 @@ class MergeTest extends DatabaseTestBase {
* This test varies from the previous test because it manually defines which
* fields are inserted, and which fields are updated.
*/
- public function testMergeUpdateExcept() {
+ public function testMergeUpdateExcept(): void {
$num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();
$this->connection->merge('test_people')
@@ -91,7 +91,7 @@ class MergeTest extends DatabaseTestBase {
/**
* Confirms that we can merge-update a record, with alternate replacement.
*/
- public function testMergeUpdateExplicit() {
+ public function testMergeUpdateExplicit(): void {
$num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();
$this->connection->merge('test_people')
@@ -117,7 +117,7 @@ class MergeTest extends DatabaseTestBase {
/**
* Confirms that we can merge-update a record successfully, with expressions.
*/
- public function testMergeUpdateExpression() {
+ public function testMergeUpdateExpression(): void {
$num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();
$age_before = $this->connection->query('SELECT [age] FROM {test_people} WHERE [job] = :job', [':job' => 'Speaker'])->fetchField();
@@ -146,7 +146,7 @@ class MergeTest extends DatabaseTestBase {
/**
* Tests that we can merge-insert without any update fields.
*/
- public function testMergeInsertWithoutUpdate() {
+ public function testMergeInsertWithoutUpdate(): void {
$num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();
$this->connection->merge('test_people')
@@ -165,7 +165,7 @@ class MergeTest extends DatabaseTestBase {
/**
* Confirms that we can merge-update without any update fields.
*/
- public function testMergeUpdateWithoutUpdate() {
+ public function testMergeUpdateWithoutUpdate(): void {
$num_records_before = $this->connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();
$this->connection->merge('test_people')
@@ -197,7 +197,7 @@ class MergeTest extends DatabaseTestBase {
/**
* Tests that an invalid merge query throws an exception.
*/
- public function testInvalidMerge() {
+ public function testInvalidMerge(): void {
$this->expectException(InvalidMergeQueryException::class);
// This merge will fail because there is no key field specified.
$this->connection
@@ -209,7 +209,7 @@ class MergeTest extends DatabaseTestBase {
/**
* Tests that we can merge-insert with reserved keywords.
*/
- public function testMergeWithReservedWords() {
+ public function testMergeWithReservedWords(): void {
$num_records_before = $this->connection->query('SELECT COUNT(*) FROM {select}')->fetchField();
$this->connection->merge('select')
diff --git a/core/tests/Drupal/KernelTests/Core/Database/QueryTest.php b/core/tests/Drupal/KernelTests/Core/Database/QueryTest.php
index 5893197ef74..b2a7fe09bbb 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/QueryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/QueryTest.php
@@ -17,7 +17,7 @@ class QueryTest extends DatabaseTestBase {
/**
* Tests that we can pass an array of values directly in the query.
*/
- public function testArraySubstitution() {
+ public function testArraySubstitution(): void {
$names = $this->connection->query('SELECT [name] FROM {test} WHERE [age] IN ( :ages[] ) ORDER BY [age]', [':ages[]' => [25, 26, 27]])->fetchAll();
$this->assertCount(3, $names, 'Correct number of names returned');
@@ -28,7 +28,7 @@ class QueryTest extends DatabaseTestBase {
/**
* Tests that we can not pass a scalar value when an array is expected.
*/
- public function testScalarSubstitution() {
+ public function testScalarSubstitution(): void {
try {
$names = $this->connection->query('SELECT [name] FROM {test} WHERE [age] IN ( :ages[] ) ORDER BY [age]', [':ages[]' => 25])->fetchAll();
$this->fail('Array placeholder with scalar argument should result in an exception.');
@@ -42,7 +42,7 @@ class QueryTest extends DatabaseTestBase {
/**
* Tests SQL injection via database query array arguments.
*/
- public function testArrayArgumentsSQLInjection() {
+ public function testArrayArgumentsSQLInjection(): void {
// Attempt SQL injection and verify that it does not work.
$condition = [
"1 ;INSERT INTO {test} (name) VALUES ('test12345678'); -- " => '',
@@ -69,7 +69,7 @@ class QueryTest extends DatabaseTestBase {
/**
* Tests SQL injection via condition operator.
*/
- public function testConditionOperatorArgumentsSQLInjection() {
+ public function testConditionOperatorArgumentsSQLInjection(): void {
$injection = "IS NOT NULL) ;INSERT INTO {test} (name) VALUES ('test12345678'); -- ";
try {
@@ -138,7 +138,7 @@ class QueryTest extends DatabaseTestBase {
* @see \Drupal\sqlite\Driver\Database\sqlite\Statement::getStatement()
* @see http://bugs.php.net/bug.php?id=45259
*/
- public function testNumericExpressionSubstitution() {
+ public function testNumericExpressionSubstitution(): void {
$count_expected = $this->connection->query('SELECT COUNT(*) + 3 FROM {test}')->fetchField();
$count = $this->connection->query('SELECT COUNT(*) + :count FROM {test}', [
@@ -150,7 +150,7 @@ class QueryTest extends DatabaseTestBase {
/**
* Tests quoting identifiers in queries.
*/
- public function testQuotingIdentifiers() {
+ public function testQuotingIdentifiers(): void {
// Use the table named an ANSI SQL reserved word with a column that is as
// well.
$result = $this->connection->query('SELECT [update] FROM {select}')->fetchObject();
diff --git a/core/tests/Drupal/KernelTests/Core/Database/RangeQueryTest.php b/core/tests/Drupal/KernelTests/Core/Database/RangeQueryTest.php
index 0043cc00df4..ef061068d16 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/RangeQueryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/RangeQueryTest.php
@@ -14,7 +14,7 @@ class RangeQueryTest extends DatabaseTestBase {
/**
* Confirms that range queries work and return the correct result.
*/
- public function testRangeQuery() {
+ public function testRangeQuery(): void {
// Test if return correct number of rows.
$range_rows = $this->connection->queryRange("SELECT [name] FROM {test} ORDER BY [name]", 1, 3)->fetchAll();
$this->assertCount(3, $range_rows, 'Range query work and return correct number of rows.');
diff --git a/core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php b/core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php
index a245c19a569..1ac344658e0 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php
@@ -21,7 +21,7 @@ class RegressionTest extends DatabaseTestBase {
/**
* Ensures that non-ASCII UTF-8 data is stored in the database properly.
*/
- public function testRegression_310447() {
+ public function testRegression_310447(): void {
// That's a 255 character UTF-8 string.
$job = str_repeat("é", 255);
$this->connection
@@ -39,7 +39,7 @@ class RegressionTest extends DatabaseTestBase {
/**
* Tests the Schema::tableExists() method.
*/
- public function testDBTableExists() {
+ public function testDBTableExists(): void {
$this->assertTrue($this->connection->schema()->tableExists('test'), 'Returns true for existent table.');
$this->assertFalse($this->connection->schema()->tableExists('no_such_table'), 'Returns false for nonexistent table.');
}
@@ -47,7 +47,7 @@ class RegressionTest extends DatabaseTestBase {
/**
* Tests the \Drupal\Core\Database\Schema::fieldExists() method.
*/
- public function testDBFieldExists() {
+ public function testDBFieldExists(): void {
$schema = $this->connection->schema();
$this->assertTrue($schema->fieldExists('test', 'name'), 'Returns true for existent column.');
$this->assertFalse($schema->fieldExists('test', 'no_such_column'), 'Returns false for nonexistent column.');
@@ -56,7 +56,7 @@ class RegressionTest extends DatabaseTestBase {
/**
* Tests the Schema::indexExists() method.
*/
- public function testDBIndexExists() {
+ public function testDBIndexExists(): void {
$this->assertTrue($this->connection->schema()->indexExists('test', 'ages'), 'Returns true for existent index.');
$this->assertFalse($this->connection->schema()->indexExists('test', 'no_such_index'), 'Returns false for nonexistent index.');
}
diff --git a/core/tests/Drupal/KernelTests/Core/Database/ReplicaKillSwitchTest.php b/core/tests/Drupal/KernelTests/Core/Database/ReplicaKillSwitchTest.php
index 3e2b2bb664f..e359c292ea5 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/ReplicaKillSwitchTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/ReplicaKillSwitchTest.php
@@ -22,7 +22,7 @@ class ReplicaKillSwitchTest extends KernelTestBase {
/**
* Tests database.replica_kill_switch service.
*/
- public function testSystemInitIgnoresSecondaries() {
+ public function testSystemInitIgnoresSecondaries(): void {
// Clone the master credentials to a replica connection.
// Note this will result in two independent connection objects that happen
// to point to the same place.
diff --git a/core/tests/Drupal/KernelTests/Core/Database/ReservedWordTest.php b/core/tests/Drupal/KernelTests/Core/Database/ReservedWordTest.php
index 322b80a6dff..182ffb67546 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/ReservedWordTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/ReservedWordTest.php
@@ -14,7 +14,7 @@ class ReservedWordTest extends DatabaseTestBase {
/**
* Tests SELECT count query from a table with a reserved name.
*/
- public function testSelectReservedWordTableCount() {
+ public function testSelectReservedWordTableCount(): void {
$query = $this->connection->select('virtual');
$num_records = $query->countQuery()->execute()->fetchField();
@@ -24,7 +24,7 @@ class ReservedWordTest extends DatabaseTestBase {
/**
* Tests SELECT query with a specific field from a table with a reserved name.
*/
- public function testSelectReservedWordTableSpecificField() {
+ public function testSelectReservedWordTableSpecificField(): void {
$query = $this->connection->select('virtual');
$query->addField('virtual', 'function');
$rows = $query->execute()->fetchCol();
@@ -35,7 +35,7 @@ class ReservedWordTest extends DatabaseTestBase {
/**
* Tests SELECT query with all fields from a table with a reserved name.
*/
- public function testSelectReservedWordTableAllFields() {
+ public function testSelectReservedWordTableAllFields(): void {
$query = $this->connection->select('virtual');
$query->fields('virtual');
$result = $query->execute()->fetchObject();
@@ -46,7 +46,7 @@ class ReservedWordTest extends DatabaseTestBase {
/**
* Tests SELECT count query from a table with a reserved alias.
*/
- public function testSelectReservedWordAliasCount() {
+ public function testSelectReservedWordAliasCount(): void {
$query = $this->connection->select('test', 'character');
$num_records = $query->countQuery()->execute()->fetchField();
@@ -56,7 +56,7 @@ class ReservedWordTest extends DatabaseTestBase {
/**
* Tests SELECT query with specific fields from a table with a reserved alias.
*/
- public function testSelectReservedWordAliasSpecificFields() {
+ public function testSelectReservedWordAliasSpecificFields(): void {
$query = $this->connection->select('test', 'high_priority');
$query->addField('high_priority', 'name');
$query->addField('high_priority', 'age', 'age');
@@ -71,7 +71,7 @@ class ReservedWordTest extends DatabaseTestBase {
/**
* Tests SELECT query with all fields from a table with a reserved alias.
*/
- public function testSelectReservedWordAliasAllFields() {
+ public function testSelectReservedWordAliasAllFields(): void {
$record = $this->connection->select('test', 'signal')
->fields('signal')
->condition('age', 27)
@@ -85,7 +85,7 @@ class ReservedWordTest extends DatabaseTestBase {
/**
* Tests SELECT query with GROUP BY clauses on fields with reserved names.
*/
- public function testGroupBy() {
+ public function testGroupBy(): void {
$this->connection->insert('select')
->fields([
'id' => 2,
diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectCloneTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectCloneTest.php
index 1619ca78d25..15364ad53af 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SelectCloneTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SelectCloneTest.php
@@ -14,7 +14,7 @@ class SelectCloneTest extends DatabaseTestBase {
/**
* Tests that subqueries as value within conditions are cloned properly.
*/
- public function testSelectConditionSubQueryCloning() {
+ public function testSelectConditionSubQueryCloning(): void {
$subquery = $this->connection->select('test', 't');
$subquery->addField('t', 'id', 'id');
$subquery->condition('age', 28, '<');
@@ -43,7 +43,7 @@ class SelectCloneTest extends DatabaseTestBase {
/**
* Tests that nested SELECT queries are cloned properly.
*/
- public function testNestedQueryCloning() {
+ public function testNestedQueryCloning(): void {
$sub_query = $this->connection->select('test', 't');
$sub_query->addField('t', 'id', 'id');
$sub_query->condition('age', 28, '<');
diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php
index ab892aeab46..a0cfc20cbb7 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php
@@ -26,7 +26,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Tests simple JOIN statements.
*/
- public function testDefaultJoin() {
+ public function testDefaultJoin(): void {
$query = $this->connection->select('test_task', 't');
$people_alias = $query->join('test', 'p', '[t].[pid] = [p].[id]');
$name_field = $query->addField($people_alias, 'name', 'name');
@@ -52,7 +52,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Tests LEFT OUTER joins.
*/
- public function testLeftOuterJoin() {
+ public function testLeftOuterJoin(): void {
$query = $this->connection->select('test', 'p');
$people_alias = $query->leftJoin('test_task', 't', '[t].[pid] = [p].[id]');
$name_field = $query->addField('p', 'name', 'name');
@@ -77,7 +77,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Tests GROUP BY clauses.
*/
- public function testGroupBy() {
+ public function testGroupBy(): void {
$query = $this->connection->select('test_task', 't');
$count_field = $query->addExpression('COUNT([task])', 'num');
$task_field = $query->addField('t', 'task');
@@ -118,7 +118,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Tests GROUP BY and HAVING clauses together.
*/
- public function testGroupByAndHaving() {
+ public function testGroupByAndHaving(): void {
$query = $this->connection->select('test_task', 't');
$count_field = $query->addExpression('COUNT([task])', 'num');
$task_field = $query->addField('t', 'task');
@@ -155,7 +155,7 @@ class SelectComplexTest extends DatabaseTestBase {
*
* The SQL clause varies with the database.
*/
- public function testRange() {
+ public function testRange(): void {
$query = $this->connection->select('test');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
@@ -168,7 +168,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Tests whether the range property of a select clause can be undone.
*/
- public function testRangeUndo() {
+ public function testRangeUndo(): void {
$query = $this->connection->select('test');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
@@ -182,7 +182,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Tests distinct queries.
*/
- public function testDistinct() {
+ public function testDistinct(): void {
$query = $this->connection->select('test_task');
$query->addField('test_task', 'task');
$query->orderBy('task');
@@ -196,7 +196,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Tests that we can generate a count query from a built query.
*/
- public function testCountQuery() {
+ public function testCountQuery(): void {
$query = $this->connection->select('test');
$name_field = $query->addField('test', 'name');
$age_field = $query->addField('test', 'age', 'age');
@@ -216,7 +216,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Tests having queries.
*/
- public function testHavingCountQuery() {
+ public function testHavingCountQuery(): void {
$query = $this->connection->select('test')
->extend(PagerSelectExtender::class)
->groupBy('age')
@@ -230,7 +230,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Tests that countQuery removes 'all_fields' statements and ordering clauses.
*/
- public function testCountQueryRemovals() {
+ public function testCountQueryRemovals(): void {
$query = $this->connection->select('test');
$query->fields('test');
$query->orderBy('name');
@@ -260,7 +260,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Tests that countQuery properly removes fields and expressions.
*/
- public function testCountQueryFieldRemovals() {
+ public function testCountQueryFieldRemovals(): void {
// countQuery should remove all fields and expressions, so this can be
// tested by adding a non-existent field and expression: if it ends
// up in the query, an error will be thrown. If not, it will return the
@@ -278,7 +278,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Tests that we can generate a count query from a query with distinct.
*/
- public function testCountQueryDistinct() {
+ public function testCountQueryDistinct(): void {
$query = $this->connection->select('test_task');
$query->addField('test_task', 'task');
$query->distinct();
@@ -291,7 +291,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Tests that we can generate a count query from a query with GROUP BY.
*/
- public function testCountQueryGroupBy() {
+ public function testCountQueryGroupBy(): void {
$query = $this->connection->select('test_task');
$query->addField('test_task', 'pid');
$query->groupBy('pid');
@@ -316,7 +316,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Confirms that we can properly nest conditional clauses.
*/
- public function testNestedConditions() {
+ public function testNestedConditions(): void {
// This query should translate to:
// "SELECT job FROM {test} WHERE name = 'Paul' AND (age = 26 OR age = 27)"
// That should find only one record. Yes it's a non-optimal way of writing
@@ -333,7 +333,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Confirms we can join on a single table twice with a dynamic alias.
*/
- public function testJoinTwice() {
+ public function testJoinTwice(): void {
$query = $this->connection->select('test')->fields('test');
$alias = $query->join('test', 'test', '[test].[job] = [%alias].[job]');
$query->addField($alias, 'name', 'other_name');
@@ -347,7 +347,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Tests that we can join on a query.
*/
- public function testJoinSubquery() {
+ public function testJoinSubquery(): void {
$account = User::create([
'name' => $this->randomMachineName(),
'mail' => $this->randomMachineName() . '@example.com',
@@ -385,7 +385,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Tests that rowCount() throws exception on SELECT query.
*/
- public function testSelectWithRowCount() {
+ public function testSelectWithRowCount(): void {
$query = $this->connection->select('test');
$query->addField('test', 'name');
$result = $query->execute();
@@ -402,7 +402,7 @@ class SelectComplexTest extends DatabaseTestBase {
/**
* Tests that join conditions can use Condition objects.
*/
- public function testJoinConditionObject() {
+ public function testJoinConditionObject(): void {
// Same test as testDefaultJoin, but with a Condition object.
$query = $this->connection->select('test_task', 't');
$join_cond = ($this->connection->condition('AND'))->where('[t].[pid] = [p].[id]');
diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectLeastTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectLeastTest.php
index 5294b75995e..a67976589ec 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SelectLeastTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SelectLeastTest.php
@@ -16,7 +16,7 @@ class SelectLeastTest extends DatabaseTestBase {
*
* @dataProvider selectLeastProvider
*/
- public function testSelectLeast($values, $expected) {
+ public function testSelectLeast($values, $expected): void {
$least = $this->connection->query("SELECT LEAST(:values[])", [':values[]' => $values])->fetchField();
$this->assertEquals($expected, $least);
}
diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectOrderedTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectOrderedTest.php
index 2d3bd8d78cb..b3cc7c2d2ce 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SelectOrderedTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SelectOrderedTest.php
@@ -14,7 +14,7 @@ class SelectOrderedTest extends DatabaseTestBase {
/**
* Tests basic ORDER BY.
*/
- public function testSimpleSelectOrdered() {
+ public function testSimpleSelectOrdered(): void {
$query = $this->connection->select('test');
$query->addField('test', 'name');
$age_field = $query->addField('test', 'age', 'age');
@@ -36,7 +36,7 @@ class SelectOrderedTest extends DatabaseTestBase {
/**
* Tests multiple ORDER BY.
*/
- public function testSimpleSelectMultiOrdered() {
+ public function testSimpleSelectMultiOrdered(): void {
$query = $this->connection->select('test');
$query->addField('test', 'name');
$age_field = $query->addField('test', 'age', 'age');
@@ -67,7 +67,7 @@ class SelectOrderedTest extends DatabaseTestBase {
/**
* Tests ORDER BY descending.
*/
- public function testSimpleSelectOrderedDesc() {
+ public function testSimpleSelectOrderedDesc(): void {
$query = $this->connection->select('test');
$query->addField('test', 'name');
$age_field = $query->addField('test', 'age', 'age');
diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php
index 98e153bf5a4..acc6ef22cb2 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php
@@ -14,7 +14,7 @@ class SelectSubqueryTest extends DatabaseTestBase {
/**
* Tests that we can use a subquery in a FROM clause.
*/
- public function testFromSubquerySelect() {
+ public function testFromSubquerySelect(): void {
// Create a subquery, which is just a normal query object.
$subquery = $this->connection->select('test_task', 'tt');
$subquery->addField('tt', 'pid', 'pid');
@@ -50,7 +50,7 @@ class SelectSubqueryTest extends DatabaseTestBase {
/**
* Tests that we can use a subquery in a FROM clause with a LIMIT.
*/
- public function testFromSubquerySelectWithLimit() {
+ public function testFromSubquerySelectWithLimit(): void {
// Create a subquery, which is just a normal query object.
$subquery = $this->connection->select('test_task', 'tt');
$subquery->addField('tt', 'pid', 'pid');
@@ -78,7 +78,7 @@ class SelectSubqueryTest extends DatabaseTestBase {
/**
* Tests that we can use a subquery with an IN operator in a WHERE clause.
*/
- public function testConditionSubquerySelect() {
+ public function testConditionSubquerySelect(): void {
// Create a subquery, which is just a normal query object.
$subquery = $this->connection->select('test_task', 'tt');
$subquery->addField('tt', 'pid', 'pid');
@@ -101,7 +101,7 @@ class SelectSubqueryTest extends DatabaseTestBase {
/**
* Tests we can use a subquery with a relational operator in a WHERE clause.
*/
- public function testConditionSubquerySelect2() {
+ public function testConditionSubquerySelect2(): void {
// Create a subquery, which is just a normal query object.
$subquery = $this->connection->select('test', 't2');
$subquery->addExpression('AVG([t2].[age])');
@@ -122,7 +122,7 @@ class SelectSubqueryTest extends DatabaseTestBase {
/**
* Tests we can use 2 subqueries with a relational operator in a WHERE clause.
*/
- public function testConditionSubquerySelect3() {
+ public function testConditionSubquerySelect3(): void {
// Create subquery 1, which is just a normal query object.
$subquery1 = $this->connection->select('test_task', 'tt');
$subquery1->addExpression('AVG([tt].[priority])');
@@ -152,7 +152,7 @@ class SelectSubqueryTest extends DatabaseTestBase {
* the right hand side. The test query may not be that logical but that's due
* to the limited amount of data and tables. 'Valid' use cases do exist :)
*/
- public function testConditionSubquerySelect4() {
+ public function testConditionSubquerySelect4(): void {
// Create subquery 1, which is just a normal query object.
$subquery1 = $this->connection->select('test_task', 'tt');
$subquery1->addExpression('AVG([tt].[priority])');
@@ -188,7 +188,7 @@ class SelectSubqueryTest extends DatabaseTestBase {
/**
* Tests that we can use a subquery in a JOIN clause.
*/
- public function testJoinSubquerySelect() {
+ public function testJoinSubquerySelect(): void {
// Create a subquery, which is just a normal query object.
$subquery = $this->connection->select('test_task', 'tt');
$subquery->addField('tt', 'pid', 'pid');
@@ -217,7 +217,7 @@ class SelectSubqueryTest extends DatabaseTestBase {
* We essentially select all rows from the {test} table that have matching
* rows in the {test_people} table based on the shared name column.
*/
- public function testExistsSubquerySelect() {
+ public function testExistsSubquerySelect(): void {
// Put George into {test_people}.
$this->connection->insert('test_people')
->fields([
@@ -247,7 +247,7 @@ class SelectSubqueryTest extends DatabaseTestBase {
* We essentially select all rows from the {test} table that don't have
* matching rows in the {test_people} table based on the shared name column.
*/
- public function testNotExistsSubquerySelect() {
+ public function testNotExistsSubquerySelect(): void {
// Put George into {test_people}.
$this->connection->insert('test_people')
->fields([
diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php
index ee4ce8145e7..be877c2866a 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php
@@ -19,7 +19,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests rudimentary SELECT statements.
*/
- public function testSimpleSelect() {
+ public function testSimpleSelect(): void {
$query = $this->connection->select('test');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
@@ -31,7 +31,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests rudimentary SELECT statement with a COMMENT.
*/
- public function testSimpleComment() {
+ public function testSimpleComment(): void {
$query = $this->connection->select('test')->comment('Testing query comments');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
@@ -49,7 +49,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests query COMMENT system against vulnerabilities.
*/
- public function testVulnerableComment() {
+ public function testVulnerableComment(): void {
$query = $this->connection->select('test')->comment('Testing query comments */ SELECT nid FROM {node}; --');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
@@ -106,7 +106,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests basic conditionals on SELECT statements.
*/
- public function testSimpleSelectConditional() {
+ public function testSimpleSelectConditional(): void {
$query = $this->connection->select('test');
$name_field = $query->addField('test', 'name');
$age_field = $query->addField('test', 'age', 'age');
@@ -126,7 +126,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests SELECT statements with expressions.
*/
- public function testSimpleSelectExpression() {
+ public function testSimpleSelectExpression(): void {
$query = $this->connection->select('test');
$name_field = $query->addField('test', 'name');
$age_field = $query->addExpression("[age]*2", 'double_age');
@@ -146,7 +146,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests SELECT statements with multiple expressions.
*/
- public function testSimpleSelectExpressionMultiple() {
+ public function testSimpleSelectExpressionMultiple(): void {
$query = $this->connection->select('test');
$name_field = $query->addField('test', 'name');
$age_double_field = $query->addExpression("[age]*2");
@@ -168,7 +168,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests adding multiple fields to a SELECT statement at the same time.
*/
- public function testSimpleSelectMultipleFields() {
+ public function testSimpleSelectMultipleFields(): void {
$record = $this->connection->select('test')
->fields('test', ['id', 'name', 'age', 'job'])
->condition('age', 27)
@@ -191,7 +191,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests adding all fields from a given table to a SELECT statement.
*/
- public function testSimpleSelectAllFields() {
+ public function testSimpleSelectAllFields(): void {
$record = $this->connection->select('test')
->fields('test')
->condition('age', 27)
@@ -214,7 +214,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests that a comparison with NULL is always FALSE.
*/
- public function testNullCondition() {
+ public function testNullCondition(): void {
$this->ensureSampleDataNull();
$names = $this->connection->select('test_null', 'tn')
@@ -228,7 +228,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests that we can find a record with a NULL value.
*/
- public function testIsNullCondition() {
+ public function testIsNullCondition(): void {
$this->ensureSampleDataNull();
$names = $this->connection->select('test_null', 'tn')
@@ -243,7 +243,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests that we can find a record without a NULL value.
*/
- public function testIsNotNullCondition() {
+ public function testIsNotNullCondition(): void {
$this->ensureSampleDataNull();
$names = $this->connection->select('test_null', 'tn')
@@ -260,7 +260,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests that we can force a query to return an empty result.
*/
- public function testAlwaysFalseCondition() {
+ public function testAlwaysFalseCondition(): void {
$names = $this->connection->select('test', 'test')
->fields('test', ['name'])
->condition('age', 27)
@@ -281,7 +281,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests that we can force an extended query to return an empty result.
*/
- public function testExtenderAlwaysFalseCondition() {
+ public function testExtenderAlwaysFalseCondition(): void {
$names = $this->connection->select('test', 'test')
->extend(SelectExtender::class)
->fields('test', ['name'])
@@ -307,7 +307,7 @@ class SelectTest extends DatabaseTestBase {
* This is semantically equal to UNION DISTINCT, so we don't explicitly test
* that.
*/
- public function testUnion() {
+ public function testUnion(): void {
$query_1 = $this->connection->select('test', 't')
->fields('t', ['name'])
->condition('age', [27, 28], 'IN');
@@ -329,7 +329,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests that we can UNION ALL multiple SELECT queries together.
*/
- public function testUnionAll() {
+ public function testUnionAll(): void {
$query_1 = $this->connection->select('test', 't')
->fields('t', ['name'])
->condition('age', [27, 28], 'IN');
@@ -353,7 +353,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests that we can get a count query for a UNION Select query.
*/
- public function testUnionCount() {
+ public function testUnionCount(): void {
$query_1 = $this->connection->select('test', 't')
->fields('t', ['name', 'age'])
->condition('age', [27, 28], 'IN');
@@ -373,7 +373,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests that we can UNION multiple Select queries together and set the ORDER.
*/
- public function testUnionOrder() {
+ public function testUnionOrder(): void {
// This gives George and Ringo.
$query_1 = $this->connection->select('test', 't')
->fields('t', ['name'])
@@ -402,7 +402,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests that we can UNION multiple Select queries together with and a LIMIT.
*/
- public function testUnionOrderLimit() {
+ public function testUnionOrderLimit(): void {
// This gives George and Ringo.
$query_1 = $this->connection->select('test', 't')
->fields('t', ['name'])
@@ -443,7 +443,7 @@ class SelectTest extends DatabaseTestBase {
* order each time, the only way this could happen is if we have successfully
* triggered the database's random ordering functionality.
*/
- public function testRandomOrder() {
+ public function testRandomOrder(): void {
// Use 52 items, so the chance that this test fails by accident will be the
// same as the chance that a deck of cards will come out in the same order
// after shuffling it (in other words, nearly impossible).
@@ -523,7 +523,7 @@ class SelectTest extends DatabaseTestBase {
*
* @dataProvider providerRegularExpressionCondition
*/
- public function testRegularExpressionCondition($expected, $column, $pattern, $operator) {
+ public function testRegularExpressionCondition($expected, $column, $pattern, $operator): void {
$database = $this->container->get('database');
$database->insert('test')
->fields([
@@ -545,7 +545,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests that aliases are renamed when they are duplicates.
*/
- public function testSelectDuplicateAlias() {
+ public function testSelectDuplicateAlias(): void {
$query = $this->connection->select('test', 't');
$alias1 = $query->addField('t', 'name', 'the_alias');
$alias2 = $query->addField('t', 'age', 'the_alias');
@@ -555,7 +555,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests that an invalid count query throws an exception.
*/
- public function testInvalidSelectCount() {
+ public function testInvalidSelectCount(): void {
$this->expectException(DatabaseExceptionWrapper::class);
// This query will fail because the table does not exist.
$this->connection->select('some_table_that_does_not_exist', 't')
@@ -567,7 +567,7 @@ class SelectTest extends DatabaseTestBase {
/**
* Tests thrown exception for IN query conditions with an empty array.
*/
- public function testEmptyInCondition() {
+ public function testEmptyInCondition(): void {
try {
$this->connection->select('test', 't')
->fields('t')
@@ -619,7 +619,7 @@ class SelectTest extends DatabaseTestBase {
*
* @dataProvider providerNonArrayOperatorWithArrayValueCondition
*/
- public function testNonArrayOperatorWithArrayValueCondition($operator, $operator_in_exception_message) {
+ public function testNonArrayOperatorWithArrayValueCondition($operator, $operator_in_exception_message): void {
$this->expectException(InvalidQueryException::class);
$this->expectExceptionMessage("Query condition 'age " . $operator_in_exception_message . " 26, 27' must have an array compatible operator.");
diff --git a/core/tests/Drupal/KernelTests/Core/Database/SerializeQueryTest.php b/core/tests/Drupal/KernelTests/Core/Database/SerializeQueryTest.php
index 00fe2780d1c..0db69d82c97 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SerializeQueryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SerializeQueryTest.php
@@ -14,7 +14,7 @@ class SerializeQueryTest extends DatabaseTestBase {
/**
* Confirms that a query can be serialized and unserialized.
*/
- public function testSerializeQuery() {
+ public function testSerializeQuery(): void {
$query = $this->connection->select('test');
$query->addField('test', 'age');
$query->condition('name', 'Ringo');
diff --git a/core/tests/Drupal/KernelTests/Core/Database/StatementTest.php b/core/tests/Drupal/KernelTests/Core/Database/StatementTest.php
index 72f693015f4..e14f39cb30d 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/StatementTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/StatementTest.php
@@ -17,7 +17,7 @@ class StatementTest extends DatabaseTestBase {
/**
* Tests that a prepared statement object can be reused for multiple inserts.
*/
- public function testRepeatedInsertStatementReuse() {
+ public function testRepeatedInsertStatementReuse(): void {
$num_records_before = $this->connection->select('test')->countQuery()->execute()->fetchField();
$sql = "INSERT INTO {test} ([name], [age]) VALUES (:name, :age)";
diff --git a/core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php b/core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php
index 92d7302c4fc..0f3368dd974 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php
@@ -19,7 +19,7 @@ class TaggingTest extends DatabaseTestBase {
/**
* Confirms that a query has a tag added to it.
*/
- public function testHasTag() {
+ public function testHasTag(): void {
$query = $this->connection->select('test');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
@@ -33,7 +33,7 @@ class TaggingTest extends DatabaseTestBase {
/**
* Tests query tagging "has all of these tags" functionality.
*/
- public function testHasAllTags() {
+ public function testHasAllTags(): void {
$query = $this->connection->select('test');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
@@ -48,7 +48,7 @@ class TaggingTest extends DatabaseTestBase {
/**
* Tests query tagging "has at least one of these tags" functionality.
*/
- public function testHasAnyTag() {
+ public function testHasAnyTag(): void {
$query = $this->connection->select('test');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
@@ -62,7 +62,7 @@ class TaggingTest extends DatabaseTestBase {
/**
* Confirms that an extended query has a tag added to it.
*/
- public function testExtenderHasTag() {
+ public function testExtenderHasTag(): void {
$query = $this->connection->select('test')
->extend(SelectExtender::class);
$query->addField('test', 'name');
@@ -77,7 +77,7 @@ class TaggingTest extends DatabaseTestBase {
/**
* Tests extended query tagging "has all of these tags" functionality.
*/
- public function testExtenderHasAllTags() {
+ public function testExtenderHasAllTags(): void {
$query = $this->connection->select('test')
->extend(SelectExtender::class);
$query->addField('test', 'name');
@@ -93,7 +93,7 @@ class TaggingTest extends DatabaseTestBase {
/**
* Tests extended query tagging for "has at least one of these tags".
*/
- public function testExtenderHasAnyTag() {
+ public function testExtenderHasAnyTag(): void {
$query = $this->connection->select('test')
->extend(SelectExtender::class);
$query->addField('test', 'name');
@@ -110,7 +110,7 @@ class TaggingTest extends DatabaseTestBase {
*
* This is how we pass additional context to alter hooks.
*/
- public function testMetaData() {
+ public function testMetaData(): void {
$query = $this->connection->select('test');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
diff --git a/core/tests/Drupal/KernelTests/Core/Database/TemporaryQueryTestBase.php b/core/tests/Drupal/KernelTests/Core/Database/TemporaryQueryTestBase.php
index cfb990c565e..a48855c2040 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/TemporaryQueryTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/TemporaryQueryTestBase.php
@@ -30,7 +30,7 @@ abstract class TemporaryQueryTestBase extends DriverSpecificDatabaseTestBase {
/**
* Confirms that temporary tables work.
*/
- public function testTemporaryQuery() {
+ public function testTemporaryQuery(): void {
$connection = $this->getConnection();
// Now try to run two temporary queries in the same request.
diff --git a/core/tests/Drupal/KernelTests/Core/Database/UpdateComplexTest.php b/core/tests/Drupal/KernelTests/Core/Database/UpdateComplexTest.php
index 48405104017..53a7abaec87 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/UpdateComplexTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/UpdateComplexTest.php
@@ -14,7 +14,7 @@ class UpdateComplexTest extends DatabaseTestBase {
/**
* Tests updates with OR conditionals.
*/
- public function testOrConditionUpdate() {
+ public function testOrConditionUpdate(): void {
$update = $this->connection->update('test')
->fields(['job' => 'Musician'])
->condition(($this->connection->condition('OR'))
@@ -31,7 +31,7 @@ class UpdateComplexTest extends DatabaseTestBase {
/**
* Tests WHERE IN clauses.
*/
- public function testInConditionUpdate() {
+ public function testInConditionUpdate(): void {
$num_updated = $this->connection->update('test')
->fields(['job' => 'Musician'])
->condition('name', ['John', 'Paul'], 'IN')
@@ -45,7 +45,7 @@ class UpdateComplexTest extends DatabaseTestBase {
/**
* Tests WHERE NOT IN clauses.
*/
- public function testNotInConditionUpdate() {
+ public function testNotInConditionUpdate(): void {
// The o is lowercase in the 'NoT IN' operator, to make sure the operators
// work in mixed case.
$num_updated = $this->connection->update('test')
@@ -61,7 +61,7 @@ class UpdateComplexTest extends DatabaseTestBase {
/**
* Tests BETWEEN conditional clauses.
*/
- public function testBetweenConditionUpdate() {
+ public function testBetweenConditionUpdate(): void {
$num_updated = $this->connection->update('test')
->fields(['job' => 'Musician'])
->condition('age', [25, 26], 'BETWEEN')
@@ -75,7 +75,7 @@ class UpdateComplexTest extends DatabaseTestBase {
/**
* Tests LIKE conditionals.
*/
- public function testLikeConditionUpdate() {
+ public function testLikeConditionUpdate(): void {
$num_updated = $this->connection->update('test')
->fields(['job' => 'Musician'])
->condition('name', '%ge%', 'LIKE')
@@ -89,7 +89,7 @@ class UpdateComplexTest extends DatabaseTestBase {
/**
* Tests UPDATE with expression values.
*/
- public function testUpdateExpression() {
+ public function testUpdateExpression(): void {
$before_age = $this->connection->query('SELECT [age] FROM {test} WHERE [name] = :name', [':name' => 'Ringo'])->fetchField();
$num_updated = $this->connection->update('test')
->condition('name', 'Ringo')
@@ -110,7 +110,7 @@ class UpdateComplexTest extends DatabaseTestBase {
/**
* Tests UPDATE with only expression values.
*/
- public function testUpdateOnlyExpression() {
+ public function testUpdateOnlyExpression(): void {
$before_age = $this->connection->query('SELECT [age] FROM {test} WHERE [name] = :name', [':name' => 'Ringo'])->fetchField();
$num_updated = $this->connection->update('test')
->condition('name', 'Ringo')
@@ -125,7 +125,7 @@ class UpdateComplexTest extends DatabaseTestBase {
/**
* Tests UPDATE with a subselect value.
*/
- public function testSubSelectUpdate() {
+ public function testSubSelectUpdate(): void {
$subselect = $this->connection->select('test_task', 't');
$subselect->addExpression('MAX([priority]) + :increment', 'max_priority', [':increment' => 30]);
// Clone this to make sure we are running a different query when
diff --git a/core/tests/Drupal/KernelTests/Core/Database/UpdateLobTest.php b/core/tests/Drupal/KernelTests/Core/Database/UpdateLobTest.php
index f7073b79c26..60bb3c6f9c2 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/UpdateLobTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/UpdateLobTest.php
@@ -14,7 +14,7 @@ class UpdateLobTest extends DatabaseTestBase {
/**
* Confirms that we can update a blob column.
*/
- public function testUpdateOneBlob() {
+ public function testUpdateOneBlob(): void {
$data = "This is\000a test.";
$this->assertSame(15, strlen($data), 'Test data contains a NULL.');
$id = $this->connection->insert('test_one_blob')
@@ -34,7 +34,7 @@ class UpdateLobTest extends DatabaseTestBase {
/**
* Tests that we can update a blob column to null.
*/
- public function testUpdateNullBlob() {
+ public function testUpdateNullBlob(): void {
$id = $this->connection->insert('test_one_blob')
->fields(['blob1' => 'test'])
->execute();
@@ -52,7 +52,7 @@ class UpdateLobTest extends DatabaseTestBase {
/**
* Confirms that we can update two blob columns in the same table.
*/
- public function testUpdateMultipleBlob() {
+ public function testUpdateMultipleBlob(): void {
$id = $this->connection->insert('test_two_blobs')
->fields([
'blob1' => 'This is',
diff --git a/core/tests/Drupal/KernelTests/Core/Database/UpdateTest.php b/core/tests/Drupal/KernelTests/Core/Database/UpdateTest.php
index eaaacc52f1c..260237c06b3 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/UpdateTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/UpdateTest.php
@@ -17,7 +17,7 @@ class UpdateTest extends DatabaseTestBase {
/**
* Confirms that we can update a single record successfully.
*/
- public function testSimpleUpdate() {
+ public function testSimpleUpdate(): void {
$num_updated = $this->connection->update('test')
->fields(['name' => 'Tiffany'])
->condition('id', 1)
@@ -31,7 +31,7 @@ class UpdateTest extends DatabaseTestBase {
/**
* Confirms updating to NULL.
*/
- public function testSimpleNullUpdate() {
+ public function testSimpleNullUpdate(): void {
$this->ensureSampleDataNull();
$num_updated = $this->connection->update('test_null')
->fields(['age' => NULL])
@@ -46,7 +46,7 @@ class UpdateTest extends DatabaseTestBase {
/**
* Confirms that we can update multiple records successfully.
*/
- public function testMultiUpdate() {
+ public function testMultiUpdate(): void {
$num_updated = $this->connection->update('test')
->fields(['job' => 'Musician'])
->condition('job', 'Singer')
@@ -60,7 +60,7 @@ class UpdateTest extends DatabaseTestBase {
/**
* Confirms that we can update multiple records with a non-equality condition.
*/
- public function testMultiGTUpdate() {
+ public function testMultiGTUpdate(): void {
$num_updated = $this->connection->update('test')
->fields(['job' => 'Musician'])
->condition('age', 26, '>')
@@ -74,7 +74,7 @@ class UpdateTest extends DatabaseTestBase {
/**
* Confirms that we can update multiple records with a where call.
*/
- public function testWhereUpdate() {
+ public function testWhereUpdate(): void {
$num_updated = $this->connection->update('test')
->fields(['job' => 'Musician'])
->where('[age] > :age', [':age' => 26])
@@ -88,7 +88,7 @@ class UpdateTest extends DatabaseTestBase {
/**
* Confirms that we can stack condition and where calls.
*/
- public function testWhereAndConditionUpdate() {
+ public function testWhereAndConditionUpdate(): void {
$update = $this->connection->update('test')
->fields(['job' => 'Musician'])
->where('[age] > :age', [':age' => 26])
@@ -103,7 +103,7 @@ class UpdateTest extends DatabaseTestBase {
/**
* Tests updating with expressions.
*/
- public function testExpressionUpdate() {
+ public function testExpressionUpdate(): void {
// Ensure that expressions are handled properly. This should set every
// record's age to a square of itself.
$num_rows = $this->connection->update('test')
@@ -118,7 +118,7 @@ class UpdateTest extends DatabaseTestBase {
/**
* Tests return value on update.
*/
- public function testUpdateAffectedRows() {
+ public function testUpdateAffectedRows(): void {
// At 5am in the morning, all band members but those with a priority 1 task
// are sleeping. So we set their tasks to 'sleep'. 5 records match the
// condition and therefore are affected by the query, even though two of
@@ -135,7 +135,7 @@ class UpdateTest extends DatabaseTestBase {
/**
* Confirm that we can update values in a column with special name.
*/
- public function testSpecialColumnUpdate() {
+ public function testSpecialColumnUpdate(): void {
$num_updated = $this->connection->update('select')
->fields([
'update' => 'New update value',
diff --git a/core/tests/Drupal/KernelTests/Core/Database/UpsertTest.php b/core/tests/Drupal/KernelTests/Core/Database/UpsertTest.php
index 47a83be9e59..edb2717ed63 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/UpsertTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/UpsertTest.php
@@ -17,7 +17,7 @@ class UpsertTest extends DatabaseTestBase {
/**
* Confirms that we can upsert (update-or-insert) records successfully.
*/
- public function testUpsert() {
+ public function testUpsert(): void {
$connection = Database::getConnection();
$num_records_before = $connection->query('SELECT COUNT(*) FROM {test_people}')->fetchField();
@@ -61,7 +61,7 @@ class UpsertTest extends DatabaseTestBase {
/**
* Confirms that we can upsert records with keywords successfully.
*/
- public function testUpsertWithKeywords() {
+ public function testUpsertWithKeywords(): void {
$num_records_before = $this->connection->query('SELECT COUNT(*) FROM {select}')->fetchField();
$upsert = $this->connection->upsert('select')
@@ -127,7 +127,7 @@ class UpsertTest extends DatabaseTestBase {
/**
* Tests that we can upsert a null into blob field.
*/
- public function testUpsertNullBlob() {
+ public function testUpsertNullBlob(): void {
$id = $this->connection->insert('test_one_blob')
->fields(['blob1' => 'test'])
->execute();
diff --git a/core/tests/Drupal/KernelTests/Core/Datetime/DateFormatterTest.php b/core/tests/Drupal/KernelTests/Core/Datetime/DateFormatterTest.php
index f9228eea5d9..e3c68cb72fd 100644
--- a/core/tests/Drupal/KernelTests/Core/Datetime/DateFormatterTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Datetime/DateFormatterTest.php
@@ -55,7 +55,7 @@ class DateFormatterTest extends KernelTestBase {
*
* @covers ::format
*/
- public function testFormat() {
+ public function testFormat(): void {
/** @var \Drupal\Core\Datetime\DateFormatterInterface $formatter */
$formatter = $this->container->get('date.formatter');
/** @var \Drupal\Core\Language\LanguageManagerInterface $language_manager */
@@ -121,7 +121,7 @@ class DateFormatterTest extends KernelTestBase {
*
* @covers ::format
*/
- public function testRfc2822DateFormat() {
+ public function testRfc2822DateFormat(): void {
$days_of_week_abbr = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
foreach ($days_of_week_abbr as $day_of_week_abbr) {
$this->setSetting('locale_custom_strings_' . self::LANGCODE, [
diff --git a/core/tests/Drupal/KernelTests/Core/Datetime/DatelistElementFormTest.php b/core/tests/Drupal/KernelTests/Core/Datetime/DatelistElementFormTest.php
index eb8dd5f64b1..a789f14d411 100644
--- a/core/tests/Drupal/KernelTests/Core/Datetime/DatelistElementFormTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Datetime/DatelistElementFormTest.php
@@ -109,7 +109,7 @@ class DatelistElementFormTest extends KernelTestBase implements FormInterface, T
/**
* Tests that trusted callbacks are executed.
*/
- public function testDatelistElement() {
+ public function testDatelistElement(): void {
$form_state = new FormState();
$form = \Drupal::formBuilder()->buildForm($this, $form_state);
$this->render($form);
diff --git a/core/tests/Drupal/KernelTests/Core/Datetime/DatetimeElementFormTest.php b/core/tests/Drupal/KernelTests/Core/Datetime/DatetimeElementFormTest.php
index 12792adb067..b4048f17e2b 100644
--- a/core/tests/Drupal/KernelTests/Core/Datetime/DatetimeElementFormTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Datetime/DatetimeElementFormTest.php
@@ -134,7 +134,7 @@ class DatetimeElementFormTest extends KernelTestBase implements FormInterface, T
/**
* Tests that default handlers are added even if custom are specified.
*/
- public function testDatetimeElement() {
+ public function testDatetimeElement(): void {
$form_state = new FormState();
$form = \Drupal::formBuilder()->buildForm($this, $form_state);
$this->render($form);
@@ -195,7 +195,7 @@ class DatetimeElementFormTest extends KernelTestBase implements FormInterface, T
/**
* Tests proper timezone handling of the Datetime element.
*/
- public function testTimezoneHandling() {
+ public function testTimezoneHandling(): void {
// Render the form once with the site's timezone.
$form = \Drupal::formBuilder()->getForm($this);
$this->render($form);
diff --git a/core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php b/core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php
index 6a24e520565..491e37ae818 100644
--- a/core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php
@@ -205,7 +205,7 @@ class TimezoneTest extends EntityKernelTestBase implements FormInterface {
* save the form, otherwise stored times may be changed without the user
* changing the element's values.
*/
- public function testDatetimeElementTimesUnderstoodCorrectly() {
+ public function testDatetimeElementTimesUnderstoodCorrectly(): void {
$this->assertTimesUnderstoodCorrectly('datetime', ['date', 'time']);
}
@@ -214,7 +214,7 @@ class TimezoneTest extends EntityKernelTestBase implements FormInterface {
*
* See testDatetimeElementTimesUnderstoodCorrectly() for more explanation.
*/
- public function testDatelistElementTimesUnderstoodCorrectly() {
+ public function testDatelistElementTimesUnderstoodCorrectly(): void {
$this->assertTimesUnderstoodCorrectly('datelist', [
'day',
'month',
@@ -232,7 +232,7 @@ class TimezoneTest extends EntityKernelTestBase implements FormInterface {
* accurately reflect the timezone that will be used to interpret times
* entered through the element.
*/
- public function testDatetimeTimezonePropertyProcessed() {
+ public function testDatetimeTimezonePropertyProcessed(): void {
$this->assertDateTimezonePropertyProcessed('datetime');
}
@@ -241,7 +241,7 @@ class TimezoneTest extends EntityKernelTestBase implements FormInterface {
*
* See testDatetimeTimezonePropertyProcessed() for more explanation.
*/
- public function testDatelistTimezonePropertyProcessed() {
+ public function testDatelistTimezonePropertyProcessed(): void {
$this->assertDateTimezonePropertyProcessed('datelist');
}
diff --git a/core/tests/Drupal/KernelTests/Core/Datetime/TimestampSchemaTest.php b/core/tests/Drupal/KernelTests/Core/Datetime/TimestampSchemaTest.php
index 794d5e84ab1..1ce68703462 100644
--- a/core/tests/Drupal/KernelTests/Core/Datetime/TimestampSchemaTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Datetime/TimestampSchemaTest.php
@@ -34,7 +34,7 @@ class TimestampSchemaTest extends KernelTestBase {
/**
* Tests if the timestamp field schema is validated.
*/
- public function testTimestampSchema() {
+ public function testTimestampSchema(): void {
$this->installConfig(['field_timestamp_test']);
// Make at least an assertion.
$this->assertTrue(TRUE);
diff --git a/core/tests/Drupal/KernelTests/Core/DependencyInjection/ServicesDefaultsTest.php b/core/tests/Drupal/KernelTests/Core/DependencyInjection/ServicesDefaultsTest.php
index c88e4650387..07828a27492 100644
--- a/core/tests/Drupal/KernelTests/Core/DependencyInjection/ServicesDefaultsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/DependencyInjection/ServicesDefaultsTest.php
@@ -19,7 +19,7 @@ class ServicesDefaultsTest extends KernelTestBase {
/**
* Tests that 'services_defaults_test.service' has its dependencies injected.
*/
- public function testAutowiring() {
+ public function testAutowiring(): void {
// Ensure interface autowiring works.
$this->assertSame(
$this->container->get('Drupal\services_defaults_test\TestInjection'),
@@ -50,7 +50,7 @@ class ServicesDefaultsTest extends KernelTestBase {
/**
* Tests that default tags for 'services_defaults_test.service' are applied.
*/
- public function testDefaultTags() {
+ public function testDefaultTags(): void {
// Ensure default tags work.
$testServiceDefinition = $this->container->getDefinition('Drupal\services_defaults_test\TestService');
$testInjection1Definition = $this->container->getDefinition('Drupal\services_defaults_test\TestInjection');
@@ -76,7 +76,7 @@ class ServicesDefaultsTest extends KernelTestBase {
/**
* Tests that service from 'services_defaults_test.service' is private.
*/
- public function testPrivateServices() {
+ public function testPrivateServices(): void {
// Ensure default and overridden public flag works.
$this->expectException(ServiceNotFoundException::class);
$this->container->getDefinition('Drupal\services_defaults_test\TestPrivateService');
diff --git a/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php b/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php
index c58461ea29e..337d920c27a 100644
--- a/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php
+++ b/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php
@@ -17,7 +17,7 @@ class DrupalKernelSiteTest extends KernelTestBase {
/**
* Tests services.yml in site directory.
*/
- public function testServicesYml() {
+ public function testServicesYml(): void {
$container_yamls = Settings::get('container_yamls');
$container_yamls[] = $this->siteDirectory . '/services.yml';
$this->setSetting('container_yamls', $container_yamls);
diff --git a/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php b/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php
index 41566b3ba95..8d1c4fd2ab0 100644
--- a/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php
+++ b/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php
@@ -73,7 +73,7 @@ class DrupalKernelTest extends KernelTestBase {
/**
* Tests DIC compilation.
*/
- public function testCompileDIC() {
+ public function testCompileDIC(): void {
// @todo Write a memory based storage backend for testing.
$modules_enabled = [
'system' => 'system',
@@ -155,7 +155,7 @@ class DrupalKernelTest extends KernelTestBase {
/**
* Tests repeated loading of compiled DIC with different environment.
*/
- public function testRepeatedBootWithDifferentEnvironment() {
+ public function testRepeatedBootWithDifferentEnvironment(): void {
$request = Request::createFromGlobals();
$class_loader = require $this->root . '/autoload.php';
@@ -177,7 +177,7 @@ class DrupalKernelTest extends KernelTestBase {
/**
* Tests setting of site path after kernel boot.
*/
- public function testPreventChangeOfSitePath() {
+ public function testPreventChangeOfSitePath(): void {
// @todo Write a memory based storage backend for testing.
$modules_enabled = [
'system' => 'system',
@@ -226,7 +226,7 @@ class DrupalKernelTest extends KernelTestBase {
* @param bool $value
* The value to set class_loader_auto_detect to.
*/
- public function testClassLoaderAutoDetect($value) {
+ public function testClassLoaderAutoDetect($value): void {
// Create a virtual file system containing items that should be
// excluded. Exception being modules directory.
vfsStream::setup('root', NULL, [
@@ -264,7 +264,7 @@ class DrupalKernelTest extends KernelTestBase {
/**
* @covers ::resetContainer
*/
- public function testResetContainer() {
+ public function testResetContainer(): void {
$modules_enabled = [
'system' => 'system',
'user' => 'user',
diff --git a/core/tests/Drupal/KernelTests/Core/DrupalKernel/ServiceDestructionTest.php b/core/tests/Drupal/KernelTests/Core/DrupalKernel/ServiceDestructionTest.php
index a3243f9eac7..5439351aef4 100644
--- a/core/tests/Drupal/KernelTests/Core/DrupalKernel/ServiceDestructionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/DrupalKernel/ServiceDestructionTest.php
@@ -17,7 +17,7 @@ class ServiceDestructionTest extends KernelTestBase {
/**
* Verifies that services are destructed when used.
*/
- public function testDestructionUsed() {
+ public function testDestructionUsed(): void {
// Enable the test module to add it to the container.
$this->enableModules(['service_provider_test']);
@@ -39,7 +39,7 @@ class ServiceDestructionTest extends KernelTestBase {
/**
* Verifies that services are not unnecessarily destructed when not used.
*/
- public function testDestructionUnused() {
+ public function testDestructionUnused(): void {
// Enable the test module to add it to the container.
$this->enableModules(['service_provider_test']);
diff --git a/core/tests/Drupal/KernelTests/Core/Element/PathElementFormTest.php b/core/tests/Drupal/KernelTests/Core/Element/PathElementFormTest.php
index 69e5c938c77..8ce07d663e8 100644
--- a/core/tests/Drupal/KernelTests/Core/Element/PathElementFormTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Element/PathElementFormTest.php
@@ -140,7 +140,7 @@ class PathElementFormTest extends KernelTestBase implements FormInterface {
/**
* Tests that default handlers are added even if custom are specified.
*/
- public function testPathElement() {
+ public function testPathElement(): void {
$form_state = (new FormState())
->setValues([
'required_validate' => 'user/' . $this->testUser->id(),
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/BundleClassTest.php b/core/tests/Drupal/KernelTests/Core/Entity/BundleClassTest.php
index c95bf42e700..3704d5c6478 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/BundleClassTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/BundleClassTest.php
@@ -46,7 +46,7 @@ class BundleClassTest extends EntityKernelTestBase {
/**
* Tests making use of a custom bundle class.
*/
- public function testEntitySubclass() {
+ public function testEntitySubclass(): void {
entity_test_create_bundle('bundle_class');
// Ensure we start life with empty counters.
@@ -206,7 +206,7 @@ class BundleClassTest extends EntityKernelTestBase {
/**
* Tests making use of a custom bundle class for an entity without bundles.
*/
- public function testEntityNoBundleSubclass() {
+ public function testEntityNoBundleSubclass(): void {
$this->container->get('state')->set('entity_test_bundle_class_enable_user_class', TRUE);
$this->container->get('kernel')->rebuildContainer();
$this->entityTypeManager->clearCachedDefinitions();
@@ -220,7 +220,7 @@ class BundleClassTest extends EntityKernelTestBase {
*
* @covers Drupal\Core\Entity\ContentEntityStorageBase::create
*/
- public function testAmbiguousBundleClassExceptionCreate() {
+ public function testAmbiguousBundleClassExceptionCreate(): void {
$this->container->get('state')->set('entity_test_bundle_class_enable_ambiguous_entity_types', TRUE);
$this->entityTypeManager->clearCachedDefinitions();
entity_test_create_bundle('bundle_class');
@@ -237,7 +237,7 @@ class BundleClassTest extends EntityKernelTestBase {
*
* @covers Drupal\Core\Entity\EntityTypeRepository::getEntityTypeFromClass
*/
- public function testAmbiguousBundleClassExceptionEntityTypeRepository() {
+ public function testAmbiguousBundleClassExceptionEntityTypeRepository(): void {
$this->container->get('state')->set('entity_test_bundle_class_enable_ambiguous_entity_types', TRUE);
entity_test_create_bundle('entity_test_no_label');
entity_test_create_bundle('entity_test_no_label', NULL, 'entity_test_no_label');
@@ -262,7 +262,7 @@ class BundleClassTest extends EntityKernelTestBase {
/**
* Checks exception thrown if a bundle class doesn't extend the entity class.
*/
- public function testBundleClassShouldExtendEntityClass() {
+ public function testBundleClassShouldExtendEntityClass(): void {
$this->container->get('state')->set('entity_test_bundle_class_non_inheriting', TRUE);
$this->entityTypeManager->clearCachedDefinitions();
$this->expectException(BundleClassInheritanceException::class);
@@ -273,7 +273,7 @@ class BundleClassTest extends EntityKernelTestBase {
/**
* Checks exception thrown if a bundle class doesn't exist.
*/
- public function testBundleClassShouldExist() {
+ public function testBundleClassShouldExist(): void {
$this->container->get('state')->set('entity_test_bundle_class_does_not_exist', TRUE);
$this->entityTypeManager->clearCachedDefinitions();
$this->expectException(MissingBundleClassException::class);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php
index 321a830a7d1..c962a2a14e6 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/BundleConstraintValidatorTest.php
@@ -35,7 +35,7 @@ class BundleConstraintValidatorTest extends KernelTestBase {
/**
* Tests bundle constraint validation.
*/
- public function testValidation() {
+ public function testValidation(): void {
// Test with multiple values.
$this->assertValidation(['foo', 'bar']);
// Test with a single string value as well.
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/BundlePermissionHandlerTraitTest.php b/core/tests/Drupal/KernelTests/Core/Entity/BundlePermissionHandlerTraitTest.php
index b3356a58708..d69ea0d9f76 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/BundlePermissionHandlerTraitTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/BundlePermissionHandlerTraitTest.php
@@ -25,7 +25,7 @@ class BundlePermissionHandlerTraitTest extends KernelTestBase {
/**
* @covers ::generatePermissions
*/
- public function testGeneratePermissions() {
+ public function testGeneratePermissions(): void {
EntityTestBundle::create([
'id' => 'test1',
])->save();
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityAdapterTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityAdapterTest.php
index 8c8e59a048f..f8c9848bfcf 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityAdapterTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityAdapterTest.php
@@ -53,7 +53,7 @@ class ConfigEntityAdapterTest extends KernelTestBase {
/**
* @covers \Drupal\Core\Entity\Plugin\DataType\Deriver\EntityDeriver::getDerivativeDefinitions
*/
- public function testEntityDeriver() {
+ public function testEntityDeriver(): void {
$definition = \Drupal::typedDataManager()->getDefinition('entity:config_test');
$this->assertEquals(ConfigEntityAdapter::class, $definition['class']);
}
@@ -61,7 +61,7 @@ class ConfigEntityAdapterTest extends KernelTestBase {
/**
* @covers ::validate
*/
- public function testValidate() {
+ public function testValidate(): void {
$adapter = ConfigEntityAdapter::createFromEntity($this->entity);
$violations = $adapter->validate();
$this->assertEmpty($violations);
@@ -85,7 +85,7 @@ class ConfigEntityAdapterTest extends KernelTestBase {
/**
* @covers ::getProperties
*/
- public function testGetProperties() {
+ public function testGetProperties(): void {
$expected_properties = [
'uuid' => StringData::class,
'langcode' => StringData::class,
@@ -111,7 +111,7 @@ class ConfigEntityAdapterTest extends KernelTestBase {
/**
* @covers ::getValue
*/
- public function testGetValue() {
+ public function testGetValue(): void {
$adapter = ConfigEntityAdapter::createFromEntity($this->entity);
$this->assertEquals($this->entity->weight, $adapter->get('weight')->getValue());
$this->assertEquals($this->entity->id(), $adapter->get('id')->getValue());
@@ -121,7 +121,7 @@ class ConfigEntityAdapterTest extends KernelTestBase {
/**
* @covers ::set
*/
- public function testSet() {
+ public function testSet(): void {
$adapter = ConfigEntityAdapter::createFromEntity($this->entity);
// Get the value via typed data to ensure that the typed representation is
// updated correctly when the value is set.
@@ -137,7 +137,7 @@ class ConfigEntityAdapterTest extends KernelTestBase {
/**
* @covers ::getString
*/
- public function testGetString() {
+ public function testGetString(): void {
$adapter = ConfigEntityAdapter::createFromEntity($this->entity);
$this->assertEquals('foobar', $adapter->getString());
}
@@ -145,7 +145,7 @@ class ConfigEntityAdapterTest extends KernelTestBase {
/**
* @covers ::applyDefaultValue
*/
- public function testApplyDefaultValue() {
+ public function testApplyDefaultValue(): void {
$this->expectException(\BadMethodCallException::class);
$this->expectExceptionMessage('Method not supported');
$adapter = ConfigEntityAdapter::createFromEntity($this->entity);
@@ -155,7 +155,7 @@ class ConfigEntityAdapterTest extends KernelTestBase {
/**
* @covers ::getIterator
*/
- public function testGetIterator() {
+ public function testGetIterator(): void {
$adapter = ConfigEntityAdapter::createFromEntity($this->entity);
$iterator = $adapter->getIterator();
$fields = iterator_to_array($iterator);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php
index cc01678df88..d7fbca66810 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php
@@ -144,7 +144,7 @@ class ConfigEntityQueryTest extends KernelTestBase {
/**
* Tests basic functionality.
*/
- public function testConfigEntityQuery() {
+ public function testConfigEntityQuery(): void {
// Run a test without any condition.
$this->queryResults = $this->entityStorage->getQuery()
->execute();
@@ -374,7 +374,7 @@ class ConfigEntityQueryTest extends KernelTestBase {
/**
* Tests ID conditions.
*/
- public function testStringIdConditions() {
+ public function testStringIdConditions(): void {
// We need an entity with a non-numeric ID.
$entity = ConfigQueryTest::create([
'label' => 'entity_1',
@@ -430,7 +430,7 @@ class ConfigEntityQueryTest extends KernelTestBase {
/**
* Tests count query.
*/
- public function testCount() {
+ public function testCount(): void {
// Test count on no conditions.
$count = $this->entityStorage->getQuery()
->count()
@@ -456,7 +456,7 @@ class ConfigEntityQueryTest extends KernelTestBase {
/**
* Tests sorting and range on config entity queries.
*/
- public function testSortRange() {
+ public function testSortRange(): void {
// Sort by simple ascending/descending.
$this->queryResults = $this->entityStorage->getQuery()
->sort('number', 'DESC')
@@ -546,7 +546,7 @@ class ConfigEntityQueryTest extends KernelTestBase {
/**
* Tests sorting with tableSort on config entity queries.
*/
- public function testTableSort() {
+ public function testTableSort(): void {
$header = [
['data' => 'ID', 'specifier' => 'id'],
['data' => 'Number', 'specifier' => 'number'],
@@ -614,7 +614,7 @@ class ConfigEntityQueryTest extends KernelTestBase {
/**
* Tests dotted path matching.
*/
- public function testDotted() {
+ public function testDotted(): void {
$this->queryResults = $this->entityStorage->getQuery()
->condition('array.level1.*', 1)
->execute();
@@ -688,7 +688,7 @@ class ConfigEntityQueryTest extends KernelTestBase {
/**
* Tests case sensitivity.
*/
- public function testCaseSensitivity() {
+ public function testCaseSensitivity(): void {
// Filter by label with a known containing case-sensitive word.
$this->queryResults = $this->entityStorage->getQuery()
->condition('label', 'TEST', 'CONTAINS')
@@ -704,7 +704,7 @@ class ConfigEntityQueryTest extends KernelTestBase {
/**
* Tests lookup keys are added to the key value store.
*/
- public function testLookupKeys() {
+ public function testLookupKeys(): void {
\Drupal::service('state')->set('config_test.lookup_keys', TRUE);
\Drupal::entityTypeManager()->clearCachedDefinitions();
$key_value = $this->container->get('keyvalue')->get(QueryFactory::CONFIG_LOOKUP_PREFIX . 'config_test');
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityChangedTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityChangedTest.php
index ede11147aee..32a49bf0a04 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityChangedTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityChangedTest.php
@@ -64,7 +64,7 @@ class ContentEntityChangedTest extends EntityKernelTestBase {
/**
* Tests basic EntityChangedInterface functionality.
*/
- public function testChanged() {
+ public function testChanged(): void {
$user1 = $this->createUser();
$user2 = $this->createUser();
@@ -241,7 +241,7 @@ class ContentEntityChangedTest extends EntityKernelTestBase {
/**
* Tests revisionable EntityChangedInterface functionality.
*/
- public function testRevisionChanged() {
+ public function testRevisionChanged(): void {
$user1 = $this->createUser();
$user2 = $this->createUser();
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php
index e27dc5b6a31..273eb7b6475 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php
@@ -36,7 +36,7 @@ class ContentEntityCloneTest extends EntityKernelTestBase {
/**
* Tests if entity references on fields are still correct after cloning.
*/
- public function testFieldEntityReferenceAfterClone() {
+ public function testFieldEntityReferenceAfterClone(): void {
$user = $this->createUser();
// Create a test entity.
@@ -76,7 +76,7 @@ class ContentEntityCloneTest extends EntityKernelTestBase {
/**
* Tests that the flag for enforcing a new entity is not shared.
*/
- public function testEnforceIsNewOnClonedEntityTranslation() {
+ public function testEnforceIsNewOnClonedEntityTranslation(): void {
// Create a test entity.
$entity = EntityTestMul::create([
'name' => $this->randomString(),
@@ -103,7 +103,7 @@ class ContentEntityCloneTest extends EntityKernelTestBase {
/**
* Tests if the entity fields are properly cloned.
*/
- public function testClonedEntityFields() {
+ public function testClonedEntityFields(): void {
$user = $this->createUser();
// Create a test entity.
@@ -148,7 +148,7 @@ class ContentEntityCloneTest extends EntityKernelTestBase {
/**
* Tests that the flag for enforcing a new revision is not shared.
*/
- public function testNewRevisionOnCloneEntityTranslation() {
+ public function testNewRevisionOnCloneEntityTranslation(): void {
// Create a test entity.
$entity = EntityTestMulRev::create([
'name' => $this->randomString(),
@@ -180,7 +180,7 @@ class ContentEntityCloneTest extends EntityKernelTestBase {
/**
* Tests modifications on entity keys of a cloned entity object.
*/
- public function testEntityKeysModifications() {
+ public function testEntityKeysModifications(): void {
// Create a test entity with a translation, which will internally trigger
// entity cloning for the new translation and create references for some of
// the entity properties.
@@ -220,7 +220,7 @@ class ContentEntityCloneTest extends EntityKernelTestBase {
/**
* Tests the field values after serializing an entity and its clone.
*/
- public function testFieldValuesAfterSerialize() {
+ public function testFieldValuesAfterSerialize(): void {
// Create a test entity with a translation, which will internally trigger
// entity cloning for the new translation and create references for some of
// the entity properties.
@@ -252,7 +252,7 @@ class ContentEntityCloneTest extends EntityKernelTestBase {
/**
* Tests changing the default revision flag.
*/
- public function testDefaultRevision() {
+ public function testDefaultRevision(): void {
// Create a test entity with a translation, which will internally trigger
// entity cloning for the new translation and create references for some of
// the entity properties.
@@ -279,7 +279,7 @@ class ContentEntityCloneTest extends EntityKernelTestBase {
/**
* Tests references of entity properties after entity cloning.
*/
- public function testEntityPropertiesModifications() {
+ public function testEntityPropertiesModifications(): void {
// Create a test entity with a translation, which will internally trigger
// entity cloning for the new translation and create references for some of
// the entity properties.
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityFieldMethodInvocationOrderTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityFieldMethodInvocationOrderTest.php
index f302c8e3b49..6327e39f6dc 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityFieldMethodInvocationOrderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityFieldMethodInvocationOrderTest.php
@@ -45,7 +45,7 @@ class ContentEntityFieldMethodInvocationOrderTest extends EntityKernelTestBase {
/**
* Tests correct field method invocation order.
*/
- public function testFieldMethodInvocationOrder() {
+ public function testFieldMethodInvocationOrder(): void {
// Create a test entity.
$entity = $this->entityTestFieldMethodsStorage->create([
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityHasChangesTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityHasChangesTest.php
index 0247245f473..4978a4bf110 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityHasChangesTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityHasChangesTest.php
@@ -39,7 +39,7 @@ class ContentEntityHasChangesTest extends KernelTestBase {
/**
* Tests the correct functionality of the hasTranslationChanges() function.
*/
- public function testHasTranslationChanges() {
+ public function testHasTranslationChanges(): void {
$user1 = User::create([
'name' => 'username1',
'status' => 1,
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNonRevisionableFieldTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNonRevisionableFieldTest.php
index b723086d32e..ab7371fadec 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNonRevisionableFieldTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNonRevisionableFieldTest.php
@@ -73,7 +73,7 @@ class ContentEntityNonRevisionableFieldTest extends EntityKernelTestBase {
/**
* Tests non-revisionable fields on revisionable and translatable entities.
*/
- public function testMulNonRevisionableField() {
+ public function testMulNonRevisionableField(): void {
$user1 = $this->createUser();
$user2 = $this->createUser();
@@ -141,7 +141,7 @@ class ContentEntityNonRevisionableFieldTest extends EntityKernelTestBase {
/**
* Tests non-revisionable fields on revisionable entities.
*/
- public function testNonRevisionableField() {
+ public function testNonRevisionableField(): void {
$user1 = $this->createUser();
$user2 = $this->createUser();
@@ -202,7 +202,7 @@ class ContentEntityNonRevisionableFieldTest extends EntityKernelTestBase {
/**
* Tests multi column non revisionable base field for revisionable entity.
*/
- public function testMultiColumnNonRevisionableBaseField() {
+ public function testMultiColumnNonRevisionableBaseField(): void {
\Drupal::state()->set('entity_test.multi_column', TRUE);
$this->applyEntityUpdates('entity_test_mulrev');
// Refresh the storage.
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNullStorageTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNullStorageTest.php
index dcc8158c9f3..fc5f662be94 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNullStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNullStorageTest.php
@@ -31,7 +31,7 @@ class ContentEntityNullStorageTest extends KernelTestBase {
*
* @see \Drupal\Core\Entity\Query\Null\Query
*/
- public function testEntityQuery() {
+ public function testEntityQuery(): void {
$this->assertSame(0, \Drupal::entityQuery('contact_message')->accessCheck(FALSE)->count()->execute(), 'Counting a null storage returns 0.');
$this->assertSame([], \Drupal::entityQuery('contact_message')->accessCheck(FALSE)->execute(), 'Querying a null storage returns an empty array.');
$this->assertSame([], \Drupal::entityQuery('contact_message')->accessCheck(FALSE)->condition('contact_form', 'test')->execute(), 'Querying a null storage returns an empty array and conditions are ignored.');
@@ -44,7 +44,7 @@ class ContentEntityNullStorageTest extends KernelTestBase {
*
* @see \Drupal\Core\Entity\Event\BundleConfigImportValidate
*/
- public function testDeleteThroughImport() {
+ public function testDeleteThroughImport(): void {
$this->installConfig(['system']);
$contact_form = ContactForm::create(['id' => 'test', 'label' => 'Test contact form']);
$contact_form->save();
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityStorageBaseTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityStorageBaseTest.php
index 0ee23a8e8d4..8bf86c67734 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityStorageBaseTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityStorageBaseTest.php
@@ -52,7 +52,7 @@ class ContentEntityStorageBaseTest extends KernelTestBase {
/**
* @covers ::create
*/
- public function testReCreate() {
+ public function testReCreate(): void {
$storage = $this->container->get('entity_type.manager')->getStorage('entity_test');
$values = $storage->create(['type' => 'test_bundle'])->toArray();
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/CreateSampleEntityTest.php b/core/tests/Drupal/KernelTests/Core/Entity/CreateSampleEntityTest.php
index 7401f2d0206..1fc832dda5c 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/CreateSampleEntityTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/CreateSampleEntityTest.php
@@ -66,7 +66,7 @@ class CreateSampleEntityTest extends KernelTestBase {
*
* @covers ::createWithSampleValues
*/
- public function testSampleValueContentEntity() {
+ public function testSampleValueContentEntity(): void {
foreach ($this->entityTypeManager->getDefinitions() as $entity_type_id => $definition) {
if ($definition->entityClassImplements(FieldableEntityInterface::class)) {
$label = $definition->getKey('label');
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php
index 16b3b98ae0a..6dcdbd0bffd 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/DefaultTableMappingIntegrationTest.php
@@ -78,7 +78,7 @@ class DefaultTableMappingIntegrationTest extends EntityKernelTestBase {
*
* @covers ::getFieldTableName
*/
- public function testGetFieldTableName() {
+ public function testGetFieldTableName(): void {
// Test the field table name for a single-valued base field, which is stored
// in the entity's base table.
$expected = 'entity_test_mulrev';
@@ -98,7 +98,7 @@ class DefaultTableMappingIntegrationTest extends EntityKernelTestBase {
/**
* @covers ::getAllFieldTableNames
*/
- public function testGetAllFieldTableNames() {
+ public function testGetAllFieldTableNames(): void {
// Check a field that is stored in all the shared tables.
$expected = [
'entity_test_mulrev',
@@ -137,7 +137,7 @@ class DefaultTableMappingIntegrationTest extends EntityKernelTestBase {
*
* @covers ::getTableNames
*/
- public function testGetTableNames() {
+ public function testGetTableNames(): void {
$storage_definitions = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions('entity_test_mulrev');
$dedicated_data_table = $this->tableMapping->getDedicatedDataTableName($storage_definitions['multivalued_base_field']);
$dedicated_revision_table = $this->tableMapping->getDedicatedRevisionTableName($storage_definitions['multivalued_base_field']);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/Element/EntityAutocompleteElementFormTest.php b/core/tests/Drupal/KernelTests/Core/Entity/Element/EntityAutocompleteElementFormTest.php
index 4fc3958421e..bd7ec5c89c7 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/Element/EntityAutocompleteElementFormTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/Element/EntityAutocompleteElementFormTest.php
@@ -213,7 +213,7 @@ class EntityAutocompleteElementFormTest extends EntityKernelTestBase implements
/**
* Tests valid entries in the EntityAutocomplete Form API element.
*/
- public function testValidEntityAutocompleteElement() {
+ public function testValidEntityAutocompleteElement(): void {
$form_state = (new FormState())
->setValues([
'single' => $this->getAutocompleteInput($this->referencedEntities[0]),
@@ -293,7 +293,7 @@ class EntityAutocompleteElementFormTest extends EntityKernelTestBase implements
/**
* Tests invalid entries in the EntityAutocomplete Form API element.
*/
- public function testInvalidEntityAutocompleteElement() {
+ public function testInvalidEntityAutocompleteElement(): void {
$form_builder = $this->container->get('form_builder');
// Test 'single' with an entity label that doesn't exist
@@ -343,7 +343,7 @@ class EntityAutocompleteElementFormTest extends EntityKernelTestBase implements
/**
* Tests that access is properly checked by the EntityAutocomplete element.
*/
- public function testEntityAutocompleteAccess() {
+ public function testEntityAutocompleteAccess(): void {
$form_builder = $this->container->get('form_builder');
$form = $form_builder->getForm($this);
@@ -372,7 +372,7 @@ class EntityAutocompleteElementFormTest extends EntityKernelTestBase implements
*
* E.g. This can happen with GET form parameters.
*/
- public function testEntityAutocompleteIdInput() {
+ public function testEntityAutocompleteIdInput(): void {
/** @var \Drupal\Core\Form\FormBuilderInterface $form_builder */
$form_builder = $this->container->get('form_builder');
// $form = $form_builder->getForm($this);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityAccessControlHandlerTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityAccessControlHandlerTest.php
index 933f8566f5e..f26280096eb 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityAccessControlHandlerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityAccessControlHandlerTest.php
@@ -57,7 +57,7 @@ class EntityAccessControlHandlerTest extends EntityLanguageTestBase {
/**
* Ensures user labels are accessible for everyone.
*/
- public function testUserLabelAccess() {
+ public function testUserLabelAccess(): void {
// Set up a non-admin user.
\Drupal::currentUser()->setAccount($this->createUser([], NULL, FALSE, ['uid' => 2]));
@@ -111,7 +111,7 @@ class EntityAccessControlHandlerTest extends EntityLanguageTestBase {
/**
* Ensures entity access is properly working.
*/
- public function testEntityAccess() {
+ public function testEntityAccess(): void {
// Set up a non-admin user that is allowed to view test entities.
\Drupal::currentUser()->setAccount($this->createUser(['view test entity'], NULL, FALSE, ['uid' => 2]));
@@ -154,7 +154,7 @@ class EntityAccessControlHandlerTest extends EntityLanguageTestBase {
* @see \Drupal\entity_test\EntityTestAccessControlHandler::checkAccess()
* @see entity_test_entity_access()
*/
- public function testDefaultEntityAccess() {
+ public function testDefaultEntityAccess(): void {
// Set up a non-admin user that is allowed to view test entities.
\Drupal::currentUser()->setAccount($this->createUser(['view test entity'], NULL, FALSE, ['uid' => 2]));
$entity = EntityTest::create([
@@ -173,7 +173,7 @@ class EntityAccessControlHandlerTest extends EntityLanguageTestBase {
/**
* Ensures that the default handler is used as a fallback.
*/
- public function testEntityAccessDefaultController() {
+ public function testEntityAccessDefaultController(): void {
// The implementation requires that the global user id can be loaded.
\Drupal::currentUser()->setAccount($this->createUser([], NULL, FALSE, ['uid' => 2]));
@@ -194,7 +194,7 @@ class EntityAccessControlHandlerTest extends EntityLanguageTestBase {
/**
* Ensures entity access for entity translations is properly working.
*/
- public function testEntityTranslationAccess() {
+ public function testEntityTranslationAccess(): void {
// Set up a non-admin user that is allowed to view test entity translations.
\Drupal::currentUser()->setAccount($this->createUser(['view test entity translations'], NULL, FALSE, ['uid' => 2]));
@@ -224,7 +224,7 @@ class EntityAccessControlHandlerTest extends EntityLanguageTestBase {
*
* @see entity_test_entity_access()
*/
- public function testEntityWithoutUuidAccessCache() {
+ public function testEntityWithoutUuidAccessCache(): void {
$account = $this->createUser();
$entity1 = EntityTestNoUuid::create([
@@ -253,7 +253,7 @@ class EntityAccessControlHandlerTest extends EntityLanguageTestBase {
*
* @see entity_test_entity_access()
*/
- public function testEntityWithUuidAccessCache() {
+ public function testEntityWithUuidAccessCache(): void {
$account = $this->createUser();
$entity1 = EntityTestRev::create([
@@ -280,7 +280,7 @@ class EntityAccessControlHandlerTest extends EntityLanguageTestBase {
/**
* Tests hook invocations.
*/
- public function testHooks() {
+ public function testHooks(): void {
$state = $this->container->get('state');
$entity = EntityTest::create([
'name' => 'test',
@@ -304,7 +304,7 @@ class EntityAccessControlHandlerTest extends EntityLanguageTestBase {
* @covers ::fieldAccess
* @dataProvider providerTestFieldAccess
*/
- public function testFieldAccess($entity_class, array $entity_create_values, $expected_id_create_access) {
+ public function testFieldAccess($entity_class, array $entity_create_values, $expected_id_create_access): void {
// Set up a non-admin user that is allowed to create and update test
// entities.
\Drupal::currentUser()->setAccount($this->createUser(['administer entity_test content'], NULL, FALSE, ['uid' => 2]));
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php
index bef50bd5bfd..07ae276d8e7 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php
@@ -33,7 +33,7 @@ class EntityApiTest extends EntityKernelTestBase {
/**
* Tests basic CRUD functionality of the Entity API.
*/
- public function testCRUD() {
+ public function testCRUD(): void {
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->assertCRUD($entity_type, $this->createUser());
@@ -147,7 +147,7 @@ class EntityApiTest extends EntityKernelTestBase {
*
* Entities should be returned in the same order as the passed IDs.
*/
- public function testLoadMultiple() {
+ public function testLoadMultiple(): void {
// Entity load.
$storage = $this->container->get('entity_type.manager')->getStorage('entity_test');
@@ -204,7 +204,7 @@ class EntityApiTest extends EntityKernelTestBase {
/**
* Tests that exceptions are thrown when saving or deleting an entity.
*/
- public function testEntityStorageExceptionHandling() {
+ public function testEntityStorageExceptionHandling(): void {
$entity = EntityTest::create(['name' => 'test']);
try {
$GLOBALS['entity_test_throw_exception'] = TRUE;
@@ -249,7 +249,7 @@ class EntityApiTest extends EntityKernelTestBase {
/**
* Tests that resaving a revision with a different revision ID throws an exception.
*/
- public function testUpdateWithRevisionId() {
+ public function testUpdateWithRevisionId(): void {
$storage = \Drupal::entityTypeManager()->getStorage('entity_test_mulrev');
// Create a new entity.
@@ -267,7 +267,7 @@ class EntityApiTest extends EntityKernelTestBase {
/**
* Tests that resaving an entity with a different entity ID throws an exception.
*/
- public function testUpdateWithId() {
+ public function testUpdateWithId(): void {
$storage = \Drupal::entityTypeManager()->getStorage('entity_test_mulrev');
// Create a new entity.
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityAutocompleteTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityAutocompleteTest.php
index eaf38ece6d9..43c24e42e87 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityAutocompleteTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityAutocompleteTest.php
@@ -44,7 +44,7 @@ class EntityAutocompleteTest extends EntityKernelTestBase {
/**
* Tests autocompletion edge cases with slashes in the names.
*/
- public function testEntityReferenceAutocompletion() {
+ public function testEntityReferenceAutocompletion(): void {
// Add an entity with a slash in its name.
$entity_1 = $this->container->get('entity_type.manager')
->getStorage($this->entityType)
@@ -145,7 +145,7 @@ class EntityAutocompleteTest extends EntityKernelTestBase {
/**
* Tests that missing or invalid selection setting key are handled correctly.
*/
- public function testSelectionSettingsHandling() {
+ public function testSelectionSettingsHandling(): void {
$entity_reference_controller = EntityAutocompleteController::create($this->container);
$request = Request::create('entity_reference_autocomplete/' . $this->entityType . '/default');
$request->query->set('q', $this->randomString());
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityBaseTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityBaseTest.php
index 2ca05368bdc..893213ee500 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityBaseTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityBaseTest.php
@@ -32,7 +32,7 @@ class EntityBaseTest extends EntityKernelTestBase {
*
* @covers ::getTypedData
*/
- public function testGetTypedData() {
+ public function testGetTypedData(): void {
$bundle = EntityTestBundle::create([
'id' => $this->randomMachineName(),
]);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleConditionTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleConditionTest.php
index a80fce19cac..1ad86c1966e 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleConditionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleConditionTest.php
@@ -33,7 +33,7 @@ class EntityBundleConditionTest extends EntityKernelTestBase {
/**
* Tests conditions.
*/
- public function testConditions() {
+ public function testConditions(): void {
$this->createUser();
// Get some entities of various bundles to check against.
$page = EntityTestWithBundle::create(['type' => 'page', 'name' => $this->randomMachineName()]);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleFieldTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleFieldTest.php
index 0290d587adf..4ef34422c3c 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleFieldTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleFieldTest.php
@@ -46,7 +46,7 @@ class EntityBundleFieldTest extends EntityKernelTestBase {
/**
* Tests making use of a custom bundle field.
*/
- public function testCustomBundleFieldUsage() {
+ public function testCustomBundleFieldUsage(): void {
entity_test_create_bundle('custom', NULL, 'entity_test_update');
// Check that an entity with bundle entity_test does not have the custom
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleListenerTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleListenerTest.php
index 718dc4767d6..9e87ad7d52b 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleListenerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityBundleListenerTest.php
@@ -20,7 +20,7 @@ class EntityBundleListenerTest extends EntityKernelTestBase {
*
* @covers ::onBundleCreate
*/
- public function testOnBundleCreate() {
+ public function testOnBundleCreate(): void {
$field_map = $this->container->get('entity_field.manager')->getFieldMap();
$expected = [
'entity_test' => 'entity_test',
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php
index 63bc66b8190..02ebbb76e34 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php
@@ -99,7 +99,7 @@ class EntityCrudHookTest extends EntityKernelTestBase {
/**
* Tests hook invocations for CRUD operations on blocks.
*/
- public function testBlockHooks() {
+ public function testBlockHooks(): void {
$entity = Block::create([
'id' => 'stark_test_html',
'plugin' => 'test_html',
@@ -154,7 +154,7 @@ class EntityCrudHookTest extends EntityKernelTestBase {
/**
* Tests hook invocations for CRUD operations on comments.
*/
- public function testCommentHooks() {
+ public function testCommentHooks(): void {
$account = $this->createUser();
NodeType::create([
'type' => 'article',
@@ -239,7 +239,7 @@ class EntityCrudHookTest extends EntityKernelTestBase {
/**
* Tests hook invocations for CRUD operations on files.
*/
- public function testFileHooks() {
+ public function testFileHooks(): void {
$this->installEntitySchema('file');
$url = 'public://entity_crud_hook_test.file';
@@ -304,7 +304,7 @@ class EntityCrudHookTest extends EntityKernelTestBase {
/**
* Tests hook invocations for CRUD operations on nodes.
*/
- public function testNodeHooks() {
+ public function testNodeHooks(): void {
$account = $this->createUser();
$node = Node::create([
@@ -368,7 +368,7 @@ class EntityCrudHookTest extends EntityKernelTestBase {
/**
* Tests hook invocations for CRUD operations on taxonomy terms.
*/
- public function testTaxonomyTermHooks() {
+ public function testTaxonomyTermHooks(): void {
$this->installEntitySchema('taxonomy_term');
$vocabulary = Vocabulary::create([
@@ -437,7 +437,7 @@ class EntityCrudHookTest extends EntityKernelTestBase {
/**
* Tests hook invocations for CRUD operations on taxonomy vocabularies.
*/
- public function testTaxonomyVocabularyHooks() {
+ public function testTaxonomyVocabularyHooks(): void {
$this->installEntitySchema('taxonomy_term');
$vocabulary = Vocabulary::create([
@@ -496,7 +496,7 @@ class EntityCrudHookTest extends EntityKernelTestBase {
/**
* Tests hook invocations for CRUD operations on users.
*/
- public function testUserHooks() {
+ public function testUserHooks(): void {
$account = User::create([
'name' => 'Test user',
'mail' => 'test@example.com',
@@ -553,7 +553,7 @@ class EntityCrudHookTest extends EntityKernelTestBase {
/**
* Tests rollback from failed entity save.
*/
- public function testEntityRollback() {
+ public function testEntityRollback(): void {
// Create a block.
try {
EntityTest::create(['name' => 'fail_insert'])->save();
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDecoupledTranslationRevisionsTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDecoupledTranslationRevisionsTest.php
index 1b4bc5f688a..81338be40eb 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDecoupledTranslationRevisionsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDecoupledTranslationRevisionsTest.php
@@ -205,7 +205,7 @@ class EntityDecoupledTranslationRevisionsTest extends EntityKernelTestBase {
*
* @dataProvider dataTestDecoupledPendingRevisions
*/
- public function testDecoupledPendingRevisions($sequence) {
+ public function testDecoupledPendingRevisions($sequence): void {
$revision_id = $this->doTestEditSequence($sequence);
$this->assertCount($revision_id, $sequence);
}
@@ -266,7 +266,7 @@ class EntityDecoupledTranslationRevisionsTest extends EntityKernelTestBase {
*
* @dataProvider dataTestUntranslatableFields
*/
- public function testUntranslatableFields($sequence, $default_translation_affected) {
+ public function testUntranslatableFields($sequence, $default_translation_affected): void {
// Configure the untranslatable fields edit mode.
$this->state->set('entity_test.untranslatable_fields.default_translation_affected', $default_translation_affected);
$this->bundleInfo->clearCachedBundles();
@@ -500,7 +500,7 @@ class EntityDecoupledTranslationRevisionsTest extends EntityKernelTestBase {
* @covers ::createRevision
* @covers \Drupal\Core\Entity\Plugin\Validation\Constraint\EntityUntranslatableFieldsConstraintValidator::validate
*/
- public function testMultipleTranslationChanges() {
+ public function testMultipleTranslationChanges(): void {
// Configure the untranslatable fields edit mode.
$this->state->set('entity_test.untranslatable_fields.default_translation_affected', TRUE);
$this->bundleInfo->clearCachedBundles();
@@ -526,7 +526,7 @@ class EntityDecoupledTranslationRevisionsTest extends EntityKernelTestBase {
/**
* Tests that internal properties are preserved while creating a new revision.
*/
- public function testInternalProperties() {
+ public function testInternalProperties(): void {
$entity = EntityTestMulRev::create();
$this->doTestInternalProperties($entity);
@@ -559,7 +559,7 @@ class EntityDecoupledTranslationRevisionsTest extends EntityKernelTestBase {
*
* @covers ::createRevision
*/
- public function testRemovedTranslations() {
+ public function testRemovedTranslations(): void {
/** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
$entity = EntityTestMulRev::create(['name' => 'Test 1.1 EN']);
$this->storage->save($entity);
@@ -594,7 +594,7 @@ class EntityDecoupledTranslationRevisionsTest extends EntityKernelTestBase {
*
* @covers ::createRevision
*/
- public function testCreateRevisionHook() {
+ public function testCreateRevisionHook(): void {
$entity = EntityTestMulRev::create();
$entity->get('name')->value = 'revision_create_test_en';
$this->storage->save($entity);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
index 2994c5c8191..7d0ea21b188 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
@@ -80,7 +80,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests that new entity type definitions are correctly handled.
*/
- public function testNewEntityType() {
+ public function testNewEntityType(): void {
$entity_type_id = 'entity_test_new';
$schema = $this->database->schema();
@@ -100,7 +100,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests when no definition update is needed.
*/
- public function testNoUpdates() {
+ public function testNoUpdates(): void {
// Ensure that the definition update manager reports no updates.
$this->assertFalse($this->entityDefinitionUpdateManager->needsUpdates(), 'EntityDefinitionUpdateManager reports that no updates are needed.');
$this->assertSame([], $this->entityDefinitionUpdateManager->getChangeSummary(), 'EntityDefinitionUpdateManager reports an empty change summary.');
@@ -110,7 +110,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests updating entity schema when there are no existing entities.
*/
- public function testEntityTypeUpdateWithoutData() {
+ public function testEntityTypeUpdateWithoutData(): void {
// The 'entity_test_update' entity type starts out non-revisionable, so
// ensure the revision table hasn't been created during setUp().
$this->assertFalse($this->database->schema()->tableExists('entity_test_update_revision'), 'Revision table not created for entity_test_update.');
@@ -138,7 +138,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests updating entity schema when there are entity storage changes.
*/
- public function testEntityTypeUpdateWithEntityStorageChange() {
+ public function testEntityTypeUpdateWithEntityStorageChange(): void {
// Update the entity type to be revisionable and try to apply the update.
// It's expected to throw an exception.
$entity_type = $this->getUpdatedEntityTypeDefinition(TRUE, FALSE);
@@ -156,7 +156,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
*
* @covers ::installFieldableEntityType
*/
- public function testInstallAdditionalBaseFieldDuringFieldableEntityTypeInstallation() {
+ public function testInstallAdditionalBaseFieldDuringFieldableEntityTypeInstallation(): void {
$entity_type = clone $this->entityTypeManager->getDefinition('entity_test_update');
$field_storage_definitions = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions('entity_test_update');
@@ -178,7 +178,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
*
* @covers ::installFieldableEntityType
*/
- public function testInstallFieldableEntityTypeWithoutInCodeDefinition() {
+ public function testInstallFieldableEntityTypeWithoutInCodeDefinition(): void {
$entity_type = clone $this->entityTypeManager->getDefinition('entity_test_update');
$field_storage_definitions = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions('entity_test_update');
@@ -196,7 +196,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
*
* @covers ::updateEntityType
*/
- public function testUpdateEntityTypeWithoutInCodeDefinition() {
+ public function testUpdateEntityTypeWithoutInCodeDefinition(): void {
$entity_type = clone $this->entityTypeManager->getDefinition('entity_test_update');
// Remove the entity type definition. This is the same thing as removing the
@@ -216,7 +216,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
*
* @covers ::updateFieldableEntityType
*/
- public function testUpdateFieldableEntityTypeWithoutInCodeDefinition() {
+ public function testUpdateFieldableEntityTypeWithoutInCodeDefinition(): void {
$entity_type = clone $this->entityTypeManager->getDefinition('entity_test_update');
$field_storage_definitions = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions('entity_test_update');
@@ -238,7 +238,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
*
* @covers ::uninstallEntityType
*/
- public function testUninstallEntityTypeWithoutInCodeDefinition() {
+ public function testUninstallEntityTypeWithoutInCodeDefinition(): void {
$entity_type = clone $this->entityTypeManager->getDefinition('entity_test_update');
// Remove the entity type definition. This is the same thing as removing the
@@ -256,7 +256,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
*
* @covers ::uninstallEntityType
*/
- public function testUninstallRevisionableEntityTypeWithoutInCodeDefinition() {
+ public function testUninstallRevisionableEntityTypeWithoutInCodeDefinition(): void {
$this->updateEntityTypeToRevisionable(TRUE);
$entity_type = $this->entityDefinitionUpdateManager->getEntityType('entity_test_update');
@@ -273,7 +273,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests creating, updating, and deleting a base field if no entities exist.
*/
- public function testBaseFieldCreateUpdateDeleteWithoutData() {
+ public function testBaseFieldCreateUpdateDeleteWithoutData(): void {
// Add a base field, ensure the update manager reports it, and the update
// creates its schema.
$this->addBaseField();
@@ -334,7 +334,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
*
* See testBaseFieldCreateUpdateDeleteWithoutData() for more details
*/
- public function testBaseFieldWithoutLabelCreateUpdateDelete() {
+ public function testBaseFieldWithoutLabelCreateUpdateDelete(): void {
// Add a base field, ensure the update manager reports it with the
// field id.
$this->addBaseField('string', 'entity_test_update', FALSE, FALSE);
@@ -362,7 +362,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests creating, updating, and deleting a bundle field if no entities exist.
*/
- public function testBundleFieldCreateUpdateDeleteWithoutData() {
+ public function testBundleFieldCreateUpdateDeleteWithoutData(): void {
// Add a bundle field, ensure the update manager reports it, and the update
// creates its schema.
$this->addBundleField();
@@ -403,7 +403,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
*
* @see testBaseFieldDeleteWithExistingData()
*/
- public function testBaseFieldCreateDeleteWithExistingEntities() {
+ public function testBaseFieldCreateDeleteWithExistingEntities(): void {
// Save an entity.
$name = $this->randomString();
$storage = $this->entityTypeManager->getStorage('entity_test_update');
@@ -459,7 +459,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
*
* @see testBundleFieldDeleteWithExistingData()
*/
- public function testBundleFieldCreateDeleteWithExistingEntities() {
+ public function testBundleFieldCreateDeleteWithExistingEntities(): void {
// Save an entity.
$name = $this->randomString();
$storage = $this->entityTypeManager->getStorage('entity_test_update');
@@ -519,7 +519,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
*
* @dataProvider baseFieldDeleteWithExistingDataTestCases
*/
- public function testBaseFieldDeleteWithExistingData($entity_type_id, $create_entity_revision, $base_field_revisionable, $create_entity_translation) {
+ public function testBaseFieldDeleteWithExistingData($entity_type_id, $create_entity_revision, $base_field_revisionable, $create_entity_translation): void {
// Enable an additional language.
ConfigurableLanguage::createFromLangcode('ro')->save();
@@ -739,7 +739,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests deleting a bundle field when it has existing data.
*/
- public function testBundleFieldDeleteWithExistingData() {
+ public function testBundleFieldDeleteWithExistingData(): void {
/** @var \Drupal\Core\Entity\Sql\SqlEntityStorageInterface $storage */
$storage = $this->entityTypeManager->getStorage('entity_test_update');
$schema_handler = $this->database->schema();
@@ -814,7 +814,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests updating a base field when it has existing data.
*/
- public function testBaseFieldUpdateWithExistingData() {
+ public function testBaseFieldUpdateWithExistingData(): void {
// Add the base field and run the update.
$this->addBaseField();
$this->applyEntityUpdates();
@@ -837,7 +837,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests updating a bundle field when it has existing data.
*/
- public function testBundleFieldUpdateWithExistingData() {
+ public function testBundleFieldUpdateWithExistingData(): void {
// Add the bundle field and run the update.
$this->addBundleField();
$this->applyEntityUpdates();
@@ -861,7 +861,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests updating a bundle field when the entity type schema has changed.
*/
- public function testBundleFieldUpdateWithEntityTypeSchemaUpdate() {
+ public function testBundleFieldUpdateWithEntityTypeSchemaUpdate(): void {
// Add the bundle field and run the update.
$this->addBundleField();
$this->applyEntityUpdates();
@@ -880,7 +880,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests creating and deleting a multi-field index when there are no existing entities.
*/
- public function testEntityIndexCreateDeleteWithoutData() {
+ public function testEntityIndexCreateDeleteWithoutData(): void {
// Add an entity index and ensure the update manager reports that as an
// update to the entity type.
$this->addEntityIndex();
@@ -934,7 +934,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests creating a multi-field index when there are existing entities.
*/
- public function testEntityIndexCreateWithData() {
+ public function testEntityIndexCreateWithData(): void {
// Save an entity.
$name = $this->randomString();
$entity = $this->entityTypeManager->getStorage('entity_test_update')->create(['name' => $name]);
@@ -952,7 +952,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests entity type and field storage definition events.
*/
- public function testDefinitionEvents() {
+ public function testDefinitionEvents(): void {
/** @var \Drupal\entity_test\EntityTestDefinitionSubscriber $event_subscriber */
$event_subscriber = $this->container->get('entity_test.definition.subscriber');
$event_subscriber->enableEventTracking();
@@ -1029,7 +1029,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests applying single updates.
*/
- public function testSingleActionCalls() {
+ public function testSingleActionCalls(): void {
$db_schema = $this->database->schema();
// Ensure that a non-existing entity type cannot be installed.
@@ -1107,7 +1107,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
*
* @see Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::createSharedTableSchema
*/
- public function testCreateFieldAndIndexOnSharedTable() {
+ public function testCreateFieldAndIndexOnSharedTable(): void {
$this->addBaseField();
$this->addBaseFieldIndex();
$this->applyEntityUpdates();
@@ -1125,7 +1125,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
*
* @see Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::onEntityTypeUpdate
*/
- public function testCreateIndexUsingEntityStorageSchemaWithData() {
+ public function testCreateIndexUsingEntityStorageSchemaWithData(): void {
// Save an entity.
$name = $this->randomString();
$storage = $this->entityTypeManager->getStorage('entity_test_update');
@@ -1152,7 +1152,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests updating a base field when it has existing data.
*/
- public function testBaseFieldEntityKeyUpdateWithExistingData() {
+ public function testBaseFieldEntityKeyUpdateWithExistingData(): void {
// Add the base field and run the update.
$this->addBaseField();
$this->applyEntityUpdates();
@@ -1204,7 +1204,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Check that field schema is correctly handled with long-named fields.
*/
- public function testLongNameFieldIndexes() {
+ public function testLongNameFieldIndexes(): void {
$this->addLongNameBaseField();
$entity_type_id = 'entity_test_update';
$entity_type = $this->entityTypeManager->getDefinition($entity_type_id);
@@ -1217,7 +1217,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests adding a base field with initial values.
*/
- public function testInitialValue() {
+ public function testInitialValue(): void {
$storage = \Drupal::entityTypeManager()->getStorage('entity_test_update');
$db_schema = $this->database->schema();
@@ -1248,7 +1248,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
*
* @dataProvider initialValueFromFieldTestCases
*/
- public function testInitialValueFromField($default_initial_value, $expected_value) {
+ public function testInitialValueFromField($default_initial_value, $expected_value): void {
$storage = \Drupal::entityTypeManager()->getStorage('entity_test_update');
$db_schema = $this->database->schema();
@@ -1322,7 +1322,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests the error handling when using initial values from another field.
*/
- public function testInitialValueFromFieldErrorHandling() {
+ public function testInitialValueFromFieldErrorHandling(): void {
// Check that setting invalid values for 'initial value from field' doesn't
// work.
try {
@@ -1376,7 +1376,7 @@ class EntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* @covers ::getEntityTypes
*/
- public function testGetEntityTypes() {
+ public function testGetEntityTypes(): void {
$entity_type_definitions = $this->entityDefinitionUpdateManager->getEntityTypes();
// Ensure that we have at least one entity type to check below.
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDeriverTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDeriverTest.php
index 0337fbd63e3..b7b65c33bbb 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDeriverTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDeriverTest.php
@@ -60,7 +60,7 @@ class EntityDeriverTest extends KernelTestBase {
*
* @dataProvider derivativesProvider
*/
- public function testDerivatives($data_type, $expect_exception) {
+ public function testDerivatives($data_type, $expect_exception): void {
if ($expect_exception) {
$this->expectException(PluginNotFoundException::class);
}
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php
index 9d70fba8620..7514533966c 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php
@@ -43,7 +43,7 @@ class EntityDisplayBaseTest extends KernelTestBase {
/**
* @covers ::preSave
*/
- public function testPreSave() {
+ public function testPreSave(): void {
$entity_display = EntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
@@ -80,7 +80,7 @@ class EntityDisplayBaseTest extends KernelTestBase {
/**
* @covers ::onDependencyRemoval
*/
- public function testOnDependencyRemoval() {
+ public function testOnDependencyRemoval(): void {
// Create a comment field for entity_test.
$comment_bundle = CommentType::create([
'id' => 'entity_test',
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php
index e5fa1ec446a..51d90fdd24c 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php
@@ -24,7 +24,7 @@ class EntityDisplayFormBaseTest extends KernelTestBase {
/**
* @covers ::copyFormValuesToEntity
*/
- public function testCopyFormValuesToEntity() {
+ public function testCopyFormValuesToEntity(): void {
$field_values = [];
$entity = $this->prophesize(EntityDisplayInterface::class);
$entity->getPluginCollections()->willReturn([]);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayRepositoryTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayRepositoryTest.php
index 8c3a1c1ed24..5ffd220dcc3 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayRepositoryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayRepositoryTest.php
@@ -61,7 +61,7 @@ class EntityDisplayRepositoryTest extends KernelTestBase {
/**
* @covers ::getViewDisplay
*/
- public function testViewDisplay() {
+ public function testViewDisplay(): void {
$display = $this->displayRepository->getViewDisplay('user', 'user');
$this->assertInstanceOf(EntityViewDisplayInterface::class, $display);
$this->assertTrue($display->isNew(), 'Default view display was created on demand.');
@@ -83,7 +83,7 @@ class EntityDisplayRepositoryTest extends KernelTestBase {
/**
* @covers ::getFormDisplay
*/
- public function testFormDisplay() {
+ public function testFormDisplay(): void {
$display = $this->displayRepository->getFormDisplay('user', 'user');
$this->assertInstanceOf(EntityFormDisplayInterface::class, $display);
$this->assertTrue($display->isNew(), 'Default form display was created on demand.');
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDuplicateTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDuplicateTest.php
index 7eb127d301b..a1b32dd60c3 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDuplicateTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDuplicateTest.php
@@ -30,7 +30,7 @@ class EntityDuplicateTest extends EntityKernelTestBase {
/**
* Tests duplicating a non-default revision.
*/
- public function testDuplicateNonDefaultRevision() {
+ public function testDuplicateNonDefaultRevision(): void {
$entity = EntityTestRev::create([
'name' => 'First Revision',
]);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldDefaultValueTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldDefaultValueTest.php
index be19a2b5983..4641f58f40a 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldDefaultValueTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldDefaultValueTest.php
@@ -32,7 +32,7 @@ class EntityFieldDefaultValueTest extends EntityKernelTestBase {
/**
* Tests default values on entities and fields.
*/
- public function testDefaultValues() {
+ public function testDefaultValues(): void {
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->assertDefaultValues($entity_type);
@@ -61,7 +61,7 @@ class EntityFieldDefaultValueTest extends EntityKernelTestBase {
/**
* Tests custom default value callbacks.
*/
- public function testDefaultValueCallback() {
+ public function testDefaultValueCallback(): void {
$entity = $this->entityTypeManager->getStorage('entity_test_default_value')->create();
// The description field has a default value callback for testing, see
// entity_test_field_default_value().
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php
index af8331e4663..0217513df6d 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php
@@ -103,7 +103,7 @@ class EntityFieldTest extends EntityKernelTestBase {
/**
* Test setting field values on revisionable entities.
*/
- public function testFieldEntityRevisionWrite() {
+ public function testFieldEntityRevisionWrite(): void {
/** @var \Drupal\Core\Entity\RevisionableStorageInterface $storage */
$storage = \Drupal::entityTypeManager()->getStorage('entity_test_rev');
@@ -136,7 +136,7 @@ class EntityFieldTest extends EntityKernelTestBase {
/**
* Tests reading and writing properties and field items.
*/
- public function testReadWrite() {
+ public function testReadWrite(): void {
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->doTestReadWrite($entity_type);
@@ -402,7 +402,7 @@ class EntityFieldTest extends EntityKernelTestBase {
/**
* Tries to save and load an entity again.
*/
- public function testSave() {
+ public function testSave(): void {
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->doTestSave($entity_type);
@@ -439,7 +439,7 @@ class EntityFieldTest extends EntityKernelTestBase {
/**
* Tests introspection and getting metadata upfront.
*/
- public function testIntrospection() {
+ public function testIntrospection(): void {
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->doTestIntrospection($entity_type);
@@ -543,7 +543,7 @@ class EntityFieldTest extends EntityKernelTestBase {
/**
* Tests iterating over properties.
*/
- public function testIterator() {
+ public function testIterator(): void {
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->doTestIterator($entity_type);
@@ -582,7 +582,7 @@ class EntityFieldTest extends EntityKernelTestBase {
/**
* Tests working with the entity based upon the TypedData API.
*/
- public function testDataStructureInterfaces() {
+ public function testDataStructureInterfaces(): void {
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->doTestDataStructureInterfaces($entity_type);
@@ -654,7 +654,7 @@ class EntityFieldTest extends EntityKernelTestBase {
/**
* Makes sure data types are correctly derived for all entity types.
*/
- public function testDataTypes() {
+ public function testDataTypes(): void {
$types = \Drupal::typedDataManager()->getDefinitions();
foreach (entity_test_entity_types() as $entity_type) {
$this->assertNotEmpty($types['entity:' . $entity_type]['class'], 'Entity data type registered.');
@@ -670,7 +670,7 @@ class EntityFieldTest extends EntityKernelTestBase {
*
* @see entity_test_entity_base_field_info_alter()
*/
- public function testBaseFieldNonExistingBaseField() {
+ public function testBaseFieldNonExistingBaseField(): void {
$this->entityTypeManager->getStorage('node_type')->create([
'type' => 'page',
'name' => 'page',
@@ -692,7 +692,7 @@ class EntityFieldTest extends EntityKernelTestBase {
*
* @see entity_test_entity_base_field_info_alter()
*/
- public function testFieldOverrideBundleField() {
+ public function testFieldOverrideBundleField(): void {
// First make sure the bundle field override in code, which is provided by
// the test entity works.
entity_test_create_bundle('some_test_bundle', 'Some test bundle', 'entity_test_field_override');
@@ -720,7 +720,7 @@ class EntityFieldTest extends EntityKernelTestBase {
/**
* Tests validation constraints provided by the Entity API.
*/
- public function testEntityConstraintValidation() {
+ public function testEntityConstraintValidation(): void {
$entity = $this->createTestEntity('entity_test');
$entity->save();
// Create a reference field item and let it reference the entity.
@@ -774,7 +774,7 @@ class EntityFieldTest extends EntityKernelTestBase {
/**
* Tests getting processed property values via a computed property.
*/
- public function testComputedProperties() {
+ public function testComputedProperties(): void {
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->doTestComputedProperties($entity_type);
@@ -784,7 +784,7 @@ class EntityFieldTest extends EntityKernelTestBase {
/**
* Tests all the interaction points of a computed field.
*/
- public function testComputedFields() {
+ public function testComputedFields(): void {
$this->installEntitySchema('entity_test_computed_field');
\Drupal::state()->set('entity_test_computed_field_item_list_value', ['foo computed']);
@@ -916,7 +916,7 @@ class EntityFieldTest extends EntityKernelTestBase {
/**
* Tests an entity reference computed field.
*/
- public function testEntityReferenceComputedField() {
+ public function testEntityReferenceComputedField(): void {
$this->installEntitySchema('entity_test_computed_field');
// Create 2 entities to be referenced.
@@ -964,7 +964,7 @@ class EntityFieldTest extends EntityKernelTestBase {
/**
* Tests explicit entity ID assignment.
*/
- public function testEntityIdAssignment() {
+ public function testEntityIdAssignment(): void {
$entity_type = 'entity_test';
/** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */
$storage = $this->container->get('entity_type.manager')->getStorage($entity_type);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityHasFieldConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityHasFieldConstraintValidatorTest.php
index 8b0daa31dd3..c53122ad5d5 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityHasFieldConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityHasFieldConstraintValidatorTest.php
@@ -28,7 +28,7 @@ class EntityHasFieldConstraintValidatorTest extends EntityKernelTestBase {
$this->createUser();
}
- public function testValidation() {
+ public function testValidation(): void {
$this->state->set('entity_test_constraints.build', [
'EntityHasField' => 'body',
]);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBaseTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBaseTest.php
index 52e4cc792e7..edcfa268f22 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBaseTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBaseTest.php
@@ -22,7 +22,7 @@ class EntityKernelTestBaseTest extends EntityKernelTestBase {
/**
* Tests that the current user is set up correctly.
*/
- public function testSetUpCurrentUser() {
+ public function testSetUpCurrentUser(): void {
$account = $this->setUpCurrentUser();
$current_user = \Drupal::currentUser();
$this->assertSame($account->id(), $current_user->id());
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityKeysTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityKeysTest.php
index caef4ae12a2..abac7914257 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityKeysTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityKeysTest.php
@@ -19,7 +19,7 @@ class EntityKeysTest extends EntityKernelTestBase {
*
* @dataProvider multipleKeysCacheTestCases
*/
- public function testMultipleKeysCache($translatable) {
+ public function testMultipleKeysCache($translatable): void {
$this->state->set('entity_test.additional_base_field_definitions', [
'test_field' => BaseFieldDefinition::create('string')->setTranslatable($translatable),
]);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityLoadByUuidTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityLoadByUuidTest.php
index 8e9c95e6f21..0ff1c38fb4b 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityLoadByUuidTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityLoadByUuidTest.php
@@ -32,7 +32,7 @@ class EntityLoadByUuidTest extends KernelTestBase {
/**
* Ensures that ::loadEntityByUuid() doesn't apply access checking.
*/
- public function testLoadEntityByUuidAccessChecking() {
+ public function testLoadEntityByUuidAccessChecking(): void {
\Drupal::state()->set('entity_test_query_access', TRUE);
// Create two test entities.
$entity_0 = EntityTest::create([
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityNonRevisionableTranslatableFieldTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityNonRevisionableTranslatableFieldTest.php
index ae51362480b..255e68b35e4 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityNonRevisionableTranslatableFieldTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityNonRevisionableTranslatableFieldTest.php
@@ -39,7 +39,7 @@ class EntityNonRevisionableTranslatableFieldTest extends EntityKernelTestBase {
/**
* Tests translating a non-revisionable field.
*/
- public function testTranslatingNonRevisionableField() {
+ public function testTranslatingNonRevisionableField(): void {
/** @var \Drupal\Core\Entity\ContentEntityBase $entity */
$entity = EntityTestMulRev::create();
$entity->set('non_rev_field', 'Hello');
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryAggregateTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryAggregateTest.php
index ca3b771bd36..f0a2ae6d9d2 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryAggregateTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryAggregateTest.php
@@ -115,7 +115,7 @@ class EntityQueryAggregateTest extends EntityKernelTestBase {
/**
* Tests aggregation support.
*/
- public function testAggregation() {
+ public function testAggregation(): void {
// Apply a simple groupby.
$this->queryResult = $this->entityStorage->getAggregateQuery()
->accessCheck(FALSE)
@@ -593,7 +593,7 @@ class EntityQueryAggregateTest extends EntityKernelTestBase {
/**
* Tests preparing a query and executing twice.
*/
- public function testRepeatedExecution() {
+ public function testRepeatedExecution(): void {
$query = $this->entityStorage->getAggregateQuery()
->accessCheck(FALSE)
->groupBy('user_id');
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php
index 6f959e7ce2b..17be6152563 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php
@@ -115,7 +115,7 @@ class EntityQueryRelationshipTest extends EntityKernelTestBase {
/**
* Tests querying.
*/
- public function testQuery() {
+ public function testQuery(): void {
$storage = $this->container->get('entity_type.manager')->getStorage('entity_test');
// This returns the 0th entity as that's the only one pointing to the 0th
// account.
@@ -214,7 +214,7 @@ class EntityQueryRelationshipTest extends EntityKernelTestBase {
/**
* Tests the invalid specifier in the query relationship.
*/
- public function testInvalidSpecifier() {
+ public function testInvalidSpecifier(): void {
$this->expectException(PluginNotFoundException::class);
$this->container
->get('entity_type.manager')
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php
index 19b92455914..0b6941d6f04 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php
@@ -177,7 +177,7 @@ class EntityQueryTest extends EntityKernelTestBase {
/**
* Tests basic functionality.
*/
- public function testEntityQuery() {
+ public function testEntityQuery(): void {
$greetings = $this->greetings;
$figures = $this->figures;
$this->queryResults = $this->storage
@@ -401,7 +401,7 @@ class EntityQueryTest extends EntityKernelTestBase {
*
* Warning: this is complicated.
*/
- public function testSort() {
+ public function testSort(): void {
$greetings = $this->greetings;
$figures = $this->figures;
// Order up and down on a number.
@@ -496,7 +496,7 @@ class EntityQueryTest extends EntityKernelTestBase {
/**
* Tests tablesort().
*/
- public function testTableSort() {
+ public function testTableSort(): void {
// While ordering on bundles do not give us a definite order, we can still
// assert that all entities from one bundle are after the other as the
// order dictates.
@@ -552,7 +552,7 @@ class EntityQueryTest extends EntityKernelTestBase {
/**
* Tests that count queries are separated across entity types.
*/
- public function testCount() {
+ public function testCount(): void {
// Create a field with the same name in a different entity type.
$field_name = $this->figures;
$field_storage = FieldStorageConfig::create([
@@ -592,7 +592,7 @@ class EntityQueryTest extends EntityKernelTestBase {
/**
* Tests that nested condition groups work as expected.
*/
- public function testNestedConditionGroups() {
+ public function testNestedConditionGroups(): void {
// Query for all entities of the first bundle that have either a red
// triangle as a figure or the Turkish greeting as a greeting.
$query = $this->storage->getQuery()->accessCheck(FALSE);
@@ -620,7 +620,7 @@ class EntityQueryTest extends EntityKernelTestBase {
/**
* Tests that condition count returns expected number of conditions.
*/
- public function testConditionCount() {
+ public function testConditionCount(): void {
// Query for all entities of the first bundle that
// have red as a color AND are triangle shaped.
$query = $this->storage->getQuery()->accessCheck(FALSE);
@@ -645,7 +645,7 @@ class EntityQueryTest extends EntityKernelTestBase {
/**
* Tests queries with delta conditions.
*/
- public function testDelta() {
+ public function testDelta(): void {
$figures = $this->figures;
// Test numeric delta value in field condition.
$this->queryResults = $this->storage
@@ -798,7 +798,7 @@ class EntityQueryTest extends EntityKernelTestBase {
*
* The tags and metadata should propagate to the SQL query object.
*/
- public function testMetaData() {
+ public function testMetaData(): void {
field_test_memorize();
$query = $this->storage->getQuery()->accessCheck(FALSE);
@@ -814,7 +814,7 @@ class EntityQueryTest extends EntityKernelTestBase {
/**
* Tests case sensitive and in-sensitive query conditions.
*/
- public function testCaseSensitivity() {
+ public function testCaseSensitivity(): void {
$bundle = $this->randomMachineName();
entity_test_create_bundle($bundle, entity_type: 'entity_test_mulrev');
@@ -1058,7 +1058,7 @@ class EntityQueryTest extends EntityKernelTestBase {
/**
* Tests base fields with multiple columns.
*/
- public function testBaseFieldMultipleColumns() {
+ public function testBaseFieldMultipleColumns(): void {
$this->enableModules(['taxonomy']);
$this->installEntitySchema('taxonomy_term');
@@ -1117,7 +1117,7 @@ class EntityQueryTest extends EntityKernelTestBase {
/**
* Tests pending revisions.
*/
- public function testPendingRevisions() {
+ public function testPendingRevisions(): void {
// Ensure entity 14 is returned.
$result = $this->storage
->getQuery()
@@ -1228,7 +1228,7 @@ class EntityQueryTest extends EntityKernelTestBase {
*
* This covers a database driver's EntityQuery\Condition class.
*/
- public function testInjectionInCondition() {
+ public function testInjectionInCondition(): void {
$this->expectException(\Exception::class);
$this->queryResults = $this->storage
->getQuery()
@@ -1241,7 +1241,7 @@ class EntityQueryTest extends EntityKernelTestBase {
/**
* Tests that EntityQuery works when querying the same entity from two fields.
*/
- public function testWithTwoEntityReferenceFieldsToSameEntityType() {
+ public function testWithTwoEntityReferenceFieldsToSameEntityType(): void {
// Create two entity reference fields referring 'entity_test' entities.
$this->createEntityReferenceField('entity_test', 'entity_test', 'ref1', $this->randomMachineName(), 'entity_test');
$this->createEntityReferenceField('entity_test', 'entity_test', 'ref2', $this->randomMachineName(), 'entity_test');
@@ -1351,7 +1351,7 @@ class EntityQueryTest extends EntityKernelTestBase {
/**
* Tests entity queries with condition on the revision metadata keys.
*/
- public function testConditionOnRevisionMetadataKeys() {
+ public function testConditionOnRevisionMetadataKeys(): void {
$this->installModule('entity_test_revlog');
$this->installEntitySchema('entity_test_revlog');
@@ -1391,7 +1391,7 @@ class EntityQueryTest extends EntityKernelTestBase {
/**
* Tests __toString().
*/
- public function testToString() {
+ public function testToString(): void {
$query = $this->storage->getQuery()->accessCheck(FALSE);
$group_blue = $query->andConditionGroup()->condition("{$this->figures}.color", ['blue'], 'IN');
$group_red = $query->andConditionGroup()->condition("{$this->figures}.color", ['red'], 'IN');
@@ -1438,7 +1438,7 @@ class EntityQueryTest extends EntityKernelTestBase {
/**
* Test the accessCheck method is called.
*/
- public function testAccessCheckSpecified() {
+ public function testAccessCheckSpecified(): void {
$this->expectException(QueryException::class);
$this->expectExceptionMessage('Entity queries must explicitly set whether the query should be access checked or not. See Drupal\Core\Entity\Query\QueryInterface::accessCheck().');
// We are purposely testing an entity query without access check, so we need
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php
index 890c3188313..40d849d25f1 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php
@@ -89,7 +89,7 @@ class EntityReferenceFieldTest extends EntityKernelTestBase {
/**
* Tests reference field validation.
*/
- public function testEntityReferenceFieldValidation() {
+ public function testEntityReferenceFieldValidation(): void {
// Test a valid reference.
$referenced_entity = $this->container->get('entity_type.manager')
->getStorage($this->referencedEntityType)
@@ -124,7 +124,7 @@ class EntityReferenceFieldTest extends EntityKernelTestBase {
/**
* Tests the multiple target entities loader.
*/
- public function testReferencedEntitiesMultipleLoad() {
+ public function testReferencedEntitiesMultipleLoad(): void {
// Create the parent entity.
$entity = $this->container->get('entity_type.manager')
->getStorage($this->entityType)
@@ -196,7 +196,7 @@ class EntityReferenceFieldTest extends EntityKernelTestBase {
/**
* Tests referencing entities with string IDs.
*/
- public function testReferencedEntitiesStringId() {
+ public function testReferencedEntitiesStringId(): void {
$field_name = 'entity_reference_string_id';
$this->installEntitySchema('entity_test_string_id');
$this->createEntityReferenceField(
@@ -246,7 +246,7 @@ class EntityReferenceFieldTest extends EntityKernelTestBase {
/**
* Tests all the possible ways to autocreate an entity via the API.
*/
- public function testAutocreateApi() {
+ public function testAutocreateApi(): void {
$entity = $this->entityTypeManager
->getStorage($this->entityType)
->create(['name' => $this->randomString()]);
@@ -374,7 +374,7 @@ class EntityReferenceFieldTest extends EntityKernelTestBase {
/**
* Tests exception thrown with a missing target entity type.
*/
- public function testTargetEntityTypeMissing() {
+ public function testTargetEntityTypeMissing(): void {
// Setup a test entity type with an entity reference field to an entity type
// that doesn't exist.
$definitions = [
@@ -394,7 +394,7 @@ class EntityReferenceFieldTest extends EntityKernelTestBase {
/**
* Tests that the target entity is not unnecessarily loaded.
*/
- public function testTargetEntityNoLoad() {
+ public function testTargetEntityNoLoad(): void {
// Setup a test entity type with an entity reference field to itself. We use
// a special storage class throwing exceptions when a load operation is
// triggered to be able to detect them.
@@ -445,7 +445,7 @@ class EntityReferenceFieldTest extends EntityKernelTestBase {
/**
* Tests the dependencies entity reference fields are created with.
*/
- public function testEntityReferenceFieldDependencies() {
+ public function testEntityReferenceFieldDependencies(): void {
$field_name = 'user_reference_field';
$entity_type = 'entity_test';
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php
index a218493c6dd..6fae5bf1177 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php
@@ -46,7 +46,7 @@ class EntityReferenceSelectionSortTest extends EntityKernelTestBase {
/**
* Assert sorting by field and property.
*/
- public function testSort() {
+ public function testSort(): void {
// Add text field to entity, to sort by.
FieldStorageConfig::create([
'field_name' => 'field_text',
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php
index fa3d33df27d..b54ccc4deb0 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php
@@ -78,7 +78,7 @@ class EntityRepositoryTest extends KernelTestBase {
* @covers ::getActive
* @covers ::getActiveMultiple
*/
- public function testGetActive() {
+ public function testGetActive(): void {
$en_contexts = $this->getLanguageContexts('en');
// Check that when the entity does not exist NULL is returned.
@@ -211,7 +211,7 @@ class EntityRepositoryTest extends KernelTestBase {
* @covers ::getCanonical
* @covers ::getCanonicalMultiple
*/
- public function testGetCanonical() {
+ public function testGetCanonical(): void {
// Check that when the entity does not exist NULL is returned.
$entity_type_id = 'entity_test_mul';
$canonical = $this->entityRepository->getActive($entity_type_id, -1);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php
index f362161b9ec..3d75bf3b29d 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php
@@ -37,7 +37,7 @@ class EntityRevisionTranslationTest extends EntityKernelTestBase {
/**
* Tests if the translation object has the right revision id after new revision.
*/
- public function testNewRevisionAfterTranslation() {
+ public function testNewRevisionAfterTranslation(): void {
$user = $this->createUser();
// Create a test entity.
@@ -63,7 +63,7 @@ class EntityRevisionTranslationTest extends EntityKernelTestBase {
/**
* Tests if the translation object has the right revision id after new revision.
*/
- public function testRevertRevisionAfterTranslation() {
+ public function testRevertRevisionAfterTranslation(): void {
$user = $this->createUser();
/** @var \Drupal\Core\Entity\RevisionableStorageInterface $storage */
$storage = $this->entityTypeManager->getStorage('entity_test_mulrev');
@@ -99,7 +99,7 @@ class EntityRevisionTranslationTest extends EntityKernelTestBase {
/**
* Tests the translation values when saving a pending revision.
*/
- public function testTranslationValuesWhenSavingPendingRevisions() {
+ public function testTranslationValuesWhenSavingPendingRevisions(): void {
$user = $this->createUser();
/** @var \Drupal\Core\Entity\RevisionableStorageInterface $storage */
$storage = $this->entityTypeManager->getStorage('entity_test_mulrev');
@@ -145,7 +145,7 @@ class EntityRevisionTranslationTest extends EntityKernelTestBase {
/**
* Tests changing the default revision flag is propagated to all translations.
*/
- public function testDefaultRevision() {
+ public function testDefaultRevision(): void {
// Create a test entity with a translation, which will internally trigger
// entity cloning for the new translation and create references for some of
// the entity properties.
@@ -170,7 +170,7 @@ class EntityRevisionTranslationTest extends EntityKernelTestBase {
/**
* @covers \Drupal\Core\Entity\ContentEntityBase::setNewRevision
*/
- public function testSetNewRevision() {
+ public function testSetNewRevision(): void {
$user = $this->createUser();
// All revisionable entity variations have to have the same results.
@@ -202,7 +202,7 @@ class EntityRevisionTranslationTest extends EntityKernelTestBase {
*
* @covers \Drupal\Core\Entity\ContentEntityStorageBase::isAnyStoredRevisionTranslated
*/
- public function testIsAnyStoredRevisionTranslated() {
+ public function testIsAnyStoredRevisionTranslated(): void {
/** @var \Drupal\Core\Entity\ContentEntityStorageInterface $storage */
$storage = $this->entityTypeManager->getStorage('entity_test_mul');
$method = new \ReflectionMethod(get_class($storage), 'isAnyStoredRevisionTranslated');
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionsTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionsTest.php
index ff9fa1c603d..163a0b5919a 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionsTest.php
@@ -40,7 +40,7 @@ class EntityRevisionsTest extends EntityKernelTestBase {
/**
* Tests getLoadedRevisionId() returns the correct ID throughout the process.
*/
- public function testLoadedRevisionId() {
+ public function testLoadedRevisionId(): void {
// Create a basic EntityTestMulRev entity and save it.
$entity = EntityTestMulRev::create();
$entity->save();
@@ -82,7 +82,7 @@ class EntityRevisionsTest extends EntityKernelTestBase {
/**
* Tests the loaded revision ID after an entity re-save, clone and duplicate.
*/
- public function testLoadedRevisionIdWithNoNewRevision() {
+ public function testLoadedRevisionIdWithNoNewRevision(): void {
// Create a basic EntityTestMulRev entity and save it.
$entity = EntityTestMulRev::create();
$entity->save();
@@ -120,7 +120,7 @@ class EntityRevisionsTest extends EntityKernelTestBase {
/**
* Tests the loaded revision ID for translatable entities.
*/
- public function testTranslatedLoadedRevisionId() {
+ public function testTranslatedLoadedRevisionId(): void {
ConfigurableLanguage::createFromLangcode('fr')->save();
// Create a basic EntityTestMulRev entity and save it.
@@ -161,7 +161,7 @@ class EntityRevisionsTest extends EntityKernelTestBase {
/**
* Tests re-saving the entity in entity_test_entity_insert().
*/
- public function testSaveInHookEntityInsert() {
+ public function testSaveInHookEntityInsert(): void {
// Create an entity which will be saved again in entity_test_entity_insert().
$entity = EntityTestMulRev::create(['name' => 'EntityLoadedRevisionTest']);
$entity->save();
@@ -175,7 +175,7 @@ class EntityRevisionsTest extends EntityKernelTestBase {
*
* @covers ::isLatestRevision
*/
- public function testIsLatestRevision() {
+ public function testIsLatestRevision(): void {
// Create a basic EntityTestMulRev entity and save it.
$entity = EntityTestMulRev::create();
$entity->save();
@@ -208,7 +208,7 @@ class EntityRevisionsTest extends EntityKernelTestBase {
* @covers \Drupal\Core\Entity\ContentEntityStorageBase::getLatestRevisionId
* @covers \Drupal\Core\Entity\ContentEntityStorageBase::getLatestTranslationAffectedRevisionId
*/
- public function testIsLatestAffectedRevisionTranslation() {
+ public function testIsLatestAffectedRevisionTranslation(): void {
ConfigurableLanguage::createFromLangcode('it')->save();
// Create a basic EntityTestMulRev entity and save it.
@@ -268,7 +268,7 @@ class EntityRevisionsTest extends EntityKernelTestBase {
*
* @covers \Drupal\Core\Entity\ContentEntityStorageBase::doSave
*/
- public function testDefaultRevisionFlag() {
+ public function testDefaultRevisionFlag(): void {
// Create a basic EntityTestMulRev entity and save it.
$entity = EntityTestMulRev::create();
$entity->save();
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php
index 6a2f44d16e3..27d9f983096 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php
@@ -61,7 +61,7 @@ class EntitySchemaTest extends EntityKernelTestBase {
/**
* Tests the custom bundle field creation and deletion.
*/
- public function testCustomFieldCreateDelete() {
+ public function testCustomFieldCreateDelete(): void {
// Install the module which adds the field.
$this->installModule('entity_schema_test');
$storage_definitions = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions('entity_test_update');
@@ -102,7 +102,7 @@ class EntitySchemaTest extends EntityKernelTestBase {
/**
* Tests that entity schema responds to changes in the entity type definition.
*/
- public function testEntitySchemaUpdate() {
+ public function testEntitySchemaUpdate(): void {
$this->installModule('entity_schema_test');
$storage_definitions = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions('entity_test_update');
\Drupal::service('field_storage_definition.listener')->onFieldStorageDefinitionCreate($storage_definitions['custom_base_field']);
@@ -147,7 +147,7 @@ class EntitySchemaTest extends EntityKernelTestBase {
*
* @dataProvider providerTestPrimaryKeyUpdate
*/
- public function testPrimaryKeyUpdate($entity_type_id, $field_name) {
+ public function testPrimaryKeyUpdate($entity_type_id, $field_name): void {
// EntityKernelTestBase::setUp() already installs the schema for the
// 'entity_test' entity type.
if ($entity_type_id !== 'entity_test') {
@@ -304,7 +304,7 @@ class EntitySchemaTest extends EntityKernelTestBase {
/**
* Tests that modifying the UUID field for a translatable entity works.
*/
- public function testModifyingTranslatableColumnSchema() {
+ public function testModifyingTranslatableColumnSchema(): void {
$this->installModule('entity_schema_test');
$this->updateEntityType(TRUE);
$fields = ['revision_log', 'uuid'];
@@ -321,7 +321,7 @@ class EntitySchemaTest extends EntityKernelTestBase {
/**
* Tests fields from an uninstalled module are removed from the schema.
*/
- public function testCleanUpStorageDefinition() {
+ public function testCleanUpStorageDefinition(): void {
// Find all the entity types provided by the entity_test module and install
// the schema for them.
$entity_type_ids = [];
@@ -376,7 +376,7 @@ class EntitySchemaTest extends EntityKernelTestBase {
/**
* Tests the installed storage schema for identifier fields.
*/
- public function testIdentifierSchema() {
+ public function testIdentifierSchema(): void {
$this->installEntitySchema('entity_test_rev');
$key_value_store = \Drupal::keyValue('entity.storage_schema.sql');
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php
index d2e4dad930a..3ddc5f0e751 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php
@@ -23,7 +23,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
/**
* Tests language related methods of the Entity class.
*/
- public function testEntityLanguageMethods() {
+ public function testEntityLanguageMethods(): void {
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->doTestEntityLanguageMethods($entity_type);
@@ -143,7 +143,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
/**
* Tests multilingual properties.
*/
- public function testMultilingualProperties() {
+ public function testMultilingualProperties(): void {
// Test all entity variations with data table support.
foreach (entity_test_entity_types(ENTITY_TEST_TYPES_MULTILINGUAL) as $entity_type) {
$this->doTestMultilingualProperties($entity_type);
@@ -306,7 +306,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
/**
* Tests the Entity Translation API behavior.
*/
- public function testEntityTranslationAPI() {
+ public function testEntityTranslationAPI(): void {
// Test all entity variations with data table support.
foreach (entity_test_entity_types(ENTITY_TEST_TYPES_MULTILINGUAL) as $entity_type) {
$this->doTestEntityTranslationAPI($entity_type);
@@ -574,7 +574,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
/**
* Tests language fallback applied to field and entity translations.
*/
- public function testLanguageFallback() {
+ public function testLanguageFallback(): void {
// Test all entity variations with data table support.
foreach (entity_test_entity_types(ENTITY_TEST_TYPES_MULTILINGUAL) as $entity_type) {
$this->doTestLanguageFallback($entity_type);
@@ -670,7 +670,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
/**
* Check that field translatability is handled properly.
*/
- public function testFieldDefinitions() {
+ public function testFieldDefinitions(): void {
// Check that field translatability can be altered to be enabled or disabled
// in field definitions.
$entity_type = 'entity_test_mulrev';
@@ -715,7 +715,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
/**
* Tests that changing entity language does not break field language.
*/
- public function testLanguageChange() {
+ public function testLanguageChange(): void {
// Test all entity variations with data table support.
foreach (entity_test_entity_types(ENTITY_TEST_TYPES_MULTILINGUAL) as $entity_type) {
$this->doTestLanguageChange($entity_type);
@@ -776,7 +776,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
/**
* Tests how entity adapters work with translations.
*/
- public function testEntityAdapter() {
+ public function testEntityAdapter(): void {
$entity_type = 'entity_test';
$default_langcode = 'en';
$values[$default_langcode] = ['name' => $this->randomString()];
@@ -800,7 +800,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
/**
* Tests if entity references are correct after adding a new translation.
*/
- public function testFieldEntityReference() {
+ public function testFieldEntityReference(): void {
$entity_type = 'entity_test_mul';
$controller = $this->entityTypeManager->getStorage($entity_type);
/** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
@@ -827,7 +827,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
/**
* Tests that translation statuses are correct after removing translations.
*/
- public function testDeleteEntityTranslation() {
+ public function testDeleteEntityTranslation(): void {
$entity_type = 'entity_test_mul';
$controller = $this->entityTypeManager->getStorage($entity_type);
@@ -919,7 +919,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
/**
* Tests the getTranslationStatus method.
*/
- public function testTranslationStatus() {
+ public function testTranslationStatus(): void {
$entity_type = 'entity_test_mul';
$storage = $this->entityTypeManager->getStorage($entity_type);
@@ -1000,7 +1000,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
/**
* Tests the translation object cache.
*/
- public function testTranslationObjectCache() {
+ public function testTranslationObjectCache(): void {
$default_langcode = $this->langcodes[1];
$translation_langcode = $this->langcodes[2];
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintValidatorTest.php
index 5bf885aadaa..fa088a8343f 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintValidatorTest.php
@@ -33,7 +33,7 @@ class EntityTypeConstraintValidatorTest extends EntityKernelTestBase {
/**
* Tests the EntityTypeConstraintValidator.
*/
- public function testValidation() {
+ public function testValidation(): void {
// Create a typed data definition with an EntityType constraint.
$entity_type = 'node';
$definition = DataDefinition::create('entity_reference')
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintsTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintsTest.php
index 120305db67f..6367d15eb9f 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeConstraintsTest.php
@@ -22,7 +22,7 @@ class EntityTypeConstraintsTest extends EntityKernelTestBase {
/**
* Tests defining entity constraints via entity type annotations and hooks.
*/
- public function testConstraintDefinition() {
+ public function testConstraintDefinition(): void {
// Test reading the annotation. There should be two constraints, the defined
// constraint and the automatically added EntityChanged constraint.
$entity_type = $this->entityTypeManager->getDefinition('entity_test_constraints');
@@ -60,7 +60,7 @@ class EntityTypeConstraintsTest extends EntityKernelTestBase {
/**
* Tests entity constraints are validated.
*/
- public function testConstraintValidation() {
+ public function testConstraintValidation(): void {
$entity = $this->entityTypeManager->getStorage('entity_test_constraints')->create();
$entity->user_id->target_id = 0;
$violations = $entity->validate();
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeTest.php
index 49723a93529..270c1c8f71f 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityTypeTest.php
@@ -33,7 +33,7 @@ class EntityTypeTest extends KernelTestBase {
/**
* Tests that the EntityType object can be serialized.
*/
- public function testIsSerializable() {
+ public function testIsSerializable(): void {
$entity_type = $this->setUpEntityType([]);
$translation_service = new class () extends TranslationManager {
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityTypedDataDefinitionTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityTypedDataDefinitionTest.php
index 71939d354a7..a7c34efcd31 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityTypedDataDefinitionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityTypedDataDefinitionTest.php
@@ -51,7 +51,7 @@ class EntityTypedDataDefinitionTest extends KernelTestBase {
/**
* Tests deriving metadata about fields.
*/
- public function testFields() {
+ public function testFields(): void {
$field_definition = BaseFieldDefinition::create('integer');
// Fields are lists of complex data.
$this->assertInstanceOf(ListDataDefinitionInterface::class, $field_definition);
@@ -90,7 +90,7 @@ class EntityTypedDataDefinitionTest extends KernelTestBase {
/**
* Tests deriving metadata about entities.
*/
- public function testEntities() {
+ public function testEntities(): void {
NodeType::create([
'type' => 'article',
'name' => 'Article',
@@ -132,7 +132,7 @@ class EntityTypedDataDefinitionTest extends KernelTestBase {
/**
* Tests deriving metadata from entity references.
*/
- public function testEntityReferences() {
+ public function testEntityReferences(): void {
$reference_definition = DataReferenceDefinition::create('entity');
$this->assertInstanceOf(DataReferenceDefinitionInterface::class, $reference_definition);
@@ -151,7 +151,7 @@ class EntityTypedDataDefinitionTest extends KernelTestBase {
*
* @dataProvider entityDefinitionIsInternalProvider
*/
- public function testEntityDefinitionIsInternal($internal, $expected) {
+ public function testEntityDefinitionIsInternal($internal, $expected): void {
$entity_type_id = $this->randomMachineName();
$entity_type = $this->prophesize(EntityTypeInterface::class);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php
index ae4fb009464..984d8abca38 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php
@@ -28,7 +28,7 @@ class EntityUUIDTest extends EntityKernelTestBase {
/**
* Tests UUID generation in entity CRUD operations.
*/
- public function testCRUD() {
+ public function testCRUD(): void {
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->assertCRUD($entity_type);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php
index 11afa0d2168..bce2dfa6d60 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php
@@ -99,7 +99,7 @@ class EntityValidationTest extends EntityKernelTestBase {
/**
* Tests validating test entity types.
*/
- public function testValidation() {
+ public function testValidation(): void {
// Ensure that the constraint manager is marked as cached cleared.
// Use the protected property on the cache_clearer first to check whether
@@ -195,7 +195,7 @@ class EntityValidationTest extends EntityKernelTestBase {
/**
* Tests composite constraints.
*/
- public function testCompositeConstraintValidation() {
+ public function testCompositeConstraintValidation(): void {
$entity = $this->createTestEntity('entity_test_composite_constraint');
$violations = $entity->validate();
$this->assertEquals(0, $violations->count());
@@ -218,7 +218,7 @@ class EntityValidationTest extends EntityKernelTestBase {
/**
* Tests the EntityChangedConstraintValidator with multiple translations.
*/
- public function testEntityChangedConstraintOnConcurrentMultilingualEditing() {
+ public function testEntityChangedConstraintOnConcurrentMultilingualEditing(): void {
$this->installEntitySchema('entity_test_mulrev_changed');
$storage = \Drupal::entityTypeManager()
->getStorage('entity_test_mulrev_changed');
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php
index 1c73452786e..fba7909ba65 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php
@@ -41,7 +41,7 @@ class EntityViewBuilderTest extends EntityKernelTestBase {
/**
* Tests entity render cache handling.
*/
- public function testEntityViewBuilderCache() {
+ public function testEntityViewBuilderCache(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$cache_contexts_manager = \Drupal::service("cache_contexts_manager");
@@ -96,7 +96,7 @@ class EntityViewBuilderTest extends EntityKernelTestBase {
/**
* Tests entity render cache with references.
*/
- public function testEntityViewBuilderCacheWithReferences() {
+ public function testEntityViewBuilderCacheWithReferences(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$cache_contexts_manager = \Drupal::service("cache_contexts_manager");
@@ -163,7 +163,7 @@ class EntityViewBuilderTest extends EntityKernelTestBase {
/**
* Tests entity render cache toggling.
*/
- public function testEntityViewBuilderCacheToggling() {
+ public function testEntityViewBuilderCacheToggling(): void {
$entity_test = $this->createTestEntity('entity_test');
$entity_test->save();
@@ -190,7 +190,7 @@ class EntityViewBuilderTest extends EntityKernelTestBase {
/**
* Tests weighting of display components.
*/
- public function testEntityViewBuilderWeight() {
+ public function testEntityViewBuilderWeight(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
@@ -212,7 +212,7 @@ class EntityViewBuilderTest extends EntityKernelTestBase {
/**
* Tests EntityViewBuilder::viewField() language awareness.
*/
- public function testViewField() {
+ public function testViewField(): void {
// Allow access to view translations as well.
Role::load(RoleInterface::ANONYMOUS_ID)
->grantPermission('view test entity translations')
@@ -359,7 +359,7 @@ class EntityViewBuilderTest extends EntityKernelTestBase {
/**
* Tests that viewing an entity without template does not specify #theme.
*/
- public function testNoTemplate() {
+ public function testNoTemplate(): void {
// Ensure that an entity type without explicit view builder uses the
// default.
$entity_type_manager = \Drupal::entityTypeManager();
@@ -378,7 +378,7 @@ class EntityViewBuilderTest extends EntityKernelTestBase {
/**
* Tests an entity type with an external canonical rel.
*/
- public function testExternalEntity() {
+ public function testExternalEntity(): void {
$this->installEntitySchema('entity_test_external');
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityViewHookTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityViewHookTest.php
index a895b7d4892..2e7fa432763 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityViewHookTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityViewHookTest.php
@@ -24,7 +24,7 @@ class EntityViewHookTest extends EntityKernelTestBase {
/**
* Tests hook_entity_display_build_alter().
*/
- public function testHookEntityDisplayBuildAlter() {
+ public function testHookEntityDisplayBuildAlter(): void {
entity_test_create_bundle('display_build_alter_bundle');
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php b/core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php
index bd6543f4e17..b9e8f2b8066 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php
@@ -107,7 +107,7 @@ class FieldSqlStorageTest extends EntityKernelTestBase {
/**
* Tests field loading works correctly by inserting directly in the tables.
*/
- public function testFieldLoad() {
+ public function testFieldLoad(): void {
$entity_type = $bundle = 'entity_test_rev';
/** @var \Drupal\Core\Entity\RevisionableStorageInterface $storage */
$storage = $this->container->get('entity_type.manager')->getStorage($entity_type);
@@ -183,7 +183,7 @@ class FieldSqlStorageTest extends EntityKernelTestBase {
/**
* Tests field saving works correctly by reading directly from the tables.
*/
- public function testFieldWrite() {
+ public function testFieldWrite(): void {
$entity_type = $bundle = 'entity_test_rev';
$entity = $this->container->get('entity_type.manager')
->getStorage($entity_type)
@@ -279,7 +279,7 @@ class FieldSqlStorageTest extends EntityKernelTestBase {
/**
* Tests that long entity type and field names do not break.
*/
- public function testLongNames() {
+ public function testLongNames(): void {
// Use one of the longest entity_type names in core.
$entity_type = $bundle = 'entity_test_multivalue_basefield';
$this->installEntitySchema('entity_test_multivalue_basefield');
@@ -320,7 +320,7 @@ class FieldSqlStorageTest extends EntityKernelTestBase {
/**
* Tests trying to update a field with data.
*/
- public function testUpdateFieldSchemaWithData() {
+ public function testUpdateFieldSchemaWithData(): void {
$entity_type = 'entity_test_rev';
// Create a decimal 5.2 field and add some data.
$field_storage = FieldStorageConfig::create([
@@ -353,7 +353,7 @@ class FieldSqlStorageTest extends EntityKernelTestBase {
/**
* Tests that failure to create fields is handled gracefully.
*/
- public function testFieldUpdateFailure() {
+ public function testFieldUpdateFailure(): void {
// Create a text field.
$field_storage = FieldStorageConfig::create([
'field_name' => 'test_text',
@@ -392,7 +392,7 @@ class FieldSqlStorageTest extends EntityKernelTestBase {
/**
* Tests adding and removing indexes while data is present.
*/
- public function testFieldUpdateIndexesWithData() {
+ public function testFieldUpdateIndexesWithData(): void {
// Create a decimal field.
$field_name = 'test_field';
$entity_type = 'entity_test_rev';
@@ -449,7 +449,7 @@ class FieldSqlStorageTest extends EntityKernelTestBase {
/**
* Tests foreign key support.
*/
- public function testFieldSqlStorageForeignKeys() {
+ public function testFieldSqlStorageForeignKeys(): void {
// Create a 'shape' field, with a configurable foreign key (see
// field_test_field_schema()).
$field_name = 'test_field';
@@ -483,7 +483,7 @@ class FieldSqlStorageTest extends EntityKernelTestBase {
/**
* Tests table name generation.
*/
- public function testTableNames() {
+ public function testTableNames(): void {
// Note: we need to test entity types with long names. We therefore use
// fields on imaginary entity types (works as long as we don't actually save
// them), and just check the generated table names.
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/FieldTranslationSqlStorageTest.php b/core/tests/Drupal/KernelTests/Core/Entity/FieldTranslationSqlStorageTest.php
index 90043437197..c864b515277 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/FieldTranslationSqlStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/FieldTranslationSqlStorageTest.php
@@ -18,7 +18,7 @@ class FieldTranslationSqlStorageTest extends EntityLanguageTestBase {
/**
* Tests field SQL storage.
*/
- public function testFieldSqlStorage() {
+ public function testFieldSqlStorage(): void {
$entity_type = 'entity_test_mul';
$controller = $this->entityTypeManager->getStorage($entity_type);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/FieldWidgetConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/Entity/FieldWidgetConstraintValidatorTest.php
index 36b7e4346be..9a0a81c5894 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/FieldWidgetConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/FieldWidgetConstraintValidatorTest.php
@@ -38,7 +38,7 @@ class FieldWidgetConstraintValidatorTest extends KernelTestBase {
/**
* Tests widget constraint validation.
*/
- public function testValidation() {
+ public function testValidation(): void {
$entity_type = 'entity_test_constraint_violation';
$entity = $this->container->get('entity_type.manager')
->getStorage($entity_type)
@@ -106,7 +106,7 @@ class FieldWidgetConstraintValidatorTest extends KernelTestBase {
/**
* Tests widget constraint validation with composite constraints.
*/
- public function testValidationWithCompositeConstraint() {
+ public function testValidationWithCompositeConstraint(): void {
// First provide a valid value, this should cause no validation.
$entity = EntityTestCompositeConstraint::create([
'name' => 'valid-value',
@@ -149,7 +149,7 @@ class FieldWidgetConstraintValidatorTest extends KernelTestBase {
/**
* Tests entity level constraint validation.
*/
- public function testEntityLevelConstraintValidation() {
+ public function testEntityLevelConstraintValidation(): void {
$entity = EntityTestCompositeConstraint::create([
'name' => 'entity-level-violation',
]);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php b/core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php
index 9842aed0bef..4a70ae7091c 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php
@@ -130,7 +130,7 @@ class FieldableEntityDefinitionUpdateTest extends EntityKernelTestBase {
* @covers ::updateFieldableEntityType
* @dataProvider providerTestFieldableEntityTypeUpdates
*/
- public function testFieldableEntityTypeUpdates($initial_rev, $initial_mul, $new_rev, $new_mul, $data_migration_supported) {
+ public function testFieldableEntityTypeUpdates($initial_rev, $initial_mul, $new_rev, $new_mul, $data_migration_supported): void {
// The 'entity_test_update' entity type is neither revisionable nor
// translatable by default, so we need to get it into the initial testing
// state. This also covers the "no existing data" scenario for fieldable
@@ -666,7 +666,7 @@ class FieldableEntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests that a failed entity schema update preserves the existing data.
*/
- public function testFieldableEntityTypeUpdatesErrorHandling() {
+ public function testFieldableEntityTypeUpdatesErrorHandling(): void {
$schema = $this->database->schema();
// First, convert the entity type to be translatable for better coverage and
@@ -834,7 +834,7 @@ class FieldableEntityDefinitionUpdateTest extends EntityKernelTestBase {
/**
* Tests the removal of the backup tables after a successful update.
*/
- public function testFieldableEntityTypeUpdatesRemoveBackupTables() {
+ public function testFieldableEntityTypeUpdatesRemoveBackupTables(): void {
$schema = $this->database->schema();
// Convert the entity type to be revisionable.
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/RevisionableContentEntityBaseTest.php b/core/tests/Drupal/KernelTests/Core/Entity/RevisionableContentEntityBaseTest.php
index 5053b3367a3..467b225134e 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/RevisionableContentEntityBaseTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/RevisionableContentEntityBaseTest.php
@@ -38,7 +38,7 @@ class RevisionableContentEntityBaseTest extends EntityKernelTestBase {
/**
* Tests the correct functionality CRUD operations of entity revisions.
*/
- public function testRevisionableContentEntity() {
+ public function testRevisionableContentEntity(): void {
$entity_type = 'entity_test_mul_revlog';
$definition = \Drupal::entityTypeManager()->getDefinition($entity_type);
$user = User::create(['name' => 'test name']);
@@ -99,7 +99,7 @@ class RevisionableContentEntityBaseTest extends EntityKernelTestBase {
*
* @covers \Drupal\Core\Entity\ContentEntityBase::wasDefaultRevision
*/
- public function testWasDefaultRevision() {
+ public function testWasDefaultRevision(): void {
$entity_type_id = 'entity_test_mul_revlog';
$entity = EntityTestMulWithRevisionLog::create([
'type' => $entity_type_id,
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/RouteProviderTest.php b/core/tests/Drupal/KernelTests/Core/Entity/RouteProviderTest.php
index ee99001dee9..ae8149e0331 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/RouteProviderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/RouteProviderTest.php
@@ -63,7 +63,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* @covers \Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider::getRoutes
*/
- public function testHtmlRoutes() {
+ public function testHtmlRoutes(): void {
/** @var \Drupal\Core\Routing\RouteProviderInterface $route_provider */
$route_provider = \Drupal::service('router.route_provider');
@@ -104,7 +104,7 @@ class RouteProviderTest extends KernelTestBase {
* @covers \Drupal\Core\Entity\Routing\AdminHtmlRouteProvider::getEditFormRoute
* @covers \Drupal\Core\Entity\Routing\AdminHtmlRouteProvider::getDeleteFormRoute
*/
- public function testAdminHtmlRoutes() {
+ public function testAdminHtmlRoutes(): void {
/** @var \Drupal\Core\Routing\RouteProviderInterface $route_provider */
$route_provider = \Drupal::service('router.route_provider');
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php b/core/tests/Drupal/KernelTests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
index 0d0c1c053e8..a0bfc4125b2 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
@@ -41,7 +41,7 @@ class SqlContentEntityStorageSchemaTest extends EntityKernelTestBase {
/**
* Tests updating a shared table field definition.
*/
- public function testOnFieldStorageDefinitionUpdateShared() {
+ public function testOnFieldStorageDefinitionUpdateShared(): void {
// Install the test entity type with an additional field. Use a multi-column
// field so that field name and column name(s) do not match.
$field = BaseFieldDefinition::create('shape')
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php
index ea891ba0ff8..f815bf33f4d 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/ValidReferenceConstraintValidatorTest.php
@@ -54,7 +54,7 @@ class ValidReferenceConstraintValidatorTest extends EntityKernelTestBase {
/**
* Tests the ValidReferenceConstraintValidator.
*/
- public function testValidation() {
+ public function testValidation(): void {
// Create a test entity to be referenced.
$entity = $this->createUser();
// By default entity references already have the ValidReference constraint.
@@ -85,7 +85,7 @@ class ValidReferenceConstraintValidatorTest extends EntityKernelTestBase {
/**
* Tests the validation of pre-existing items in an entity reference field.
*/
- public function testPreExistingItemsValidation() {
+ public function testPreExistingItemsValidation(): void {
// Create two types of users, with and without access to bypass content
// access.
/** @var \Drupal\user\RoleInterface $role_with_access */
diff --git a/core/tests/Drupal/KernelTests/Core/EventSubscriber/ExceptionLoggingSubscriberTest.php b/core/tests/Drupal/KernelTests/Core/EventSubscriber/ExceptionLoggingSubscriberTest.php
index 1f5afcdd001..785a52c981b 100644
--- a/core/tests/Drupal/KernelTests/Core/EventSubscriber/ExceptionLoggingSubscriberTest.php
+++ b/core/tests/Drupal/KernelTests/Core/EventSubscriber/ExceptionLoggingSubscriberTest.php
@@ -32,7 +32,7 @@ class ExceptionLoggingSubscriberTest extends KernelTestBase {
/**
* Tests \Drupal\Core\EventSubscriber\ExceptionLoggingSubscriber::onException().
*/
- public function testExceptionLogging() {
+ public function testExceptionLogging(): void {
$http_kernel = \Drupal::service('http_kernel');
$channel_map = [
diff --git a/core/tests/Drupal/KernelTests/Core/Extension/ModuleExtensionListTest.php b/core/tests/Drupal/KernelTests/Core/Extension/ModuleExtensionListTest.php
index fecd16f08c5..0981068243e 100644
--- a/core/tests/Drupal/KernelTests/Core/Extension/ModuleExtensionListTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Extension/ModuleExtensionListTest.php
@@ -15,7 +15,7 @@ class ModuleExtensionListTest extends KernelTestBase {
/**
* @covers ::getList
*/
- public function testGetList() {
+ public function testGetList(): void {
\Drupal::configFactory()->getEditable('core.extension')
->set('module.testing', 1000)
->set('profile', 'testing')
diff --git a/core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerDeprecatedHookTest.php b/core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerDeprecatedHookTest.php
index 1f89983cbb7..91c4b426ff8 100644
--- a/core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerDeprecatedHookTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerDeprecatedHookTest.php
@@ -21,7 +21,7 @@ class ModuleHandlerDeprecatedHookTest extends KernelTestBase {
/**
* @covers ::invokeDeprecated
*/
- public function testInvokeDeprecated() {
+ public function testInvokeDeprecated(): void {
$this->expectDeprecation('The deprecated hook hook_deprecated_hook() is implemented in these functions: deprecation_test_deprecated_hook(). Use something else.');
/** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */
$module_handler = $this->container->get('module_handler');
@@ -35,7 +35,7 @@ class ModuleHandlerDeprecatedHookTest extends KernelTestBase {
/**
* @covers ::invokeAllDeprecated
*/
- public function testInvokeAllDeprecated() {
+ public function testInvokeAllDeprecated(): void {
$this->expectDeprecation('The deprecated hook hook_deprecated_hook() is implemented in these functions: deprecation_test_deprecated_hook(). Use something else.');
/** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */
$module_handler = $this->container->get('module_handler');
@@ -49,7 +49,7 @@ class ModuleHandlerDeprecatedHookTest extends KernelTestBase {
/**
* @covers ::alterDeprecated
*/
- public function testAlterDeprecated() {
+ public function testAlterDeprecated(): void {
$this->expectDeprecation('The deprecated alter hook hook_deprecated_alter_alter() is implemented in these functions: deprecation_test_deprecated_alter_alter. Alter something else.');
/** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */
$module_handler = $this->container->get('module_handler');
diff --git a/core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerDeprecatedHookUnimplementedTest.php b/core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerDeprecatedHookUnimplementedTest.php
index feff674ecfc..2f58084c353 100644
--- a/core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerDeprecatedHookUnimplementedTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerDeprecatedHookUnimplementedTest.php
@@ -21,7 +21,7 @@ class ModuleHandlerDeprecatedHookUnimplementedTest extends KernelTestBase {
* @covers ::invokeAllDeprecated
* @covers ::invokeDeprecated
*/
- public function testUnimplementedHooks() {
+ public function testUnimplementedHooks(): void {
$unimplemented_hook_name = 'unimplemented_hook_name';
/** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */
diff --git a/core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerTest.php b/core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerTest.php
index a2d8e0da4e3..8ee28a968fd 100644
--- a/core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerTest.php
@@ -19,7 +19,7 @@ class ModuleHandlerTest extends KernelTestBase {
*
* @covers ::getName
*/
- public function testInvalidGetName() {
+ public function testInvalidGetName(): void {
$this->expectException(UnknownExtensionException::class);
$this->expectExceptionMessage('The module module_nonsense does not exist.');
$module_handler = $this->container->get('module_handler');
@@ -31,7 +31,7 @@ class ModuleHandlerTest extends KernelTestBase {
*
* @group legacy
*/
- public function testGetNameDeprecation() {
+ public function testGetNameDeprecation(): void {
$this->expectDeprecation('Drupal\Core\Extension\ModuleHandler::getName() is deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. Use \Drupal\Core\Extension\ModuleExtensionList::getName($module) instead. See https://www.drupal.org/node/3310017');
$this->assertNotNull(\Drupal::service('module_handler')->getName('module_test'));
}
diff --git a/core/tests/Drupal/KernelTests/Core/Extension/ModuleImplementsAlterTest.php b/core/tests/Drupal/KernelTests/Core/Extension/ModuleImplementsAlterTest.php
index 6fd04ef0de4..f37e257d0ee 100644
--- a/core/tests/Drupal/KernelTests/Core/Extension/ModuleImplementsAlterTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Extension/ModuleImplementsAlterTest.php
@@ -24,7 +24,7 @@ class ModuleImplementsAlterTest extends KernelTestBase {
* @see \Drupal\Core\Extension\ModuleHandler::buildImplementationInfo()
* @see module_test_module_implements_alter()
*/
- public function testModuleImplementsAlter() {
+ public function testModuleImplementsAlter(): void {
// Get an instance of the module handler, to observe how it is going to be
// replaced.
@@ -71,7 +71,7 @@ class ModuleImplementsAlterTest extends KernelTestBase {
* @see \Drupal\Core\Extension\ModuleHandler::buildImplementationInfo()
* @see module_test_module_implements_alter()
*/
- public function testModuleImplementsAlterNonExistingImplementation() {
+ public function testModuleImplementsAlterNonExistingImplementation(): void {
// Install the module_test module.
\Drupal::service('module_installer')->install(['module_test']);
diff --git a/core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php b/core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php
index d232e0cd0f1..b95fad54b6e 100644
--- a/core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php
@@ -27,7 +27,7 @@ class ModuleInstallerTest extends KernelTestBase {
* @covers ::install
* @covers ::uninstall
*/
- public function testRouteRebuild() {
+ public function testRouteRebuild(): void {
// Remove the routing table manually to ensure it can be created lazily
// properly.
Database::getConnection()->schema()->dropTable('router');
@@ -46,7 +46,7 @@ class ModuleInstallerTest extends KernelTestBase {
*
* @covers ::install
*/
- public function testConfigChangeOnInstall() {
+ public function testConfigChangeOnInstall(): void {
// Install the child module so the parent is installed automatically.
$this->container->get('module_installer')->install(['module_handler_test_multiple_child']);
$modules = $this->config('core.extension')->get('module');
@@ -62,7 +62,7 @@ class ModuleInstallerTest extends KernelTestBase {
*
* @covers ::removeCacheBins
*/
- public function testCacheBinCleanup() {
+ public function testCacheBinCleanup(): void {
$schema = $this->container->get('database')->schema();
$table = 'cache_module_cache_bin';
@@ -85,7 +85,7 @@ class ModuleInstallerTest extends KernelTestBase {
/**
* Ensure that rebuilding the container in hook_install() works.
*/
- public function testKernelRebuildDuringHookInstall() {
+ public function testKernelRebuildDuringHookInstall(): void {
\Drupal::state()->set('module_test_install:rebuild_container', TRUE);
$module_installer = $this->container->get('module_installer');
$this->assertTrue($module_installer->install(['module_test']));
@@ -97,7 +97,7 @@ class ModuleInstallerTest extends KernelTestBase {
* @dataProvider providerTestInvalidCoreInstall
* @covers ::install
*/
- public function testInvalidCoreInstall($module_name, $install_dependencies) {
+ public function testInvalidCoreInstall($module_name, $install_dependencies): void {
$this->expectException(MissingDependencyException::class);
$this->expectExceptionMessage("Unable to install modules: module '$module_name' is incompatible with this version of Drupal core.");
$this->container->get('module_installer')->install([$module_name], $install_dependencies);
@@ -124,7 +124,7 @@ class ModuleInstallerTest extends KernelTestBase {
*
* @covers ::install
*/
- public function testDependencyInvalidCoreInstall() {
+ public function testDependencyInvalidCoreInstall(): void {
$this->expectException(MissingDependencyException::class);
$this->expectExceptionMessage("Unable to install modules: module 'system_incompatible_core_version_dependencies_test'. Its dependency module 'system_core_incompatible_semver_test' is incompatible with this version of Drupal core.");
$this->container->get('module_installer')->install(['system_incompatible_core_version_dependencies_test']);
@@ -135,7 +135,7 @@ class ModuleInstallerTest extends KernelTestBase {
*
* @covers ::install
*/
- public function testDependencyInvalidCoreInstallNoDependencies() {
+ public function testDependencyInvalidCoreInstallNoDependencies(): void {
$this->assertTrue($this->container->get('module_installer')->install(['system_incompatible_core_version_dependencies_test'], FALSE));
}
@@ -144,7 +144,7 @@ class ModuleInstallerTest extends KernelTestBase {
*
* @covers ::install
*/
- public function testObsoleteInstall() {
+ public function testObsoleteInstall(): void {
$this->expectException(ObsoleteExtensionException::class);
$this->expectExceptionMessage("Unable to install modules: module 'system_status_obsolete_test' is obsolete.");
$this->container->get('module_installer')->install(['system_status_obsolete_test']);
@@ -157,7 +157,7 @@ class ModuleInstallerTest extends KernelTestBase {
*
* @group legacy
*/
- public function testDeprecatedInstall() {
+ public function testDeprecatedInstall(): void {
$this->expectDeprecation("The module 'deprecated_module' is deprecated. See http://example.com/deprecated");
\Drupal::service('module_installer')->install(['deprecated_module']);
$this->assertTrue(\Drupal::service('module_handler')->moduleExists('deprecated_module'));
@@ -171,7 +171,7 @@ class ModuleInstallerTest extends KernelTestBase {
*
* @group legacy
*/
- public function testUninstallValidatorsBC() {
+ public function testUninstallValidatorsBC(): void {
$this->expectDeprecation('The "module_installer.uninstall_validators" service is deprecated in drupal:11.1.0 and is removed from drupal:12.0.0. Inject "!tagged_iterator module_install.uninstall_validator" instead. See https://www.drupal.org/node/3432595');
$module_installer = new ModuleInstaller(
$this->container->getParameter('app.root'),
diff --git a/core/tests/Drupal/KernelTests/Core/Extension/ThemeEngineExtensionListTest.php b/core/tests/Drupal/KernelTests/Core/Extension/ThemeEngineExtensionListTest.php
index c551d06b188..9c39a9246b3 100644
--- a/core/tests/Drupal/KernelTests/Core/Extension/ThemeEngineExtensionListTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Extension/ThemeEngineExtensionListTest.php
@@ -15,7 +15,7 @@ class ThemeEngineExtensionListTest extends KernelTestBase {
/**
* @covers ::getList
*/
- public function testGetList() {
+ public function testGetList(): void {
// Confirm that all theme engines are available.
$theme_engines = \Drupal::service('extension.list.theme_engine')->getList();
$this->assertArrayHasKey('twig', $theme_engines);
diff --git a/core/tests/Drupal/KernelTests/Core/Extension/ThemeExtensionListTest.php b/core/tests/Drupal/KernelTests/Core/Extension/ThemeExtensionListTest.php
index 98e3627823d..0ccae25b155 100644
--- a/core/tests/Drupal/KernelTests/Core/Extension/ThemeExtensionListTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Extension/ThemeExtensionListTest.php
@@ -15,7 +15,7 @@ class ThemeExtensionListTest extends KernelTestBase {
/**
* @covers ::getList
*/
- public function testGetList() {
+ public function testGetList(): void {
\Drupal::configFactory()->getEditable('core.extension')
->set('module.testing', 1000)
->set('theme.test_theme', 0)
@@ -35,7 +35,7 @@ class ThemeExtensionListTest extends KernelTestBase {
/**
* Tests that themes have an empty default version set.
*/
- public function testThemeWithoutVersion() {
+ public function testThemeWithoutVersion(): void {
$theme = \Drupal::service('extension.list.theme')->get('test_theme_settings_features');
$this->assertNull($theme->info['version']);
}
diff --git a/core/tests/Drupal/KernelTests/Core/Extension/UpdateDescriptionTest.php b/core/tests/Drupal/KernelTests/Core/Extension/UpdateDescriptionTest.php
index 3009dcd588d..e9ce1e2e4e0 100644
--- a/core/tests/Drupal/KernelTests/Core/Extension/UpdateDescriptionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Extension/UpdateDescriptionTest.php
@@ -23,7 +23,7 @@ class UpdateDescriptionTest extends KernelTestBase {
*
* @see update_get_update_list()
*/
- public function testUpdateGetUpdateList() {
+ public function testUpdateGetUpdateList(): void {
require_once $this->root . '/core/includes/update.inc';
\Drupal::service('update.update_hook_registry')->setInstalledVersion('update_test_description', 8000);
\Drupal::moduleHandler()->loadInclude('update_test_description', 'install');
diff --git a/core/tests/Drupal/KernelTests/Core/Extension/UpdateSchemaTest.php b/core/tests/Drupal/KernelTests/Core/Extension/UpdateSchemaTest.php
index a9a3282eed0..26b698ca787 100644
--- a/core/tests/Drupal/KernelTests/Core/Extension/UpdateSchemaTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Extension/UpdateSchemaTest.php
@@ -23,7 +23,7 @@ class UpdateSchemaTest extends KernelTestBase {
*
* @see \Drupal\Core\Update\UpdateHookRegistry::getAvailableUpdates()
*/
- public function testDrupalGetSchemaVersionsInt() {
+ public function testDrupalGetSchemaVersionsInt(): void {
\Drupal::state()->set('update_test_schema_version', 8001);
$this->installSchema('update_test_schema', ['update_test_schema_table']);
$schema = \Drupal::service('update.update_hook_registry')->getAvailableUpdates('update_test_schema');
diff --git a/core/tests/Drupal/KernelTests/Core/Field/Entity/BaseFieldOverrideTest.php b/core/tests/Drupal/KernelTests/Core/Field/Entity/BaseFieldOverrideTest.php
index cee655b539f..b78dd21c164 100644
--- a/core/tests/Drupal/KernelTests/Core/Field/Entity/BaseFieldOverrideTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Field/Entity/BaseFieldOverrideTest.php
@@ -40,7 +40,7 @@ class BaseFieldOverrideTest extends KernelTestBase {
*
* @dataProvider getClassTestCases
*/
- public function testGetClass($field_type, $base_field_class, $expected_override_class) {
+ public function testGetClass($field_type, $base_field_class, $expected_override_class): void {
$base_field = BaseFieldDefinition::create($field_type)
->setName('Test Field')
->setTargetEntityTypeId('entity_test');
@@ -72,7 +72,7 @@ class BaseFieldOverrideTest extends KernelTestBase {
/**
* Tests the default value callback.
*/
- public function testDefaultValueCallback() {
+ public function testDefaultValueCallback(): void {
$base_field = BaseFieldDefinition::create('entity_reference')
->setName('Test Field')
->setTargetEntityTypeId('entity_test')
@@ -92,7 +92,7 @@ class BaseFieldOverrideTest extends KernelTestBase {
* @covers ::isInternal
* @covers ::getUniqueIdentifier
*/
- public function testInheritedProperties() {
+ public function testInheritedProperties(): void {
$base_field = BaseFieldDefinition::create('string')
->setName('Test Field')
->setTargetEntityTypeId('entity_test')
diff --git a/core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php b/core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php
index aa1e1265949..37d06f0d1a4 100644
--- a/core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php
@@ -69,7 +69,7 @@ class FieldAccessTest extends KernelTestBase {
* @see entity_test_entity_field_access()
* @see entity_test_entity_field_access_alter()
*/
- public function testFieldAccess() {
+ public function testFieldAccess(): void {
$values = [
'name' => $this->randomMachineName(),
'user_id' => 1,
diff --git a/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php b/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php
index 42a528945f4..7c16f9a0bc3 100644
--- a/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php
@@ -59,7 +59,7 @@ class FieldItemTest extends EntityKernelTestBase {
/**
* Tests the field item save workflow.
*/
- public function testSaveWorkflow() {
+ public function testSaveWorkflow(): void {
$entity = EntityTestMulRev::create([
'name' => $this->randomString(),
'field_test_item' => $this->randomString(),
diff --git a/core/tests/Drupal/KernelTests/Core/Field/FieldMissingTypeTest.php b/core/tests/Drupal/KernelTests/Core/Field/FieldMissingTypeTest.php
index 0cd6eaf4eb0..3fedd71caf2 100644
--- a/core/tests/Drupal/KernelTests/Core/Field/FieldMissingTypeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Field/FieldMissingTypeTest.php
@@ -62,7 +62,7 @@ class FieldMissingTypeTest extends EntityKernelTestBase {
*
* @see \Drupal\field\FieldStorageConfigStorage::mapFromStorageRecords()
*/
- public function testFieldStorageMissingType() {
+ public function testFieldStorageMissingType(): void {
$this->expectException(PluginNotFoundException::class);
$this->expectExceptionMessage("Unable to determine class for field type 'foo_field_storage' found in the 'field.storage.entity_test_mulrev.{$this->fieldName}' configuration");
$entity = EntityTestMulRev::create([
@@ -82,7 +82,7 @@ class FieldMissingTypeTest extends EntityKernelTestBase {
*
* @see \Drupal\field\FieldConfigStorageBase::mapFromStorageRecords()
*/
- public function testFieldMissingType() {
+ public function testFieldMissingType(): void {
$this->expectException(PluginNotFoundException::class);
$this->expectExceptionMessage("Unable to determine class for field type 'foo_field' found in the 'field.field.entity_test_mulrev.entity_test_mulrev.{$this->fieldName}' configuration");
$entity = EntityTestMulRev::create([
diff --git a/core/tests/Drupal/KernelTests/Core/Field/FieldSettingsTest.php b/core/tests/Drupal/KernelTests/Core/Field/FieldSettingsTest.php
index 8e82ce9f413..dbf6f206255 100644
--- a/core/tests/Drupal/KernelTests/Core/Field/FieldSettingsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Field/FieldSettingsTest.php
@@ -27,7 +27,7 @@ class FieldSettingsTest extends EntityKernelTestBase {
* @covers \Drupal\Core\Field\BaseFieldDefinition::getSettings
* @covers \Drupal\Core\Field\BaseFieldDefinition::setSettings
*/
- public function testBaseFieldSettings() {
+ public function testBaseFieldSettings(): void {
$base_field = BaseFieldDefinition::create('test_field');
// Check that the default settings have been populated.
@@ -51,7 +51,7 @@ class FieldSettingsTest extends EntityKernelTestBase {
/**
* Tests the base field settings on a cloned base field definition object.
*/
- public function testBaseFieldSettingsOnClone() {
+ public function testBaseFieldSettingsOnClone(): void {
$base_field = BaseFieldDefinition::create('test_field');
// Check that the default settings have been populated.
@@ -80,7 +80,7 @@ class FieldSettingsTest extends EntityKernelTestBase {
* @covers \Drupal\field\Entity\FieldStorageConfig::getSettings
* @covers \Drupal\field\Entity\FieldStorageConfig::setSettings
*/
- public function testConfigurableFieldStorageSettings() {
+ public function testConfigurableFieldStorageSettings(): void {
$field_storage = FieldStorageConfig::create([
'field_name' => 'test_field',
'entity_type' => 'entity_test',
@@ -108,7 +108,7 @@ class FieldSettingsTest extends EntityKernelTestBase {
* @covers \Drupal\field\Entity\FieldStorageConfig::getSettings
* @covers \Drupal\field\Entity\FieldStorageConfig::setSettings
*/
- public function testConfigurableFieldSettings() {
+ public function testConfigurableFieldSettings(): void {
$field_storage = FieldStorageConfig::create([
'field_name' => 'test_field',
'entity_type' => 'entity_test',
diff --git a/core/tests/Drupal/KernelTests/Core/Field/FieldType/PasswordItemTest.php b/core/tests/Drupal/KernelTests/Core/Field/FieldType/PasswordItemTest.php
index 7db2a7d285a..c3d6fc47392 100644
--- a/core/tests/Drupal/KernelTests/Core/Field/FieldType/PasswordItemTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Field/FieldType/PasswordItemTest.php
@@ -55,7 +55,7 @@ class PasswordItemTest extends FieldKernelTestBase {
/**
* @covers ::preSave
*/
- public function testPreSavePreHashed() {
+ public function testPreSavePreHashed(): void {
$entity = EntityTest::create([
'name' => $this->randomString(),
]);
@@ -70,7 +70,7 @@ class PasswordItemTest extends FieldKernelTestBase {
/**
* @covers ::preSave
*/
- public function testPreSaveNewNull() {
+ public function testPreSaveNewNull(): void {
$entity = EntityTest::create([
'name' => $this->randomString(),
]);
@@ -83,7 +83,7 @@ class PasswordItemTest extends FieldKernelTestBase {
/**
* @covers ::preSave
*/
- public function testPreSaveNewEmptyString() {
+ public function testPreSaveNewEmptyString(): void {
$entity = EntityTest::create([
'name' => $this->randomString(),
]);
@@ -100,7 +100,7 @@ class PasswordItemTest extends FieldKernelTestBase {
/**
* @covers ::preSave
*/
- public function testPreSaveNewMultipleSpacesString() {
+ public function testPreSaveNewMultipleSpacesString(): void {
$entity = EntityTest::create([
'name' => $this->randomString(),
]);
@@ -117,7 +117,7 @@ class PasswordItemTest extends FieldKernelTestBase {
/**
* @covers ::preSave
*/
- public function testPreSaveExistingNull() {
+ public function testPreSaveExistingNull(): void {
$entity = EntityTest::create();
$entity->test_field = $this->randomString();
$entity->save();
@@ -133,7 +133,7 @@ class PasswordItemTest extends FieldKernelTestBase {
/**
* @covers ::preSave
*/
- public function testPreSaveExistingEmptyString() {
+ public function testPreSaveExistingEmptyString(): void {
$entity = EntityTest::create();
$entity->test_field = $this->randomString();
$entity->save();
@@ -149,7 +149,7 @@ class PasswordItemTest extends FieldKernelTestBase {
/**
* @covers ::preSave
*/
- public function testPreSaveExistingMultipleSpacesString() {
+ public function testPreSaveExistingMultipleSpacesString(): void {
$entity = EntityTest::create();
$entity->test_field = $this->randomString();
$entity->save();
@@ -164,7 +164,7 @@ class PasswordItemTest extends FieldKernelTestBase {
/**
* @covers ::preSave
*/
- public function testPreSaveExceptionNew() {
+ public function testPreSaveExceptionNew(): void {
$entity = EntityTest::create();
$entity->test_field = str_repeat('a', PasswordInterface::PASSWORD_MAX_LENGTH + 1);
$this->expectException(EntityStorageException::class);
@@ -175,7 +175,7 @@ class PasswordItemTest extends FieldKernelTestBase {
/**
* @covers ::preSave
*/
- public function testPreSaveExceptionExisting() {
+ public function testPreSaveExceptionExisting(): void {
$entity = EntityTest::create();
$entity->test_field = 'will_be_hashed';
$entity->save();
diff --git a/core/tests/Drupal/KernelTests/Core/Field/MapBaseFieldTest.php b/core/tests/Drupal/KernelTests/Core/Field/MapBaseFieldTest.php
index 01eefa6e2b7..fc3338dac81 100644
--- a/core/tests/Drupal/KernelTests/Core/Field/MapBaseFieldTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Field/MapBaseFieldTest.php
@@ -45,7 +45,7 @@ class MapBaseFieldTest extends EntityKernelTestBase {
/**
* Tests uninstalling map item base field.
*/
- public function testUninstallMapItemBaseField() {
+ public function testUninstallMapItemBaseField(): void {
$definitions['data_map'] = BaseFieldDefinition::create('map')
->setLabel(t('Data'))
->setRequired(TRUE);
diff --git a/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php b/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php
index d32a42343f4..8c6490d6e12 100644
--- a/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php
@@ -21,7 +21,7 @@ class DirectoryTest extends FileTestBase {
/**
* Tests local directory handling functions.
*/
- public function testFileCheckLocalDirectoryHandling() {
+ public function testFileCheckLocalDirectoryHandling(): void {
$site_path = $this->container->getParameter('site.path');
$directory = $site_path . '/files';
@@ -62,7 +62,7 @@ class DirectoryTest extends FileTestBase {
/**
* Tests directory handling functions.
*/
- public function testFileCheckDirectoryHandling() {
+ public function testFileCheckDirectoryHandling(): void {
// A directory to operate on.
$default_scheme = 'public';
$directory = $default_scheme . '://' . $this->randomMachineName() . '/' . $this->randomMachineName();
@@ -117,7 +117,7 @@ class DirectoryTest extends FileTestBase {
/**
* Tests the file paths of newly created files.
*/
- public function testFileCreateNewFilepath() {
+ public function testFileCreateNewFilepath(): void {
// First we test against an imaginary file that does not exist in a
// directory.
$basename = 'xyz.txt';
@@ -152,7 +152,7 @@ class DirectoryTest extends FileTestBase {
* If the file doesn't currently exist, then it will simply return the
* filepath.
*/
- public function testFileDestination() {
+ public function testFileDestination(): void {
// First test for non-existent file.
$destination = 'core/misc/xyz.txt';
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
@@ -181,7 +181,7 @@ class DirectoryTest extends FileTestBase {
/**
* Ensure that the getTempDirectory() method always returns a value.
*/
- public function testFileDirectoryTemp() {
+ public function testFileDirectoryTemp(): void {
$tmp_directory = \Drupal::service('file_system')->getTempDirectory();
$this->assertNotEmpty($tmp_directory);
$this->assertEquals($tmp_directory, FileSystem::getOsTemporaryDirectory());
@@ -190,7 +190,7 @@ class DirectoryTest extends FileTestBase {
/**
* Tests directory creation.
*/
- public function testDirectoryCreation() {
+ public function testDirectoryCreation(): void {
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = $this->container->get('file_system');
@@ -206,7 +206,7 @@ class DirectoryTest extends FileTestBase {
* Image style generation can result in many calls to create similar directory
* paths. This test forks the process to create the same situation.
*/
- public function testMultiplePrepareDirectory() {
+ public function testMultiplePrepareDirectory(): void {
if (!function_exists('pcntl_fork')) {
$this->markTestSkipped('Requires the pcntl_fork() function');
}
diff --git a/core/tests/Drupal/KernelTests/Core/File/FileCopyTest.php b/core/tests/Drupal/KernelTests/Core/File/FileCopyTest.php
index 18fa19a9fff..a7bf5b9dd70 100644
--- a/core/tests/Drupal/KernelTests/Core/File/FileCopyTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/FileCopyTest.php
@@ -20,7 +20,7 @@ class FileCopyTest extends FileTestBase {
/**
* Copy a normal file.
*/
- public function testNormal() {
+ public function testNormal(): void {
// Create a file for testing
$uri = $this->createUri();
@@ -50,7 +50,7 @@ class FileCopyTest extends FileTestBase {
/**
* Copy a non-existent file.
*/
- public function testNonExistent() {
+ public function testNonExistent(): void {
// Copy non-existent file
$desired_filepath = $this->randomMachineName();
$this->assertFileDoesNotExist($desired_filepath);
@@ -62,7 +62,7 @@ class FileCopyTest extends FileTestBase {
/**
* Copy a file onto itself.
*/
- public function testOverwriteSelf() {
+ public function testOverwriteSelf(): void {
// Create a file for testing
$uri = $this->createUri();
diff --git a/core/tests/Drupal/KernelTests/Core/File/FileDeleteRecursiveTest.php b/core/tests/Drupal/KernelTests/Core/File/FileDeleteRecursiveTest.php
index 78fed67a906..03f01e30fa1 100644
--- a/core/tests/Drupal/KernelTests/Core/File/FileDeleteRecursiveTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/FileDeleteRecursiveTest.php
@@ -14,7 +14,7 @@ class FileDeleteRecursiveTest extends FileTestBase {
/**
* Delete a normal file.
*/
- public function testSingleFile() {
+ public function testSingleFile(): void {
// Create a file for testing
$filepath = 'public://' . $this->randomMachineName();
file_put_contents($filepath, '');
@@ -27,7 +27,7 @@ class FileDeleteRecursiveTest extends FileTestBase {
/**
* Try deleting an empty directory.
*/
- public function testEmptyDirectory() {
+ public function testEmptyDirectory(): void {
// A directory to operate on.
$directory = $this->createDirectory();
@@ -39,7 +39,7 @@ class FileDeleteRecursiveTest extends FileTestBase {
/**
* Try deleting a directory with some files.
*/
- public function testDirectory() {
+ public function testDirectory(): void {
// A directory to operate on.
$directory = $this->createDirectory();
$filepathA = $directory . '/A';
@@ -57,7 +57,7 @@ class FileDeleteRecursiveTest extends FileTestBase {
/**
* Try deleting subdirectories with some files.
*/
- public function testSubDirectory() {
+ public function testSubDirectory(): void {
// A directory to operate on.
$directory = $this->createDirectory();
$subdirectory = $this->createDirectory($directory . '/sub');
diff --git a/core/tests/Drupal/KernelTests/Core/File/FileDeleteTest.php b/core/tests/Drupal/KernelTests/Core/File/FileDeleteTest.php
index b6eb9042c5e..1b6cbd1df17 100644
--- a/core/tests/Drupal/KernelTests/Core/File/FileDeleteTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/FileDeleteTest.php
@@ -16,7 +16,7 @@ class FileDeleteTest extends FileTestBase {
/**
* Delete a normal file.
*/
- public function testNormal() {
+ public function testNormal(): void {
// Create a file for testing
$uri = $this->createUri();
@@ -28,7 +28,7 @@ class FileDeleteTest extends FileTestBase {
/**
* Try deleting a missing file.
*/
- public function testMissing() {
+ public function testMissing(): void {
// Try to delete a non-existing file
$this->assertTrue(\Drupal::service('file_system')->delete('public://' . $this->randomMachineName()), 'Returns true when deleting a non-existent file.');
}
@@ -36,7 +36,7 @@ class FileDeleteTest extends FileTestBase {
/**
* Try deleting a directory.
*/
- public function testDirectory() {
+ public function testDirectory(): void {
// A directory to operate on.
$directory = $this->createDirectory();
diff --git a/core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php b/core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php
index b4462006457..bc0d8073153 100644
--- a/core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php
@@ -20,7 +20,7 @@ class FileMoveTest extends FileTestBase {
/**
* Move a normal file.
*/
- public function testNormal() {
+ public function testNormal(): void {
// Create a file for testing
$uri = $this->createUri();
@@ -53,7 +53,7 @@ class FileMoveTest extends FileTestBase {
/**
* Try to move a missing file.
*/
- public function testMissing() {
+ public function testMissing(): void {
// Move non-existent file.
$this->expectException(FileNotExistsException::class);
\Drupal::service('file_system')->move($this->randomMachineName(), $this->randomMachineName());
@@ -62,7 +62,7 @@ class FileMoveTest extends FileTestBase {
/**
* Try to move a file onto itself.
*/
- public function testOverwriteSelf() {
+ public function testOverwriteSelf(): void {
// Create a file for testing.
$uri = $this->createUri();
diff --git a/core/tests/Drupal/KernelTests/Core/File/FileSaveDataTest.php b/core/tests/Drupal/KernelTests/Core/File/FileSaveDataTest.php
index ae0a7a64fdd..67f95b43cbd 100644
--- a/core/tests/Drupal/KernelTests/Core/File/FileSaveDataTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/FileSaveDataTest.php
@@ -16,7 +16,7 @@ class FileSaveDataTest extends FileTestBase {
/**
* Tests the file_unmanaged_save_data() function.
*/
- public function testFileSaveData() {
+ public function testFileSaveData(): void {
$contents = $this->randomMachineName(8);
$this->setSetting('file_chmod_file', 0777);
diff --git a/core/tests/Drupal/KernelTests/Core/File/FileSystemRequirementsTest.php b/core/tests/Drupal/KernelTests/Core/File/FileSystemRequirementsTest.php
index fd3d206c687..20679366393 100644
--- a/core/tests/Drupal/KernelTests/Core/File/FileSystemRequirementsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/FileSystemRequirementsTest.php
@@ -34,7 +34,7 @@ class FileSystemRequirementsTest extends KernelTestBase {
/**
* Tests if settings are set, there are not warnings.
*/
- public function testSettingsExist() {
+ public function testSettingsExist(): void {
$this->setSetting('file_temp_path', $this->randomMachineName());
$requirements = $this->checkSystemRequirements();
$this->assertArrayNotHasKey('temp_directory', $requirements);
diff --git a/core/tests/Drupal/KernelTests/Core/File/FileSystemTempDirectoryTest.php b/core/tests/Drupal/KernelTests/Core/File/FileSystemTempDirectoryTest.php
index 41c54c3080f..c66d1238826 100644
--- a/core/tests/Drupal/KernelTests/Core/File/FileSystemTempDirectoryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/FileSystemTempDirectoryTest.php
@@ -45,7 +45,7 @@ class FileSystemTempDirectoryTest extends KernelTestBase {
*
* @covers ::getTempDirectory
*/
- public function testGetTempDirectorySettings() {
+ public function testGetTempDirectorySettings(): void {
$tempDir = '/var/tmp/' . $this->randomMachineName();
$this->setSetting('file_temp_path', $tempDir);
$this->assertEquals($tempDir, $this->fileSystem->getTempDirectory());
@@ -56,7 +56,7 @@ class FileSystemTempDirectoryTest extends KernelTestBase {
*
* @covers ::getTempDirectory
*/
- public function testGetTempDirectoryOsDefault() {
+ public function testGetTempDirectoryOsDefault(): void {
$tempDir = FileSystemComponent::getOsTemporaryDirectory();
$dir = $this->fileSystem->getTempDirectory();
$this->assertEquals($tempDir, $dir);
diff --git a/core/tests/Drupal/KernelTests/Core/File/FileSystemTest.php b/core/tests/Drupal/KernelTests/Core/File/FileSystemTest.php
index 3231dd4bc5e..c68e69ca89a 100644
--- a/core/tests/Drupal/KernelTests/Core/File/FileSystemTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/FileSystemTest.php
@@ -40,7 +40,7 @@ class FileSystemTest extends KernelTestBase {
/**
* @covers ::copy
*/
- public function testEnsureFileExistsBeforeCopy() {
+ public function testEnsureFileExistsBeforeCopy(): void {
// We need to compute the exception message here because it will include
// the 'real' path to the file, which varies with $this->siteDirectory.
$this->expectException(FileNotExistsException::class);
@@ -52,7 +52,7 @@ class FileSystemTest extends KernelTestBase {
/**
* @covers ::copy
*/
- public function testDestinationDirectoryFailureOnCopy() {
+ public function testDestinationDirectoryFailureOnCopy(): void {
$this->expectException(DirectoryNotReadyException::class);
$this->expectExceptionMessage("The specified file 'public://test.txt' could not be copied because the destination directory 'public://subdirectory' is not properly configured. This may be caused by a problem with file or directory permissions.");
touch('public://test.txt');
@@ -64,7 +64,7 @@ class FileSystemTest extends KernelTestBase {
/**
* @covers ::copy
*/
- public function testCopyFailureIfFileAlreadyExists() {
+ public function testCopyFailureIfFileAlreadyExists(): void {
$this->expectException(FileExistsException::class);
$this->expectExceptionMessage("File 'public://test.txt' could not be copied because a file by that name already exists in the destination directory ('')");
$uri = 'public://test.txt';
@@ -75,7 +75,7 @@ class FileSystemTest extends KernelTestBase {
/**
* @covers ::copy
*/
- public function testCopyFailureIfSelfOverwrite() {
+ public function testCopyFailureIfSelfOverwrite(): void {
$this->expectException(FileException::class);
$this->expectExceptionMessage("'public://test.txt' could not be copied because it would overwrite itself");
$uri = 'public://test.txt';
@@ -86,7 +86,7 @@ class FileSystemTest extends KernelTestBase {
/**
* @covers ::copy
*/
- public function testCopySelfRename() {
+ public function testCopySelfRename(): void {
$uri = 'public://test.txt';
touch($uri);
$this->fileSystem->copy($uri, $uri);
@@ -96,7 +96,7 @@ class FileSystemTest extends KernelTestBase {
/**
* @covers ::copy
*/
- public function testSuccessfulCopy() {
+ public function testSuccessfulCopy(): void {
touch('public://test.txt');
$this->fileSystem->copy('public://test.txt', 'public://test-copy.txt');
$this->assertFileExists('public://test-copy.txt');
diff --git a/core/tests/Drupal/KernelTests/Core/File/FileUrlGeneratorTest.php b/core/tests/Drupal/KernelTests/Core/File/FileUrlGeneratorTest.php
index 743bed3ee8b..a505e245412 100644
--- a/core/tests/Drupal/KernelTests/Core/File/FileUrlGeneratorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/FileUrlGeneratorTest.php
@@ -41,7 +41,7 @@ class FileUrlGeneratorTest extends FileTestBase {
*
* @covers ::generate
*/
- public function testGenerateMissingStreamWrapper() {
+ public function testGenerateMissingStreamWrapper(): void {
$this->expectException(InvalidStreamWrapperException::class);
$result = $this->fileUrlGenerator->generate("foo://bar");
}
@@ -51,7 +51,7 @@ class FileUrlGeneratorTest extends FileTestBase {
*
* @covers ::generateString
*/
- public function testGenerateStringMissingStreamWrapper() {
+ public function testGenerateStringMissingStreamWrapper(): void {
$this->expectException(InvalidStreamWrapperException::class);
$result = $this->fileUrlGenerator->generateString("foo://bar");
}
@@ -61,7 +61,7 @@ class FileUrlGeneratorTest extends FileTestBase {
*
* @covers ::generateAbsoluteString
*/
- public function testGenerateAbsoluteStringMissingStreamWrapper() {
+ public function testGenerateAbsoluteStringMissingStreamWrapper(): void {
$this->expectException(InvalidStreamWrapperException::class);
$result = $this->fileUrlGenerator->generateAbsoluteString("foo://bar");
}
@@ -71,7 +71,7 @@ class FileUrlGeneratorTest extends FileTestBase {
*
* @covers ::generateAbsoluteString
*/
- public function testShippedFileURL() {
+ public function testShippedFileURL(): void {
// Test generating a URL to a shipped file (i.e. a file that is part of
// Drupal core, a module or a theme, for example a JavaScript file).
@@ -120,7 +120,7 @@ class FileUrlGeneratorTest extends FileTestBase {
*
* @covers ::generateAbsoluteString
*/
- public function testPublicManagedFileURL() {
+ public function testPublicManagedFileURL(): void {
// Test generating a URL to a managed file.
// Test alteration of file URLs to use a CDN.
@@ -152,7 +152,7 @@ class FileUrlGeneratorTest extends FileTestBase {
*
* @covers ::generateAbsoluteString
*/
- public function testRelativeFileURL() {
+ public function testRelativeFileURL(): void {
// Disable file_test.module's hook_file_url_alter() implementation.
\Drupal::state()->set('file_test.hook_file_url_alter', NULL);
@@ -182,7 +182,7 @@ class FileUrlGeneratorTest extends FileTestBase {
*
* @dataProvider providerGenerateURI
*/
- public function testGenerateURI($filepath, $expected) {
+ public function testGenerateURI($filepath, $expected): void {
// Disable file_test.module's hook_file_url_alter() implementation.
\Drupal::state()->set('file_test.hook_file_url_alter', NULL);
@@ -200,7 +200,7 @@ class FileUrlGeneratorTest extends FileTestBase {
/**
* @covers ::generate
*/
- public function testGenerateURIWithSchema() {
+ public function testGenerateURIWithSchema(): void {
// Disable file_test.module's hook_file_url_alter() implementation.
\Drupal::state()->set('file_test.hook_file_url_alter', NULL);
diff --git a/core/tests/Drupal/KernelTests/Core/File/HtaccessTest.php b/core/tests/Drupal/KernelTests/Core/File/HtaccessTest.php
index c992e76510c..dfe537e4d1f 100644
--- a/core/tests/Drupal/KernelTests/Core/File/HtaccessTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/HtaccessTest.php
@@ -46,7 +46,7 @@ class HtaccessTest extends KernelTestBase {
/**
* @covers ::write
*/
- public function testHtaccessSave() {
+ public function testHtaccessSave(): void {
// Prepare test directories.
$private = Settings::get('file_public_path') . '/test/private';
$stream = 'public://test/stream';
diff --git a/core/tests/Drupal/KernelTests/Core/File/MimeTypeTest.php b/core/tests/Drupal/KernelTests/Core/File/MimeTypeTest.php
index 2050989c84d..833e3765a65 100644
--- a/core/tests/Drupal/KernelTests/Core/File/MimeTypeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/MimeTypeTest.php
@@ -21,7 +21,7 @@ class MimeTypeTest extends FileTestBase {
/**
* Tests mapping of mimetypes from filenames.
*/
- public function testFileMimeTypeDetection() {
+ public function testFileMimeTypeDetection(): void {
$prefixes = ['public://', 'private://', 'temporary://', 'dummy-remote://'];
$test_case = [
diff --git a/core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php b/core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php
index 54305629dbb..3752b396994 100644
--- a/core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/ReadOnlyStreamWrapperTest.php
@@ -31,7 +31,7 @@ class ReadOnlyStreamWrapperTest extends FileTestBase {
/**
* Tests read-only specific behavior.
*/
- public function testReadOnlyBehavior() {
+ public function testReadOnlyBehavior(): void {
$type = DummyReadOnlyStreamWrapper::getType();
// Checks that the stream wrapper type is not declared as writable.
$this->assertSame(0, $type & StreamWrapperInterface::WRITE);
diff --git a/core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php b/core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php
index c527b625a6e..9bbf22f07df 100644
--- a/core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php
@@ -50,7 +50,7 @@ class ScanDirectoryTest extends FileTestBase {
*
* @covers ::scanDirectory
*/
- public function testReturn() {
+ public function testReturn(): void {
// Grab a listing of all the JavaScript files and check that they're
// passed to the callback.
$all_files = $this->fileSystem->scanDirectory($this->path, '/^javascript-/');
@@ -77,7 +77,7 @@ class ScanDirectoryTest extends FileTestBase {
*
* @covers ::scanDirectory
*/
- public function testOptionCallback() {
+ public function testOptionCallback(): void {
// When nothing is matched nothing should be passed to the callback.
$all_files = $this->fileSystem->scanDirectory($this->path, '/^NON-EXISTING-FILENAME/', ['callback' => 'file_test_file_scan_callback']);
@@ -100,7 +100,7 @@ class ScanDirectoryTest extends FileTestBase {
*
* @covers ::scanDirectory
*/
- public function testOptionNoMask() {
+ public function testOptionNoMask(): void {
// Grab a listing of all the JavaScript files.
$all_files = $this->fileSystem->scanDirectory($this->path, '/^javascript-/');
$this->assertCount(2, $all_files, 'Found two, expected javascript files.');
@@ -115,7 +115,7 @@ class ScanDirectoryTest extends FileTestBase {
*
* @covers ::scanDirectory
*/
- public function testOptionKey() {
+ public function testOptionKey(): void {
// "filename", for the path starting with $dir.
$expected = [$this->path . '/javascript-1.txt', $this->path . '/javascript-2.script'];
$actual = array_keys($this->fileSystem->scanDirectory($this->path, '/^javascript-/', ['key' => 'filepath']));
@@ -146,7 +146,7 @@ class ScanDirectoryTest extends FileTestBase {
*
* @covers ::scanDirectory
*/
- public function testOptionRecurse() {
+ public function testOptionRecurse(): void {
$files = $this->fileSystem->scanDirectory($this->path . '/..', '/^javascript-/', ['recurse' => FALSE]);
$this->assertEmpty($files, "Without recursion couldn't find javascript files.");
@@ -159,7 +159,7 @@ class ScanDirectoryTest extends FileTestBase {
*
* @covers ::scanDirectory
*/
- public function testOptionMinDepth() {
+ public function testOptionMinDepth(): void {
$files = $this->fileSystem->scanDirectory($this->path, '/^javascript-/', ['min_depth' => 0]);
$this->assertCount(2, $files, 'No minimum-depth gets files in current directory.');
@@ -172,7 +172,7 @@ class ScanDirectoryTest extends FileTestBase {
*
* @covers ::scanDirectory
*/
- public function testIgnoreDirectories() {
+ public function testIgnoreDirectories(): void {
$files = $this->fileSystem->scanDirectory('core/modules/system/tests/fixtures/IgnoreDirectories', '/\.txt$/');
$this->assertCount(2, $files, '2 text files found when not ignoring directories.');
diff --git a/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php b/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php
index 9468ba7f30d..59e95b7dde6 100644
--- a/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php
@@ -54,7 +54,7 @@ class StreamWrapperTest extends FileTestBase {
/**
* Tests the getClassName() function.
*/
- public function testGetClassName() {
+ public function testGetClassName(): void {
// Check the dummy scheme.
$this->assertEquals($this->classname, \Drupal::service('stream_wrapper_manager')->getClass($this->scheme), 'Got correct class name for dummy scheme.');
// Check core's scheme.
@@ -64,7 +64,7 @@ class StreamWrapperTest extends FileTestBase {
/**
* Tests the getViaScheme() method.
*/
- public function testGetInstanceByScheme() {
+ public function testGetInstanceByScheme(): void {
$instance = \Drupal::service('stream_wrapper_manager')->getViaScheme($this->scheme);
$this->assertEquals($this->classname, get_class($instance), 'Got correct class type for dummy scheme.');
@@ -75,7 +75,7 @@ class StreamWrapperTest extends FileTestBase {
/**
* Tests the getViaUri() and getViaScheme() methods and target functions.
*/
- public function testUriFunctions() {
+ public function testUriFunctions(): void {
$config = $this->config('system.file');
/** @var \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager */
@@ -113,7 +113,7 @@ class StreamWrapperTest extends FileTestBase {
/**
* Tests some file handle functions.
*/
- public function testFileFunctions() {
+ public function testFileFunctions(): void {
$filename = 'public://' . $this->randomMachineName();
file_put_contents($filename, str_repeat('d', 1000));
@@ -145,7 +145,7 @@ class StreamWrapperTest extends FileTestBase {
/**
* Tests the scheme functions.
*/
- public function testGetValidStreamScheme() {
+ public function testGetValidStreamScheme(): void {
/** @var \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager */
$stream_wrapper_manager = \Drupal::service('stream_wrapper_manager');
diff --git a/core/tests/Drupal/KernelTests/Core/File/UrlTransformRelativeTest.php b/core/tests/Drupal/KernelTests/Core/File/UrlTransformRelativeTest.php
index 14b1a74d73b..063917d5b59 100644
--- a/core/tests/Drupal/KernelTests/Core/File/UrlTransformRelativeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/File/UrlTransformRelativeTest.php
@@ -23,7 +23,7 @@ class UrlTransformRelativeTest extends KernelTestBase {
*
* @dataProvider providerFileUrlTransformRelative
*/
- public function testFileUrlTransformRelative($host, $port, $https, $base_path, $root_relative, $url, $expected) {
+ public function testFileUrlTransformRelative($host, $port, $https, $base_path, $root_relative, $url, $expected): void {
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
$_SERVER['SERVER_ADDR'] = '127.0.0.1';
diff --git a/core/tests/Drupal/KernelTests/Core/Form/ExternalFormUrlTest.php b/core/tests/Drupal/KernelTests/Core/Form/ExternalFormUrlTest.php
index 930f0d7f869..5a193154a84 100644
--- a/core/tests/Drupal/KernelTests/Core/Form/ExternalFormUrlTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Form/ExternalFormUrlTest.php
@@ -70,7 +70,7 @@ class ExternalFormUrlTest extends KernelTestBase implements FormInterface {
/**
* Tests form behavior.
*/
- public function testActionUrlBehavior() {
+ public function testActionUrlBehavior(): void {
// Create a new request which has a request uri with multiple leading
// slashes and make it the master request.
$request_stack = \Drupal::service('request_stack');
diff --git a/core/tests/Drupal/KernelTests/Core/Form/FormActionXssTest.php b/core/tests/Drupal/KernelTests/Core/Form/FormActionXssTest.php
index 2ff12479f5b..8fb9a3659aa 100644
--- a/core/tests/Drupal/KernelTests/Core/Form/FormActionXssTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Form/FormActionXssTest.php
@@ -72,7 +72,7 @@ class FormActionXssTest extends KernelTestBase implements FormInterface {
/**
* Tests form action attribute for XSS.
*/
- public function testFormActionXss() {
+ public function testFormActionXss(): void {
// Create a new request with a uri which attempts XSS.
$request_stack = \Drupal::service('request_stack');
/** @var \Symfony\Component\HttpFoundation\RequestStack $original_request */
diff --git a/core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php b/core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php
index b8f265166bf..5c8e576471e 100644
--- a/core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php
@@ -59,7 +59,7 @@ class FormCacheTest extends KernelTestBase {
/**
* Tests the form cache with a logged-in user.
*/
- public function testCacheToken() {
+ public function testCacheToken(): void {
\Drupal::currentUser()->setAccount(new UserSession(['uid' => 1]));
\Drupal::formBuilder()->setCache($this->formBuildId, $this->form, $this->formState);
@@ -90,7 +90,7 @@ class FormCacheTest extends KernelTestBase {
/**
* Tests the form cache without a logged-in user.
*/
- public function testNoCacheToken() {
+ public function testNoCacheToken(): void {
// Switch to an anonymous user account.
$account_switcher = \Drupal::service('account_switcher');
$account_switcher->switchTo(new AnonymousUserSession());
@@ -111,7 +111,7 @@ class FormCacheTest extends KernelTestBase {
/**
* Tests the form cache with an overridden cache expiration.
*/
- public function testCacheCustomExpiration() {
+ public function testCacheCustomExpiration(): void {
// Override form cache expiration so that the cached form expired yesterday.
new Settings(['form_cache_expiration' => -1 * (24 * 60 * 60), 'hash_salt' => $this->randomMachineName()]);
\Drupal::formBuilder()->setCache($this->formBuildId, $this->form, $this->formState);
diff --git a/core/tests/Drupal/KernelTests/Core/Form/FormDefaultHandlersTest.php b/core/tests/Drupal/KernelTests/Core/Form/FormDefaultHandlersTest.php
index 0e53bcc7106..b092803e22e 100644
--- a/core/tests/Drupal/KernelTests/Core/Form/FormDefaultHandlersTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Form/FormDefaultHandlersTest.php
@@ -72,7 +72,7 @@ class FormDefaultHandlersTest extends KernelTestBase implements FormInterface {
/**
* Tests that default handlers are added even if custom are specified.
*/
- public function testDefaultAndCustomHandlers() {
+ public function testDefaultAndCustomHandlers(): void {
$form_state = new FormState();
$form_builder = $this->container->get('form_builder');
$form_builder->submitForm($this, $form_state);
diff --git a/core/tests/Drupal/KernelTests/Core/Form/FormValidationMessageOrderTest.php b/core/tests/Drupal/KernelTests/Core/Form/FormValidationMessageOrderTest.php
index 7476643b913..c9b3a582d06 100644
--- a/core/tests/Drupal/KernelTests/Core/Form/FormValidationMessageOrderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Form/FormValidationMessageOrderTest.php
@@ -77,7 +77,7 @@ class FormValidationMessageOrderTest extends KernelTestBase implements FormInter
/**
* Tests that fields validation messages are sorted in the fields order.
*/
- public function testValidationErrorMessagesSortedWithWeight() {
+ public function testValidationErrorMessagesSortedWithWeight(): void {
$form_state = new FormState();
$form_builder = $this->container->get('form_builder');
$form_builder->submitForm($this, $form_state);
diff --git a/core/tests/Drupal/KernelTests/Core/Form/TriggeringElementProgrammedTest.php b/core/tests/Drupal/KernelTests/Core/Form/TriggeringElementProgrammedTest.php
index f6a2a87af14..dd145c87804 100644
--- a/core/tests/Drupal/KernelTests/Core/Form/TriggeringElementProgrammedTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Form/TriggeringElementProgrammedTest.php
@@ -68,7 +68,7 @@ class TriggeringElementProgrammedTest extends KernelTestBase implements FormInte
/**
* Tests that #limit_validation_errors of the only submit button takes effect.
*/
- public function testLimitValidationErrors() {
+ public function testLimitValidationErrors(): void {
// Programmatically submit the form.
$form_state = new FormState();
$form_state->setValue('section', 'one');
diff --git a/core/tests/Drupal/KernelTests/Core/Http/LinkRelationsTest.php b/core/tests/Drupal/KernelTests/Core/Http/LinkRelationsTest.php
index 0f70b66aadd..a8401e7a8c4 100644
--- a/core/tests/Drupal/KernelTests/Core/Http/LinkRelationsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Http/LinkRelationsTest.php
@@ -17,7 +17,7 @@ class LinkRelationsTest extends KernelTestBase {
/**
* Tests correct Link Relations are returned from the Link Relation Type Manager.
*/
- public function testAvailableLinkRelationships() {
+ public function testAvailableLinkRelationships(): void {
/** @var \Drupal\Core\Http\LinkRelationTypeManager $link_relation_type_manager */
$link_relation_type_manager = $this->container->get('plugin.manager.link_relation_type');
diff --git a/core/tests/Drupal/KernelTests/Core/HttpKernel/StackKernelIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/HttpKernel/StackKernelIntegrationTest.php
index 52a2ac9eb5d..94489e21cdf 100644
--- a/core/tests/Drupal/KernelTests/Core/HttpKernel/StackKernelIntegrationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/HttpKernel/StackKernelIntegrationTest.php
@@ -26,7 +26,7 @@ class StackKernelIntegrationTest extends KernelTestBase {
/**
* Tests a request.
*/
- public function testRequest() {
+ public function testRequest(): void {
$request = Request::create((new Url('http_kernel_test.empty'))->toString());
/** @var \Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel */
$http_kernel = \Drupal::service('http_kernel');
@@ -39,7 +39,7 @@ class StackKernelIntegrationTest extends KernelTestBase {
/**
* Tests that late middlewares are automatically flagged lazy.
*/
- public function testLazyLateMiddlewares() {
+ public function testLazyLateMiddlewares(): void {
$this->assertFalse($this->container->getDefinition('http_middleware.reverse_proxy')->isLazy(), 'lazy flag on http_middleware.reverse_proxy definition is not set');
$this->assertFalse($this->container->getDefinition('http_middleware.kernel_pre_handle')->isLazy(), 'lazy flag on http_middleware.kernel_pre_handle definition is not set');
$this->assertFalse($this->container->getDefinition('http_middleware.session')->isLazy(), 'lazy flag on http_middleware.session definition is not set');
diff --git a/core/tests/Drupal/KernelTests/Core/Image/ToolkitTest.php b/core/tests/Drupal/KernelTests/Core/Image/ToolkitTest.php
index d46a5665c23..3e417576d6d 100644
--- a/core/tests/Drupal/KernelTests/Core/Image/ToolkitTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Image/ToolkitTest.php
@@ -53,7 +53,7 @@ class ToolkitTest extends KernelTestBase {
/**
* Tests that the toolkit manager only returns available toolkits.
*/
- public function testGetAvailableToolkits() {
+ public function testGetAvailableToolkits(): void {
$manager = $this->container->get('image.toolkit.manager');
$toolkits = $manager->getAvailableToolkits();
@@ -66,7 +66,7 @@ class ToolkitTest extends KernelTestBase {
/**
* Tests Image's methods.
*/
- public function testLoad() {
+ public function testLoad(): void {
$image = $this->getImage();
$this->assertInstanceOf(ImageInterface::class, $image);
$this->assertEquals('test', $image->getToolkitId());
@@ -76,7 +76,7 @@ class ToolkitTest extends KernelTestBase {
/**
* Tests the Image::save() function.
*/
- public function testSave() {
+ public function testSave(): void {
$this->assertFalse($this->image->save());
$this->assertToolkitOperationsCalled(['save']);
}
@@ -84,7 +84,7 @@ class ToolkitTest extends KernelTestBase {
/**
* Tests the 'apply' method.
*/
- public function testApply() {
+ public function testApply(): void {
$data = ['p1' => 1, 'p2' => TRUE, 'p3' => 'text'];
// The operation plugin itself does not exist, so apply will return false.
@@ -102,7 +102,7 @@ class ToolkitTest extends KernelTestBase {
/**
* Tests the 'apply' method without parameters.
*/
- public function testApplyNoParameters() {
+ public function testApplyNoParameters(): void {
// The operation plugin itself does not exist, so apply will return false.
$this->assertFalse($this->image->apply('my_operation'));
@@ -116,7 +116,7 @@ class ToolkitTest extends KernelTestBase {
/**
* Tests image toolkit operations inheritance by derivative toolkits.
*/
- public function testDerivative() {
+ public function testDerivative(): void {
$toolkit_manager = $this->container->get('image.toolkit.manager');
$operation_manager = $this->container->get('image.toolkit.operation.manager');
diff --git a/core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php b/core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php
index 6393c754b86..abe6af08571 100644
--- a/core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php
@@ -18,7 +18,7 @@ class InstallerLanguageTest extends KernelTestBase {
/**
* Tests that the installer can find translation files.
*/
- public function testInstallerTranslationFiles() {
+ public function testInstallerTranslationFiles(): void {
// Different translation files would be found depending on which language
// we are looking for.
$expected_translation_files = [
@@ -44,7 +44,7 @@ class InstallerLanguageTest extends KernelTestBase {
/**
* Tests profile info caching in non-English languages.
*/
- public function testInstallerTranslationCache() {
+ public function testInstallerTranslationCache(): void {
require_once 'core/includes/install.inc';
// Prime the \Drupal\Core\Extension\ExtensionList::getPathname() static
diff --git a/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php b/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php
index a5bcb00f05f..2f71293003a 100644
--- a/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php
@@ -69,7 +69,7 @@ class InstallerRedirectTraitTest extends KernelTestBase {
* @covers ::shouldRedirectToInstaller
* @dataProvider providerShouldRedirectToInstaller
*/
- public function testShouldRedirectToInstaller($expected, $exception, $connection, $connection_info, $sequences_table_exists = TRUE) {
+ public function testShouldRedirectToInstaller($expected, $exception, $connection, $connection_info, $sequences_table_exists = TRUE): void {
try {
throw new $exception();
}
diff --git a/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php
index 28752925be3..529dd3f0ce7 100644
--- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php
@@ -42,7 +42,7 @@ class DatabaseStorageExpirableTest extends StorageTestBase {
/**
* Tests CRUD functionality with expiration.
*/
- public function testCRUDWithExpiration() {
+ public function testCRUDWithExpiration(): void {
$stores = $this->createStorage();
// Verify that an item can be stored with setWithExpire().
@@ -121,7 +121,7 @@ class DatabaseStorageExpirableTest extends StorageTestBase {
/**
* Tests data expiration.
*/
- public function testExpiration() {
+ public function testExpiration(): void {
$stores = $this->createStorage();
$day = 604800;
diff --git a/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php
index 06b8fdd8e27..c187deed612 100644
--- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php
@@ -37,7 +37,7 @@ class DatabaseStorageTest extends StorageTestBase {
/**
* Tests asynchronous table creation.
*/
- public function testConcurrent() {
+ public function testConcurrent(): void {
$this->markTestSkipped("Skipped due to frequent random test failures. See https://www.drupal.org/project/drupal/issues/3398063");
if (!function_exists('pcntl_fork')) {
$this->markTestSkipped('Requires the pcntl_fork() function');
diff --git a/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php
index cc91e7e8d16..8da527a58f7 100644
--- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php
@@ -26,7 +26,7 @@ class GarbageCollectionTest extends KernelTestBase {
/**
* Tests garbage collection.
*/
- public function testGarbageCollection() {
+ public function testGarbageCollection(): void {
$collection = $this->randomMachineName();
$connection = Database::getConnection();
$store = new DatabaseStorageExpirable($collection, new PhpSerialize(), $connection, \Drupal::time());
diff --git a/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php
index 3edc1d2fc97..1ca7fcbd2de 100644
--- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php
@@ -36,7 +36,7 @@ class KeyValueContentEntityStorageTest extends KernelTestBase {
*
* @covers \Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage::hasData
*/
- public function testCRUD() {
+ public function testCRUD(): void {
$default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId();
$storage = \Drupal::entityTypeManager()->getStorage('entity_test_label');
@@ -170,7 +170,7 @@ class KeyValueContentEntityStorageTest extends KernelTestBase {
/**
* Tests uninstallation of a module that does not use the SQL entity storage.
*/
- public function testUninstall() {
+ public function testUninstall(): void {
$uninstall_validator_reasons = \Drupal::service('content_uninstall_validator')->validate('keyvalue_test');
$this->assertEmpty($uninstall_validator_reasons);
}
diff --git a/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php
index c2c56ad2eb3..3f2d0ff2d85 100644
--- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php
@@ -50,7 +50,7 @@ abstract class StorageTestBase extends KernelTestBase {
/**
* Tests CRUD operations.
*/
- public function testCRUD() {
+ public function testCRUD(): void {
$stores = $this->createStorage();
// Verify that each store returns its own collection name.
$this->assertSame($this->collections[0], $stores[0]->getCollectionName());
@@ -129,7 +129,7 @@ abstract class StorageTestBase extends KernelTestBase {
/**
* Tests expected behavior for non-existing keys.
*/
- public function testNonExistingKeys() {
+ public function testNonExistingKeys(): void {
$stores = $this->createStorage();
@@ -157,7 +157,7 @@ abstract class StorageTestBase extends KernelTestBase {
/**
* Tests the setIfNotExists() method.
*/
- public function testSetIfNotExists() {
+ public function testSetIfNotExists(): void {
$stores = $this->createStorage();
$key = $this->randomMachineName();
@@ -183,7 +183,7 @@ abstract class StorageTestBase extends KernelTestBase {
/**
* Tests the rename operation.
*/
- public function testRename() {
+ public function testRename(): void {
$stores = $this->createStorage();
$store = $stores[0];
@@ -197,7 +197,7 @@ abstract class StorageTestBase extends KernelTestBase {
/**
* Tests the rename operation.
*/
- public function testRenameNoChange() {
+ public function testRenameNoChange(): void {
$stores = $this->createStorage();
$store = $stores[0];
diff --git a/core/tests/Drupal/KernelTests/Core/Layout/IconBuilderTest.php b/core/tests/Drupal/KernelTests/Core/Layout/IconBuilderTest.php
index aa3da7215de..b76ca4df3c3 100644
--- a/core/tests/Drupal/KernelTests/Core/Layout/IconBuilderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Layout/IconBuilderTest.php
@@ -23,7 +23,7 @@ class IconBuilderTest extends KernelTestBase {
*
* @dataProvider providerTestBuild
*/
- public function testBuild(SvgIconBuilder $icon_builder, $icon_map, $expected) {
+ public function testBuild(SvgIconBuilder $icon_builder, $icon_map, $expected): void {
$renderer = $this->container->get('renderer');
$build = $icon_builder->build($icon_map);
diff --git a/core/tests/Drupal/KernelTests/Core/Lock/LockTest.php b/core/tests/Drupal/KernelTests/Core/Lock/LockTest.php
index 54232d02c58..7de324526b2 100644
--- a/core/tests/Drupal/KernelTests/Core/Lock/LockTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Lock/LockTest.php
@@ -32,7 +32,7 @@ class LockTest extends KernelTestBase {
/**
* Tests backend release functionality.
*/
- public function testBackendLockRelease() {
+ public function testBackendLockRelease(): void {
$success = $this->lock->acquire('lock_a');
$this->assertTrue($success, 'Could acquire first lock.');
@@ -72,7 +72,7 @@ class LockTest extends KernelTestBase {
/**
* Tests backend release functionality.
*/
- public function testBackendLockReleaseAll() {
+ public function testBackendLockReleaseAll(): void {
$success = $this->lock->acquire('lock_a');
$this->assertTrue($success, 'Could acquire first lock.');
diff --git a/core/tests/Drupal/KernelTests/Core/Menu/LocalActionManagerTest.php b/core/tests/Drupal/KernelTests/Core/Menu/LocalActionManagerTest.php
index e70b4dd0d56..3a509a61215 100644
--- a/core/tests/Drupal/KernelTests/Core/Menu/LocalActionManagerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Menu/LocalActionManagerTest.php
@@ -22,7 +22,7 @@ class LocalActionManagerTest extends KernelTestBase {
/**
* Tests the cacheability of local actions.
*/
- public function testCacheability() {
+ public function testCacheability(): void {
/** @var \Drupal\Core\Menu\LocalActionManager $local_action_manager */
$local_action_manager = \Drupal::service('plugin.manager.menu.local_action');
$build = [
diff --git a/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkDefaultIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkDefaultIntegrationTest.php
index c5837f792e2..7c4f5f83b08 100644
--- a/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkDefaultIntegrationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkDefaultIntegrationTest.php
@@ -26,7 +26,7 @@ class MenuLinkDefaultIntegrationTest extends KernelTestBase {
/**
* Tests moving a static menu link without a specified menu to the root.
*/
- public function testMoveToRoot() {
+ public function testMoveToRoot(): void {
/** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */
$menu_link_manager = \Drupal::service('plugin.manager.menu.link');
$menu_link_manager->rebuild();
diff --git a/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php
index 1f790e6a067..809f90c99fd 100644
--- a/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php
@@ -64,7 +64,7 @@ class MenuLinkTreeTest extends KernelTestBase {
/**
* Tests deleting all the links in a menu.
*/
- public function testDeleteLinksInMenu() {
+ public function testDeleteLinksInMenu(): void {
/** @var \Drupal\system\MenuStorage $storage */
$storage = \Drupal::entityTypeManager()->getStorage('menu');
$storage->create(['id' => 'menu1', 'label' => 'Menu 1'])->save();
@@ -91,7 +91,7 @@ class MenuLinkTreeTest extends KernelTestBase {
/**
* Tests creating links with an expected tree structure.
*/
- public function testCreateLinksInMenu() {
+ public function testCreateLinksInMenu(): void {
// This creates a tree with the following structure:
// - 1
// - 2
@@ -141,7 +141,7 @@ class MenuLinkTreeTest extends KernelTestBase {
/**
* Tests user/login and user/logout links.
*/
- public function testUserLoginAndUserLogoutLinks() {
+ public function testUserLoginAndUserLogoutLinks(): void {
$account_switcher = $this->container->get('account_switcher');
$login_menu_link = MenuLinkMock::create(['id' => 'user_login_example', 'route_name' => 'user.login']);
diff --git a/core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php b/core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
index 558c61e8c1c..eceb9c16fc6 100644
--- a/core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
@@ -47,7 +47,7 @@ class MenuTreeStorageTest extends KernelTestBase {
/**
* Tests the tree storage when no tree was built yet.
*/
- public function testBasicMethods() {
+ public function testBasicMethods(): void {
$this->doTestEmptyStorage();
$this->doTestTable();
}
@@ -74,7 +74,7 @@ class MenuTreeStorageTest extends KernelTestBase {
/**
* Tests with a simple linear hierarchy.
*/
- public function testSimpleHierarchy() {
+ public function testSimpleHierarchy(): void {
// Add some links with parent on the previous one and test some values.
// <tools>
// - test1
@@ -96,7 +96,7 @@ class MenuTreeStorageTest extends KernelTestBase {
/**
* Tests the tree with moving links inside the hierarchy.
*/
- public function testMenuLinkMoving() {
+ public function testMenuLinkMoving(): void {
// Before the move.
// <tools>
// - test1
@@ -174,7 +174,7 @@ class MenuTreeStorageTest extends KernelTestBase {
/**
* Tests with disabled child links.
*/
- public function testMenuDisabledChildLinks() {
+ public function testMenuDisabledChildLinks(): void {
// Add some links with parent on the previous one and test some values.
// <tools>
// - test1
@@ -229,7 +229,7 @@ class MenuTreeStorageTest extends KernelTestBase {
/**
* Tests the loadTreeData method.
*/
- public function testLoadTree() {
+ public function testLoadTree(): void {
$this->addMenuLink('test1', '', 'test1');
$this->addMenuLink('test2', 'test1', 'test2');
$this->addMenuLink('test3', 'test2', 'test3');
@@ -299,7 +299,7 @@ class MenuTreeStorageTest extends KernelTestBase {
/**
* Tests finding the subtree height with content menu links.
*/
- public function testSubtreeHeight() {
+ public function testSubtreeHeight(): void {
// root
// - child1
// -- child2
@@ -321,7 +321,7 @@ class MenuTreeStorageTest extends KernelTestBase {
/**
* Ensure hierarchy persists after a menu rebuild.
*/
- public function testMenuRebuild() {
+ public function testMenuRebuild(): void {
// root
// - child1
// -- child2
@@ -352,7 +352,7 @@ class MenuTreeStorageTest extends KernelTestBase {
/**
* Tests MenuTreeStorage::loadByProperties().
*/
- public function testLoadByProperties() {
+ public function testLoadByProperties(): void {
$tests = [
['foo' => 'bar'],
[0 => 'wrong'],
diff --git a/core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php b/core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php
index 674217db6e5..73e95136cb1 100644
--- a/core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php
@@ -35,7 +35,7 @@ class MessengerTest extends KernelTestBase {
* @covers ::deleteByType
* @covers ::messagesByType
*/
- public function testRemoveSingleMessage() {
+ public function testRemoveSingleMessage(): void {
// Set two messages.
$this->messenger->addStatus('First message (removed).');
@@ -65,7 +65,7 @@ class MessengerTest extends KernelTestBase {
* @covers ::deleteByType
* @covers ::deleteAll
*/
- public function testAddNoDuplicates() {
+ public function testAddNoDuplicates(): void {
$this->messenger->addStatus('Non Duplicated status message');
$this->messenger->addStatus('Non Duplicated status message');
@@ -106,7 +106,7 @@ class MessengerTest extends KernelTestBase {
* @covers ::addError
* @covers ::deleteByType
*/
- public function testAddWithDuplicates() {
+ public function testAddWithDuplicates(): void {
$this->messenger->addStatus('Duplicated status message', TRUE);
$this->messenger->addStatus('Duplicated status message', TRUE);
@@ -132,7 +132,7 @@ class MessengerTest extends KernelTestBase {
* @covers ::deleteByType
* @covers ::messagesByType
*/
- public function testAddMarkup() {
+ public function testAddMarkup(): void {
// Add a Markup message.
$this->messenger->addStatus(Markup::create('Markup with <em>markup!</em>'));
diff --git a/core/tests/Drupal/KernelTests/Core/Pager/PagerManagerTest.php b/core/tests/Drupal/KernelTests/Core/Pager/PagerManagerTest.php
index b79200a68cc..7fa906db6cf 100644
--- a/core/tests/Drupal/KernelTests/Core/Pager/PagerManagerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Pager/PagerManagerTest.php
@@ -19,7 +19,7 @@ class PagerManagerTest extends KernelTestBase {
/**
* @covers ::getUpdatedParameters
*/
- public function testGetUpdatedParameters() {
+ public function testGetUpdatedParameters(): void {
$element = 2;
$index = 5;
$test_parameters = [
@@ -46,7 +46,7 @@ class PagerManagerTest extends KernelTestBase {
/**
* @covers ::findPage
*/
- public function testFindPage() {
+ public function testFindPage(): void {
$request = Request::create('http://example.com', 'GET', ['page' => '0,10']);
$request->setSession(new Session(new MockArraySessionStorage()));
diff --git a/core/tests/Drupal/KernelTests/Core/Pager/RequestPagerTest.php b/core/tests/Drupal/KernelTests/Core/Pager/RequestPagerTest.php
index 9e4b22d972c..89c2f0f09fd 100644
--- a/core/tests/Drupal/KernelTests/Core/Pager/RequestPagerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Pager/RequestPagerTest.php
@@ -19,7 +19,7 @@ class RequestPagerTest extends KernelTestBase {
/**
* @covers ::findPage
*/
- public function testFindPage() {
+ public function testFindPage(): void {
$request = Request::create('http://example.com', 'GET', ['page' => '0,10']);
$request->setSession(new Session(new MockArraySessionStorage()));
@@ -35,7 +35,7 @@ class RequestPagerTest extends KernelTestBase {
/**
* @covers ::getQueryParameters
*/
- public function testGetQueryParameters() {
+ public function testGetQueryParameters(): void {
$test_parameters = [
'other' => 'arbitrary',
];
diff --git a/core/tests/Drupal/KernelTests/Core/ParamConverter/EntityConverterLatestRevisionTest.php b/core/tests/Drupal/KernelTests/Core/ParamConverter/EntityConverterLatestRevisionTest.php
index 31ca6dd011c..19178bf7849 100644
--- a/core/tests/Drupal/KernelTests/Core/ParamConverter/EntityConverterLatestRevisionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/ParamConverter/EntityConverterLatestRevisionTest.php
@@ -59,7 +59,7 @@ class EntityConverterLatestRevisionTest extends KernelTestBase {
/**
* Tests with no matching entity.
*/
- public function testNoEntity() {
+ public function testNoEntity(): void {
$converted = $this->converter->convert(1, [
'load_latest_revision' => TRUE,
'type' => 'entity:entity_test_mulrev',
@@ -70,7 +70,7 @@ class EntityConverterLatestRevisionTest extends KernelTestBase {
/**
* Tests with no pending revision.
*/
- public function testEntityNoPendingRevision() {
+ public function testEntityNoPendingRevision(): void {
$entity = EntityTestMulRev::create();
$entity->save();
@@ -84,7 +84,7 @@ class EntityConverterLatestRevisionTest extends KernelTestBase {
/**
* Tests with a pending revision.
*/
- public function testEntityWithPendingRevision() {
+ public function testEntityWithPendingRevision(): void {
$entity = EntityTestMulRev::create();
$entity->save();
@@ -103,7 +103,7 @@ class EntityConverterLatestRevisionTest extends KernelTestBase {
/**
* Tests with a translated pending revision.
*/
- public function testWithTranslatedPendingRevision() {
+ public function testWithTranslatedPendingRevision(): void {
// Enable translation for test entities.
$this->container->get('state')->set('entity_test.translation', TRUE);
$this->container->get('entity_type.bundle.info')->clearCachedBundles();
@@ -151,7 +151,7 @@ class EntityConverterLatestRevisionTest extends KernelTestBase {
/**
* Tests that pending revisions are loaded only when needed.
*/
- public function testOptimizedConvert() {
+ public function testOptimizedConvert(): void {
$entity = EntityTestMulRev::create();
$entity->save();
@@ -179,7 +179,7 @@ class EntityConverterLatestRevisionTest extends KernelTestBase {
/**
* Tests the latest revision flag and non-revisionable entities.
*/
- public function testConvertNonRevisionableEntityType() {
+ public function testConvertNonRevisionableEntityType(): void {
$entity = EntityTest::create();
$entity->save();
diff --git a/core/tests/Drupal/KernelTests/Core/Path/PathValidatorTest.php b/core/tests/Drupal/KernelTests/Core/Path/PathValidatorTest.php
index d909e7631a9..2ec71d9dd10 100644
--- a/core/tests/Drupal/KernelTests/Core/Path/PathValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Path/PathValidatorTest.php
@@ -35,7 +35,7 @@ class PathValidatorTest extends KernelTestBase {
$this->installEntitySchema('entity_test');
}
- public function testGetUrlIfValidWithoutAccessCheck() {
+ public function testGetUrlIfValidWithoutAccessCheck(): void {
$requestContext = \Drupal::service('router.request_context');
$pathValidator = \Drupal::service('path.validator');
diff --git a/core/tests/Drupal/KernelTests/Core/Path/UrlAlterTest.php b/core/tests/Drupal/KernelTests/Core/Path/UrlAlterTest.php
index a85d0d7693c..4f36dd3f41a 100644
--- a/core/tests/Drupal/KernelTests/Core/Path/UrlAlterTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Path/UrlAlterTest.php
@@ -21,7 +21,7 @@ class UrlAlterTest extends KernelTestBase {
*/
protected static $modules = ['path', 'url_alter_test', 'user'];
- public function testUrlWithQueryString() {
+ public function testUrlWithQueryString(): void {
// Test outbound query string altering.
$url = Url::fromRoute('user.login');
$this->assertEquals(\Drupal::request()->getBaseUrl() . '/user/login?foo=bar', $url->toString());
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/Annotation/ContextDefinitionTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Annotation/ContextDefinitionTest.php
index 5872ea06b77..6bb2c6172de 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/Annotation/ContextDefinitionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Annotation/ContextDefinitionTest.php
@@ -21,7 +21,7 @@ class ContextDefinitionTest extends KernelTestBase {
/**
* Tests adding constraints via annotations.
*/
- public function testConstraints() {
+ public function testConstraints(): void {
$definition = $this->container->get('plugin.manager.block')->getDefinition('test_context_aware');
$this->assertArrayHasKey('context_definitions', $definition);
$this->assertArrayHasKey('user', $definition['context_definitions']);
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/ConditionTestDualUserTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/ConditionTestDualUserTest.php
index 998e9fef3f6..239e76243a9 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/ConditionTestDualUserTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/ConditionTestDualUserTest.php
@@ -49,7 +49,7 @@ class ConditionTestDualUserTest extends KernelTestBase {
/**
* Tests the dual user condition.
*/
- public function testConditions() {
+ public function testConditions(): void {
$this->doTestIdenticalUser();
$this->doTestDifferentUser();
}
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/CurrentThemeConditionTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/CurrentThemeConditionTest.php
index 8b90107f6bd..f9d40c6c14f 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/CurrentThemeConditionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/CurrentThemeConditionTest.php
@@ -22,7 +22,7 @@ class CurrentThemeConditionTest extends KernelTestBase {
/**
* Tests the current theme condition.
*/
- public function testCurrentTheme() {
+ public function testCurrentTheme(): void {
\Drupal::service('theme_installer')->install(['test_theme']);
$manager = \Drupal::service('plugin.manager.condition');
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/OptionalContextConditionTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/OptionalContextConditionTest.php
index 59e64844afb..0fc70903827 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/OptionalContextConditionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/OptionalContextConditionTest.php
@@ -26,7 +26,7 @@ class OptionalContextConditionTest extends KernelTestBase {
/**
* Tests with both contexts mapped to the same user.
*/
- public function testContextMissing() {
+ public function testContextMissing(): void {
/** @var \Drupal\Core\Condition\ConditionPluginBase $condition */
$condition = \Drupal::service('plugin.manager.condition')
->createInstance('condition_test_optional_context')
@@ -40,7 +40,7 @@ class OptionalContextConditionTest extends KernelTestBase {
/**
* Tests with both contexts mapped to the same user.
*/
- public function testContextNoValue() {
+ public function testContextNoValue(): void {
/** @var \Drupal\Core\Condition\ConditionPluginBase $condition */
$condition = \Drupal::service('plugin.manager.condition')
->createInstance('condition_test_optional_context')
@@ -56,7 +56,7 @@ class OptionalContextConditionTest extends KernelTestBase {
/**
* Tests with both contexts mapped to the same user.
*/
- public function testContextAvailable() {
+ public function testContextAvailable(): void {
NodeType::create(['type' => 'example', 'name' => 'Example'])->save();
/** @var \Drupal\Core\Condition\ConditionPluginBase $condition */
$condition = \Drupal::service('plugin.manager.condition')
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/RequestPathTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/RequestPathTest.php
index a837a6b09c2..bfc73c4de0e 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/RequestPathTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/RequestPathTest.php
@@ -79,7 +79,7 @@ class RequestPathTest extends KernelTestBase {
/**
* Tests the request path condition.
*/
- public function testConditions() {
+ public function testConditions(): void {
// Get the request path condition and test and configure it to check against
// different patterns and requests.
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/ResponseStatusTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/ResponseStatusTest.php
index faec6e8c45f..6617de54650 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/ResponseStatusTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/ResponseStatusTest.php
@@ -55,7 +55,7 @@ class ResponseStatusTest extends KernelTestBase {
*
* @dataProvider providerTestConditions
*/
- public function testConditions(array $status_codes, bool $negate, int $response_code, bool $expected_execute) {
+ public function testConditions(array $status_codes, bool $negate, int $response_code, bool $expected_execute): void {
if ($response_code === Response::HTTP_OK) {
$request = Request::create('/my/valid/page');
}
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php
index a64cb87119b..1bf868c8bf2 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginTraitTest.php
@@ -55,14 +55,14 @@ class ContextAwarePluginTraitTest extends KernelTestBase {
/**
* @covers ::getContextDefinitions
*/
- public function testGetContextDefinitions() {
+ public function testGetContextDefinitions(): void {
$this->assertIsArray($this->plugin->getContextDefinitions());
}
/**
* @covers ::getContextDefinition
*/
- public function testGetContextDefinition() {
+ public function testGetContextDefinition(): void {
// The context is not defined, so an exception will be thrown.
$this->expectException(ContextException::class);
$this->expectExceptionMessage('The person context is not a valid context.');
@@ -72,7 +72,7 @@ class ContextAwarePluginTraitTest extends KernelTestBase {
/**
* @covers ::getContextValue
*/
- public function testGetContextValue() {
+ public function testGetContextValue(): void {
$this->plugin->setContextValue('nato_letter', 'Alpha');
$this->assertSame('Alpha', $this->plugin->getContextValue('nato_letter'));
}
@@ -80,7 +80,7 @@ class ContextAwarePluginTraitTest extends KernelTestBase {
/**
* @covers ::setContextValue
*/
- public function testSetContextValue() {
+ public function testSetContextValue(): void {
$typed_data_manager = $this->prophesize(TypedDataManagerInterface::class);
$container = new ContainerBuilder();
$container->set('typed_data_manager', $typed_data_manager->reveal());
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/ContextDefinitionTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/ContextDefinitionTest.php
index 41f5346af5d..436c9fd70a7 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/ContextDefinitionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/ContextDefinitionTest.php
@@ -25,7 +25,7 @@ class ContextDefinitionTest extends KernelTestBase {
/**
* @covers ::isSatisfiedBy
*/
- public function testIsSatisfiedBy() {
+ public function testIsSatisfiedBy(): void {
$this->installEntitySchema('user');
$value = EntityTest::create([]);
@@ -51,7 +51,7 @@ class ContextDefinitionTest extends KernelTestBase {
/**
* @covers ::__construct
*/
- public function testEntityContextDefinitionAssert() {
+ public function testEntityContextDefinitionAssert(): void {
$this->expectException(\AssertionError::class);
$this->expectExceptionMessage('assert(!str_starts_with($data_type, \'entity:\') || $this instanceof EntityContextDefinition)');
new ContextDefinition('entity:entity_test');
@@ -60,7 +60,7 @@ class ContextDefinitionTest extends KernelTestBase {
/**
* @covers ::create
*/
- public function testCreateWithEntityDataType() {
+ public function testCreateWithEntityDataType(): void {
$this->assertInstanceOf(EntityContextDefinition::class, ContextDefinition::create('entity:user'));
}
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/ContextHandlerTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/ContextHandlerTest.php
index 0259ca15c9b..2340cbec9ad 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/ContextHandlerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/ContextHandlerTest.php
@@ -31,7 +31,7 @@ class ContextHandlerTest extends KernelTestBase {
/**
* @covers ::applyContextMapping
*/
- public function testApplyContextMapping() {
+ public function testApplyContextMapping(): void {
$entity = EntityTest::create([]);
$context_definition = EntityContextDefinition::fromEntity($entity);
$context = EntityContext::fromEntity($entity);
@@ -49,7 +49,7 @@ class ContextHandlerTest extends KernelTestBase {
/**
* @covers ::applyContextMapping
*/
- public function testApplyContextMappingAlreadyApplied() {
+ public function testApplyContextMappingAlreadyApplied(): void {
$entity = EntityTest::create([]);
$context_definition = EntityContextDefinition::fromEntity($entity);
$context = EntityContext::fromEntity($entity);
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php
index 2c5bb1c4ac5..d47d0aedffe 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php
@@ -31,7 +31,7 @@ class ContextPluginTest extends KernelTestBase {
/**
* Tests basic context definition and value getters and setters.
*/
- public function testContext() {
+ public function testContext(): void {
$this->installEntitySchema('user');
$this->installEntitySchema('node');
$type = NodeType::create(['type' => 'page', 'name' => 'Page']);
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/ContextTypedDataTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/ContextTypedDataTest.php
index 6954011a15a..3e3e88bf0b0 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/ContextTypedDataTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/ContextTypedDataTest.php
@@ -22,7 +22,7 @@ class ContextTypedDataTest extends KernelTestBase {
/**
* Tests that contexts can be serialized.
*/
- public function testSerialize() {
+ public function testSerialize(): void {
$definition = new ContextDefinition('any');
$data_definition = DataDefinition::create('string');
$typed_data = new StringData($data_definition);
@@ -44,7 +44,7 @@ class ContextTypedDataTest extends KernelTestBase {
*
* @covers ::getContextValue
*/
- public function testGetContextValue() {
+ public function testGetContextValue(): void {
$data_definition = DataDefinition::create('string');
$typed_data = new StringData($data_definition);
$typed_data->setValue('example string');
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/DefaultPluginManagerTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/DefaultPluginManagerTest.php
index aff66dcf970..703d15f2062 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/DefaultPluginManagerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/DefaultPluginManagerTest.php
@@ -25,7 +25,7 @@ class DefaultPluginManagerTest extends KernelTestBase {
/**
* Tests annotations and attributes on the default plugin manager.
*/
- public function testDefaultPluginManager() {
+ public function testDefaultPluginManager(): void {
$subdir = 'Plugin/plugin_test/custom_annotation';
$base_directory = $this->root . '/core/modules/system/tests/modules/plugin_test/src';
$namespaces = new \ArrayObject(['Drupal\plugin_test' => $base_directory]);
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/DerivativeTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/DerivativeTest.php
index 16ec96bdd21..aecad9faa95 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/DerivativeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/DerivativeTest.php
@@ -19,7 +19,7 @@ class DerivativeTest extends PluginTestBase {
/**
* Tests getDefinitions() and getDefinition() with a derivativeDecorator.
*/
- public function testDerivativeDecorator() {
+ public function testDerivativeDecorator(): void {
// Ensure that getDefinitions() returns the expected definitions.
$this->assertEquals($this->mockBlockExpectedDefinitions, $this->mockBlockManager->getDefinitions());
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php
index 76dd4a32407..1a9686cf8cd 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php
@@ -39,7 +39,7 @@ abstract class DiscoveryTestBase extends KernelTestBase {
/**
* Tests getDefinitions() and getDefinition().
*/
- public function testDiscoveryInterface() {
+ public function testDiscoveryInterface(): void {
// Ensure that getDefinitions() returns the expected definitions.
// For the arrays to be identical (instead of only equal), they must be
// sorted equally, which seems unnecessary here.
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/EntityContextTypedDataTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/EntityContextTypedDataTest.php
index 0effaabea89..868f06e4f7f 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/EntityContextTypedDataTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/EntityContextTypedDataTest.php
@@ -23,7 +23,7 @@ class EntityContextTypedDataTest extends KernelTestBase {
/**
* Tests that entity contexts wrapping a config entity can be validated.
*/
- public function testValidateConfigEntityContext() {
+ public function testValidateConfigEntityContext(): void {
$display = EntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/FactoryTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/FactoryTest.php
index 4ad37617ee6..60d073b06e7 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/FactoryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/FactoryTest.php
@@ -21,7 +21,7 @@ class FactoryTest extends PluginTestBase {
/**
* Tests that DefaultFactory can create a plugin instance.
*/
- public function testDefaultFactory() {
+ public function testDefaultFactory(): void {
// Ensure a non-derivative plugin can be instantiated.
$plugin = $this->testPluginManager->createInstance('user_login', ['title' => 'Enter your login name and password']);
$this->assertSame('Drupal\\plugin_test\\Plugin\\plugin_test\\mock_block\\MockUserLoginBlock', get_class($plugin), 'Correct plugin class instantiated with default factory.');
@@ -48,7 +48,7 @@ class FactoryTest extends PluginTestBase {
* reflection factory and it provides some additional variety in plugin
* object creation.
*/
- public function testReflectionFactory() {
+ public function testReflectionFactory(): void {
// Ensure a non-derivative plugin can be instantiated.
$plugin = $this->mockBlockManager->createInstance('user_login', ['title' => 'Enter your login name and password']);
$this->assertSame('Drupal\\plugin_test\\Plugin\\plugin_test\\mock_block\\MockUserLoginBlock', get_class($plugin), 'Correct plugin class instantiated.');
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/InspectionTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/InspectionTest.php
index 1d6e0be68fa..df96e368654 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/InspectionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/InspectionTest.php
@@ -19,7 +19,7 @@ class InspectionTest extends PluginTestBase {
/**
* Ensure the test plugins correctly implement getPluginId() and getPluginDefinition().
*/
- public function testInspection() {
+ public function testInspection(): void {
foreach (['user_login'] as $id) {
$plugin = $this->testPluginManager->createInstance($id);
$expected_definition = $this->testPluginExpectedDefinitions[$id];
diff --git a/core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php b/core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php
index 5bb185c880c..d69767410be 100644
--- a/core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php
@@ -93,7 +93,7 @@ class QueueSerializationTest extends KernelTestBase implements FormInterface {
/**
* Tests queue injection serialization.
*/
- public function testQueueSerialization() {
+ public function testQueueSerialization(): void {
$form_state = new FormState();
$form_state->setRequestMethod('POST');
$form_state->setCached();
diff --git a/core/tests/Drupal/KernelTests/Core/Queue/QueueTest.php b/core/tests/Drupal/KernelTests/Core/Queue/QueueTest.php
index 9561f0804ed..9b91a911174 100644
--- a/core/tests/Drupal/KernelTests/Core/Queue/QueueTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Queue/QueueTest.php
@@ -19,7 +19,7 @@ class QueueTest extends KernelTestBase {
/**
* Tests the System queue.
*/
- public function testSystemQueue() {
+ public function testSystemQueue(): void {
// Create two queues.
$queue1 = new DatabaseQueue($this->randomMachineName(), Database::getConnection());
$queue1->createQueue();
@@ -32,7 +32,7 @@ class QueueTest extends KernelTestBase {
/**
* Tests the Memory queue.
*/
- public function testMemoryQueue() {
+ public function testMemoryQueue(): void {
// Create two queues.
$queue1 = new Memory($this->randomMachineName());
$queue1->createQueue();
diff --git a/core/tests/Drupal/KernelTests/Core/Render/Element/ActionsTest.php b/core/tests/Drupal/KernelTests/Core/Render/Element/ActionsTest.php
index a67f3e7167c..d263f1a4bc3 100644
--- a/core/tests/Drupal/KernelTests/Core/Render/Element/ActionsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/Element/ActionsTest.php
@@ -63,7 +63,7 @@ class ActionsTest extends KernelTestBase implements FormInterface {
public function submitForm(array &$form, FormStateInterface $form_state) {
}
- public function testDropbuttonWithBubbleableMetadata() {
+ public function testDropbuttonWithBubbleableMetadata(): void {
$result = \Drupal::formBuilder()->getForm($this);
\Drupal::service('renderer')->renderRoot($result);
$this->assertEquals(['system/base', 'core/drupal.dropbutton'], $result['#attached']['library']);
diff --git a/core/tests/Drupal/KernelTests/Core/Render/Element/DeprecatedElementTest.php b/core/tests/Drupal/KernelTests/Core/Render/Element/DeprecatedElementTest.php
index 815e999b09f..09931b10f3a 100644
--- a/core/tests/Drupal/KernelTests/Core/Render/Element/DeprecatedElementTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/Element/DeprecatedElementTest.php
@@ -22,7 +22,7 @@ class DeprecatedElementTest extends KernelTestBase {
/**
* Tests that render elements can trigger deprecations in their constructor.
*/
- public function testBuildInfo() {
+ public function testBuildInfo(): void {
$info_manager = $this->container->get('plugin.manager.element_info');
$element_names = [
'deprecated',
diff --git a/core/tests/Drupal/KernelTests/Core/Render/Element/MachineNameTest.php b/core/tests/Drupal/KernelTests/Core/Render/Element/MachineNameTest.php
index 98962932b30..95d6d633f11 100644
--- a/core/tests/Drupal/KernelTests/Core/Render/Element/MachineNameTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/Element/MachineNameTest.php
@@ -66,7 +66,7 @@ class MachineNameTest extends KernelTestBase implements FormInterface {
/**
* Tests the order of the machine name field and the source.
*/
- public function testMachineNameOrderException() {
+ public function testMachineNameOrderException(): void {
$this->expectException(\LogicException::class);
$this->expectExceptionMessage('The machine name element "test_machine_name" is defined before the source element "test_source", it must be defined after or the source element must specify an id.');
$form = \Drupal::formBuilder()->getForm($this);
diff --git a/core/tests/Drupal/KernelTests/Core/Render/Element/PluginAlterTest.php b/core/tests/Drupal/KernelTests/Core/Render/Element/PluginAlterTest.php
index 36bfeec7106..7ad8afa75be 100644
--- a/core/tests/Drupal/KernelTests/Core/Render/Element/PluginAlterTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/Element/PluginAlterTest.php
@@ -19,7 +19,7 @@ class PluginAlterTest extends KernelTestBase {
/**
* Tests hook_element_plugin_alter().
*/
- public function testPluginAlter() {
+ public function testPluginAlter(): void {
$info_manager = $this->container->get('plugin.manager.element_info');
$this->assertArrayHasKey('weight', $info_manager->getDefinitions());
diff --git a/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php b/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php
index aa5022359af..e03e9d4f3ef 100644
--- a/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php
@@ -50,7 +50,7 @@ class RenderElementTypesTest extends KernelTestBase {
/**
* Tests system #type 'container'.
*/
- public function testContainer() {
+ public function testContainer(): void {
// Basic container with no attributes.
$this->assertElements([
'#type' => 'container',
@@ -78,7 +78,7 @@ class RenderElementTypesTest extends KernelTestBase {
/**
* Tests system #type 'html_tag'.
*/
- public function testHtmlTag() {
+ public function testHtmlTag(): void {
// Test void element.
$this->assertElements([
'#type' => 'html_tag',
@@ -116,7 +116,7 @@ class RenderElementTypesTest extends KernelTestBase {
/**
* Tests system #type 'more_link'.
*/
- public function testMoreLink() {
+ public function testMoreLink(): void {
$elements = [
[
'name' => "#type 'more_link' anchor tag generation without extra classes",
@@ -196,7 +196,7 @@ class RenderElementTypesTest extends KernelTestBase {
/**
* Tests system #type 'system_compact_link'.
*/
- public function testSystemCompactLink() {
+ public function testSystemCompactLink(): void {
$elements = [
[
'name' => "#type 'system_compact_link' when admin compact mode is off",
diff --git a/core/tests/Drupal/KernelTests/Core/Render/Element/TableSortExtenderTest.php b/core/tests/Drupal/KernelTests/Core/Render/Element/TableSortExtenderTest.php
index 0bb07c99357..3596aafe707 100644
--- a/core/tests/Drupal/KernelTests/Core/Render/Element/TableSortExtenderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/Element/TableSortExtenderTest.php
@@ -20,7 +20,7 @@ class TableSortExtenderTest extends KernelTestBase {
/**
* Tests \Drupal\Core\Utility\TableSort::getContextFromRequest().
*/
- public function testTableSortInit() {
+ public function testTableSortInit(): void {
// Test simple table headers.
diff --git a/core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php b/core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php
index 04741d5114b..0d72f964a5f 100644
--- a/core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php
@@ -23,7 +23,7 @@ class TableTest extends KernelTestBase {
/**
* If $sticky is TRUE, `sticky-header` class should be included.
*/
- public function testThemeTableStickyHeaders() {
+ public function testThemeTableStickyHeaders(): void {
$header = ['one', 'two', 'three'];
$rows = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
$table = [
@@ -39,7 +39,7 @@ class TableTest extends KernelTestBase {
/**
* If $sticky is FALSE, `sticky-header` class should not be included.
*/
- public function testThemeTableNoStickyHeaders() {
+ public function testThemeTableNoStickyHeaders(): void {
$header = ['one', 'two', 'three'];
$rows = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
$attributes = [];
@@ -64,7 +64,7 @@ class TableTest extends KernelTestBase {
* Tests are performed when the there are no rows and that the empty text is
* displayed correctly.
*/
- public function testThemeTableWithEmptyMessage() {
+ public function testThemeTableWithEmptyMessage(): void {
$header = [
'Header 1',
[
@@ -92,7 +92,7 @@ class TableTest extends KernelTestBase {
/**
* Tests that the 'no_striping' option works correctly.
*/
- public function testThemeTableWithNoStriping() {
+ public function testThemeTableWithNoStriping(): void {
$rows = [
[
'data' => [1],
@@ -111,7 +111,7 @@ class TableTest extends KernelTestBase {
/**
* Tests that the 'footer' option works correctly.
*/
- public function testThemeTableFooter() {
+ public function testThemeTableFooter(): void {
$footer = [
[
'data' => [1],
@@ -133,7 +133,7 @@ class TableTest extends KernelTestBase {
/**
* Tests that the 'header' option in cells works correctly.
*/
- public function testThemeTableHeaderCellOption() {
+ public function testThemeTableHeaderCellOption(): void {
$rows = [
[
['data' => 1, 'header' => TRUE],
@@ -153,7 +153,7 @@ class TableTest extends KernelTestBase {
/**
* Tests that the 'responsive-table' class is applied correctly.
*/
- public function testThemeTableResponsive() {
+ public function testThemeTableResponsive(): void {
$header = ['one', 'two', 'three'];
$rows = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
$table = [
@@ -169,7 +169,7 @@ class TableTest extends KernelTestBase {
/**
* Tests that the 'responsive-table' class is not applied without headers.
*/
- public function testThemeTableNotResponsiveHeaders() {
+ public function testThemeTableNotResponsiveHeaders(): void {
$rows = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
$table = [
'#type' => 'table',
@@ -183,7 +183,7 @@ class TableTest extends KernelTestBase {
/**
* Tests that 'responsive-table' class only applied when responsive is TRUE.
*/
- public function testThemeTableNotResponsiveProperty() {
+ public function testThemeTableNotResponsiveProperty(): void {
$header = ['one', 'two', 'three'];
$rows = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
$table = [
@@ -199,7 +199,7 @@ class TableTest extends KernelTestBase {
/**
* Tests 'priority-medium' and 'priority-low' classes.
*/
- public function testThemeTableResponsivePriority() {
+ public function testThemeTableResponsivePriority(): void {
$header = [
// Test associative header indices.
'associative_key' => ['data' => 1, 'class' => [RESPONSIVE_PRIORITY_MEDIUM]],
@@ -227,7 +227,7 @@ class TableTest extends KernelTestBase {
/**
* Tests header elements with a mix of string and render array values.
*/
- public function testThemeTableHeaderRenderArray() {
+ public function testThemeTableHeaderRenderArray(): void {
$header = [
[
'data' => [
@@ -258,7 +258,7 @@ class TableTest extends KernelTestBase {
/**
* Tests row elements with a mix of string and render array values.
*/
- public function testThemeTableRowRenderArray() {
+ public function testThemeTableRowRenderArray(): void {
$header = ['one', 'two', 'three'];
$rows = [
[
@@ -299,7 +299,7 @@ class TableTest extends KernelTestBase {
/**
* Tests that the select/checkbox label is being generated and escaped.
*/
- public function testThemeTableTitle() {
+ public function testThemeTableTitle(): void {
$form = \Drupal::formBuilder()->getForm('\Drupal\form_test\Form\FormTestTableForm');
$this->render($form);
$this->assertEscaped('Update <em>kitten</em>');
diff --git a/core/tests/Drupal/KernelTests/Core/Render/Element/WeightTest.php b/core/tests/Drupal/KernelTests/Core/Render/Element/WeightTest.php
index d14f9511d4a..00b7948f2a8 100644
--- a/core/tests/Drupal/KernelTests/Core/Render/Element/WeightTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/Element/WeightTest.php
@@ -35,7 +35,7 @@ class WeightTest extends KernelTestBase {
*
* @covers ::processWeight
*/
- public function testProcessWeight() {
+ public function testProcessWeight(): void {
$element = [];
$form_state = new FormState();
$complete_form = [];
@@ -61,7 +61,7 @@ class WeightTest extends KernelTestBase {
*
* @covers ::processWeight
*/
- public function testProcessWeightSelectMax() {
+ public function testProcessWeightSelectMax(): void {
$form_state = new FormState();
$definition = [
'#type' => 'weight',
diff --git a/core/tests/Drupal/KernelTests/Core/Render/ElementInfoIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/Render/ElementInfoIntegrationTest.php
index 46fa63a0908..defad383bea 100644
--- a/core/tests/Drupal/KernelTests/Core/Render/ElementInfoIntegrationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/ElementInfoIntegrationTest.php
@@ -25,7 +25,7 @@ class ElementInfoIntegrationTest extends KernelTestBase {
/**
* Ensures that the element info can be altered by themes.
*/
- public function testElementInfoByTheme() {
+ public function testElementInfoByTheme(): void {
/** @var \Drupal\Core\Theme\ThemeInitializationInterface $theme_initializer */
$theme_initializer = $this->container->get('theme.initialization');
diff --git a/core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php b/core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php
index f29477a48a5..2f49ac29e50 100644
--- a/core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php
@@ -45,14 +45,14 @@ class RenderCacheTest extends KernelTestBase {
/**
* Tests that user 1 has a different permission context with the same roles.
*/
- public function testUser1PermissionContext() {
+ public function testUser1PermissionContext(): void {
$this->doTestUser1WithContexts(['user.permissions']);
}
/**
* Tests that user 1 has a different roles context with the same roles.
*/
- public function testUser1RolesContext() {
+ public function testUser1RolesContext(): void {
$this->doTestUser1WithContexts(['user.roles']);
}
diff --git a/core/tests/Drupal/KernelTests/Core/Render/RenderTest.php b/core/tests/Drupal/KernelTests/Core/Render/RenderTest.php
index d2948015e7c..8a517f5a491 100644
--- a/core/tests/Drupal/KernelTests/Core/Render/RenderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/RenderTest.php
@@ -23,7 +23,7 @@ class RenderTest extends KernelTestBase {
/**
* Tests theme preprocess functions being able to attach assets.
*/
- public function testDrupalRenderThemePreprocessAttached() {
+ public function testDrupalRenderThemePreprocessAttached(): void {
\Drupal::state()->set('theme_preprocess_attached_test', TRUE);
$test_element = [
@@ -48,7 +48,7 @@ class RenderTest extends KernelTestBase {
/**
* Ensures that render array children are processed correctly.
*/
- public function testRenderChildren() {
+ public function testRenderChildren(): void {
// Ensure that #prefix and #suffix is only being printed once since that is
// the behavior the caller code expects.
$build = [
@@ -65,7 +65,7 @@ class RenderTest extends KernelTestBase {
/**
* Tests that we get an exception when we try to attach an illegal type.
*/
- public function testProcessAttached() {
+ public function testProcessAttached(): void {
// Specify invalid attachments in a render array.
$build['#attached']['library'][] = 'core/drupal.states';
$build['#attached']['drupal_process_states'][] = [];
@@ -79,7 +79,7 @@ class RenderTest extends KernelTestBase {
*
* @group legacy
*/
- public function testDeprecateRenderPlain() {
+ public function testDeprecateRenderPlain(): void {
$message = ['#markup' => 'Test'];
\Drupal::service('renderer')->renderPlain($message);
$this->expectDeprecation('Renderer::renderPlain() is deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. Instead, you should use ::renderInIsolation(). See https://www.drupal.org/node/3407994');
diff --git a/core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteNoneTest.php b/core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteNoneTest.php
index 2f18af508b3..9758937cd99 100644
--- a/core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteNoneTest.php
+++ b/core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteNoneTest.php
@@ -47,7 +47,7 @@ class RouteNoneTest extends KernelTestBase {
/**
* Tests the output process.
*/
- public function testProcessOutbound() {
+ public function testProcessOutbound(): void {
$expected_cacheability = (new BubbleableMetadata())->setCacheMaxAge(Cache::PERMANENT);
$request_stack = \Drupal::requestStack();
diff --git a/core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteProcessorCurrentIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteProcessorCurrentIntegrationTest.php
index 32a6024215c..942fd5b2751 100644
--- a/core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteProcessorCurrentIntegrationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/RouteProcessor/RouteProcessorCurrentIntegrationTest.php
@@ -46,7 +46,7 @@ class RouteProcessorCurrentIntegrationTest extends KernelTestBase {
/**
* Tests the output process.
*/
- public function testProcessOutbound() {
+ public function testProcessOutbound(): void {
$expected_cacheability = (new BubbleableMetadata())
->addCacheContexts(['route'])
->setCacheMaxAge(Cache::PERMANENT);
diff --git a/core/tests/Drupal/KernelTests/Core/Routing/ContentNegotiationRoutingTest.php b/core/tests/Drupal/KernelTests/Core/Routing/ContentNegotiationRoutingTest.php
index 9254ccc2568..76e9b232ec6 100644
--- a/core/tests/Drupal/KernelTests/Core/Routing/ContentNegotiationRoutingTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Routing/ContentNegotiationRoutingTest.php
@@ -35,7 +35,7 @@ class ContentNegotiationRoutingTest extends KernelTestBase {
/**
* Tests the content negotiation aspect of routing.
*/
- public function testContentRouting() {
+ public function testContentRouting(): void {
// Alias with extension pointing to no extension/constant content-type.
$this->createPathAlias('/content_negotiation/html', '/alias.html');
@@ -99,7 +99,7 @@ class ContentNegotiationRoutingTest extends KernelTestBase {
/**
* Full negotiation by header only.
*/
- public function testFullNegotiation() {
+ public function testFullNegotiation(): void {
$this->enableModules(['accept_header_routing_test']);
$tests = [
// ['path', 'accept', 'content-type'],
diff --git a/core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php b/core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php
index c5b9e26d6dd..f9eed1d6eaf 100644
--- a/core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php
@@ -34,7 +34,7 @@ class ExceptionHandlingTest extends KernelTestBase {
/**
* Tests on a route with a non-supported HTTP method.
*/
- public function test405() {
+ public function test405(): void {
$request = Request::create('/router_test/test15', 'PATCH');
/** @var \Symfony\Component\HttpKernel\HttpKernelInterface $kernel */
@@ -47,7 +47,7 @@ class ExceptionHandlingTest extends KernelTestBase {
/**
* Tests a route with a non-supported _format parameter.
*/
- public function test406() {
+ public function test406(): void {
$request = Request::create('/router_test/test2?_format=non_existent_format');
/** @var \Symfony\Component\HttpKernel\HttpKernelInterface $kernel */
@@ -60,7 +60,7 @@ class ExceptionHandlingTest extends KernelTestBase {
/**
* Tests the exception handling for json and 403 status code.
*/
- public function testJson403() {
+ public function testJson403(): void {
$request = Request::create('/router_test/test15');
$request->query->set('_format', 'json');
$request->setRequestFormat('json');
@@ -78,7 +78,7 @@ class ExceptionHandlingTest extends KernelTestBase {
/**
* Tests the exception handling for json and 404 status code.
*/
- public function testJson404() {
+ public function testJson404(): void {
$request = Request::create('/not-found');
$request->query->set('_format', 'json');
$request->setRequestFormat('json');
@@ -95,7 +95,7 @@ class ExceptionHandlingTest extends KernelTestBase {
/**
* Tests the exception handling for HTML and 403 status code.
*/
- public function testHtml403() {
+ public function testHtml403(): void {
$request = Request::create('/router_test/test15');
$request->setFormat('html', ['text/html']);
@@ -110,7 +110,7 @@ class ExceptionHandlingTest extends KernelTestBase {
/**
* Tests the exception handling for HTML and 404 status code.
*/
- public function testHtml404() {
+ public function testHtml404(): void {
$request = Request::create('/not-found');
$request->setFormat('html', ['text/html']);
@@ -125,7 +125,7 @@ class ExceptionHandlingTest extends KernelTestBase {
/**
* Tests that the exception response is executed in the original context.
*/
- public function testExceptionResponseGeneratedForOriginalRequest() {
+ public function testExceptionResponseGeneratedForOriginalRequest(): void {
// Test with 404 path pointing to a route that uses '_controller'.
$response = $this->doTest404Route('/router_test/test25');
$this->assertStringContainsString('/not-found', $response->getContent());
@@ -163,7 +163,7 @@ class ExceptionHandlingTest extends KernelTestBase {
/**
* Tests if exception backtraces are properly escaped when output to HTML.
*/
- public function testBacktraceEscaping() {
+ public function testBacktraceEscaping(): void {
// Enable verbose error logging.
$this->config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_VERBOSE)->save();
@@ -185,7 +185,7 @@ class ExceptionHandlingTest extends KernelTestBase {
/**
* Tests exception message escaping.
*/
- public function testExceptionEscaping() {
+ public function testExceptionEscaping(): void {
// Enable verbose error logging.
$this->config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_VERBOSE)->save();
diff --git a/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php b/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php
index 677968b3ec8..481caab2ca4 100644
--- a/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php
@@ -59,7 +59,7 @@ class MatcherDumperTest extends KernelTestBase {
/**
* Confirms that the dumper can be instantiated successfully.
*/
- public function testCreate() {
+ public function testCreate(): void {
$connection = Database::getConnection();
$dumper = new MatcherDumper($connection, $this->state, $this->logger);
@@ -70,7 +70,7 @@ class MatcherDumperTest extends KernelTestBase {
/**
* Confirms that we can add routes to the dumper.
*/
- public function testAddRoutes() {
+ public function testAddRoutes(): void {
$connection = Database::getConnection();
$dumper = new MatcherDumper($connection, $this->state, $this->logger);
@@ -91,7 +91,7 @@ class MatcherDumperTest extends KernelTestBase {
/**
* Confirms that we can add routes to the dumper when it already has some.
*/
- public function testAddAdditionalRoutes() {
+ public function testAddAdditionalRoutes(): void {
$connection = Database::getConnection();
$dumper = new MatcherDumper($connection, $this->state, $this->logger);
@@ -119,7 +119,7 @@ class MatcherDumperTest extends KernelTestBase {
/**
* Confirm that we can dump a route collection to the database.
*/
- public function testDump() {
+ public function testDump(): void {
$connection = Database::getConnection();
$dumper = new MatcherDumper($connection, $this->state, $this->logger, 'test_routes');
@@ -154,7 +154,7 @@ class MatcherDumperTest extends KernelTestBase {
/**
* Tests the determination of the masks generation.
*/
- public function testMenuMasksGeneration() {
+ public function testMenuMasksGeneration(): void {
$connection = Database::getConnection();
$dumper = new MatcherDumper($connection, $this->state, $this->logger, 'test_routes');
diff --git a/core/tests/Drupal/KernelTests/Core/Routing/PathChangedHelperTest.php b/core/tests/Drupal/KernelTests/Core/Routing/PathChangedHelperTest.php
index 99ab50ce000..82ab86cdf11 100644
--- a/core/tests/Drupal/KernelTests/Core/Routing/PathChangedHelperTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Routing/PathChangedHelperTest.php
@@ -34,7 +34,7 @@ class PathChangedHelperTest extends KernelTestBase {
* @covers ::newPath
* @covers ::redirect
*/
- public function testPathChangedHelper() {
+ public function testPathChangedHelper(): void {
$route = \Drupal::service('router.route_provider')->getRouteByName('path.changed.bc');
$raw_parameters = [
'block_type' => 'test_block_type',
diff --git a/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
index fd9008f73c1..4bb9c5efa29 100644
--- a/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
@@ -122,7 +122,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* Confirms that the correct candidate outlines are generated.
*/
- public function testCandidateOutlines() {
+ public function testCandidateOutlines(): void {
$connection = Database::getConnection();
$provider = new TestRouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
@@ -146,7 +146,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* Don't fail when given an empty path.
*/
- public function testEmptyPathCandidatesOutlines() {
+ public function testEmptyPathCandidatesOutlines(): void {
$provider = new TestRouteProvider(Database::getConnection(), $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
$candidates = $provider->getCandidateOutlines([]);
$this->assertCount(0, $candidates, 'Empty parts should return no candidates.');
@@ -155,7 +155,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* Confirms that we can find routes with the exact incoming path.
*/
- public function testExactPathMatch() {
+ public function testExactPathMatch(): void {
$connection = Database::getConnection();
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
@@ -179,7 +179,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* Confirms that we can find routes whose pattern would match the request.
*/
- public function testOutlinePathMatch() {
+ public function testOutlinePathMatch(): void {
$connection = Database::getConnection();
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
@@ -232,7 +232,7 @@ class RouteProviderTest extends KernelTestBase {
*
* @dataProvider providerMixedCaseRoutePaths
*/
- public function testMixedCasePaths($path, $expected_route_name, $method = 'GET') {
+ public function testMixedCasePaths($path, $expected_route_name, $method = 'GET'): void {
$connection = Database::getConnection();
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
@@ -276,7 +276,7 @@ class RouteProviderTest extends KernelTestBase {
*
* @dataProvider providerDuplicateRoutePaths
*/
- public function testDuplicateRoutePaths($path, $number, $expected_route_name = NULL) {
+ public function testDuplicateRoutePaths($path, $number, $expected_route_name = NULL): void {
$connection = Database::getConnection();
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
@@ -298,7 +298,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* Confirms RouteProvider::getAllRoutes() extracts information correctly from the database.
*/
- public function testGetAllRoutes() {
+ public function testGetAllRoutes(): void {
$connection = Database::getConnection();
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
@@ -324,7 +324,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* Confirms that a trailing slash on the request does not result in a 404.
*/
- public function testOutlinePathMatchTrailingSlash() {
+ public function testOutlinePathMatchTrailingSlash(): void {
$connection = Database::getConnection();
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
@@ -353,7 +353,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* Confirms that we can find routes whose pattern would match the request.
*/
- public function testOutlinePathMatchDefaults() {
+ public function testOutlinePathMatchDefaults(): void {
$connection = Database::getConnection();
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
@@ -391,7 +391,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* Confirms that we can find routes whose pattern would match the request.
*/
- public function testOutlinePathMatchDefaultsCollision() {
+ public function testOutlinePathMatchDefaultsCollision(): void {
$connection = Database::getConnection();
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
@@ -430,7 +430,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* Confirms that we can find routes whose pattern would match the request.
*/
- public function testOutlinePathMatchDefaultsCollision2() {
+ public function testOutlinePathMatchDefaultsCollision2(): void {
$connection = Database::getConnection();
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
@@ -469,7 +469,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* Confirms that we can find multiple routes that match the request equally.
*/
- public function testOutlinePathMatchDefaultsCollision3() {
+ public function testOutlinePathMatchDefaultsCollision3(): void {
$connection = Database::getConnection();
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
@@ -508,7 +508,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* Tests a route with a 0 as value.
*/
- public function testOutlinePathMatchZero() {
+ public function testOutlinePathMatchZero(): void {
$connection = Database::getConnection();
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
@@ -543,7 +543,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* Confirms that an exception is thrown when no matching path is found.
*/
- public function testOutlinePathNoMatch() {
+ public function testOutlinePathNoMatch(): void {
$connection = Database::getConnection();
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
@@ -567,7 +567,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* Tests that route caching works.
*/
- public function testRouteCaching() {
+ public function testRouteCaching(): void {
$connection = Database::getConnection();
$language_manager = \Drupal::languageManager();
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes', $language_manager);
@@ -659,7 +659,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* Tests RouteProvider::getRouteByName() & RouteProvider::getRoutesByNames().
*/
- public function testRouteByName() {
+ public function testRouteByName(): void {
$connection = Database::getConnection();
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
@@ -694,7 +694,7 @@ class RouteProviderTest extends KernelTestBase {
/**
* Ensures that the routing system is capable of extreme long patterns.
*/
- public function testGetRoutesByPatternWithLongPatterns() {
+ public function testGetRoutesByPatternWithLongPatterns(): void {
$connection = Database::getConnection();
$provider = new TestRouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
diff --git a/core/tests/Drupal/KernelTests/Core/Routing/UrlIntegrationTest.php b/core/tests/Drupal/KernelTests/Core/Routing/UrlIntegrationTest.php
index 1b337b92b92..b71725dec07 100644
--- a/core/tests/Drupal/KernelTests/Core/Routing/UrlIntegrationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Routing/UrlIntegrationTest.php
@@ -26,7 +26,7 @@ class UrlIntegrationTest extends KernelTestBase {
/**
* Ensures that the access() method on \Drupal\Core\Url objects works.
*/
- public function testAccess() {
+ public function testAccess(): void {
/** @var \Drupal\user\RoleInterface $role_with_access */
$role_with_access = Role::create(['id' => 'role_with_access', 'label' => 'With access']);
$role_with_access->grantPermission('administer users');
diff --git a/core/tests/Drupal/KernelTests/Core/ServiceProvider/ServiceProviderTest.php b/core/tests/Drupal/KernelTests/Core/ServiceProvider/ServiceProviderTest.php
index 19ad485c3b5..b0807f5d41e 100644
--- a/core/tests/Drupal/KernelTests/Core/ServiceProvider/ServiceProviderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/ServiceProvider/ServiceProviderTest.php
@@ -42,7 +42,7 @@ class ServiceProviderTest extends KernelTestBase {
/**
* Tests that services provided by module service providers get registered to the DIC.
*/
- public function testServiceProviderRegistration() {
+ public function testServiceProviderRegistration(): void {
$definition = $this->container->getDefinition('file.usage');
$this->assertSame('Drupal\\service_provider_test\\TestFileUsage', $definition->getClass(), 'Class has been changed');
$this->assertTrue(\Drupal::hasService('service_provider_test_class'), 'The service_provider_test_class service has been registered to the DIC');
@@ -51,7 +51,7 @@ class ServiceProviderTest extends KernelTestBase {
/**
* Tests that the DIC keeps up with module enable/disable in the same request.
*/
- public function testServiceProviderRegistrationDynamic() {
+ public function testServiceProviderRegistrationDynamic(): void {
// Uninstall the module and ensure the service provider's service is not registered.
\Drupal::service('module_installer')->uninstall(['service_provider_test']);
$this->assertFalse(\Drupal::hasService('service_provider_test_class'), 'The service_provider_test_class service does not exist in the DIC.');
diff --git a/core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php b/core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php
index e10da57516b..ca78d1997ac 100644
--- a/core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php
@@ -14,7 +14,7 @@ use Drupal\KernelTests\KernelTestBase;
*/
class AccountSwitcherTest extends KernelTestBase {
- public function testAccountSwitching() {
+ public function testAccountSwitching(): void {
$session_handler = $this->container->get('session_handler.write_safe');
$user = $this->container->get('current_user');
$switcher = $this->container->get('account_switcher');
diff --git a/core/tests/Drupal/KernelTests/Core/Session/SessionManagerDestroyNoCliCheckTest.php b/core/tests/Drupal/KernelTests/Core/Session/SessionManagerDestroyNoCliCheckTest.php
index 398c3d2dd07..8fc563f9d2e 100644
--- a/core/tests/Drupal/KernelTests/Core/Session/SessionManagerDestroyNoCliCheckTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Session/SessionManagerDestroyNoCliCheckTest.php
@@ -16,7 +16,7 @@ class SessionManagerDestroyNoCliCheckTest extends KernelTestBase {
/**
* Tests starting and destroying a session from the CLI.
*/
- public function testCallSessionManagerStartAndDestroy() {
+ public function testCallSessionManagerStartAndDestroy(): void {
$this->assertFalse(\Drupal::service('session_manager')->start());
$this->assertNull(\Drupal::service('session_manager')->destroy());
}
diff --git a/core/tests/Drupal/KernelTests/Core/Site/SettingsRewriteTest.php b/core/tests/Drupal/KernelTests/Core/Site/SettingsRewriteTest.php
index 61121ef7c3e..7d8b28ef37e 100644
--- a/core/tests/Drupal/KernelTests/Core/Site/SettingsRewriteTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Site/SettingsRewriteTest.php
@@ -18,7 +18,7 @@ class SettingsRewriteTest extends KernelTestBase {
/**
* @covers \Drupal\Core\Site\SettingsEditor::rewrite
*/
- public function testDrupalRewriteSettings() {
+ public function testDrupalRewriteSettings(): void {
include_once $this->root . '/core/includes/install.inc';
$site_path = $this->container->getParameter('site.path');
$tests = [
diff --git a/core/tests/Drupal/KernelTests/Core/StreamWrapper/StreamWrapperManagerTest.php b/core/tests/Drupal/KernelTests/Core/StreamWrapper/StreamWrapperManagerTest.php
index 8df1ccb9d96..5d2fe9e6b9d 100644
--- a/core/tests/Drupal/KernelTests/Core/StreamWrapper/StreamWrapperManagerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/StreamWrapper/StreamWrapperManagerTest.php
@@ -38,7 +38,7 @@ class StreamWrapperManagerTest extends KernelTestBase {
*
* @dataProvider providerTestUriScheme
*/
- public function testUriScheme($uri, $expected) {
+ public function testUriScheme($uri, $expected): void {
$this->assertSame($expected, StreamWrapperManager::getScheme($uri));
}
diff --git a/core/tests/Drupal/KernelTests/Core/StringTranslation/TranslationStringTest.php b/core/tests/Drupal/KernelTests/Core/StringTranslation/TranslationStringTest.php
index cc2cf7045ec..e5c3663d477 100644
--- a/core/tests/Drupal/KernelTests/Core/StringTranslation/TranslationStringTest.php
+++ b/core/tests/Drupal/KernelTests/Core/StringTranslation/TranslationStringTest.php
@@ -35,7 +35,7 @@ class TranslationStringTest extends KernelTestBase {
/**
* Tests that TranslatableMarkup objects can be compared.
*/
- public function testComparison() {
+ public function testComparison(): void {
$this->rebootAndPrepareSettings();
$a = \Drupal::service('string_translation')->translate('Example @number', ['@number' => 42], ['langcode' => 'de']);
diff --git a/core/tests/Drupal/KernelTests/Core/TempStore/AnonymousPrivateTempStoreTest.php b/core/tests/Drupal/KernelTests/Core/TempStore/AnonymousPrivateTempStoreTest.php
index 6c7e2b99dce..85aedbd1305 100644
--- a/core/tests/Drupal/KernelTests/Core/TempStore/AnonymousPrivateTempStoreTest.php
+++ b/core/tests/Drupal/KernelTests/Core/TempStore/AnonymousPrivateTempStoreTest.php
@@ -38,7 +38,7 @@ class AnonymousPrivateTempStoreTest extends KernelTestBase {
/**
* Tests anonymous can get without a previous set.
*/
- public function testAnonymousCanUsePrivateTempStoreGet() {
+ public function testAnonymousCanUsePrivateTempStoreGet(): void {
$actual = $this->tempStore->get('foo');
$this->assertNull($actual);
}
@@ -46,7 +46,7 @@ class AnonymousPrivateTempStoreTest extends KernelTestBase {
/**
* Tests anonymous can use the PrivateTempStore.
*/
- public function testAnonymousCanUsePrivateTempStoreSet() {
+ public function testAnonymousCanUsePrivateTempStoreSet(): void {
$this->tempStore->set('foo', 'bar');
$metadata1 = $this->tempStore->getMetadata('foo');
diff --git a/core/tests/Drupal/KernelTests/Core/TempStore/TempStoreDatabaseTest.php b/core/tests/Drupal/KernelTests/Core/TempStore/TempStoreDatabaseTest.php
index 8d58db8806a..e78bed73227 100644
--- a/core/tests/Drupal/KernelTests/Core/TempStore/TempStoreDatabaseTest.php
+++ b/core/tests/Drupal/KernelTests/Core/TempStore/TempStoreDatabaseTest.php
@@ -22,7 +22,7 @@ class TempStoreDatabaseTest extends KernelTestBase {
/**
* Tests the SharedTempStore API.
*/
- public function testSharedTempStore() {
+ public function testSharedTempStore(): void {
// Create testing objects.
$objects = [];
for ($i = 0; $i <= 3; $i++) {
diff --git a/core/tests/Drupal/KernelTests/Core/Test/AssertMailTraitTest.php b/core/tests/Drupal/KernelTests/Core/Test/AssertMailTraitTest.php
index ea8369c1673..859f1fe3bad 100644
--- a/core/tests/Drupal/KernelTests/Core/Test/AssertMailTraitTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Test/AssertMailTraitTest.php
@@ -20,7 +20,7 @@ class AssertMailTraitTest extends KernelTestBase {
/**
* Tests that the maintenance theme initializes the theme and its base themes.
*/
- public function testAssertMailTrait() {
+ public function testAssertMailTrait(): void {
/** @var \Drupal\Core\Mail\MailManagerInterface $mail_service */
$mail_service = \Drupal::service('plugin.manager.mail');
diff --git a/core/tests/Drupal/KernelTests/Core/Test/EnvironmentCleanerTest.php b/core/tests/Drupal/KernelTests/Core/Test/EnvironmentCleanerTest.php
index 218b3418d70..12fc563de17 100644
--- a/core/tests/Drupal/KernelTests/Core/Test/EnvironmentCleanerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Test/EnvironmentCleanerTest.php
@@ -20,7 +20,7 @@ class EnvironmentCleanerTest extends KernelTestBase {
/**
* @covers ::doCleanTemporaryDirectories
*/
- public function testDoCleanTemporaryDirectories() {
+ public function testDoCleanTemporaryDirectories(): void {
vfsStream::setup('cleanup_test', NULL, [
'sites' => [
'simpletest' => [
diff --git a/core/tests/Drupal/KernelTests/Core/Test/PhpUnitBridgeTest.php b/core/tests/Drupal/KernelTests/Core/Test/PhpUnitBridgeTest.php
index 006b20cee69..5480197f406 100644
--- a/core/tests/Drupal/KernelTests/Core/Test/PhpUnitBridgeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Test/PhpUnitBridgeTest.php
@@ -17,13 +17,13 @@ class PhpUnitBridgeTest extends KernelTestBase {
protected static $modules = ['deprecation_test'];
- public function testDeprecatedClass() {
+ public function testDeprecatedClass(): void {
$this->expectDeprecation('Drupal\deprecation_test\Deprecation\FixtureDeprecatedClass is deprecated.');
$deprecated = new FixtureDeprecatedClass();
$this->assertEquals('test', $deprecated->testFunction());
}
- public function testDeprecatedFunction() {
+ public function testDeprecatedFunction(): void {
$this->expectDeprecation('This is the deprecation message for deprecation_test_function().');
$this->assertEquals('known_return_value', \deprecation_test_function());
}
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/BaseThemeMissingTest.php b/core/tests/Drupal/KernelTests/Core/Theme/BaseThemeMissingTest.php
index 12deaf10683..c59f43156f8 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/BaseThemeMissingTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/BaseThemeMissingTest.php
@@ -46,7 +46,7 @@ class BaseThemeMissingTest extends KernelTestBase {
/**
* Tests exception is thrown.
*/
- public function testMissingBaseThemeException() {
+ public function testMissingBaseThemeException(): void {
$this->expectException(InfoParserException::class);
$this->expectExceptionMessage('Missing required key ("base theme") in core/tests/fixtures/test_missing_base_theme/test_missing_base_theme.info.yml, see https://www.drupal.org/node/3066038');
$this->themeInstaller->install(['test_missing_base_theme']);
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/BaseThemeRequiredTest.php b/core/tests/Drupal/KernelTests/Core/Theme/BaseThemeRequiredTest.php
index 80aab70730b..3f7c18953d3 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/BaseThemeRequiredTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/BaseThemeRequiredTest.php
@@ -45,7 +45,7 @@ class BaseThemeRequiredTest extends KernelTestBase {
/**
* Tests opting out of Stable 9 by setting the base theme to false.
*/
- public function testWildWest() {
+ public function testWildWest(): void {
$this->themeInstaller->install(['test_wild_west']);
$this->config('system.theme')->set('default', 'test_wild_west')->save();
$theme = $this->themeManager->getActiveTheme();
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/ClaroVerticalTabsTest.php b/core/tests/Drupal/KernelTests/Core/Theme/ClaroVerticalTabsTest.php
index 841432ad607..15ccdcb2490 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/ClaroVerticalTabsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/ClaroVerticalTabsTest.php
@@ -22,7 +22,7 @@ class ClaroVerticalTabsTest extends KernelTestBase {
/**
* Confirms that Claro can render vertical tabs correctly.
*/
- public function testVerticalTabs() {
+ public function testVerticalTabs(): void {
// Enable the Claro theme.
\Drupal::service('theme_installer')->install(['claro']);
$this->config('system.theme')->set('default', 'claro')->save();
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/ConfigImportThemeInstallTest.php b/core/tests/Drupal/KernelTests/Core/Theme/ConfigImportThemeInstallTest.php
index a7ecad01929..6f0ed1a344e 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/ConfigImportThemeInstallTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/ConfigImportThemeInstallTest.php
@@ -32,7 +32,7 @@ class ConfigImportThemeInstallTest extends KernelTestBase {
/**
* Tests config imports that install and uninstall a theme with dependencies.
*/
- public function testConfigImportWithThemeWithModuleDependencies() {
+ public function testConfigImportWithThemeWithModuleDependencies(): void {
$this->container->get('module_installer')->install(['test_module_required_by_theme', 'test_another_module_required_by_theme']);
$this->container->get('theme_installer')->install(['test_theme_depending_on_modules']);
$this->assertTrue($this->container->get('theme_handler')->themeExists('test_theme_depending_on_modules'), 'test_theme_depending_on_modules theme installed');
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/FrontMatterTest.php b/core/tests/Drupal/KernelTests/Core/Theme/FrontMatterTest.php
index 895afc92fe3..888db8a0cd7 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/FrontMatterTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/FrontMatterTest.php
@@ -72,7 +72,7 @@ class FrontMatterTest extends KernelTestBase {
* @covers \Drupal\Core\Template\TwigEnvironment::getTemplateMetadata
* @covers \Drupal\Component\FrontMatter\Exception\FrontMatterParseException
*/
- public function testFrontMatterBroken() {
+ public function testFrontMatterBroken(): void {
$source = "---\ncollection:\n- key: foo\n foo: bar\n---\n" . ComponentFrontMatterTest::SOURCE;
$file = $this->createTwigTemplate($source);
$this->expectException(SyntaxError::class);
@@ -95,7 +95,7 @@ class FrontMatterTest extends KernelTestBase {
*
* @dataProvider \Drupal\Tests\Component\FrontMatter\FrontMatterTest::providerFrontMatterData
*/
- public function testFrontMatter($yaml, $line, $content = ComponentFrontMatterTest::SOURCE) {
+ public function testFrontMatter($yaml, $line, $content = ComponentFrontMatterTest::SOURCE): void {
// Create a temporary Twig template.
$source = ComponentFrontMatterTest::createFrontMatterSource($yaml, $content);
$file = $this->createTwigTemplate($source);
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/ImageTest.php b/core/tests/Drupal/KernelTests/Core/Theme/ImageTest.php
index 78890315c6e..297c1111a17 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/ImageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/ImageTest.php
@@ -62,7 +62,7 @@ class ImageTest extends KernelTestBase {
/**
* Tests that an image with the sizes attribute is output correctly.
*/
- public function testThemeImageWithSizes() {
+ public function testThemeImageWithSizes(): void {
// Test with multipliers.
$sizes = '(max-width: ' . rand(10, 30) . 'em) 100vw, (max-width: ' . rand(30, 50) . 'em) 50vw, 30vw';
$image = [
@@ -83,7 +83,7 @@ class ImageTest extends KernelTestBase {
/**
* Tests that an image with the src attribute is output correctly.
*/
- public function testThemeImageWithSrc() {
+ public function testThemeImageWithSrc(): void {
$image = [
'#theme' => 'image',
@@ -102,7 +102,7 @@ class ImageTest extends KernelTestBase {
/**
* Tests that an image with the srcset and multipliers is output correctly.
*/
- public function testThemeImageWithSrcsetMultiplier() {
+ public function testThemeImageWithSrcsetMultiplier(): void {
// Test with multipliers.
$image = [
'#theme' => 'image',
@@ -130,7 +130,7 @@ class ImageTest extends KernelTestBase {
/**
* Tests that an image with the srcset and widths is output correctly.
*/
- public function testThemeImageWithSrcsetWidth() {
+ public function testThemeImageWithSrcsetWidth(): void {
// Test with multipliers.
$widths = [
rand(0, 500) . 'w',
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/MaintenanceThemeTest.php b/core/tests/Drupal/KernelTests/Core/Theme/MaintenanceThemeTest.php
index 4e350ee689f..2a7f8412d34 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/MaintenanceThemeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/MaintenanceThemeTest.php
@@ -16,7 +16,7 @@ class MaintenanceThemeTest extends KernelTestBase {
/**
* Tests that the maintenance theme initializes the theme and its base themes.
*/
- public function testMaintenanceTheme() {
+ public function testMaintenanceTheme(): void {
$this->setSetting('maintenance_theme', 'test_subtheme');
// Get the maintenance theme loaded.
drupal_maintenance_theme();
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/MessageTest.php b/core/tests/Drupal/KernelTests/Core/Theme/MessageTest.php
index aaea0758dd5..8898598e4d0 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/MessageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/MessageTest.php
@@ -21,7 +21,7 @@ class MessageTest extends KernelTestBase {
/**
* Tests setting messages output.
*/
- public function testMessages() {
+ public function testMessages(): void {
// Enable the Starterkit theme.
\Drupal::service('theme_installer')->install(['starterkit_theme']);
$this->config('system.theme')->set('default', 'starterkit_theme')->save();
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
index 0a672d6e321..7e5ef5f4cfd 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
@@ -31,7 +31,7 @@ class RegistryTest extends KernelTestBase {
/**
* Tests the behavior of the theme registry class.
*/
- public function testRaceCondition() {
+ public function testRaceCondition(): void {
// The theme registry is not marked as persistable in case we don't have a
// proper request.
\Drupal::request()->setMethod('GET');
@@ -69,7 +69,7 @@ class RegistryTest extends KernelTestBase {
/**
* Tests the theme registry with multiple subthemes.
*/
- public function testMultipleSubThemes() {
+ public function testMultipleSubThemes(): void {
$theme_handler = \Drupal::service('theme_handler');
\Drupal::service('theme_installer')->install(['test_basetheme', 'test_subtheme', 'test_subsubtheme']);
@@ -108,7 +108,7 @@ class RegistryTest extends KernelTestBase {
/**
* Tests the theme registry with suggestions.
*/
- public function testSuggestionPreprocessFunctions() {
+ public function testSuggestionPreprocessFunctions(): void {
$theme_handler = \Drupal::service('theme_handler');
\Drupal::service('theme_installer')->install(['test_theme']);
@@ -147,7 +147,7 @@ class RegistryTest extends KernelTestBase {
/**
* Tests that the theme registry can be altered by themes.
*/
- public function testThemeRegistryAlterByTheme() {
+ public function testThemeRegistryAlterByTheme(): void {
/** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */
$theme_handler = \Drupal::service('theme_handler');
@@ -164,7 +164,7 @@ class RegistryTest extends KernelTestBase {
/**
* Tests front node theme suggestion generation.
*/
- public function testThemeSuggestions() {
+ public function testThemeSuggestions(): void {
// Mock the current page as the front page.
/** @var \Drupal\Core\Path\PathMatcherInterface $path_matcher */
$path_matcher = $this->prophesize(PathMatcherInterface::class);
@@ -197,7 +197,7 @@ class RegistryTest extends KernelTestBase {
/**
* Tests page theme suggestions for 200 responses.
*/
- public function test200ThemeSuggestions() {
+ public function test200ThemeSuggestions(): void {
$path_matcher = $this->prophesize(PathMatcherInterface::class);
$path_matcher->isFrontPage()->willReturn(FALSE);
\Drupal::getContainer()->set('path.matcher', $path_matcher->reveal());
@@ -259,7 +259,7 @@ class RegistryTest extends KernelTestBase {
/**
* Tests theme-provided templates that are registered by modules.
*/
- public function testThemeTemplatesRegisteredByModules() {
+ public function testThemeTemplatesRegisteredByModules(): void {
$theme_handler = \Drupal::service('theme_handler');
\Drupal::service('theme_installer')->install(['test_theme']);
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/Stable9LibraryOverrideTest.php b/core/tests/Drupal/KernelTests/Core/Theme/Stable9LibraryOverrideTest.php
index 2e3fa0799ba..be6b1fc5342 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/Stable9LibraryOverrideTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/Stable9LibraryOverrideTest.php
@@ -58,7 +58,7 @@ class Stable9LibraryOverrideTest extends StableLibraryOverrideTestBase {
/**
* Ensures that Stable 9 overrides all relevant core library assets.
*/
- public function testStable9LibraryOverrides() {
+ public function testStable9LibraryOverrides(): void {
// First get the clean library definitions with no active theme.
$libraries_before = $this->getAllLibraries();
$libraries_before = $this->removeVendorAssets($libraries_before);
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/Stable9TemplateOverrideTest.php b/core/tests/Drupal/KernelTests/Core/Theme/Stable9TemplateOverrideTest.php
index 7f2598e2fa3..2e50db7e9b7 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/Stable9TemplateOverrideTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/Stable9TemplateOverrideTest.php
@@ -91,7 +91,7 @@ class Stable9TemplateOverrideTest extends KernelTestBase {
/**
* Ensures that Stable 9 overrides all relevant core templates.
*/
- public function testStable9TemplateOverrides() {
+ public function testStable9TemplateOverrides(): void {
$registry = new Registry($this->root, \Drupal::cache(), \Drupal::lock(), \Drupal::moduleHandler(), $this->themeHandler, \Drupal::service('theme.initialization'), \Drupal::service('cache.bootstrap'), \Drupal::service('extension.list.module'), \Drupal::service('kernel'), 'stable9');
$registry->setThemeManager(\Drupal::theme());
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php b/core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php
index 2ed0fd4650c..69ef57c8cdb 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/ThemeInstallerTest.php
@@ -50,7 +50,7 @@ class ThemeInstallerTest extends KernelTestBase {
/**
* Verifies that no themes are installed by default.
*/
- public function testEmpty() {
+ public function testEmpty(): void {
$this->assertEmpty($this->extensionConfig()->get('theme'));
$this->assertEmpty(array_keys($this->themeHandler()->listInfo()));
@@ -66,7 +66,7 @@ class ThemeInstallerTest extends KernelTestBase {
/**
* Tests installing a theme.
*/
- public function testInstall() {
+ public function testInstall(): void {
$name = 'test_basetheme';
$themes = $this->themeHandler()->listInfo();
@@ -89,7 +89,7 @@ class ThemeInstallerTest extends KernelTestBase {
/**
* Tests installing a sub-theme.
*/
- public function testInstallSubTheme() {
+ public function testInstallSubTheme(): void {
$name = 'test_subtheme';
$base_name = 'test_basetheme';
@@ -112,7 +112,7 @@ class ThemeInstallerTest extends KernelTestBase {
/**
* Tests installing a non-existing theme.
*/
- public function testInstallNonExisting() {
+ public function testInstallNonExisting(): void {
$name = 'non_existing_theme';
$themes = $this->themeHandler()->listInfo();
@@ -134,7 +134,7 @@ class ThemeInstallerTest extends KernelTestBase {
/**
* Tests installing a theme with a too long name.
*/
- public function testInstallNameTooLong() {
+ public function testInstallNameTooLong(): void {
$name = 'test_theme_having_veery_long_name_which_is_too_long';
try {
@@ -150,7 +150,7 @@ class ThemeInstallerTest extends KernelTestBase {
/**
* Tests installing a theme with the same name as an enabled module.
*/
- public function testInstallThemeSameNameAsModule() {
+ public function testInstallThemeSameNameAsModule(): void {
$name = 'name_collision_test';
// Install and uninstall the theme.
@@ -170,7 +170,7 @@ class ThemeInstallerTest extends KernelTestBase {
*
* @dataProvider providerTestInstallThemeWithUnmetModuleDependencies
*/
- public function testInstallThemeWithUnmetModuleDependencies($theme_name, $installed_modules, $message) {
+ public function testInstallThemeWithUnmetModuleDependencies($theme_name, $installed_modules, $message): void {
$this->moduleInstaller()->install($installed_modules);
$themes = $this->themeHandler()->listInfo();
$this->assertEmpty($themes);
@@ -186,7 +186,7 @@ class ThemeInstallerTest extends KernelTestBase {
*
* @group legacy
*/
- public function testInstallDeprecated() {
+ public function testInstallDeprecated(): void {
$this->expectDeprecation("The theme 'deprecated_theme_test' is deprecated. See https://example.com/deprecated");
$this->themeInstaller()->install(['deprecated_theme_test']);
$this->assertTrue(\Drupal::service('theme_handler')->themeExists('deprecated_theme_test'));
@@ -238,7 +238,7 @@ class ThemeInstallerTest extends KernelTestBase {
/**
* Tests installing a theme with module dependencies that are met.
*/
- public function testInstallThemeWithMetModuleDependencies() {
+ public function testInstallThemeWithMetModuleDependencies(): void {
$name = 'test_theme_depending_on_modules';
$themes = $this->themeHandler()->listInfo();
$this->assertArrayNotHasKey($name, $themes);
@@ -254,7 +254,7 @@ class ThemeInstallerTest extends KernelTestBase {
/**
* Tests uninstalling the default theme.
*/
- public function testUninstallDefault() {
+ public function testUninstallDefault(): void {
$name = 'stark';
$other_name = 'olivero';
$this->themeInstaller()->install([$name, $other_name]);
@@ -281,7 +281,7 @@ class ThemeInstallerTest extends KernelTestBase {
/**
* Tests uninstalling the admin theme.
*/
- public function testUninstallAdmin() {
+ public function testUninstallAdmin(): void {
$name = 'stark';
$other_name = 'olivero';
$this->themeInstaller()->install([$name, $other_name]);
@@ -308,7 +308,7 @@ class ThemeInstallerTest extends KernelTestBase {
/**
* Tests uninstalling a sub-theme.
*/
- public function testUninstallSubTheme() {
+ public function testUninstallSubTheme(): void {
$name = 'test_subtheme';
$base_name = 'test_basetheme';
@@ -323,7 +323,7 @@ class ThemeInstallerTest extends KernelTestBase {
/**
* Tests uninstalling a base theme before its sub-theme.
*/
- public function testUninstallBaseBeforeSubTheme() {
+ public function testUninstallBaseBeforeSubTheme(): void {
$name = 'test_basetheme';
$sub_name = 'test_subtheme';
@@ -353,7 +353,7 @@ class ThemeInstallerTest extends KernelTestBase {
/**
* Tests uninstalling a non-existing theme.
*/
- public function testUninstallNonExisting() {
+ public function testUninstallNonExisting(): void {
$name = 'non_existing_theme';
$themes = $this->themeHandler()->listInfo();
@@ -366,7 +366,7 @@ class ThemeInstallerTest extends KernelTestBase {
/**
* Tests uninstalling a theme.
*/
- public function testUninstall() {
+ public function testUninstall(): void {
$name = 'test_basetheme';
$this->themeInstaller()->install([$name]);
@@ -389,7 +389,7 @@ class ThemeInstallerTest extends KernelTestBase {
/**
* Tests uninstalling a theme that is not installed.
*/
- public function testUninstallNotInstalled() {
+ public function testUninstallNotInstalled(): void {
$name = 'test_basetheme';
$themes = $this->themeHandler()->listInfo();
@@ -403,7 +403,7 @@ class ThemeInstallerTest extends KernelTestBase {
*
* @see module_test_system_info_alter()
*/
- public function testThemeInfoAlter() {
+ public function testThemeInfoAlter(): void {
$name = 'stark';
$this->container->get('state')->set('module_test.hook_system_info_alter', TRUE);
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/ThemeSettingsTest.php b/core/tests/Drupal/KernelTests/Core/Theme/ThemeSettingsTest.php
index 00c2220fd2d..1e7613e33a9 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/ThemeSettingsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/ThemeSettingsTest.php
@@ -46,7 +46,7 @@ class ThemeSettingsTest extends KernelTestBase {
/**
* Tests that $theme.settings are imported and used as default theme settings.
*/
- public function testDefaultConfig() {
+ public function testDefaultConfig(): void {
$name = 'test_basetheme';
$path = $this->availableThemes[$name]->getPath();
$this->assertFileExists("$path/" . InstallStorage::CONFIG_INSTALL_DIRECTORY . "/$name.settings.yml");
@@ -57,7 +57,7 @@ class ThemeSettingsTest extends KernelTestBase {
/**
* Tests that the $theme.settings default config file is optional.
*/
- public function testNoDefaultConfig() {
+ public function testNoDefaultConfig(): void {
$name = 'stark';
$path = $this->availableThemes[$name]->getPath();
$this->assertFileDoesNotExist("$path/" . InstallStorage::CONFIG_INSTALL_DIRECTORY . "/$name.settings.yml");
@@ -68,7 +68,7 @@ class ThemeSettingsTest extends KernelTestBase {
/**
* Tests that the default logo config can be overridden.
*/
- public function testLogoConfig() {
+ public function testLogoConfig(): void {
/** @var \Drupal\Core\Extension\ThemeInstallerInterface $theme_installer */
$theme_installer = $this->container->get('theme_installer');
$theme_installer->install(['stark']);
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php b/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php
index fe5bf4eaba3..1552dc39a01 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php
@@ -33,7 +33,7 @@ class TwigEnvironmentTest extends KernelTestBase {
/**
* Tests inline templates.
*/
- public function testInlineTemplate() {
+ public function testInlineTemplate(): void {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
/** @var \Drupal\Core\Template\TwigEnvironment $environment */
@@ -103,7 +103,7 @@ class TwigEnvironmentTest extends KernelTestBase {
/**
* Tests that exceptions are thrown when a template is not found.
*/
- public function testTemplateNotFoundException() {
+ public function testTemplateNotFoundException(): void {
/** @var \Drupal\Core\Template\TwigEnvironment $environment */
$environment = \Drupal::service('twig');
@@ -119,7 +119,7 @@ class TwigEnvironmentTest extends KernelTestBase {
/**
* Ensures that templates resolve to the same class name and cache file.
*/
- public function testTemplateClassname() {
+ public function testTemplateClassname(): void {
/** @var \Drupal\Core\Template\TwigEnvironment $environment */
$environment = \Drupal::service('twig');
@@ -148,7 +148,7 @@ class TwigEnvironmentTest extends KernelTestBase {
/**
* Ensures that cacheFilename() varies by extensions + deployment identifier.
*/
- public function testCacheFilename() {
+ public function testCacheFilename(): void {
/** @var \Drupal\Core\Template\TwigEnvironment $environment */
// Note: Later we refetch the twig service in order to bypass its internal
// static cache.
@@ -198,7 +198,7 @@ class TwigEnvironmentTest extends KernelTestBase {
/**
* Tests template invalidation.
*/
- public function testTemplateInvalidation() {
+ public function testTemplateInvalidation(): void {
$template_before = <<<TWIG
<div>Hello before</div>
TWIG;
@@ -234,7 +234,7 @@ TWIG;
/**
* Test twig file prefix change.
*/
- public function testTwigFilePrefixChange() {
+ public function testTwigFilePrefixChange(): void {
/** @var \Drupal\Core\Template\TwigEnvironment $environment */
$environment = \Drupal::service('twig');
$cache_prefixes = [];
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/TwigMarkupInterfaceTest.php b/core/tests/Drupal/KernelTests/Core/Theme/TwigMarkupInterfaceTest.php
index b7fb86ff9cf..dbdc813d133 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/TwigMarkupInterfaceTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/TwigMarkupInterfaceTest.php
@@ -33,7 +33,7 @@ class TwigMarkupInterfaceTest extends KernelTestBase {
/**
* @dataProvider providerTestMarkupInterfaceEmpty
*/
- public function testMarkupInterfaceEmpty($expected, $variable) {
+ public function testMarkupInterfaceEmpty($expected, $variable): void {
$this->assertSame($expected, (string) $this->renderObjectWithTwig($variable));
}
@@ -61,7 +61,7 @@ class TwigMarkupInterfaceTest extends KernelTestBase {
/**
* Tests behavior if a string is translated to become an empty string.
*/
- public function testEmptyTranslation() {
+ public function testEmptyTranslation(): void {
$settings = Settings::getAll();
$settings['locale_custom_strings_en'] = ['' => ['test' => '']];
// Recreate the settings static.
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php b/core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php
index c78854623d2..a34dc73edea 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php
@@ -121,7 +121,7 @@ class TwigWhiteListTest extends KernelTestBase {
/**
* Tests white-listing of methods doesn't interfere with chaining.
*/
- public function testWhiteListChaining() {
+ public function testWhiteListChaining(): void {
/** @var \Drupal\Core\Template\TwigEnvironment $environment */
$environment = \Drupal::service('twig');
$node = Node::create([
diff --git a/core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php
index b6a7c0a6ded..acefd78cd72 100644
--- a/core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/TypedData/AllowedValuesConstraintValidatorTest.php
@@ -35,7 +35,7 @@ class AllowedValuesConstraintValidatorTest extends KernelTestBase {
*
* For testing we define an integer with a set of allowed values.
*/
- public function testValidation() {
+ public function testValidation(): void {
// Create a definition that specifies some AllowedValues.
$definition = DataDefinition::create('integer')
->addConstraint('AllowedValues', [1, 2, 3]);
@@ -65,7 +65,7 @@ class AllowedValuesConstraintValidatorTest extends KernelTestBase {
/**
* Tests the AllowedValuesConstraintValidator with callbacks.
*/
- public function testValidationCallback() {
+ public function testValidationCallback(): void {
// Create a definition that specifies some AllowedValues and a callback.
// This tests that callbacks have a higher priority than a supplied list of
// values and can be used to coerce the value to the correct type.
@@ -105,7 +105,7 @@ class AllowedValuesConstraintValidatorTest extends KernelTestBase {
/**
* Tests the AllowedValuesConstraintValidator with an invalid callback.
*/
- public function testValidationCallbackException() {
+ public function testValidationCallbackException(): void {
// Create a definition that specifies some AllowedValues and a callback.
// This tests that callbacks have a higher priority than a supplied list of
// values and can be used to coerce the value to the correct type.
diff --git a/core/tests/Drupal/KernelTests/Core/TypedData/ComplexDataConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/TypedData/ComplexDataConstraintValidatorTest.php
index aade322cddf..17934095205 100644
--- a/core/tests/Drupal/KernelTests/Core/TypedData/ComplexDataConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/TypedData/ComplexDataConstraintValidatorTest.php
@@ -35,7 +35,7 @@ class ComplexDataConstraintValidatorTest extends KernelTestBase {
*
* For testing a map including a constraint on one of its keys is defined.
*/
- public function testValidation() {
+ public function testValidation(): void {
// Create a definition that specifies some ComplexData constraint.
$definition = MapDataDefinition::create()
->setPropertyDefinition('key', DataDefinition::create('integer'))
diff --git a/core/tests/Drupal/KernelTests/Core/TypedData/RecursiveContextualValidatorTest.php b/core/tests/Drupal/KernelTests/Core/TypedData/RecursiveContextualValidatorTest.php
index 6646fb2cc5f..cdc9a3da703 100644
--- a/core/tests/Drupal/KernelTests/Core/TypedData/RecursiveContextualValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/TypedData/RecursiveContextualValidatorTest.php
@@ -35,7 +35,7 @@ class RecursiveContextualValidatorTest extends KernelTestBase {
/**
* Tests recursive validation against given constraints against an entity.
*/
- public function testRecursiveValidate() {
+ public function testRecursiveValidate(): void {
$entity = EntityTest::create();
$adapter = EntityAdapter::createFromEntity($entity);
// This would trigger the ValidReferenceConstraint due to EntityTest
@@ -47,7 +47,7 @@ class RecursiveContextualValidatorTest extends KernelTestBase {
/**
* Tests recursive propagation of violations.
*/
- public function testRecursiveViolationPropagation() {
+ public function testRecursiveViolationPropagation(): void {
// We create an entity reference field with a constraint which will
// trigger the validation of the referenced entities. Then we add a
// required field and populate it only on the parent entity, so that
diff --git a/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataDefinitionTest.php b/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataDefinitionTest.php
index 045ac297379..7c0580ff064 100644
--- a/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataDefinitionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataDefinitionTest.php
@@ -40,7 +40,7 @@ class TypedDataDefinitionTest extends KernelTestBase {
/**
* Tests deriving metadata about list items.
*/
- public function testLists() {
+ public function testLists(): void {
$list_definition = ListDataDefinition::create('string');
$this->assertInstanceOf(ListDataDefinitionInterface::class, $list_definition);
$item_definition = $list_definition->getItemDefinition();
@@ -63,7 +63,7 @@ class TypedDataDefinitionTest extends KernelTestBase {
/**
* Tests deriving metadata about maps.
*/
- public function testMaps() {
+ public function testMaps(): void {
$map_definition = MapDataDefinition::create()
->setPropertyDefinition('one', DataDefinition::create('string'))
->setPropertyDefinition('two', DataDefinition::create('string'))
@@ -89,7 +89,7 @@ class TypedDataDefinitionTest extends KernelTestBase {
/**
* Tests deriving metadata from data references.
*/
- public function testDataReferences() {
+ public function testDataReferences(): void {
$language_reference_definition = DataReferenceDefinition::create('language');
$this->assertInstanceOf(DataReferenceDefinitionInterface::class, $language_reference_definition);
@@ -105,7 +105,7 @@ class TypedDataDefinitionTest extends KernelTestBase {
/**
* Tests getString() throws exception when getType() is not implemented.
*/
- public function testNotImplementedGetType() {
+ public function testNotImplementedGetType(): void {
$language_reference_definition = DataReferenceDefinition::create('language');
$language_reference = $this->typedDataManager->create($language_reference_definition);
$this->assertInstanceOf(DataReferenceInterface::class, $language_reference);
diff --git a/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php b/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php
index bc69a340134..a7048f38eef 100644
--- a/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php
+++ b/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php
@@ -72,7 +72,7 @@ class TypedDataTest extends KernelTestBase {
/**
* Tests the basics around constructing and working with typed data objects.
*/
- public function testGetAndSet() {
+ public function testGetAndSet(): void {
// Boolean type.
$typed_data = $this->createTypedData(['type' => 'boolean'], TRUE);
$this->assertInstanceOf(BooleanInterface::class, $typed_data);
@@ -386,7 +386,7 @@ class TypedDataTest extends KernelTestBase {
/**
* Tests using typed data lists.
*/
- public function testTypedDataLists() {
+ public function testTypedDataLists(): void {
// Test working with an existing list of strings.
$value = ['one', 'two', 'three'];
$typed_data = $this->createTypedData(ListDataDefinition::create('string'), $value);
@@ -465,7 +465,7 @@ class TypedDataTest extends KernelTestBase {
/**
* Tests the filter() method on typed data lists.
*/
- public function testTypedDataListsFilter() {
+ public function testTypedDataListsFilter(): void {
// Check that an all-pass filter leaves the list untouched.
$value = ['zero', 'one'];
$typed_data = $this->createTypedData(ListDataDefinition::create('string'), $value);
@@ -502,7 +502,7 @@ class TypedDataTest extends KernelTestBase {
/**
* Tests using a typed data map.
*/
- public function testTypedDataMaps() {
+ public function testTypedDataMaps(): void {
// Test working with a simple map.
$value = [
'one' => 'eins',
@@ -599,7 +599,7 @@ class TypedDataTest extends KernelTestBase {
/**
* Tests typed data validation.
*/
- public function testTypedDataValidation() {
+ public function testTypedDataValidation(): void {
$definition = DataDefinition::create('integer')
->setConstraints([
'Range' => ['min' => 5],
diff --git a/core/tests/Drupal/KernelTests/Core/Updater/UpdaterTest.php b/core/tests/Drupal/KernelTests/Core/Updater/UpdaterTest.php
index 36d0c858f59..c63b10f8540 100644
--- a/core/tests/Drupal/KernelTests/Core/Updater/UpdaterTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Updater/UpdaterTest.php
@@ -23,7 +23,7 @@ class UpdaterTest extends KernelTestBase {
*
* @see https://drupal.org/node/2409515
*/
- public function testGetProjectTitleWithChild() {
+ public function testGetProjectTitleWithChild(): void {
// Get the project title from its directory. If it can't find the title
// it will choose the first project title in the directory.
$directory = $this->root . '/core/modules/system/tests/modules/module_handler_test_multiple';
diff --git a/core/tests/Drupal/KernelTests/Core/Url/LinkGenerationTest.php b/core/tests/Drupal/KernelTests/Core/Url/LinkGenerationTest.php
index fb81a8018a0..395bf9055e8 100644
--- a/core/tests/Drupal/KernelTests/Core/Url/LinkGenerationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Url/LinkGenerationTest.php
@@ -21,7 +21,7 @@ class LinkGenerationTest extends KernelTestBase {
/**
* Tests how hook_link_alter() can affect escaping of the link text.
*/
- public function testHookLinkAlter() {
+ public function testHookLinkAlter(): void {
$url = Url::fromUri('http://example.com');
$renderer = \Drupal::service('renderer');
diff --git a/core/tests/Drupal/KernelTests/Core/Validation/ConstraintFactoryTest.php b/core/tests/Drupal/KernelTests/Core/Validation/ConstraintFactoryTest.php
index 3b9326814a4..626f304f7b2 100644
--- a/core/tests/Drupal/KernelTests/Core/Validation/ConstraintFactoryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Validation/ConstraintFactoryTest.php
@@ -24,7 +24,7 @@ class ConstraintFactoryTest extends KernelTestBase {
/**
* @covers ::createInstance
*/
- public function testCreateInstance() {
+ public function testCreateInstance(): void {
$constraint_manager = \Drupal::typedDataManager()->getValidationConstraintManager();
// If the plugin is a \Symfony\Component\Validator\Constraint, they will be
diff --git a/core/tests/Drupal/KernelTests/Core/Validation/ConstraintsTest.php b/core/tests/Drupal/KernelTests/Core/Validation/ConstraintsTest.php
index 7caeadd50a4..7eec6908d60 100644
--- a/core/tests/Drupal/KernelTests/Core/Validation/ConstraintsTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Validation/ConstraintsTest.php
@@ -30,7 +30,7 @@ class ConstraintsTest extends KernelTestBase {
/**
* @see \Drupal\Core\Validation\Plugin\Validation\Constraint\UuidConstraint
*/
- public function testUuid() {
+ public function testUuid(): void {
$typed_config_manager = \Drupal::service('config.typed');
/** @var \Drupal\Core\Config\Schema\TypedConfigInterface $typed_config */
$typed_config = $typed_config_manager->get('config_test.validation');
diff --git a/core/tests/Drupal/KernelTests/Core/Validation/UniqueFieldConstraintTest.php b/core/tests/Drupal/KernelTests/Core/Validation/UniqueFieldConstraintTest.php
index 22adbfbe19e..1bf767970b2 100644
--- a/core/tests/Drupal/KernelTests/Core/Validation/UniqueFieldConstraintTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Validation/UniqueFieldConstraintTest.php
@@ -33,7 +33,7 @@ class UniqueFieldConstraintTest extends KernelTestBase {
*
* @covers ::validate
*/
- public function testEntityWithStringId() {
+ public function testEntityWithStringId(): void {
$this->installEntitySchema('entity_test_string_id');
EntityTestStringId::create([
@@ -69,7 +69,7 @@ class UniqueFieldConstraintTest extends KernelTestBase {
*
* @dataProvider providerTestEntityWithStringIdWithViolation
*/
- public function testEntityWithStringIdWithViolation($id) {
+ public function testEntityWithStringIdWithViolation($id): void {
$this->installEntitySchema('entity_test_string_id');
$value = $this->randomString();
@@ -124,7 +124,7 @@ class UniqueFieldConstraintTest extends KernelTestBase {
*
* @covers ::validate
*/
- public function testViolationDespiteNoAccess() {
+ public function testViolationDespiteNoAccess(): void {
$this->installEntitySchema('entity_test');
// Create and save an entity with a given field value in the field that has
diff --git a/core/tests/Drupal/KernelTests/Core/Validation/UniqueValuesConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/Validation/UniqueValuesConstraintValidatorTest.php
index 304fa191cdb..78cfaea2fc3 100644
--- a/core/tests/Drupal/KernelTests/Core/Validation/UniqueValuesConstraintValidatorTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Validation/UniqueValuesConstraintValidatorTest.php
@@ -47,7 +47,7 @@ class UniqueValuesConstraintValidatorTest extends KernelTestBase {
*
* @covers ::validate
*/
- public function testValidation() {
+ public function testValidation(): void {
// Create entity with two values for the testing field.
$definition = [
'id' => (int) rand(0, getrandmax()),
@@ -114,7 +114,7 @@ class UniqueValuesConstraintValidatorTest extends KernelTestBase {
*
* @covers ::validate
*/
- public function testValidationReference() {
+ public function testValidationReference(): void {
$users = [];
for ($i = 0; $i <= 5; $i++) {
@@ -190,7 +190,7 @@ class UniqueValuesConstraintValidatorTest extends KernelTestBase {
*
* @covers ::validate
*/
- public function testValidationOwn() {
+ public function testValidationOwn(): void {
// Create new entity with two identical values for the testing field.
$definition = [
'user_id' => 0,
@@ -238,7 +238,7 @@ class UniqueValuesConstraintValidatorTest extends KernelTestBase {
*
* @covers ::validate
*/
- public function testValidationMultiple() {
+ public function testValidationMultiple(): void {
// Create entity with two different values for the testing field.
$definition = [
'user_id' => 0,
diff --git a/core/tests/Drupal/KernelTests/KernelTestBaseShutdownTest.php b/core/tests/Drupal/KernelTests/KernelTestBaseShutdownTest.php
index 570d3f8c4cc..4b99b24b1aa 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBaseShutdownTest.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBaseShutdownTest.php
@@ -39,7 +39,7 @@ class KernelTestBaseShutdownTest extends KernelTestBase {
/**
* @covers ::assertPostConditions
*/
- public function testShutdownFunction() {
+ public function testShutdownFunction(): void {
$this->expectedShutdownCalled = ['shutdownFunction', 'shutdownFunction2'];
drupal_register_shutdown_function([$this, 'shutdownFunction']);
}
@@ -47,7 +47,7 @@ class KernelTestBaseShutdownTest extends KernelTestBase {
/**
* @covers ::assertPostConditions
*/
- public function testNoShutdownFunction() {
+ public function testNoShutdownFunction(): void {
$this->expectedShutdownCalled = [];
}
diff --git a/core/tests/Drupal/KernelTests/KernelTestBaseTest.php b/core/tests/Drupal/KernelTests/KernelTestBaseTest.php
index 55c27fa4c0c..add76e05fbc 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBaseTest.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBaseTest.php
@@ -25,7 +25,7 @@ class KernelTestBaseTest extends KernelTestBase {
/**
* @covers ::setUpBeforeClass
*/
- public function testSetUpBeforeClass() {
+ public function testSetUpBeforeClass(): void {
// Note: PHPUnit automatically restores the original working directory.
$this->assertSame(realpath(__DIR__ . '/../../../../'), getcwd());
}
@@ -33,7 +33,7 @@ class KernelTestBaseTest extends KernelTestBase {
/**
* @covers ::bootEnvironment
*/
- public function testBootEnvironment() {
+ public function testBootEnvironment(): void {
$this->assertMatchesRegularExpression('/^test\d{8}$/', $this->databasePrefix);
$this->assertStringStartsWith('vfs://root/sites/simpletest/', $this->siteDirectory);
$this->assertEquals([
@@ -56,7 +56,7 @@ class KernelTestBaseTest extends KernelTestBase {
/**
* @covers ::getDatabaseConnectionInfo
*/
- public function testGetDatabaseConnectionInfoWithOutManualSetDbUrl() {
+ public function testGetDatabaseConnectionInfoWithOutManualSetDbUrl(): void {
$options = $this->container->get('database')->getConnectionOptions();
$this->assertSame($this->databasePrefix, $options['prefix']);
}
@@ -64,7 +64,7 @@ class KernelTestBaseTest extends KernelTestBase {
/**
* @covers ::setUp
*/
- public function testSetUp() {
+ public function testSetUp(): void {
$this->assertTrue($this->container->has('request_stack'));
$this->assertTrue($this->container->initialized('request_stack'));
$request = $this->container->get('request_stack')->getCurrentRequest();
@@ -94,7 +94,7 @@ class KernelTestBaseTest extends KernelTestBase {
* @covers ::setUp
* @depends testSetUp
*/
- public function testSetUpDoesNotLeak() {
+ public function testSetUpDoesNotLeak(): void {
// Ensure that we have a different database prefix.
$schema = $this->container->get('database')->schema();
$this->assertFalse($schema->tableExists('foo'));
@@ -103,7 +103,7 @@ class KernelTestBaseTest extends KernelTestBase {
/**
* @covers ::register
*/
- public function testRegister() {
+ public function testRegister(): void {
// Verify that this container is identical to the actual container.
$this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerInterface', $this->container);
$this->assertSame($this->container, \Drupal::getContainer());
@@ -142,7 +142,7 @@ class KernelTestBaseTest extends KernelTestBase {
*
* @see ::testSubsequentContainerIsolation()
*/
- public function testContainerIsolation() {
+ public function testContainerIsolation(): void {
$this->enableModules(['system', 'user']);
$this->assertNull($this->installConfig('user'));
}
@@ -152,7 +152,7 @@ class KernelTestBaseTest extends KernelTestBase {
*
* @depends testContainerIsolation
*/
- public function testSubsequentContainerIsolation() {
+ public function testSubsequentContainerIsolation(): void {
$this->enableModules(['system', 'user']);
$this->assertNull($this->installConfig('user'));
}
@@ -160,7 +160,7 @@ class KernelTestBaseTest extends KernelTestBase {
/**
* Tests that an outbound HTTP request can be performed inside of a test.
*/
- public function testOutboundHttpRequest() {
+ public function testOutboundHttpRequest(): void {
// The middleware test.http_client.middleware calls drupal_generate_test_ua
// which checks the DRUPAL_TEST_IN_CHILD_SITE constant, that is not defined
// in Kernel tests.
@@ -178,7 +178,7 @@ class KernelTestBaseTest extends KernelTestBase {
/**
* @covers ::render
*/
- public function testRender() {
+ public function testRender(): void {
$type = 'processed_text';
$element_info = $this->container->get('element_info');
$this->assertSame(['#defaults_loaded' => TRUE], $element_info->getInfo($type));
@@ -206,7 +206,7 @@ class KernelTestBaseTest extends KernelTestBase {
/**
* @covers ::render
*/
- public function testRenderWithTheme() {
+ public function testRenderWithTheme(): void {
$this->enableModules(['system']);
$build = [
@@ -226,7 +226,7 @@ class KernelTestBaseTest extends KernelTestBase {
/**
* @covers ::bootKernel
*/
- public function testBootKernel() {
+ public function testBootKernel(): void {
$this->assertNull($this->container->get('request_stack')->getParentRequest(), 'There should only be one request on the stack');
$this->assertEquals('public', \Drupal::config('system.file')->get('default_scheme'));
}
@@ -250,7 +250,7 @@ class KernelTestBaseTest extends KernelTestBase {
/**
* Tests the assumption that local time is in 'Australia/Sydney'.
*/
- public function testLocalTimeZone() {
+ public function testLocalTimeZone(): void {
// The 'Australia/Sydney' time zone is set in core/tests/bootstrap.php
$this->assertEquals('Australia/Sydney', date_default_timezone_get());
}
@@ -284,7 +284,7 @@ class KernelTestBaseTest extends KernelTestBase {
/**
* Ensures KernelTestBase tests can access modules in profiles.
*/
- public function testProfileModules() {
+ public function testProfileModules(): void {
$this->assertFileExists('core/profiles/demo_umami/modules/demo_umami_content/demo_umami_content.info.yml');
$this->assertSame(
'core/profiles/demo_umami/modules/demo_umami_content/demo_umami_content.info.yml',
@@ -295,7 +295,7 @@ class KernelTestBaseTest extends KernelTestBase {
/**
* Tests the dump() function provided by the var-dumper Symfony component.
*/
- public function testVarDump() {
+ public function testVarDump(): void {
// Append the stream capturer to the STDERR stream, so that we can test the
// dump() output and also prevent it from actually outputting in this
// particular test.
@@ -315,7 +315,7 @@ class KernelTestBaseTest extends KernelTestBase {
/**
* @covers ::bootEnvironment
*/
- public function testDatabaseDriverModuleEnabled() {
+ public function testDatabaseDriverModuleEnabled(): void {
$module = Database::getConnection()->getProvider();
// Test that the module that is providing the database driver is enabled.
diff --git a/core/tests/Drupal/KernelTests/RequestProcessing/RedirectOnExceptionTest.php b/core/tests/Drupal/KernelTests/RequestProcessing/RedirectOnExceptionTest.php
index c9caef6ea7e..6eb25fc0ad2 100644
--- a/core/tests/Drupal/KernelTests/RequestProcessing/RedirectOnExceptionTest.php
+++ b/core/tests/Drupal/KernelTests/RequestProcessing/RedirectOnExceptionTest.php
@@ -20,7 +20,7 @@ class RedirectOnExceptionTest extends KernelTestBase {
*/
protected static $modules = ['system', 'test_page_test'];
- public function testRedirectOn404() {
+ public function testRedirectOn404(): void {
\Drupal::configFactory()->getEditable('system.site')
->set('page.404', '/test-http-response-exception/' . Response::HTTP_PERMANENTLY_REDIRECT)
->save();
diff --git a/core/tests/Drupal/Tests/CSpell/SortTest.php b/core/tests/Drupal/Tests/CSpell/SortTest.php
index 1b55eb542ce..be073955fbb 100644
--- a/core/tests/Drupal/Tests/CSpell/SortTest.php
+++ b/core/tests/Drupal/Tests/CSpell/SortTest.php
@@ -28,14 +28,14 @@ class SortTest extends TestCase {
/**
* Tests that the file exists.
*/
- public function testFileExists() {
+ public function testFileExists(): void {
$this->assertFileExists($this->filePath);
}
/**
* Tests that the file is properly sorted.
*/
- public function testSorted() {
+ public function testSorted(): void {
$content = file_get_contents($this->filePath);
$this->assertIsString($content);
$current_dictionary = explode("\n", rtrim($content));
diff --git a/core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryCachedTest.php b/core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryCachedTest.php
index 944f479a7cd..07a9fab674f 100644
--- a/core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryCachedTest.php
+++ b/core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryCachedTest.php
@@ -32,7 +32,7 @@ class AnnotatedClassDiscoveryCachedTest extends TestCase {
*
* @covers ::getDefinitions
*/
- public function testGetDefinitions() {
+ public function testGetDefinitions(): void {
// Path to the classes which we'll discover and parse annotation.
$discovery_path = __DIR__ . '/Fixtures';
// File path that should be discovered within that directory.
diff --git a/core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryTest.php b/core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryTest.php
index 97e1a6bec50..a83d030b2af 100644
--- a/core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryTest.php
+++ b/core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryTest.php
@@ -31,7 +31,7 @@ class AnnotatedClassDiscoveryTest extends TestCase {
* @covers ::__construct
* @covers ::getPluginNamespaces
*/
- public function testGetPluginNamespaces() {
+ public function testGetPluginNamespaces(): void {
$discovery = new AnnotatedClassDiscovery(['com/example' => [__DIR__]]);
$reflection = new \ReflectionMethod($discovery, 'getPluginNamespaces');
@@ -44,7 +44,7 @@ class AnnotatedClassDiscoveryTest extends TestCase {
* @covers ::prepareAnnotationDefinition
* @covers ::getAnnotationReader
*/
- public function testGetDefinitions() {
+ public function testGetDefinitions(): void {
$discovery = new AnnotatedClassDiscovery(['com\example' => [__DIR__ . '/Fixtures']]);
$this->assertEquals([
'discovery_test_1' => [
diff --git a/core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.php b/core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.php
index 28824ecb5d9..80f3b31f82b 100644
--- a/core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.php
+++ b/core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.php
@@ -17,7 +17,7 @@ class AnnotationBaseTest extends TestCase {
* @covers ::getProvider
* @covers ::setProvider
*/
- public function testSetProvider() {
+ public function testSetProvider(): void {
$plugin = new AnnotationBaseStub();
$plugin->setProvider('example');
$this->assertEquals('example', $plugin->getProvider());
@@ -26,7 +26,7 @@ class AnnotationBaseTest extends TestCase {
/**
* @covers ::getId
*/
- public function testGetId() {
+ public function testGetId(): void {
$plugin = new AnnotationBaseStub();
// Doctrine sets the public prop directly.
$plugin->id = 'example';
@@ -37,7 +37,7 @@ class AnnotationBaseTest extends TestCase {
* @covers ::getClass
* @covers ::setClass
*/
- public function testSetClass() {
+ public function testSetClass(): void {
$plugin = new AnnotationBaseStub();
$plugin->setClass('example');
$this->assertEquals('example', $plugin->getClass());
diff --git a/core/tests/Drupal/Tests/Component/Annotation/DocParserIgnoredClassesTest.php b/core/tests/Drupal/Tests/Component/Annotation/DocParserIgnoredClassesTest.php
index 7ef3f2638a6..c211193d1fd 100644
--- a/core/tests/Drupal/Tests/Component/Annotation/DocParserIgnoredClassesTest.php
+++ b/core/tests/Drupal/Tests/Component/Annotation/DocParserIgnoredClassesTest.php
@@ -20,7 +20,7 @@ class DocParserIgnoredClassesTest extends TestCase {
* Drupal's DocParser should never use class_exists() on an ignored
* annotation, including cases where namespaces are set.
*/
- public function testIgnoredAnnotationSkippedBeforeReflection() {
+ public function testIgnoredAnnotationSkippedBeforeReflection(): void {
$annotation = 'neverReflectThis';
$parser = new DocParser();
$parser->setIgnoredAnnotationNames([$annotation => TRUE]);
diff --git a/core/tests/Drupal/Tests/Component/Annotation/MockFileFinderTest.php b/core/tests/Drupal/Tests/Component/Annotation/MockFileFinderTest.php
index be571a20584..6511a2c980c 100644
--- a/core/tests/Drupal/Tests/Component/Annotation/MockFileFinderTest.php
+++ b/core/tests/Drupal/Tests/Component/Annotation/MockFileFinderTest.php
@@ -17,7 +17,7 @@ class MockFileFinderTest extends TestCase {
* @covers ::create
* @covers ::findFile
*/
- public function testFindFile() {
+ public function testFindFile(): void {
$tmp = MockFileFinder::create('test_filename.txt');
$this->assertEquals('test_filename.txt', $tmp->findFile('n/a'));
$this->assertEquals('test_filename.txt', $tmp->findFile('SomeClass'));
diff --git a/core/tests/Drupal/Tests/Component/Annotation/Plugin/Discovery/AnnotationBridgeDecoratorTest.php b/core/tests/Drupal/Tests/Component/Annotation/Plugin/Discovery/AnnotationBridgeDecoratorTest.php
index d4fbd465c76..ab59964f339 100644
--- a/core/tests/Drupal/Tests/Component/Annotation/Plugin/Discovery/AnnotationBridgeDecoratorTest.php
+++ b/core/tests/Drupal/Tests/Component/Annotation/Plugin/Discovery/AnnotationBridgeDecoratorTest.php
@@ -22,7 +22,7 @@ class AnnotationBridgeDecoratorTest extends TestCase {
/**
* @covers ::getDefinitions
*/
- public function testGetDefinitions() {
+ public function testGetDefinitions(): void {
$definitions = [];
$definitions['object'] = new ObjectDefinition(['id' => 'foo']);
$definitions['array'] = ['id' => 'bar'];
diff --git a/core/tests/Drupal/Tests/Component/Annotation/PluginIdTest.php b/core/tests/Drupal/Tests/Component/Annotation/PluginIdTest.php
index b0795460543..17fb399a726 100644
--- a/core/tests/Drupal/Tests/Component/Annotation/PluginIdTest.php
+++ b/core/tests/Drupal/Tests/Component/Annotation/PluginIdTest.php
@@ -16,7 +16,7 @@ class PluginIdTest extends TestCase {
/**
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
// Assert plugin starts empty.
$plugin = new PluginID();
$this->assertEquals([
@@ -39,7 +39,7 @@ class PluginIdTest extends TestCase {
/**
* @covers ::getId
*/
- public function testGetId() {
+ public function testGetId(): void {
$plugin = new PluginID();
$plugin->value = 'example';
$this->assertEquals('example', $plugin->getId());
diff --git a/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php b/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php
index 5c106d70a5b..a2b6ce7086d 100644
--- a/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php
+++ b/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php
@@ -18,7 +18,7 @@ class PluginTest extends TestCase {
* @covers ::parse
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
// Assert all values are accepted through constructor and default value is
// used for non existent but defined property.
$plugin = new PluginStub([
@@ -53,7 +53,7 @@ class PluginTest extends TestCase {
/**
* @covers ::getProvider
*/
- public function testGetProvider() {
+ public function testGetProvider(): void {
$plugin = new Plugin(['provider' => 'example']);
$this->assertEquals('example', $plugin->getProvider());
}
@@ -61,7 +61,7 @@ class PluginTest extends TestCase {
/**
* @covers ::setProvider
*/
- public function testSetProvider() {
+ public function testSetProvider(): void {
$plugin = new Plugin([]);
$plugin->setProvider('example');
$this->assertEquals('example', $plugin->getProvider());
@@ -70,7 +70,7 @@ class PluginTest extends TestCase {
/**
* @covers ::getId
*/
- public function testGetId() {
+ public function testGetId(): void {
$plugin = new Plugin(['id' => 'example']);
$this->assertEquals('example', $plugin->getId());
}
@@ -78,7 +78,7 @@ class PluginTest extends TestCase {
/**
* @covers ::getClass
*/
- public function testGetClass() {
+ public function testGetClass(): void {
$plugin = new Plugin(['class' => 'example']);
$this->assertEquals('example', $plugin->getClass());
}
@@ -86,7 +86,7 @@ class PluginTest extends TestCase {
/**
* @covers ::setClass
*/
- public function testSetClass() {
+ public function testSetClass(): void {
$plugin = new Plugin([]);
$plugin->setClass('example');
$this->assertEquals('example', $plugin->getClass());
diff --git a/core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php b/core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php
index a5e1c570516..0d3f5d221a3 100644
--- a/core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php
+++ b/core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php
@@ -22,7 +22,7 @@ class InspectorTest extends TestCase {
* @covers ::assertAllStrings
* @dataProvider providerTestAssertAllStrings
*/
- public function testAssertAllStrings($input, $expected) {
+ public function testAssertAllStrings($input, $expected): void {
$this->assertSame($expected, Inspector::assertAllStrings($input));
}
@@ -57,7 +57,7 @@ class InspectorTest extends TestCase {
*
* @covers ::assertAllStringable
*/
- public function testAssertAllStringable() {
+ public function testAssertAllStringable(): void {
$this->assertTrue(Inspector::assertAllStringable([]));
$this->assertTrue(Inspector::assertAllStringable(['foo', 'bar']));
$this->assertFalse(Inspector::assertAllStringable('foo'));
@@ -69,7 +69,7 @@ class InspectorTest extends TestCase {
*
* @covers ::assertAllArrays
*/
- public function testAssertAllArrays() {
+ public function testAssertAllArrays(): void {
$this->assertTrue(Inspector::assertAllArrays([]));
$this->assertTrue(Inspector::assertAllArrays([[], []]));
$this->assertFalse(Inspector::assertAllArrays([[], 'foo']));
@@ -80,7 +80,7 @@ class InspectorTest extends TestCase {
*
* @covers ::assertStrictArray
*/
- public function testAssertStrictArray() {
+ public function testAssertStrictArray(): void {
$this->assertTrue(Inspector::assertStrictArray([]));
$this->assertTrue(Inspector::assertStrictArray(['bar', 'foo']));
$this->assertFalse(Inspector::assertStrictArray(['foo' => 'bar', 'bar' => 'foo']));
@@ -91,7 +91,7 @@ class InspectorTest extends TestCase {
*
* @covers ::assertAllStrictArrays
*/
- public function testAssertAllStrictArrays() {
+ public function testAssertAllStrictArrays(): void {
$this->assertTrue(Inspector::assertAllStrictArrays([]));
$this->assertTrue(Inspector::assertAllStrictArrays([[], []]));
$this->assertFalse(Inspector::assertAllStrictArrays([['foo' => 'bar', 'bar' => 'foo']]));
@@ -102,7 +102,7 @@ class InspectorTest extends TestCase {
*
* @covers ::assertAllHaveKey
*/
- public function testAssertAllHaveKey() {
+ public function testAssertAllHaveKey(): void {
$this->assertTrue(Inspector::assertAllHaveKey([]));
$this->assertTrue(Inspector::assertAllHaveKey([['foo' => 'bar', 'bar' => 'foo']]));
$this->assertTrue(Inspector::assertAllHaveKey([['foo' => 'bar', 'bar' => 'foo']], 'foo'));
@@ -115,7 +115,7 @@ class InspectorTest extends TestCase {
*
* @covers ::assertAllIntegers
*/
- public function testAssertAllIntegers() {
+ public function testAssertAllIntegers(): void {
$this->assertTrue(Inspector::assertAllIntegers([]));
$this->assertTrue(Inspector::assertAllIntegers([1, 2, 3]));
$this->assertFalse(Inspector::assertAllIntegers([1, 2, 3.14]));
@@ -127,7 +127,7 @@ class InspectorTest extends TestCase {
*
* @covers ::assertAllFloat
*/
- public function testAssertAllFloat() {
+ public function testAssertAllFloat(): void {
$this->assertTrue(Inspector::assertAllFloat([]));
$this->assertTrue(Inspector::assertAllFloat([1.0, 2.1, 3.14]));
$this->assertFalse(Inspector::assertAllFloat([1, 2.1, 3.14]));
@@ -140,7 +140,7 @@ class InspectorTest extends TestCase {
*
* @covers ::assertAllCallable
*/
- public function testAllCallable() {
+ public function testAllCallable(): void {
$this->assertTrue(Inspector::assertAllCallable([
'strchr',
[$this, 'callMe'],
@@ -166,7 +166,7 @@ class InspectorTest extends TestCase {
*
* @covers ::assertAllNotEmpty
*/
- public function testAllNotEmpty() {
+ public function testAllNotEmpty(): void {
$this->assertTrue(Inspector::assertAllNotEmpty([1, 'two']));
$this->assertFalse(Inspector::assertAllNotEmpty(['']));
}
@@ -176,7 +176,7 @@ class InspectorTest extends TestCase {
*
* @covers ::assertAllNumeric
*/
- public function testAssertAllNumeric() {
+ public function testAssertAllNumeric(): void {
$this->assertTrue(Inspector::assertAllNumeric([1, '2', 3.14]));
$this->assertFalse(Inspector::assertAllNumeric([1, 'two', 3.14]));
}
@@ -186,7 +186,7 @@ class InspectorTest extends TestCase {
*
* @covers ::assertAllMatch
*/
- public function testAssertAllMatch() {
+ public function testAssertAllMatch(): void {
$this->assertTrue(Inspector::assertAllMatch('f', ['fee', 'fi', 'fo']));
$this->assertTrue(Inspector::assertAllMatch('F', ['fee', 'fi', 'fo']));
$this->assertTrue(Inspector::assertAllMatch('f', ['fee', 'fi', 'fo'], TRUE));
@@ -200,7 +200,7 @@ class InspectorTest extends TestCase {
*
* @covers ::assertAllRegularExpressionMatch
*/
- public function testAssertAllRegularExpressionMatch() {
+ public function testAssertAllRegularExpressionMatch(): void {
$this->assertTrue(Inspector::assertAllRegularExpressionMatch('/f/i', ['fee', 'fi', 'fo']));
$this->assertTrue(Inspector::assertAllRegularExpressionMatch('/F/i', ['fee', 'fi', 'fo']));
$this->assertTrue(Inspector::assertAllRegularExpressionMatch('/f/', ['fee', 'fi', 'fo']));
@@ -214,7 +214,7 @@ class InspectorTest extends TestCase {
*
* @covers ::assertAllObjects
*/
- public function testAssertAllObjects() {
+ public function testAssertAllObjects(): void {
$this->assertTrue(Inspector::assertAllObjects([new \ArrayObject(), new \ArrayObject()]));
$this->assertFalse(Inspector::assertAllObjects([new \ArrayObject(), new \ArrayObject(), 'foo']));
$this->assertTrue(Inspector::assertAllObjects([new \ArrayObject(), new \ArrayObject()], '\\Traversable'));
diff --git a/core/tests/Drupal/Tests/Component/ClassFinder/ClassFinderTest.php b/core/tests/Drupal/Tests/Component/ClassFinder/ClassFinderTest.php
index c7742e4cd7e..9653180cfa2 100644
--- a/core/tests/Drupal/Tests/Component/ClassFinder/ClassFinderTest.php
+++ b/core/tests/Drupal/Tests/Component/ClassFinder/ClassFinderTest.php
@@ -17,7 +17,7 @@ class ClassFinderTest extends TestCase {
/**
* @covers ::findFile
*/
- public function testFindFile() {
+ public function testFindFile(): void {
$finder = new ClassFinder();
// The full path is returned therefore only tests with
diff --git a/core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php b/core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php
index 99d0b79bdb4..2ae7a736a5c 100644
--- a/core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php
+++ b/core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php
@@ -25,7 +25,7 @@ class DateTimePlusTest extends TestCase {
*
* @dataProvider providerTestDates
*/
- public function testDates($input, $timezone, $expected) {
+ public function testDates($input, $timezone, $expected): void {
$date = new DateTimePlus($input, $timezone);
$value = $date->format('c');
@@ -47,7 +47,7 @@ class DateTimePlusTest extends TestCase {
*
* @dataProvider providerTestDateArrays
*/
- public function testDateArrays($input, $timezone, $expected) {
+ public function testDateArrays($input, $timezone, $expected): void {
$date = DateTimePlus::createFromArray($input, $timezone);
$value = $date->format('c');
@@ -71,7 +71,7 @@ class DateTimePlusTest extends TestCase {
*
* @dataProvider providerTestDateDiff
*/
- public function testDateDiff($input1, $input2, $absolute, \DateInterval $expected) {
+ public function testDateDiff($input1, $input2, $absolute, \DateInterval $expected): void {
$interval = $input1->diff($input2, $absolute);
$this->assertEquals($interval, $expected);
}
@@ -88,7 +88,7 @@ class DateTimePlusTest extends TestCase {
*
* @dataProvider providerTestInvalidDateDiff
*/
- public function testInvalidDateDiff($input1, $input2, $absolute) {
+ public function testInvalidDateDiff($input1, $input2, $absolute): void {
$this->expectException(\BadMethodCallException::class);
$this->expectExceptionMessage('Method Drupal\Component\Datetime\DateTimePlus::diff expects parameter 1 to be a \DateTime or \Drupal\Component\Datetime\DateTimePlus object');
$interval = $input1->diff($input2, $absolute);
@@ -106,7 +106,7 @@ class DateTimePlusTest extends TestCase {
*
* @dataProvider providerTestInvalidDateArrays
*/
- public function testInvalidDateArrays($input, $timezone, $class) {
+ public function testInvalidDateArrays($input, $timezone, $class): void {
$this->expectException($class);
$this->assertInstanceOf(
'\Drupal\Component\DateTimePlus',
@@ -124,7 +124,7 @@ class DateTimePlusTest extends TestCase {
*
* @dataProvider providerTestCheckArray
*/
- public function testCheckArray(array $array, $expected) {
+ public function testCheckArray(array $array, $expected): void {
$this->assertSame(
$expected,
DateTimePlus::checkArray($array)
@@ -159,7 +159,7 @@ class DateTimePlusTest extends TestCase {
*
* @dataProvider providerTestTimestamp
*/
- public function testTimestamp($input, array $initial, array $transform) {
+ public function testTimestamp($input, array $initial, array $transform): void {
// Initialize a new date object.
$date = DateTimePlus::createFromTimestamp($input, $initial['timezone']);
$this->assertDateTimestamp($date, $input, $initial, $transform);
@@ -177,7 +177,7 @@ class DateTimePlusTest extends TestCase {
*
* @dataProvider providerTestDateTimestamp
*/
- public function testDateTimestamp($input, array $initial, array $transform) {
+ public function testDateTimestamp($input, array $initial, array $transform): void {
// Initialize a new date object.
$date = new DateTimePlus($input, $initial['timezone']);
$this->assertDateTimestamp($date, $input, $initial, $transform);
@@ -242,7 +242,7 @@ class DateTimePlusTest extends TestCase {
*
* @dataProvider providerTestDateFormat
*/
- public function testDateFormat($input, $timezone, $format, $format_date, $expected) {
+ public function testDateFormat($input, $timezone, $format, $format_date, $expected): void {
$date = DateTimePlus::createFromFormat($format, $input, $timezone);
$value = $date->format($format_date);
$this->assertEquals($expected, $value, sprintf("Test new DateTimePlus(%s, %s, %s): should be %s, found %s.", $input, $timezone, $format, $expected, $value));
@@ -264,7 +264,7 @@ class DateTimePlusTest extends TestCase {
*
* @dataProvider providerTestInvalidDates
*/
- public function testInvalidDates($input, $timezone, $format, $message, $class) {
+ public function testInvalidDates($input, $timezone, $format, $message, $class): void {
$this->expectException($class);
DateTimePlus::createFromFormat($format, $input, $timezone);
}
@@ -285,7 +285,7 @@ class DateTimePlusTest extends TestCase {
*
* @dataProvider providerTestDateTimezone
*/
- public function testDateTimezone($input, $timezone, $expected_timezone, $message) {
+ public function testDateTimezone($input, $timezone, $expected_timezone, $message): void {
$date = new DateTimePlus($input, $timezone);
$timezone = $date->getTimezone()->getName();
$this->assertEquals($timezone, $expected_timezone, $message);
@@ -296,7 +296,7 @@ class DateTimePlusTest extends TestCase {
*
* But only when the DrupalDateTime is constructed from a datetime object.
*/
- public function testDateTimezoneWithDateTimeObject() {
+ public function testDateTimezoneWithDateTimeObject(): void {
// Create a date object with another date object.
$input = new \DateTime('now', new \DateTimeZone('Pacific/Midway'));
$timezone = NULL;
@@ -757,7 +757,7 @@ class DateTimePlusTest extends TestCase {
*
* @dataProvider providerTestInvalidConstructor
*/
- public function testInvalidConstructor($time, array $errors) {
+ public function testInvalidConstructor($time, array $errors): void {
$date = new DateTimePlus($time);
$this->assertEquals(TRUE, $date->hasErrors());
@@ -837,7 +837,7 @@ class DateTimePlusTest extends TestCase {
/**
* Tests the $settings['validate_format'] parameter in ::createFromFormat().
*/
- public function testValidateFormat() {
+ public function testValidateFormat(): void {
// Check that an input that does not strictly follow the input format will
// produce the desired date. In this case the year string '11' doesn't
// precisely match the 'Y' formatter parameter, but PHP will parse it
@@ -856,7 +856,7 @@ class DateTimePlusTest extends TestCase {
/**
* Tests setting the default time for date-only objects.
*/
- public function testDefaultDateTime() {
+ public function testDefaultDateTime(): void {
$utc = new \DateTimeZone('UTC');
$date = DateTimePlus::createFromFormat('Y-m-d H:i:s', '2017-05-23 22:58:00', $utc);
@@ -870,7 +870,7 @@ class DateTimePlusTest extends TestCase {
*
* @covers ::__call
*/
- public function testChainable() {
+ public function testChainable(): void {
$date = new DateTimePlus('now', 'Australia/Sydney');
$date->setTimestamp(12345678);
@@ -894,7 +894,7 @@ class DateTimePlusTest extends TestCase {
*
* @covers ::__call
*/
- public function testChainableNonChainable() {
+ public function testChainableNonChainable(): void {
$datetime1 = new DateTimePlus('2009-10-11 12:00:00');
$datetime2 = new DateTimePlus('2009-10-13 12:00:00');
$interval = $datetime1->diff($datetime2);
@@ -907,7 +907,7 @@ class DateTimePlusTest extends TestCase {
*
* @covers ::__call
*/
- public function testChainableNonCallable() {
+ public function testChainableNonCallable(): void {
$this->expectException(\BadMethodCallException::class);
$this->expectExceptionMessage('Call to undefined method Drupal\Component\Datetime\DateTimePlus::nonexistent()');
$date = new DateTimePlus('now', 'Australia/Sydney');
@@ -917,7 +917,7 @@ class DateTimePlusTest extends TestCase {
/**
* @covers ::getPhpDateTime
*/
- public function testGetPhpDateTime() {
+ public function testGetPhpDateTime(): void {
$new_york = new \DateTimeZone('America/New_York');
$berlin = new \DateTimeZone('Europe/Berlin');
diff --git a/core/tests/Drupal/Tests/Component/Datetime/TimeTest.php b/core/tests/Drupal/Tests/Component/Datetime/TimeTest.php
index 9291d73f406..f793e3a9460 100644
--- a/core/tests/Drupal/Tests/Component/Datetime/TimeTest.php
+++ b/core/tests/Drupal/Tests/Component/Datetime/TimeTest.php
@@ -49,7 +49,7 @@ class TimeTest extends TestCase {
*
* @covers ::getRequestTime
*/
- public function testGetRequestTime() {
+ public function testGetRequestTime(): void {
$expected = 12345678;
$request = Request::createFromGlobals();
@@ -68,7 +68,7 @@ class TimeTest extends TestCase {
*
* @covers ::getRequestMicroTime
*/
- public function testGetRequestMicroTime() {
+ public function testGetRequestMicroTime(): void {
$expected = 1234567.89;
$request = Request::createFromGlobals();
@@ -85,7 +85,7 @@ class TimeTest extends TestCase {
/**
* @covers ::getRequestTime
*/
- public function testGetRequestTimeNoRequest() {
+ public function testGetRequestTimeNoRequest(): void {
// With no request, and no global variable, we expect to get the int part
// of the microtime.
$expected = 1234567;
@@ -98,7 +98,7 @@ class TimeTest extends TestCase {
/**
* @covers ::getRequestMicroTime
*/
- public function testGetRequestMicroTimeNoRequest() {
+ public function testGetRequestMicroTimeNoRequest(): void {
$expected = 1234567.89;
unset($_SERVER['REQUEST_TIME_FLOAT']);
$this->assertEquals($expected, $this->time->getRequestMicroTime());
@@ -111,7 +111,7 @@ class TimeTest extends TestCase {
*
* @covers ::getCurrentTime
*/
- public function testGetCurrentTime() {
+ public function testGetCurrentTime(): void {
$expected = 12345678;
$this->assertEquals($expected, $this->time->getCurrentTime());
}
@@ -121,7 +121,7 @@ class TimeTest extends TestCase {
*
* @covers ::getCurrentMicroTime
*/
- public function testGetCurrentMicroTime() {
+ public function testGetCurrentMicroTime(): void {
$expected = 1234567.89;
$this->assertEquals($expected, $this->time->getCurrentMicroTime());
}
diff --git a/core/tests/Drupal/Tests/Component/Datetime/TimeWithNoRequestTest.php b/core/tests/Drupal/Tests/Component/Datetime/TimeWithNoRequestTest.php
index 7eaf6e6130f..69bac3cb028 100644
--- a/core/tests/Drupal/Tests/Component/Datetime/TimeWithNoRequestTest.php
+++ b/core/tests/Drupal/Tests/Component/Datetime/TimeWithNoRequestTest.php
@@ -52,7 +52,7 @@ class TimeWithNoRequestTest extends TestCase {
*
* @covers ::getRequestMicroTime
*/
- public function testGetRequestMicroTimeImmutable() {
+ public function testGetRequestMicroTimeImmutable(): void {
$requestTime = $this->time->getRequestMicroTime();
usleep(20000);
$this->assertSame($requestTime, $this->time->getRequestMicroTime());
diff --git a/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php b/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php
index 0e42a0b4e8e..79fcaad7d74 100644
--- a/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php
+++ b/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php
@@ -68,7 +68,7 @@ class ContainerTest extends TestCase {
*
* @covers ::__construct
*/
- public function testConstruct() {
+ public function testConstruct(): void {
$container_definition = $this->getMockContainerDefinition();
$container_definition['machine_format'] = !$this->machineFormat;
$this->expectException(InvalidArgumentException::class);
@@ -80,7 +80,7 @@ class ContainerTest extends TestCase {
*
* @covers ::getParameter
*/
- public function testGetParameter() {
+ public function testGetParameter(): void {
$this->assertEquals($this->containerDefinition['parameters']['some_config'], $this->container->getParameter('some_config'), 'Container parameter matches for %some_config%.');
$this->assertEquals($this->containerDefinition['parameters']['some_other_config'], $this->container->getParameter('some_other_config'), 'Container parameter matches for %some_other_config%.');
}
@@ -92,7 +92,7 @@ class ContainerTest extends TestCase {
* @covers ::getParameterAlternatives
* @covers ::getAlternatives
*/
- public function testGetParameterIfNotFound() {
+ public function testGetParameterIfNotFound(): void {
$this->expectException(ParameterNotFoundException::class);
$this->container->getParameter('parameter_that_does_not_exist');
}
@@ -102,7 +102,7 @@ class ContainerTest extends TestCase {
*
* @covers ::getParameter
*/
- public function testGetParameterIfNotFoundBecauseNull() {
+ public function testGetParameterIfNotFoundBecauseNull(): void {
$this->expectException(ParameterNotFoundException::class);
$this->container->getParameter(NULL);
}
@@ -112,7 +112,7 @@ class ContainerTest extends TestCase {
*
* @covers ::hasParameter
*/
- public function testHasParameter() {
+ public function testHasParameter(): void {
$this->assertTrue($this->container->hasParameter('some_config'), 'Container parameters include %some_config%.');
$this->assertFalse($this->container->hasParameter('some_config_not_exists'), 'Container parameters do not include %some_config_not_exists%.');
}
@@ -122,7 +122,7 @@ class ContainerTest extends TestCase {
*
* @covers ::setParameter
*/
- public function testSetParameterWithUnfrozenContainer() {
+ public function testSetParameterWithUnfrozenContainer(): void {
$container_definition = $this->containerDefinition;
$container_definition['frozen'] = FALSE;
$this->container = new $this->containerClass($container_definition);
@@ -135,7 +135,7 @@ class ContainerTest extends TestCase {
*
* @covers ::setParameter
*/
- public function testSetParameterWithFrozenContainer() {
+ public function testSetParameterWithFrozenContainer(): void {
$this->container = new $this->containerClass($this->containerDefinition);
$this->expectException(LogicException::class);
$this->container->setParameter('some_config', 'new_value');
@@ -147,7 +147,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGet() {
+ public function testGet(): void {
$container = $this->container->get('service_container');
$this->assertSame($this->container, $container, 'Container can be retrieved from itself.');
@@ -174,7 +174,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetForNonSharedService() {
+ public function testGetForNonSharedService(): void {
$service = $this->container->get('non_shared_service');
$service2 = $this->container->get('non_shared_service');
@@ -187,7 +187,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetForClassFromParameter() {
+ public function testGetForClassFromParameter(): void {
$container_definition = $this->containerDefinition;
$container_definition['frozen'] = FALSE;
$container = new $this->containerClass($container_definition);
@@ -202,7 +202,7 @@ class ContainerTest extends TestCase {
*
* @covers ::set
*/
- public function testSet() {
+ public function testSet(): void {
$this->assertNull($this->container->get('new_id', ContainerInterface::NULL_ON_INVALID_REFERENCE));
$mock_service = new MockService();
$this->container->set('new_id', $mock_service);
@@ -215,7 +215,7 @@ class ContainerTest extends TestCase {
*
* @covers ::has
*/
- public function testHas() {
+ public function testHas(): void {
$this->assertTrue($this->container->has('other.service'));
$this->assertFalse($this->container->has('another.service'));
@@ -230,7 +230,7 @@ class ContainerTest extends TestCase {
*
* @covers ::has
*/
- public function testHasForAliasedService() {
+ public function testHasForAliasedService(): void {
$service = $this->container->has('service.provider');
$aliased_service = $this->container->has('service.provider_alias');
$this->assertSame($service, $aliased_service);
@@ -241,7 +241,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetForCircularServices() {
+ public function testGetForCircularServices(): void {
$this->expectException(ServiceCircularReferenceException::class);
$this->container->get('circular_dependency');
}
@@ -254,7 +254,7 @@ class ContainerTest extends TestCase {
* @covers ::getAlternatives
* @covers ::getServiceAlternatives
*/
- public function testGetForNonExistentService() {
+ public function testGetForNonExistentService(): void {
$this->expectException(ServiceNotFoundException::class);
$this->container->get('service_not_exists');
}
@@ -265,7 +265,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetForSerializedServiceDefinition() {
+ public function testGetForSerializedServiceDefinition(): void {
$container_definition = $this->containerDefinition;
$container_definition['services']['other.service'] = serialize($container_definition['services']['other.service']);
$container = new $this->containerClass($container_definition);
@@ -286,7 +286,7 @@ class ContainerTest extends TestCase {
* @covers ::createService
* @covers ::resolveServicesAndParameters
*/
- public function testGetForNonExistentParameterDependency() {
+ public function testGetForNonExistentParameterDependency(): void {
$service = $this->container->get('service_parameter_not_exists', ContainerInterface::NULL_ON_INVALID_REFERENCE);
$this->assertNull($service, 'Service is NULL.');
}
@@ -298,7 +298,7 @@ class ContainerTest extends TestCase {
* @covers ::createService
* @covers ::resolveServicesAndParameters
*/
- public function testGetForParameterDependencyWithExceptionOnSecondCall() {
+ public function testGetForParameterDependencyWithExceptionOnSecondCall(): void {
$service = $this->container->get('service_parameter_not_exists', ContainerInterface::NULL_ON_INVALID_REFERENCE);
$this->assertNull($service, 'Service is NULL.');
@@ -315,7 +315,7 @@ class ContainerTest extends TestCase {
* @covers ::createService
* @covers ::resolveServicesAndParameters
*/
- public function testGetForNonExistentParameterDependencyWithException() {
+ public function testGetForNonExistentParameterDependencyWithException(): void {
$this->expectException(InvalidArgumentException::class);
$this->container->get('service_parameter_not_exists');
}
@@ -327,7 +327,7 @@ class ContainerTest extends TestCase {
* @covers ::createService
* @covers ::resolveServicesAndParameters
*/
- public function testGetForNonExistentServiceDependency() {
+ public function testGetForNonExistentServiceDependency(): void {
$service = $this->container->get('service_dependency_not_exists', ContainerInterface::NULL_ON_INVALID_REFERENCE);
$this->assertNull($service, 'Service is NULL.');
}
@@ -340,7 +340,7 @@ class ContainerTest extends TestCase {
* @covers ::resolveServicesAndParameters
* @covers ::getAlternatives
*/
- public function testGetForNonExistentServiceDependencyWithException() {
+ public function testGetForNonExistentServiceDependencyWithException(): void {
$this->expectException(ServiceNotFoundException::class);
$this->container->get('service_dependency_not_exists');
}
@@ -351,7 +351,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetForNonExistentServiceWhenUsingNull() {
+ public function testGetForNonExistentServiceWhenUsingNull(): void {
$this->assertNull($this->container->get('service_not_exists', ContainerInterface::NULL_ON_INVALID_REFERENCE), 'Not found service does not throw exception.');
}
@@ -360,7 +360,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetForNonExistentNULLService() {
+ public function testGetForNonExistentNULLService(): void {
$this->expectException(ServiceNotFoundException::class);
$this->container->get(NULL);
}
@@ -371,7 +371,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetForNonExistentServiceMultipleTimes() {
+ public function testGetForNonExistentServiceMultipleTimes(): void {
$container = new $this->containerClass();
$this->assertNull($container->get('service_not_exists', ContainerInterface::NULL_ON_INVALID_REFERENCE), 'Not found service does not throw exception.');
@@ -385,7 +385,7 @@ class ContainerTest extends TestCase {
* @covers ::createService
* @covers ::getAlternatives
*/
- public function testGetForNonExistentServiceWithExceptionOnSecondCall() {
+ public function testGetForNonExistentServiceWithExceptionOnSecondCall(): void {
$this->assertNull($this->container->get('service_not_exists', ContainerInterface::NULL_ON_INVALID_REFERENCE), 'Not found service does nto throw exception.');
$this->expectException(ServiceNotFoundException::class);
$this->container->get('service_not_exists');
@@ -397,7 +397,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetForAliasedService() {
+ public function testGetForAliasedService(): void {
$service = $this->container->get('service.provider');
$aliased_service = $this->container->get('service.provider_alias');
$this->assertSame($service, $aliased_service);
@@ -409,7 +409,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetForSyntheticService() {
+ public function testGetForSyntheticService(): void {
$synthetic_service = new \stdClass();
$this->container->set('synthetic', $synthetic_service);
$test_service = $this->container->get('synthetic');
@@ -422,7 +422,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetForSyntheticServiceWithException() {
+ public function testGetForSyntheticServiceWithException(): void {
$this->expectException(RuntimeException::class);
$this->container->get('synthetic');
}
@@ -433,7 +433,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetWithFileInclude() {
+ public function testGetWithFileInclude(): void {
$this->container->get('container_test_file_service_test');
$this->assertTrue(function_exists('container_test_file_service_test_service_function'));
$this->assertEquals('Hello Container', container_test_file_service_test_service_function());
@@ -446,7 +446,7 @@ class ContainerTest extends TestCase {
* @covers ::createService
* @covers ::resolveServicesAndParameters
*/
- public function testGetForInstantiationWithVariousArgumentLengths() {
+ public function testGetForInstantiationWithVariousArgumentLengths(): void {
$args = [];
for ($i = 0; $i < 12; $i++) {
$instantiation_service = $this->container->get('service_test_instantiation_' . $i);
@@ -461,7 +461,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetForWrongFactory() {
+ public function testGetForWrongFactory(): void {
$this->expectException(RuntimeException::class);
$this->container->get('wrong_factory');
}
@@ -472,7 +472,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetForFactoryService() {
+ public function testGetForFactoryService(): void {
$factory_service = $this->container->get('factory_service');
$factory_service_class = $this->container->getParameter('factory_service_class');
$this->assertInstanceOf($factory_service_class, $factory_service);
@@ -484,7 +484,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetForFactoryClass() {
+ public function testGetForFactoryClass(): void {
$service = $this->container->get('service.provider');
$factory_service = $this->container->get('factory_class');
@@ -499,7 +499,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetForConfiguratorWithException() {
+ public function testGetForConfiguratorWithException(): void {
$this->expectException(InvalidArgumentException::class);
$this->container->get('configurable_service_exception');
}
@@ -510,7 +510,7 @@ class ContainerTest extends TestCase {
* @covers ::get
* @covers ::createService
*/
- public function testGetForConfigurator() {
+ public function testGetForConfigurator(): void {
$container = $this->container;
// Setup a configurator.
@@ -534,7 +534,7 @@ class ContainerTest extends TestCase {
* @covers ::createService
* @covers ::resolveServicesAndParameters
*/
- public function testResolveServicesAndParametersForPrivateService() {
+ public function testResolveServicesAndParametersForPrivateService(): void {
$service = $this->container->get('service_using_private');
$private_service = $service->getSomeOtherService();
$this->assertEquals('really_private_lama', $private_service->getSomeParameter(), 'Private was found successfully.');
@@ -553,7 +553,7 @@ class ContainerTest extends TestCase {
* @covers ::createService
* @covers ::resolveServicesAndParameters
*/
- public function testResolveServicesAndParametersForSharedPrivateService() {
+ public function testResolveServicesAndParametersForSharedPrivateService(): void {
$service = $this->container->get('service_using_shared_private');
$private_service = $service->getSomeOtherService();
$this->assertEquals('really_private_lama', $private_service->getSomeParameter(), 'Private was found successfully.');
@@ -572,7 +572,7 @@ class ContainerTest extends TestCase {
* @covers ::createService
* @covers ::resolveServicesAndParameters
*/
- public function testResolveServicesAndParametersForArgumentsUsingDeepArray() {
+ public function testResolveServicesAndParametersForArgumentsUsingDeepArray(): void {
$service = $this->container->get('service_using_array');
$other_service = $this->container->get('other.service');
$this->assertEquals($other_service, $service->getSomeOtherService(), '@other.service was injected via constructor.');
@@ -585,7 +585,7 @@ class ContainerTest extends TestCase {
* @covers ::createService
* @covers ::resolveServicesAndParameters
*/
- public function testResolveServicesAndParametersForOptionalServiceDependencies() {
+ public function testResolveServicesAndParametersForOptionalServiceDependencies(): void {
$service = $this->container->get('service_with_optional_dependency');
$this->assertNull($service->getSomeOtherService(), 'other service was NULL was expected.');
}
@@ -597,7 +597,7 @@ class ContainerTest extends TestCase {
* @covers ::createService
* @covers ::resolveServicesAndParameters
*/
- public function testResolveServicesAndParametersForServiceReferencedViaServiceClosure() {
+ public function testResolveServicesAndParametersForServiceReferencedViaServiceClosure(): void {
$service = $this->container->get('service_within_service_closure');
$other_service = $this->container->get('other.service');
$factory_function = $service->getSomeOtherService();
@@ -612,7 +612,7 @@ class ContainerTest extends TestCase {
* @covers ::createService
* @covers ::resolveServicesAndParameters
*/
- public function testResolveServicesAndParametersForInvalidArgument() {
+ public function testResolveServicesAndParametersForInvalidArgument(): void {
$this->expectException(InvalidArgumentException::class);
$this->container->get('invalid_argument_service');
}
@@ -624,7 +624,7 @@ class ContainerTest extends TestCase {
* @covers ::createService
* @covers ::resolveServicesAndParameters
*/
- public function testResolveServicesAndParametersForInvalidArguments() {
+ public function testResolveServicesAndParametersForInvalidArguments(): void {
// In case the machine-optimized format is not used, we need to simulate the
// test failure.
$this->expectException(InvalidArgumentException::class);
@@ -641,7 +641,7 @@ class ContainerTest extends TestCase {
* @covers ::createService
* @covers ::resolveServicesAndParameters
*/
- public function testResolveServicesAndParametersForServiceInstantiatedFromParameter() {
+ public function testResolveServicesAndParametersForServiceInstantiatedFromParameter(): void {
$service = $this->container->get('service.provider');
$test_service = $this->container->get('service_with_parameter_service');
$this->assertSame($service, $test_service->getSomeOtherService(), 'Service was passed via parameter.');
@@ -652,7 +652,7 @@ class ContainerTest extends TestCase {
*
* @covers ::initialized
*/
- public function testInitialized() {
+ public function testInitialized(): void {
$this->assertFalse($this->container->initialized('late.service'), 'Late service is not initialized.');
$this->container->get('late.service');
$this->assertTrue($this->container->initialized('late.service'), 'Late service is initialized after it was retrieved once.');
@@ -663,7 +663,7 @@ class ContainerTest extends TestCase {
*
* @covers ::initialized
*/
- public function testInitializedForAliases() {
+ public function testInitializedForAliases(): void {
$this->assertFalse($this->container->initialized('late.service_alias'), 'Late service is not initialized.');
$this->container->get('late.service');
$this->assertTrue($this->container->initialized('late.service_alias'), 'Late service is initialized after it was retrieved once.');
@@ -674,7 +674,7 @@ class ContainerTest extends TestCase {
*
* @covers ::getServiceIds
*/
- public function testGetServiceIds() {
+ public function testGetServiceIds(): void {
$service_definition_keys = array_merge(['service_container'], array_keys($this->containerDefinition['services']));
$this->assertEquals($service_definition_keys, $this->container->getServiceIds(), 'Retrieved service IDs match definition.');
@@ -693,14 +693,14 @@ class ContainerTest extends TestCase {
* @covers ::createService
* @covers ::resolveServicesAndParameters
*/
- public function testResolveServicesAndParametersForRawArgument() {
+ public function testResolveServicesAndParametersForRawArgument(): void {
$this->assertEquals(['ccc'], $this->container->get('service_with_raw_argument')->getArguments());
}
/**
* Tests that service iterators are lazily instantiated.
*/
- public function testIterator() {
+ public function testIterator(): void {
$iterator = $this->container->get('service_iterator')->getArguments()[0];
$this->assertIsIterable($iterator);
$this->assertFalse($this->container->initialized('other.service'));
@@ -715,7 +715,7 @@ class ContainerTest extends TestCase {
*
* @covers ::reset
*/
- public function testReset() {
+ public function testReset(): void {
$this->assertFalse($this->container->initialized('late.service'), 'Late service is not initialized.');
$this->container->get('late.service');
$this->assertTrue($this->container->initialized('late.service'), 'Late service is initialized after it was retrieved once.');
diff --git a/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php b/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php
index 1143f59e0b6..5a6f3140afc 100644
--- a/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php
+++ b/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php
@@ -95,7 +95,7 @@ class OptimizedPhpArrayDumperTest extends TestCase {
* @covers ::getArray
* @covers ::supportsMachineFormat
*/
- public function testDumpForEmptyContainer() {
+ public function testDumpForEmptyContainer(): void {
$serialized_definition = $this->dumper->dump();
$this->assertEquals(serialize($this->containerDefinition), $serialized_definition);
}
@@ -107,7 +107,7 @@ class OptimizedPhpArrayDumperTest extends TestCase {
*
* @dataProvider getAliasesDataProvider
*/
- public function testGetAliases($aliases, $definition_aliases) {
+ public function testGetAliases($aliases, $definition_aliases): void {
$this->containerDefinition['aliases'] = $definition_aliases;
$this->containerBuilder->getAliases()->willReturn($aliases);
$this->assertEquals($this->containerDefinition, $this->dumper->getArray(), 'Expected definition matches dump.');
@@ -146,7 +146,7 @@ class OptimizedPhpArrayDumperTest extends TestCase {
*
* @dataProvider getParametersDataProvider
*/
- public function testGetParameters($parameters, $definition_parameters, $is_frozen) {
+ public function testGetParameters($parameters, $definition_parameters, $is_frozen): void {
$this->containerDefinition['parameters'] = $definition_parameters;
$this->containerDefinition['frozen'] = $is_frozen;
@@ -209,7 +209,7 @@ class OptimizedPhpArrayDumperTest extends TestCase {
*
* @dataProvider getDefinitionsDataProvider
*/
- public function testGetServiceDefinitions($services, $definition_services) {
+ public function testGetServiceDefinitions($services, $definition_services): void {
$this->containerDefinition['services'] = $definition_services;
$this->containerBuilder->getDefinitions()->willReturn($services);
@@ -502,7 +502,7 @@ class OptimizedPhpArrayDumperTest extends TestCase {
*
* @dataProvider publicPrivateDataProvider
*/
- public function testGetServiceDefinitionWithReferenceToAlias($public) {
+ public function testGetServiceDefinitionWithReferenceToAlias($public): void {
$bar_definition = new Definition('\stdClass');
$bar_definition_php_array = [
'class' => '\stdClass',
@@ -561,7 +561,7 @@ class OptimizedPhpArrayDumperTest extends TestCase {
*
* @covers ::getServiceDefinition
*/
- public function testGetServiceDefinitionForDecoratedService() {
+ public function testGetServiceDefinitionForDecoratedService(): void {
$bar_definition = new Definition('\stdClass');
$bar_definition->setPublic(TRUE);
$bar_definition->setDecoratedService((string) new Reference('foo'));
@@ -577,7 +577,7 @@ class OptimizedPhpArrayDumperTest extends TestCase {
*
* @covers ::dumpValue
*/
- public function testGetServiceDefinitionForExpression() {
+ public function testGetServiceDefinitionForExpression(): void {
$expression = new Expression('');
$bar_definition = new Definition('\stdClass');
@@ -595,7 +595,7 @@ class OptimizedPhpArrayDumperTest extends TestCase {
*
* @covers ::dumpValue
*/
- public function testGetServiceDefinitionForObject() {
+ public function testGetServiceDefinitionForObject(): void {
$service = new \stdClass();
$bar_definition = new Definition('\stdClass');
@@ -613,7 +613,7 @@ class OptimizedPhpArrayDumperTest extends TestCase {
*
* @covers ::dumpValue
*/
- public function testGetServiceDefinitionForResource() {
+ public function testGetServiceDefinitionForResource(): void {
$resource = fopen('php://memory', 'r');
$bar_definition = new Definition('\stdClass');
@@ -631,7 +631,7 @@ class OptimizedPhpArrayDumperTest extends TestCase {
*
* @dataProvider percentsEscapeProvider
*/
- public function testPercentsEscape($expected, $argument) {
+ public function testPercentsEscape($expected, $argument): void {
$definition = new Definition('\stdClass', [$argument]);
$definition->setPublic(TRUE);
$this->containerBuilder->getDefinitions()->willReturn([
diff --git a/core/tests/Drupal/Tests/Component/Diff/DiffFormatterTest.php b/core/tests/Drupal/Tests/Component/Diff/DiffFormatterTest.php
index 9016dd483f4..696dcb85203 100644
--- a/core/tests/Drupal/Tests/Component/Diff/DiffFormatterTest.php
+++ b/core/tests/Drupal/Tests/Component/Diff/DiffFormatterTest.php
@@ -50,7 +50,7 @@ class DiffFormatterTest extends TestCase {
* @covers ::format
* @dataProvider provideTestDiff
*/
- public function testDiff($expected, $from, $to) {
+ public function testDiff($expected, $from, $to): void {
$diff = new Diff($from, $to);
$formatter = new DiffFormatter();
$output = $formatter->format($diff);
diff --git a/core/tests/Drupal/Tests/Component/Diff/Engine/HWLDFWordAccumulatorTest.php b/core/tests/Drupal/Tests/Component/Diff/Engine/HWLDFWordAccumulatorTest.php
index bcaf935eabd..fecf7d1ed07 100644
--- a/core/tests/Drupal/Tests/Component/Diff/Engine/HWLDFWordAccumulatorTest.php
+++ b/core/tests/Drupal/Tests/Component/Diff/Engine/HWLDFWordAccumulatorTest.php
@@ -25,7 +25,7 @@ class HWLDFWordAccumulatorTest extends TestCase {
*
* @see Drupal\Component\Diff\Engine\HWLDFWordAccumulator::NBSP
*/
- public function testGetLinesEmpty() {
+ public function testGetLinesEmpty(): void {
$acc = new HWLDFWordAccumulator();
$this->assertEquals(['&#160;'], $acc->getLines());
}
@@ -48,7 +48,7 @@ class HWLDFWordAccumulatorTest extends TestCase {
* @covers ::addWords
* @dataProvider provideAddWords
*/
- public function testAddWords($expected, $words, $tag) {
+ public function testAddWords($expected, $words, $tag): void {
$acc = new HWLDFWordAccumulator();
$acc->addWords($words, $tag);
$this->assertEquals($expected, $acc->getLines());
diff --git a/core/tests/Drupal/Tests/Component/Discovery/YamlDirectoryDiscoveryTest.php b/core/tests/Drupal/Tests/Component/Discovery/YamlDirectoryDiscoveryTest.php
index ce8744744c4..c0241d053c1 100644
--- a/core/tests/Drupal/Tests/Component/Discovery/YamlDirectoryDiscoveryTest.php
+++ b/core/tests/Drupal/Tests/Component/Discovery/YamlDirectoryDiscoveryTest.php
@@ -32,7 +32,7 @@ class YamlDirectoryDiscoveryTest extends TestCase {
*
* @covers ::findAll
*/
- public function testDiscovery() {
+ public function testDiscovery(): void {
vfsStream::setup('modules', NULL, [
'test_1' => [
'subdir1' => [
@@ -103,7 +103,7 @@ class YamlDirectoryDiscoveryTest extends TestCase {
*
* @covers ::findAll
*/
- public function testDiscoveryAlternateId() {
+ public function testDiscoveryAlternateId(): void {
vfsStream::setup('modules', NULL, [
'test_1' => [
'item_1.test.yml' => "alt_id: item1\nid: ignored",
@@ -126,7 +126,7 @@ class YamlDirectoryDiscoveryTest extends TestCase {
* @covers ::findAll
* @covers ::getIdentifier
*/
- public function testDiscoveryNoIdException() {
+ public function testDiscoveryNoIdException(): void {
$this->expectException(DiscoveryException::class);
$this->expectExceptionMessage('The vfs://modules/test_1' . DIRECTORY_SEPARATOR . 'item_1.test.yml contains no data in the identifier key \'id\'');
vfsStream::setup('modules', NULL, [
@@ -147,7 +147,7 @@ class YamlDirectoryDiscoveryTest extends TestCase {
*
* @covers ::findAll
*/
- public function testDiscoveryInvalidYamlException() {
+ public function testDiscoveryInvalidYamlException(): void {
$this->expectException(DiscoveryException::class);
$this->expectExceptionMessage('The vfs://modules/test_1' . DIRECTORY_SEPARATOR . 'item_1.test.yml contains invalid YAML');
vfsStream::setup('modules', NULL, [
diff --git a/core/tests/Drupal/Tests/Component/Discovery/YamlDiscoveryTest.php b/core/tests/Drupal/Tests/Component/Discovery/YamlDiscoveryTest.php
index 2f0cf2af14d..a592b1cea48 100644
--- a/core/tests/Drupal/Tests/Component/Discovery/YamlDiscoveryTest.php
+++ b/core/tests/Drupal/Tests/Component/Discovery/YamlDiscoveryTest.php
@@ -30,7 +30,7 @@ class YamlDiscoveryTest extends TestCase {
/**
* Tests the YAML file discovery.
*/
- public function testDiscovery() {
+ public function testDiscovery(): void {
vfsStreamWrapper::register();
$root = new vfsStreamDirectory('modules');
vfsStreamWrapper::setRoot($root);
@@ -73,7 +73,7 @@ class YamlDiscoveryTest extends TestCase {
/**
* Tests if filename is output for a broken YAML file.
*/
- public function testForBrokenYml() {
+ public function testForBrokenYml(): void {
vfsStreamWrapper::register();
$root = new vfsStreamDirectory('modules');
vfsStreamWrapper::setRoot($root);
diff --git a/core/tests/Drupal/Tests/Component/DrupalComponentTest.php b/core/tests/Drupal/Tests/Component/DrupalComponentTest.php
index b2566ed752b..3f42a89a80a 100644
--- a/core/tests/Drupal/Tests/Component/DrupalComponentTest.php
+++ b/core/tests/Drupal/Tests/Component/DrupalComponentTest.php
@@ -18,7 +18,7 @@ class DrupalComponentTest extends TestCase {
/**
* Tests that classes in Component do not use any Core class.
*/
- public function testNoCoreInComponent() {
+ public function testNoCoreInComponent(): void {
$component_path = dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__))) . '/lib/Drupal/Component';
foreach ($this->findPhpClasses($component_path) as $class) {
$this->assertNoCoreUsage($class);
@@ -28,7 +28,7 @@ class DrupalComponentTest extends TestCase {
/**
* Tests that classes in Component Tests do not use any Core class.
*/
- public function testNoCoreInComponentTests() {
+ public function testNoCoreInComponentTests(): void {
$component_path = dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__))) . '/tests/Drupal/Tests/Component';
foreach ($this->findPhpClasses($component_path) as $class) {
$this->assertNoCoreUsage($class);
@@ -140,7 +140,7 @@ class DrupalComponentTest extends TestCase {
* @covers \Drupal\Tests\Component\DrupalComponentTest::assertNoCoreUsage
* @dataProvider providerAssertNoCoreUsage
*/
- public function testAssertNoCoreUsage($expected_pass, $file_data) {
+ public function testAssertNoCoreUsage($expected_pass, $file_data): void {
// Set up a virtual file to read.
$vfs_root = vfsStream::setup('root');
vfsStream::newFile('Test.php')->at($vfs_root)->setContent($file_data);
diff --git a/core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php b/core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php
index 5d87abef971..392c206e488 100644
--- a/core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php
+++ b/core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php
@@ -38,7 +38,7 @@ class FileCacheFactoryTest extends TestCase {
/**
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
$file_cache = FileCacheFactory::get('test_foo_settings', []);
// Ensure the right backend and configuration is used.
@@ -59,7 +59,7 @@ class FileCacheFactoryTest extends TestCase {
/**
* @covers ::get
*/
- public function testGetNoPrefix() {
+ public function testGetNoPrefix(): void {
FileCacheFactory::setPrefix(NULL);
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Required prefix configuration is missing');
@@ -69,7 +69,7 @@ class FileCacheFactoryTest extends TestCase {
/**
* @covers ::get
*/
- public function testGetDisabledFileCache() {
+ public function testGetDisabledFileCache(): void {
// Ensure the returned FileCache is an instance of FileCache::class.
$file_cache = FileCacheFactory::get('test_foo_settings', []);
$this->assertInstanceOf(FileCache::class, $file_cache);
@@ -88,7 +88,7 @@ class FileCacheFactoryTest extends TestCase {
*
* @dataProvider configurationDataProvider
*/
- public function testGetConfigurationOverrides($configuration, $arguments, $class) {
+ public function testGetConfigurationOverrides($configuration, $arguments, $class): void {
FileCacheFactory::setConfiguration($configuration);
$file_cache = FileCacheFactory::get('test_foo_settings', $arguments);
@@ -157,7 +157,7 @@ class FileCacheFactoryTest extends TestCase {
* @covers ::getConfiguration
* @covers ::setConfiguration
*/
- public function testGetSetConfiguration() {
+ public function testGetSetConfiguration(): void {
$configuration = FileCacheFactory::getConfiguration();
$configuration['test_foo_bar'] = ['bar' => 'llama'];
FileCacheFactory::setConfiguration($configuration);
@@ -169,7 +169,7 @@ class FileCacheFactoryTest extends TestCase {
* @covers ::getPrefix
* @covers ::setPrefix
*/
- public function testGetSetPrefix() {
+ public function testGetSetPrefix(): void {
// Random generator.
$random = new Random();
diff --git a/core/tests/Drupal/Tests/Component/FileCache/FileCacheTest.php b/core/tests/Drupal/Tests/Component/FileCache/FileCacheTest.php
index 610a90905c5..88aa8e2f34c 100644
--- a/core/tests/Drupal/Tests/Component/FileCache/FileCacheTest.php
+++ b/core/tests/Drupal/Tests/Component/FileCache/FileCacheTest.php
@@ -41,7 +41,7 @@ class FileCacheTest extends TestCase {
* @covers ::get
* @covers ::__construct
*/
- public function testGet() {
+ public function testGet(): void {
// Test a cache miss.
$result = $this->fileCache->get(__DIR__ . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR . 'no-llama-42.yml');
$this->assertNull($result);
@@ -68,7 +68,7 @@ class FileCacheTest extends TestCase {
/**
* @covers ::getMultiple
*/
- public function testGetMultiple() {
+ public function testGetMultiple(): void {
// Test a cache miss.
$result = $this->fileCache->getMultiple([__DIR__ . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR . 'no-llama-42.yml']);
$this->assertEmpty($result);
@@ -103,7 +103,7 @@ class FileCacheTest extends TestCase {
/**
* @covers ::set
*/
- public function testSet() {
+ public function testSet(): void {
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR . 'llama-23.txt';
$realpath = realpath($filename);
$cid = 'prefix:test:' . $realpath;
@@ -124,7 +124,7 @@ class FileCacheTest extends TestCase {
/**
* @covers ::delete
*/
- public function testDelete() {
+ public function testDelete(): void {
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR . 'llama-23.txt';
$realpath = realpath($filename);
$cid = 'prefix:test:' . $realpath;
diff --git a/core/tests/Drupal/Tests/Component/FileSecurity/FileSecurityTest.php b/core/tests/Drupal/Tests/Component/FileSecurity/FileSecurityTest.php
index add09e6613c..60cedeb245c 100644
--- a/core/tests/Drupal/Tests/Component/FileSecurity/FileSecurityTest.php
+++ b/core/tests/Drupal/Tests/Component/FileSecurity/FileSecurityTest.php
@@ -19,7 +19,7 @@ class FileSecurityTest extends TestCase {
/**
* @covers ::writeHtaccess
*/
- public function testWriteHtaccessPrivate() {
+ public function testWriteHtaccessPrivate(): void {
vfsStream::setup('root');
FileSecurity::writeHtaccess(vfsStream::url('root'));
$htaccess_file = vfsStream::url('root') . '/.htaccess';
@@ -32,7 +32,7 @@ class FileSecurityTest extends TestCase {
/**
* @covers ::writeHtaccess
*/
- public function testWriteHtaccessPublic() {
+ public function testWriteHtaccessPublic(): void {
vfsStream::setup('root');
$this->assertTrue(FileSecurity::writeHtaccess(vfsStream::url('root'), FALSE));
$htaccess_file = vfsStream::url('root') . '/.htaccess';
@@ -45,7 +45,7 @@ class FileSecurityTest extends TestCase {
/**
* @covers ::writeHtaccess
*/
- public function testWriteHtaccessForceOverwrite() {
+ public function testWriteHtaccessForceOverwrite(): void {
vfsStream::setup('root');
$htaccess_file = vfsStream::url('root') . '/.htaccess';
file_put_contents($htaccess_file, "foo");
@@ -58,7 +58,7 @@ class FileSecurityTest extends TestCase {
/**
* @covers ::writeHtaccess
*/
- public function testWriteHtaccessFailure() {
+ public function testWriteHtaccessFailure(): void {
vfsStream::setup('root');
$this->assertFalse(FileSecurity::writeHtaccess(vfsStream::url('root') . '/foo'));
}
diff --git a/core/tests/Drupal/Tests/Component/FileSystem/RegexDirectoryIteratorTest.php b/core/tests/Drupal/Tests/Component/FileSystem/RegexDirectoryIteratorTest.php
index 39a5095525b..36749ade6dd 100644
--- a/core/tests/Drupal/Tests/Component/FileSystem/RegexDirectoryIteratorTest.php
+++ b/core/tests/Drupal/Tests/Component/FileSystem/RegexDirectoryIteratorTest.php
@@ -18,7 +18,7 @@ class RegexDirectoryIteratorTest extends TestCase {
* @covers ::accept
* @dataProvider providerTestRegexDirectoryIterator
*/
- public function testRegexDirectoryIterator(array $directory, $regex, array $expected) {
+ public function testRegexDirectoryIterator(array $directory, $regex, array $expected): void {
vfsStream::setup('root', NULL, $directory);
$iterator = new RegexDirectoryIterator(vfsStream::url('root'), $regex);
diff --git a/core/tests/Drupal/Tests/Component/FrontMatter/FrontMatterTest.php b/core/tests/Drupal/Tests/Component/FrontMatter/FrontMatterTest.php
index a371dc3a70c..90977d85fb6 100644
--- a/core/tests/Drupal/Tests/Component/FrontMatter/FrontMatterTest.php
+++ b/core/tests/Drupal/Tests/Component/FrontMatter/FrontMatterTest.php
@@ -50,7 +50,7 @@ class FrontMatterTest extends TestCase {
* @covers ::__construct
* @covers ::create
*/
- public function testFrontMatterSerializerException() {
+ public function testFrontMatterSerializerException(): void {
$this->expectException(\AssertionError::class);
$this->expectExceptionMessage('The $serializer parameter must reference a class that implements Drupal\Component\Serialization\SerializationInterface.');
FrontMatter::create('', '');
@@ -64,7 +64,7 @@ class FrontMatterTest extends TestCase {
* @covers ::parse
* @covers \Drupal\Component\FrontMatter\Exception\FrontMatterParseException
*/
- public function testFrontMatterBroken() {
+ public function testFrontMatterBroken(): void {
$this->expectException(FrontMatterParseException::class);
$this->expectExceptionMessage('An error occurred when attempting to parse front matter data on line 4');
$source = "---\ncollection:\n- key: foo\n foo: bar\n---\n";
@@ -90,7 +90,7 @@ class FrontMatterTest extends TestCase {
*
* @dataProvider providerFrontMatterData
*/
- public function testFrontMatterData($yaml, $line, $content = self::SOURCE) {
+ public function testFrontMatterData($yaml, $line, $content = self::SOURCE): void {
$source = static::createFrontMatterSource($yaml, $content);
$frontMatter = FrontMatter::create($source);
$this->assertEquals($content, $frontMatter->getContent());
diff --git a/core/tests/Drupal/Tests/Component/Gettext/PoHeaderTest.php b/core/tests/Drupal/Tests/Component/Gettext/PoHeaderTest.php
index 54d7914475a..17c26a0b36e 100644
--- a/core/tests/Drupal/Tests/Component/Gettext/PoHeaderTest.php
+++ b/core/tests/Drupal/Tests/Component/Gettext/PoHeaderTest.php
@@ -29,7 +29,7 @@ class PoHeaderTest extends TestCase {
*
* @dataProvider providerTestPluralsFormula
*/
- public function testPluralsFormula($plural, $expected) {
+ public function testPluralsFormula($plural, $expected): void {
$p = new PoHeader();
$parsed = $p->parsePluralForms($plural);
[$nplurals, $new_plural] = $parsed;
diff --git a/core/tests/Drupal/Tests/Component/Gettext/PoStreamWriterTest.php b/core/tests/Drupal/Tests/Component/Gettext/PoStreamWriterTest.php
index d18888eecdd..667c2129770 100644
--- a/core/tests/Drupal/Tests/Component/Gettext/PoStreamWriterTest.php
+++ b/core/tests/Drupal/Tests/Component/Gettext/PoStreamWriterTest.php
@@ -53,7 +53,7 @@ class PoStreamWriterTest extends TestCase {
/**
* @covers ::getURI
*/
- public function testGetUriException() {
+ public function testGetUriException(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('No URI set.');
@@ -64,7 +64,7 @@ class PoStreamWriterTest extends TestCase {
* @covers ::writeItem
* @dataProvider providerWriteData
*/
- public function testWriteItem($poContent, $expected, $long) {
+ public function testWriteItem($poContent, $expected, $long): void {
if ($long) {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Unable to write data:');
@@ -107,7 +107,7 @@ class PoStreamWriterTest extends TestCase {
/**
* @covers ::close
*/
- public function testCloseException() {
+ public function testCloseException(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Cannot close stream that is not open.');
diff --git a/core/tests/Drupal/Tests/Component/Graph/GraphTest.php b/core/tests/Drupal/Tests/Component/Graph/GraphTest.php
index 3fa25a7f1fa..ccfd520b127 100644
--- a/core/tests/Drupal/Tests/Component/Graph/GraphTest.php
+++ b/core/tests/Drupal/Tests/Component/Graph/GraphTest.php
@@ -16,7 +16,7 @@ class GraphTest extends TestCase {
/**
* Tests depth-first-search features.
*/
- public function testDepthFirstSearch() {
+ public function testDepthFirstSearch(): void {
// The sample graph used is:
// @code
// 1 --> 2 --> 3 5 ---> 6
diff --git a/core/tests/Drupal/Tests/Component/HttpFoundation/SecuredRedirectResponseTest.php b/core/tests/Drupal/Tests/Component/HttpFoundation/SecuredRedirectResponseTest.php
index b2a2cabea78..c6a19a35b99 100644
--- a/core/tests/Drupal/Tests/Component/HttpFoundation/SecuredRedirectResponseTest.php
+++ b/core/tests/Drupal/Tests/Component/HttpFoundation/SecuredRedirectResponseTest.php
@@ -23,7 +23,7 @@ class SecuredRedirectResponseTest extends TestCase {
* @covers ::createFromRedirectResponse
* @covers ::fromResponse
*/
- public function testRedirectCopy() {
+ public function testRedirectCopy(): void {
$redirect = new RedirectResponse('/magic_redirect_url', 301, ['x-cache-foobar' => 123]);
$redirect->setProtocolVersion('2.0');
$redirect->setCharset('ibm-943_P14A-2000');
diff --git a/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageReadOnlyTest.php b/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageReadOnlyTest.php
index 438814702c6..4d4c56ef1eb 100644
--- a/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageReadOnlyTest.php
+++ b/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageReadOnlyTest.php
@@ -53,7 +53,7 @@ class FileStorageReadOnlyTest extends PhpStorageTestBase {
/**
* Tests writing with one class and reading with another.
*/
- public function testReadOnly() {
+ public function testReadOnly(): void {
// Random generator.
$random = new Random();
@@ -85,7 +85,7 @@ class FileStorageReadOnlyTest extends PhpStorageTestBase {
/**
* @covers ::deleteAll
*/
- public function testDeleteAll() {
+ public function testDeleteAll(): void {
// Random generator.
$random = new Random();
diff --git a/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php b/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php
index db63b5498b6..bc0d8e5e908 100644
--- a/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php
+++ b/core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php
@@ -45,7 +45,7 @@ class FileStorageTest extends PhpStorageTestBase {
* @covers ::exists
* @covers ::delete
*/
- public function testCRUD() {
+ public function testCRUD(): void {
$php = new FileStorage($this->standardSettings);
$this->assertCRUD($php);
}
@@ -53,7 +53,7 @@ class FileStorageTest extends PhpStorageTestBase {
/**
* @covers ::deleteAll
*/
- public function testDeleteAll() {
+ public function testDeleteAll(): void {
// Random generator.
$random_generator = new Random();
@@ -88,7 +88,7 @@ class FileStorageTest extends PhpStorageTestBase {
/**
* @covers ::createDirectory
*/
- public function testCreateDirectoryFailWarning() {
+ public function testCreateDirectoryFailWarning(): void {
$directory = new vfsStreamDirectory('permissionDenied', 0200);
$storage = new FileStorage([
'directory' => $directory->url(),
diff --git a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageBase.php b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageBase.php
index 0056c4477cf..5d769d0b194 100644
--- a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageBase.php
+++ b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageBase.php
@@ -62,7 +62,7 @@ abstract class MTimeProtectedFileStorageBase extends PhpStorageTestBase {
/**
* Tests basic load/save/delete operations.
*/
- public function testCRUD() {
+ public function testCRUD(): void {
$php = new $this->storageClass($this->settings);
$this->assertCRUD($php);
}
@@ -76,7 +76,7 @@ abstract class MTimeProtectedFileStorageBase extends PhpStorageTestBase {
* We need to delay over 1 second for mtime test.
* @medium
*/
- public function testSecurity() {
+ public function testSecurity(): void {
$php = new $this->storageClass($this->settings);
$name = 'test.php';
$php->save($name, '<?php');
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeBaseTest.php b/core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeBaseTest.php
index 877a0fae2e5..1dfa467e599 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeBaseTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeBaseTest.php
@@ -17,7 +17,7 @@ class AttributeBaseTest extends TestCase {
* @covers ::getProvider
* @covers ::setProvider
*/
- public function testSetProvider() {
+ public function testSetProvider(): void {
$plugin = new AttributeBaseStub(id: '1');
$plugin->setProvider('example');
$this->assertEquals('example', $plugin->getProvider());
@@ -26,7 +26,7 @@ class AttributeBaseTest extends TestCase {
/**
* @covers ::getId
*/
- public function testGetId() {
+ public function testGetId(): void {
$plugin = new AttributeBaseStub(id: 'example');
$this->assertEquals('example', $plugin->getId());
}
@@ -35,7 +35,7 @@ class AttributeBaseTest extends TestCase {
* @covers ::getClass
* @covers ::setClass
*/
- public function testSetClass() {
+ public function testSetClass(): void {
$plugin = new AttributeBaseStub(id: '1');
$plugin->setClass('example');
$this->assertEquals('example', $plugin->getClass());
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeClassDiscoveryCachedTest.php b/core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeClassDiscoveryCachedTest.php
index 4798504927b..566058d7c88 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeClassDiscoveryCachedTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeClassDiscoveryCachedTest.php
@@ -36,7 +36,7 @@ class AttributeClassDiscoveryCachedTest extends TestCase {
*
* @covers ::getDefinitions
*/
- public function testGetDefinitions() {
+ public function testGetDefinitions(): void {
// Path to the classes which we'll discover and parse annotation.
$discovery_path = __DIR__ . '/Fixtures/Plugins';
// File path that should be discovered within that directory.
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeClassDiscoveryTest.php b/core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeClassDiscoveryTest.php
index 92b8fede1c4..f6c6370e7e1 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeClassDiscoveryTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeClassDiscoveryTest.php
@@ -36,7 +36,7 @@ class AttributeClassDiscoveryTest extends TestCase {
* @covers ::__construct
* @covers ::getPluginNamespaces
*/
- public function testGetPluginNamespaces() {
+ public function testGetPluginNamespaces(): void {
// Path to the classes which we'll discover and parse annotation.
$discovery = new AttributeClassDiscovery(['com/example' => [__DIR__]]);
@@ -51,7 +51,7 @@ class AttributeClassDiscoveryTest extends TestCase {
* @covers ::getDefinitions
* @covers ::prepareAttributeDefinition
*/
- public function testGetDefinitions() {
+ public function testGetDefinitions(): void {
$discovery = new AttributeClassDiscovery(['com\example' => [__DIR__ . '/Fixtures/Plugins']]);
$this->assertEquals([
'discovery_test_1' => [
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Attribute/PluginIdTest.php b/core/tests/Drupal/Tests/Component/Plugin/Attribute/PluginIdTest.php
index 72ba747627a..2791af3d3f7 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Attribute/PluginIdTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Attribute/PluginIdTest.php
@@ -16,7 +16,7 @@ class PluginIdTest extends TestCase {
/**
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
// Assert plugin starts with only an ID.
$plugin = new PluginID(id: 'test');
// Plugin's always have a class set by discovery.
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Attribute/PluginTest.php b/core/tests/Drupal/Tests/Component/Plugin/Attribute/PluginTest.php
index 0399b7c59b7..5cad2a94067 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Attribute/PluginTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Attribute/PluginTest.php
@@ -17,7 +17,7 @@ class PluginTest extends TestCase {
* @covers ::__construct
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
$plugin = new PluginStub(id: 'example', deriver: 'test');
$plugin->setClass('foo');
$this->assertEquals([
@@ -31,7 +31,7 @@ class PluginTest extends TestCase {
* @covers ::setProvider
* @covers ::getProvider
*/
- public function testSetProvider() {
+ public function testSetProvider(): void {
$plugin = new Plugin(id: 'example');
$plugin->setProvider('example');
$this->assertEquals('example', $plugin->getProvider());
@@ -40,7 +40,7 @@ class PluginTest extends TestCase {
/**
* @covers ::getId
*/
- public function testGetId() {
+ public function testGetId(): void {
$plugin = new Plugin(id: 'example');
$this->assertEquals('example', $plugin->getId());
}
@@ -49,7 +49,7 @@ class PluginTest extends TestCase {
* @covers ::setClass
* @covers ::getClass
*/
- public function testSetClass() {
+ public function testSetClass(): void {
$plugin = new Plugin(id: 'test');
$plugin->setClass('example');
$this->assertEquals('example', $plugin->getClass());
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Context/ContextTest.php b/core/tests/Drupal/Tests/Component/Plugin/Context/ContextTest.php
index faa0dd47f0d..6004e705acf 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Context/ContextTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Context/ContextTest.php
@@ -28,7 +28,7 @@ class ContextTest extends TestCase {
* @covers ::getContextValue
* @dataProvider providerGetContextValue
*/
- public function testGetContextValue($expected, $context_value, $is_required, $data_type) {
+ public function testGetContextValue($expected, $context_value, $is_required, $data_type): void {
// Mock a Context object.
$mock_context = $this->getMockBuilder('Drupal\Component\Plugin\Context\Context')
->disableOriginalConstructor()
@@ -116,7 +116,7 @@ class ContextTest extends TestCase {
/**
* @covers ::getContextValue
*/
- public function testDefaultValue() {
+ public function testDefaultValue(): void {
$mock_definition = $this->createMock('Drupal\Component\Plugin\Context\ContextDefinitionInterface');
$mock_definition->expects($this->once())
diff --git a/core/tests/Drupal/Tests/Component/Plugin/DefaultFactoryTest.php b/core/tests/Drupal/Tests/Component/Plugin/DefaultFactoryTest.php
index 0413216eeb1..f92d274cd85 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/DefaultFactoryTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/DefaultFactoryTest.php
@@ -23,7 +23,7 @@ class DefaultFactoryTest extends TestCase {
*
* @covers ::getPluginClass
*/
- public function testGetPluginClassWithValidArrayPluginDefinition() {
+ public function testGetPluginClassWithValidArrayPluginDefinition(): void {
$plugin_class = Corn::class;
$class = DefaultFactory::getPluginClass('corn', ['class' => $plugin_class]);
@@ -35,7 +35,7 @@ class DefaultFactoryTest extends TestCase {
*
* @covers ::getPluginClass
*/
- public function testGetPluginClassWithValidObjectPluginDefinition() {
+ public function testGetPluginClassWithValidObjectPluginDefinition(): void {
$plugin_class = Corn::class;
$plugin_definition = $this->getMockBuilder(PluginDefinitionInterface::class)->getMock();
$plugin_definition->expects($this->atLeastOnce())
@@ -51,7 +51,7 @@ class DefaultFactoryTest extends TestCase {
*
* @covers ::getPluginClass
*/
- public function testGetPluginClassWithMissingClassWithArrayPluginDefinition() {
+ public function testGetPluginClassWithMissingClassWithArrayPluginDefinition(): void {
$this->expectException(PluginException::class);
$this->expectExceptionMessage('The plugin (corn) did not specify an instance class.');
DefaultFactory::getPluginClass('corn', []);
@@ -62,7 +62,7 @@ class DefaultFactoryTest extends TestCase {
*
* @covers ::getPluginClass
*/
- public function testGetPluginClassWithMissingClassWithObjectPluginDefinition() {
+ public function testGetPluginClassWithMissingClassWithObjectPluginDefinition(): void {
$plugin_definition = $this->getMockBuilder(PluginDefinitionInterface::class)
->getMock();
$this->expectException(PluginException::class);
@@ -75,7 +75,7 @@ class DefaultFactoryTest extends TestCase {
*
* @covers ::getPluginClass
*/
- public function testGetPluginClassWithNotExistingClassWithArrayPluginDefinition() {
+ public function testGetPluginClassWithNotExistingClassWithArrayPluginDefinition(): void {
$this->expectException(PluginException::class);
$this->expectExceptionMessage('Plugin (carrot) instance class "Drupal\Tests\Component\Plugin\Fixtures\vegetable\Carrot" does not exist.');
DefaultFactory::getPluginClass('carrot', ['class' => 'Drupal\Tests\Component\Plugin\Fixtures\vegetable\Carrot']);
@@ -86,7 +86,7 @@ class DefaultFactoryTest extends TestCase {
*
* @covers ::getPluginClass
*/
- public function testGetPluginClassWithNotExistingClassWithObjectPluginDefinition() {
+ public function testGetPluginClassWithNotExistingClassWithObjectPluginDefinition(): void {
$plugin_class = 'Drupal\Tests\Component\Plugin\Fixtures\vegetable\Carrot';
$plugin_definition = $this->getMockBuilder(PluginDefinitionInterface::class)->getMock();
$plugin_definition->expects($this->atLeastOnce())
@@ -101,7 +101,7 @@ class DefaultFactoryTest extends TestCase {
*
* @covers ::getPluginClass
*/
- public function testGetPluginClassWithInterfaceWithArrayPluginDefinition() {
+ public function testGetPluginClassWithInterfaceWithArrayPluginDefinition(): void {
$plugin_class = Corn::class;
$class = DefaultFactory::getPluginClass('corn', ['class' => $plugin_class], VegetableInterface::class);
@@ -113,7 +113,7 @@ class DefaultFactoryTest extends TestCase {
*
* @covers ::getPluginClass
*/
- public function testGetPluginClassWithInterfaceWithObjectPluginDefinition() {
+ public function testGetPluginClassWithInterfaceWithObjectPluginDefinition(): void {
$plugin_class = Corn::class;
$plugin_definition = $this->getMockBuilder(PluginDefinitionInterface::class)->getMock();
$plugin_definition->expects($this->atLeastOnce())
@@ -129,7 +129,7 @@ class DefaultFactoryTest extends TestCase {
*
* @covers ::getPluginClass
*/
- public function testGetPluginClassWithInterfaceAndInvalidClassWithArrayPluginDefinition() {
+ public function testGetPluginClassWithInterfaceAndInvalidClassWithArrayPluginDefinition(): void {
$this->expectException(PluginException::class);
$this->expectExceptionMessage('Plugin "corn" (Drupal\Tests\Component\Plugin\Fixtures\vegetable\Broccoli) must implement interface Drupal\Tests\Component\Plugin\Fixtures\vegetable\VegetableInterface.');
DefaultFactory::getPluginClass('corn', ['class' => Broccoli::class], VegetableInterface::class);
@@ -140,7 +140,7 @@ class DefaultFactoryTest extends TestCase {
*
* @covers ::getPluginClass
*/
- public function testGetPluginClassWithInterfaceAndInvalidClassWithObjectPluginDefinition() {
+ public function testGetPluginClassWithInterfaceAndInvalidClassWithObjectPluginDefinition(): void {
$plugin_class = Broccoli::class;
$plugin_definition = $this->getMockBuilder(PluginDefinitionInterface::class)->getMock();
$plugin_definition->expects($this->atLeastOnce())
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Discovery/AnnotatedClassDiscoveryTest.php b/core/tests/Drupal/Tests/Component/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
index 6b7c905c28f..483764b3c0e 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
@@ -58,7 +58,7 @@ class AnnotatedClassDiscoveryTest extends TestCase {
*
* @coversNothing
*/
- public function testAutoloadBadAnnotations($annotation) {
+ public function testAutoloadBadAnnotations($annotation): void {
// Set up a class file in vfsStream.
vfsStreamWrapper::register();
$root = new vfsStreamDirectory('root');
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Discovery/AttributeBridgeDecoratorTest.php b/core/tests/Drupal/Tests/Component/Plugin/Discovery/AttributeBridgeDecoratorTest.php
index 8d7be68c166..d2deaa5ffb2 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Discovery/AttributeBridgeDecoratorTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Discovery/AttributeBridgeDecoratorTest.php
@@ -19,7 +19,7 @@ class AttributeBridgeDecoratorTest extends TestCase {
/**
* @covers ::getDefinitions
*/
- public function testGetDefinitions() {
+ public function testGetDefinitions(): void {
// Normally the attribute classes would be autoloaded.
include_once __DIR__ . '/../Attribute/Fixtures/CustomPlugin.php';
include_once __DIR__ . '/../Attribute/Fixtures/Plugins/PluginNamespace/AttributeDiscoveryTest1.php';
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php b/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php
index cd2bbcea11b..9db89444c17 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php
@@ -35,7 +35,7 @@ class DiscoveryCachedTraitTest extends TestCase {
* @covers ::getDefinition
* @dataProvider providerGetDefinition
*/
- public function testGetDefinition($expected, $cached_definitions, $get_definitions, $plugin_id) {
+ public function testGetDefinition($expected, $cached_definitions, $get_definitions, $plugin_id): void {
$trait = $this->getMockBuilder(DiscoveryCachedTraitMockableClass::class)
->onlyMethods(['getDefinitions'])
->getMock();
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php b/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php
index 16858ae5d13..d26a538aad6 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php
@@ -33,7 +33,7 @@ class DiscoveryTraitTest extends TestCase {
* @covers ::doGetDefinition
* @dataProvider providerDoGetDefinition
*/
- public function testDoGetDefinition($expected, $definitions, $plugin_id) {
+ public function testDoGetDefinition($expected, $definitions, $plugin_id): void {
$trait = new DiscoveryTraitMockableClass();
// Un-protect the method using reflection.
$method_ref = new \ReflectionMethod($trait, 'doGetDefinition');
@@ -63,7 +63,7 @@ class DiscoveryTraitTest extends TestCase {
* @dataProvider providerDoGetDefinitionException
* @uses \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/
- public function testDoGetDefinitionException($expected, $definitions, $plugin_id) {
+ public function testDoGetDefinitionException($expected, $definitions, $plugin_id): void {
$trait = new DiscoveryTraitMockableClass();
// Un-protect the method using reflection.
$method_ref = new \ReflectionMethod($trait, 'doGetDefinition');
@@ -76,7 +76,7 @@ class DiscoveryTraitTest extends TestCase {
* @covers ::getDefinition
* @dataProvider providerDoGetDefinition
*/
- public function testGetDefinition($expected, $definitions, $plugin_id) {
+ public function testGetDefinition($expected, $definitions, $plugin_id): void {
// Since getDefinition is a wrapper around doGetDefinition(), we can re-use
// its data provider. We just have to tell abstract method getDefinitions()
// to use the $definitions array.
@@ -98,7 +98,7 @@ class DiscoveryTraitTest extends TestCase {
* @dataProvider providerDoGetDefinitionException
* @uses \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/
- public function testGetDefinitionException($expected, $definitions, $plugin_id) {
+ public function testGetDefinitionException($expected, $definitions, $plugin_id): void {
// Since getDefinition is a wrapper around doGetDefinition(), we can re-use
// its data provider. We just have to tell abstract method getDefinitions()
// to use the $definitions array.
@@ -131,7 +131,7 @@ class DiscoveryTraitTest extends TestCase {
* @covers ::hasDefinition
* @dataProvider providerHasDefinition
*/
- public function testHasDefinition($expected, $plugin_id) {
+ public function testHasDefinition($expected, $plugin_id): void {
$trait = $this->getMockBuilder(DiscoveryTraitMockableClass::class)
->onlyMethods(['getDefinition'])
->getMock();
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Discovery/StaticDiscoveryDecoratorTest.php b/core/tests/Drupal/Tests/Component/Plugin/Discovery/StaticDiscoveryDecoratorTest.php
index 94fbe6ad9d7..b2f430416a7 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Discovery/StaticDiscoveryDecoratorTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Discovery/StaticDiscoveryDecoratorTest.php
@@ -61,7 +61,7 @@ class StaticDiscoveryDecoratorTest extends TestCase {
* @covers ::getDefinition
* @dataProvider providerGetDefinition
*/
- public function testGetDefinition($expected, $has_register_definitions, $exception_on_invalid, $definitions, $base_plugin_id) {
+ public function testGetDefinition($expected, $has_register_definitions, $exception_on_invalid, $definitions, $base_plugin_id): void {
// Mock our StaticDiscoveryDecorator.
$mock_decorator = $this->getMockBuilder(StaticDiscoveryDecorator::class)
->disableOriginalConstructor()
@@ -126,7 +126,7 @@ class StaticDiscoveryDecoratorTest extends TestCase {
* @covers ::getDefinitions
* @dataProvider providerGetDefinitions
*/
- public function testGetDefinitions($has_register_definitions, $definitions) {
+ public function testGetDefinitions($has_register_definitions, $definitions): void {
// Mock our StaticDiscoveryDecorator.
$mock_decorator = $this->getMockBuilder(StaticDiscoveryDecorator::class)
->disableOriginalConstructor()
@@ -189,7 +189,7 @@ class StaticDiscoveryDecoratorTest extends TestCase {
* @covers ::__call
* @dataProvider providerCall
*/
- public function testCall($method, $args) {
+ public function testCall($method, $args): void {
// Mock a decorated object.
$mock_decorated = $this->getMockBuilder(StaticDiscoveryTestDecoratedClass::class)
->onlyMethods([$method])
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php b/core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php
index ccacab19e64..860c96c6e22 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php
@@ -80,7 +80,7 @@ class ReflectionFactoryTest extends TestCase {
* @covers ::createInstance
* @dataProvider providerGetInstanceArguments
*/
- public function testCreateInstance($expected, $reflector_name, $plugin_id, $plugin_definition, $configuration) {
+ public function testCreateInstance($expected, $reflector_name, $plugin_id, $plugin_definition, $configuration): void {
// Create a mock DiscoveryInterface which can return our plugin definition.
$mock_discovery = $this->getMockBuilder('Drupal\Component\Plugin\Discovery\DiscoveryInterface')
->onlyMethods(['getDefinition', 'getDefinitions', 'hasDefinition'])
@@ -105,7 +105,7 @@ class ReflectionFactoryTest extends TestCase {
* @covers ::getInstanceArguments
* @dataProvider providerGetInstanceArguments
*/
- public function testGetInstanceArguments($expected, $reflector_name, $plugin_id, $plugin_definition, $configuration) {
+ public function testGetInstanceArguments($expected, $reflector_name, $plugin_id, $plugin_definition, $configuration): void {
$reflection_factory = $this->getMockBuilder('Drupal\Component\Plugin\Factory\ReflectionFactory')
->disableOriginalConstructor()
->getMock();
diff --git a/core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php b/core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php
index e33cf214a75..488361d6de9 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php
@@ -16,7 +16,7 @@ class PluginBaseTest extends TestCase {
* @dataProvider providerTestGetPluginId
* @covers ::getPluginId
*/
- public function testGetPluginId($plugin_id, $expected) {
+ public function testGetPluginId($plugin_id, $expected): void {
$plugin_base = $this->getMockForAbstractClass('Drupal\Component\Plugin\PluginBase', [
[],
$plugin_id,
@@ -42,7 +42,7 @@ class PluginBaseTest extends TestCase {
* @dataProvider providerTestGetBaseId
* @coves ::getBaseId
*/
- public function testGetBaseId($plugin_id, $expected) {
+ public function testGetBaseId($plugin_id, $expected): void {
/** @var \Drupal\Component\Plugin\PluginBase|\PHPUnit\Framework\MockObject\MockObject $plugin_base */
$plugin_base = $this->getMockForAbstractClass('Drupal\Component\Plugin\PluginBase', [
[],
@@ -69,7 +69,7 @@ class PluginBaseTest extends TestCase {
* @dataProvider providerTestGetDerivativeId
* @covers ::getDerivativeId
*/
- public function testGetDerivativeId($plugin_id = NULL, $expected = NULL) {
+ public function testGetDerivativeId($plugin_id = NULL, $expected = NULL): void {
/** @var \Drupal\Component\Plugin\PluginBase|\PHPUnit\Framework\MockObject\MockObject $plugin_base */
$plugin_base = $this->getMockForAbstractClass('Drupal\Component\Plugin\PluginBase', [
[],
@@ -95,7 +95,7 @@ class PluginBaseTest extends TestCase {
/**
* @covers ::getPluginDefinition
*/
- public function testGetPluginDefinition() {
+ public function testGetPluginDefinition(): void {
$plugin_base = $this->getMockForAbstractClass('Drupal\Component\Plugin\PluginBase', [
[],
'plugin_id',
diff --git a/core/tests/Drupal/Tests/Component/Plugin/PluginManagerBaseTest.php b/core/tests/Drupal/Tests/Component/Plugin/PluginManagerBaseTest.php
index ad9ba1ac969..39fdeddc08d 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/PluginManagerBaseTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/PluginManagerBaseTest.php
@@ -50,7 +50,7 @@ class PluginManagerBaseTest extends TestCase {
*
* @covers ::createInstance
*/
- public function testCreateInstance() {
+ public function testCreateInstance(): void {
$manager = $this->getMockBuilder('Drupal\Component\Plugin\PluginManagerBase')
->getMockForAbstractClass();
// PluginManagerBase::createInstance() looks for a factory object and then
@@ -70,7 +70,7 @@ class PluginManagerBaseTest extends TestCase {
*
* @covers ::createInstance
*/
- public function testCreateInstanceFallback() {
+ public function testCreateInstanceFallback(): void {
// We use our special stub class which extends PluginManagerBase and also
// implements FallbackPluginManagerInterface.
$manager = new StubFallbackPluginManager();
@@ -96,7 +96,7 @@ class PluginManagerBaseTest extends TestCase {
/**
* @covers ::getInstance
*/
- public function testGetInstance() {
+ public function testGetInstance(): void {
$options = [
'foo' => 'F00',
'bar' => 'bAr',
@@ -113,7 +113,7 @@ class PluginManagerBaseTest extends TestCase {
/**
* @covers ::getInstance
*/
- public function testGetInstanceWithoutMapperShouldThrowException() {
+ public function testGetInstanceWithoutMapperShouldThrowException(): void {
$options = [
'foo' => 'F00',
'bar' => 'bAr',
diff --git a/core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyBuilderTest.php b/core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyBuilderTest.php
index 271bef19ca0..05eac87208e 100644
--- a/core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyBuilderTest.php
+++ b/core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyBuilderTest.php
@@ -32,7 +32,7 @@ class ProxyBuilderTest extends TestCase {
/**
* @covers ::buildProxyClassName
*/
- public function testBuildProxyClassName() {
+ public function testBuildProxyClassName(): void {
$class_name = $this->proxyBuilder->buildProxyClassName('Drupal\Tests\Component\ProxyBuilder\TestServiceNoMethod');
$this->assertEquals('Drupal\Tests\ProxyClass\Component\ProxyBuilder\TestServiceNoMethod', $class_name);
}
@@ -40,7 +40,7 @@ class ProxyBuilderTest extends TestCase {
/**
* @covers ::buildProxyClassName
*/
- public function testBuildProxyClassNameForModule() {
+ public function testBuildProxyClassNameForModule(): void {
$class_name = $this->proxyBuilder->buildProxyClassName('Drupal\views_ui\ParamConverter\ViewUIConverter');
$this->assertEquals('Drupal\views_ui\ProxyClass\ParamConverter\ViewUIConverter', $class_name);
}
@@ -48,7 +48,7 @@ class ProxyBuilderTest extends TestCase {
/**
* @covers ::buildProxyNamespace
*/
- public function testBuildProxyNamespace() {
+ public function testBuildProxyNamespace(): void {
$class_name = $this->proxyBuilder->buildProxyNamespace('Drupal\Tests\Component\ProxyBuilder\TestServiceNoMethod');
$this->assertEquals('Drupal\Tests\ProxyClass\Component\ProxyBuilder', $class_name);
}
@@ -60,7 +60,7 @@ class ProxyBuilderTest extends TestCase {
* @covers ::buildConstructorMethod
* @covers ::buildLazyLoadItselfMethod
*/
- public function testBuildNoMethod() {
+ public function testBuildNoMethod(): void {
$class = 'Drupal\Tests\Component\ProxyBuilder\TestServiceNoMethod';
$result = $this->proxyBuilder->build($class);
@@ -71,7 +71,7 @@ class ProxyBuilderTest extends TestCase {
* @covers ::buildMethod
* @covers ::buildMethodBody
*/
- public function testBuildSimpleMethod() {
+ public function testBuildSimpleMethod(): void {
$class = 'Drupal\Tests\Component\ProxyBuilder\TestServiceSimpleMethod';
$result = $this->proxyBuilder->build($class);
@@ -95,7 +95,7 @@ EOS;
* @covers ::buildParameter
* @covers ::buildMethodBody
*/
- public function testBuildMethodWithParameter() {
+ public function testBuildMethodWithParameter(): void {
$class = 'Drupal\Tests\Component\ProxyBuilder\TestServiceMethodWithParameter';
$result = $this->proxyBuilder->build($class);
@@ -119,7 +119,7 @@ EOS;
* @covers ::buildParameter
* @covers ::buildMethodBody
*/
- public function testBuildComplexMethod() {
+ public function testBuildComplexMethod(): void {
$class = 'Drupal\Tests\Component\ProxyBuilder\TestServiceComplexMethod';
$result = $this->proxyBuilder->build($class);
@@ -144,7 +144,7 @@ EOS;
/**
* @covers ::buildMethodBody
*/
- public function testBuildServiceMethodReturnsVoid() {
+ public function testBuildServiceMethodReturnsVoid(): void {
$class = TestServiceMethodReturnsVoid::class;
$result = $this->proxyBuilder->build($class);
@@ -169,7 +169,7 @@ EOS;
* @covers ::buildMethod
* @covers ::buildMethodBody
*/
- public function testBuildReturnReference() {
+ public function testBuildReturnReference(): void {
$class = 'Drupal\Tests\Component\ProxyBuilder\TestServiceReturnReference';
$result = $this->proxyBuilder->build($class);
@@ -195,7 +195,7 @@ EOS;
* @covers ::buildParameter
* @covers ::buildMethodBody
*/
- public function testBuildWithInterface() {
+ public function testBuildWithInterface(): void {
$class = 'Drupal\Tests\Component\ProxyBuilder\TestServiceWithInterface';
$result = $this->proxyBuilder->build($class);
@@ -219,7 +219,7 @@ EOS;
/**
* @covers ::build
*/
- public function testBuildWithNestedInterface() {
+ public function testBuildWithNestedInterface(): void {
$class = 'Drupal\Tests\Component\ProxyBuilder\TestServiceWithChildInterfaces';
$result = $this->proxyBuilder->build($class);
@@ -234,7 +234,7 @@ EOS;
* @covers ::buildParameter
* @covers ::buildMethodBody
*/
- public function testBuildWithProtectedAndPrivateMethod() {
+ public function testBuildWithProtectedAndPrivateMethod(): void {
$class = 'Drupal\Tests\Component\ProxyBuilder\TestServiceWithProtectedMethods';
$result = $this->proxyBuilder->build($class);
@@ -259,7 +259,7 @@ EOS;
* @covers ::buildParameter
* @covers ::buildMethodBody
*/
- public function testBuildWithPublicStaticMethod() {
+ public function testBuildWithPublicStaticMethod(): void {
$class = 'Drupal\Tests\Component\ProxyBuilder\TestServiceWithPublicStaticMethod';
$result = $this->proxyBuilder->build($class);
@@ -285,7 +285,7 @@ EOS;
* @covers ::buildParameter
* @covers ::buildMethodBody
*/
- public function testBuildWithNullableSelfTypeHint() {
+ public function testBuildWithNullableSelfTypeHint(): void {
$class = 'Drupal\Tests\Component\ProxyBuilder\TestServiceNullableTypeHintSelf';
$result = $this->proxyBuilder->build($class);
diff --git a/core/tests/Drupal/Tests/Component/Render/FormattableMarkupTest.php b/core/tests/Drupal/Tests/Component/Render/FormattableMarkupTest.php
index 9bd02126d78..d3451194895 100644
--- a/core/tests/Drupal/Tests/Component/Render/FormattableMarkupTest.php
+++ b/core/tests/Drupal/Tests/Component/Render/FormattableMarkupTest.php
@@ -36,7 +36,7 @@ class FormattableMarkupTest extends TestCase {
* @covers ::__toString
* @covers ::jsonSerialize
*/
- public function testToString() {
+ public function testToString(): void {
$string = 'Can I have a @replacement';
$formattable_string = new FormattableMarkup($string, ['@replacement' => 'kitten']);
$text = (string) $formattable_string;
@@ -48,7 +48,7 @@ class FormattableMarkupTest extends TestCase {
/**
* @covers ::count
*/
- public function testCount() {
+ public function testCount(): void {
$string = 'Can I have a @replacement';
$formattable_string = new FormattableMarkup($string, ['@replacement' => 'kitten']);
$this->assertEquals(strlen($string), $formattable_string->count());
@@ -75,7 +75,7 @@ class FormattableMarkupTest extends TestCase {
* @covers ::__toString
* @dataProvider providerTestUnexpectedPlaceholder
*/
- public function testUnexpectedPlaceholder($string, $arguments, $error_number, $error_message) {
+ public function testUnexpectedPlaceholder($string, $arguments, $error_number, $error_message): void {
// We set a custom error handler because of https://github.com/sebastianbergmann/phpunit/issues/487
set_error_handler([$this, 'errorHandler']);
// We want this to trigger an error.
diff --git a/core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php b/core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php
index 2f09bf1821f..2b10bbfbd79 100644
--- a/core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php
+++ b/core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php
@@ -23,7 +23,7 @@ class HtmlEscapedTextTest extends TestCase {
*
* @dataProvider providerToString
*/
- public function testToString($text, $expected, $message) {
+ public function testToString($text, $expected, $message): void {
$escapable_string = new HtmlEscapedText($text);
$this->assertEquals($expected, (string) $escapable_string, $message);
$this->assertEquals($expected, $escapable_string->jsonSerialize());
@@ -60,7 +60,7 @@ class HtmlEscapedTextTest extends TestCase {
/**
* @covers ::count
*/
- public function testCount() {
+ public function testCount(): void {
$string = 'Can I have a <em>kitten</em>';
$escapable_string = new HtmlEscapedText($string);
$this->assertEquals(strlen($string), $escapable_string->count());
diff --git a/core/tests/Drupal/Tests/Component/Render/PlainTextOutputTest.php b/core/tests/Drupal/Tests/Component/Render/PlainTextOutputTest.php
index afae2d777fe..23ddfea0119 100644
--- a/core/tests/Drupal/Tests/Component/Render/PlainTextOutputTest.php
+++ b/core/tests/Drupal/Tests/Component/Render/PlainTextOutputTest.php
@@ -30,7 +30,7 @@ class PlainTextOutputTest extends TestCase {
* @covers ::renderFromHtml
* @dataProvider providerRenderFromHtml
*/
- public function testRenderFromHtml($expected, $string, $args = []) {
+ public function testRenderFromHtml($expected, $string, $args = []): void {
$markup = new FormattableMarkup($string, $args);
$output = PlainTextOutput::renderFromHtml($markup);
$this->assertSame($expected, $output);
diff --git a/core/tests/Drupal/Tests/Component/Serialization/JsonTest.php b/core/tests/Drupal/Tests/Component/Serialization/JsonTest.php
index d940543136b..9f24283f962 100644
--- a/core/tests/Drupal/Tests/Component/Serialization/JsonTest.php
+++ b/core/tests/Drupal/Tests/Component/Serialization/JsonTest.php
@@ -57,7 +57,7 @@ class JsonTest extends TestCase {
/**
* Tests encoding for every ASCII character.
*/
- public function testEncodingAscii() {
+ public function testEncodingAscii(): void {
// Verify there aren't character encoding problems with the source string.
$this->assertSame(127, strlen($this->string), 'A string with the full ASCII table has the correct length.');
foreach ($this->htmlUnsafe as $char) {
@@ -68,7 +68,7 @@ class JsonTest extends TestCase {
/**
* Tests encoding length.
*/
- public function testEncodingLength() {
+ public function testEncodingLength(): void {
// Verify that JSON encoding produces a string with all of the characters.
$json = Json::encode($this->string);
// Verify that a JSON-encoded string is larger than the source string.
@@ -78,7 +78,7 @@ class JsonTest extends TestCase {
/**
* Tests end and start of the encoded string.
*/
- public function testEncodingStartEnd() {
+ public function testEncodingStartEnd(): void {
$json = Json::encode($this->string);
// The first and last characters should be ", and no others.
$this->assertStringStartsWith('"', $json, 'A JSON encoded string begins with ".');
@@ -89,7 +89,7 @@ class JsonTest extends TestCase {
/**
* Tests converting PHP variables to JSON strings and back.
*/
- public function testReversibility() {
+ public function testReversibility(): void {
$json = Json::encode($this->string);
// Verify that encoding/decoding is reversible.
$json_decoded = Json::decode($json);
@@ -99,7 +99,7 @@ class JsonTest extends TestCase {
/**
* Tests the reversibility of structured data.
*/
- public function testStructuredReversibility() {
+ public function testStructuredReversibility(): void {
// Verify reversibility for structured data. Also verify that necessary
// characters are escaped.
$source = [TRUE, FALSE, 0, 1, '0', '1', $this->string, ['key1' => $this->string, 'key2' => ['nested' => TRUE]]];
diff --git a/core/tests/Drupal/Tests/Component/Serialization/YamlPeclTest.php b/core/tests/Drupal/Tests/Component/Serialization/YamlPeclTest.php
index 174ea786b2a..8f124a85ba9 100644
--- a/core/tests/Drupal/Tests/Component/Serialization/YamlPeclTest.php
+++ b/core/tests/Drupal/Tests/Component/Serialization/YamlPeclTest.php
@@ -31,7 +31,7 @@ class YamlPeclTest extends YamlTestBase {
/**
* Ensures that php object support is disabled.
*/
- public function testObjectSupportDisabled() {
+ public function testObjectSupportDisabled(): void {
$object = new \stdClass();
$object->foo = 'bar';
$this->assertEquals(['O:8:"stdClass":1:{s:3:"foo";s:3:"bar";}'], YamlPecl::decode(YamlPecl::encode([$object])));
@@ -44,7 +44,7 @@ class YamlPeclTest extends YamlTestBase {
* @covers ::decode
* @dataProvider providerDecodeTests
*/
- public function testDecode($string, $data) {
+ public function testDecode($string, $data): void {
$this->assertEquals($data, YamlPecl::decode($string));
}
@@ -53,7 +53,7 @@ class YamlPeclTest extends YamlTestBase {
*
* @covers ::encode
*/
- public function testEncode() {
+ public function testEncode(): void {
// cSpell:disable
$this->assertEquals('---
foo:
@@ -74,14 +74,14 @@ foo:
* @covers ::applyBooleanCallbacks
* @dataProvider providerBoolTest
*/
- public function testApplyBooleanCallbacks($string, $expected) {
+ public function testApplyBooleanCallbacks($string, $expected): void {
$this->assertEquals($expected, YamlPecl::applyBooleanCallbacks($string, 'bool', NULL));
}
/**
* @covers ::getFileExtension
*/
- public function testGetFileExtension() {
+ public function testGetFileExtension(): void {
$this->assertEquals('yml', YamlPecl::getFileExtension());
}
@@ -90,7 +90,7 @@ foo:
*
* @covers ::errorHandler
*/
- public function testError() {
+ public function testError(): void {
$this->expectException(InvalidDataTypeException::class);
YamlPecl::decode('foo: [ads');
}
diff --git a/core/tests/Drupal/Tests/Component/Serialization/YamlTest.php b/core/tests/Drupal/Tests/Component/Serialization/YamlTest.php
index 7c08d60d701..7980f584535 100644
--- a/core/tests/Drupal/Tests/Component/Serialization/YamlTest.php
+++ b/core/tests/Drupal/Tests/Component/Serialization/YamlTest.php
@@ -33,7 +33,7 @@ class YamlTest extends YamlTestBase {
* @covers ::decode
* @dataProvider providerDecodeTests
*/
- public function testDecode($string, $data) {
+ public function testDecode($string, $data): void {
$this->assertSame($data, Yaml::decode($string));
}
@@ -42,7 +42,7 @@ class YamlTest extends YamlTestBase {
*
* @covers ::encode
*/
- public function testEncode() {
+ public function testEncode(): void {
// cSpell:disable
$this->assertSame('foo:
bar: \'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sapien ex, venenatis vitae nisi eu, posuere luctus dolor. Nullam convallis\'
@@ -53,7 +53,7 @@ class YamlTest extends YamlTestBase {
/**
* @covers ::getFileExtension
*/
- public function testGetFileExtension() {
+ public function testGetFileExtension(): void {
$this->assertSame('yml', Yaml::getFileExtension());
}
@@ -62,7 +62,7 @@ class YamlTest extends YamlTestBase {
*
* @covers ::decode
*/
- public function testError() {
+ public function testError(): void {
$this->expectException(InvalidDataTypeException::class);
Yaml::decode('foo: [ads');
}
@@ -72,7 +72,7 @@ class YamlTest extends YamlTestBase {
*
* @covers ::encode
*/
- public function testEncodeObjectSupportDisabled() {
+ public function testEncodeObjectSupportDisabled(): void {
$this->expectException(InvalidDataTypeException::class);
$this->expectExceptionMessage('Object support when dumping a YAML file has been disabled.');
$object = new \stdClass();
@@ -85,7 +85,7 @@ class YamlTest extends YamlTestBase {
*
* @covers ::decode
*/
- public function testDecodeObjectSupportDisabled() {
+ public function testDecodeObjectSupportDisabled(): void {
$this->expectException(InvalidDataTypeException::class);
$this->expectExceptionMessageMatches('/^Object support when parsing a YAML file has been disabled/');
$yaml = <<<YAML
diff --git a/core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php b/core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php
index ce176d26299..3badd32fab8 100644
--- a/core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php
+++ b/core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php
@@ -28,7 +28,7 @@ class PhpTransliterationTest extends TestCase {
*
* @dataProvider providerTestPhpTransliterationRemoveDiacritics
*/
- public function testRemoveDiacritics($original, $expected) {
+ public function testRemoveDiacritics($original, $expected): void {
$transliterator_class = new PhpTransliteration();
$result = $transliterator_class->removeDiacritics($original);
$this->assertEquals($expected, $result);
@@ -225,7 +225,7 @@ class PhpTransliterationTest extends TestCase {
*
* @covers ::readLanguageOverrides
*/
- public function testSafeInclude() {
+ public function testSafeInclude(): void {
// The overrides in the transliteration data directory transliterates 0x82
// into "safe" but the overrides one directory higher transliterates the
// same character into "security hole". So by using "../index" as the
diff --git a/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php b/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php
index 9f7004e4d27..d9d8563de20 100644
--- a/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php
@@ -25,7 +25,7 @@ class ArgumentsResolverTest extends TestCase {
*
* @dataProvider providerTestGetArgument
*/
- public function testGetArgument($callable, $scalars, $objects, $wildcards, $expected) {
+ public function testGetArgument($callable, $scalars, $objects, $wildcards, $expected): void {
$arguments = (new ArgumentsResolver($scalars, $objects, $wildcards))->getArguments($callable);
$this->assertSame($expected, $arguments);
}
@@ -79,7 +79,7 @@ class ArgumentsResolverTest extends TestCase {
/**
* Tests getArgument() with an object.
*/
- public function testGetArgumentObject() {
+ public function testGetArgumentObject(): void {
$callable = function (\stdClass $object) {};
$object = new \stdClass();
@@ -90,7 +90,7 @@ class ArgumentsResolverTest extends TestCase {
/**
* Tests getArgument() with a wildcard object for a parameter with a custom name.
*/
- public function testGetWildcardArgument() {
+ public function testGetWildcardArgument(): void {
$callable = function (\stdClass $custom_name) {};
$object = new \stdClass();
@@ -101,7 +101,7 @@ class ArgumentsResolverTest extends TestCase {
/**
* Tests getArgument() with a Route, Request, and Account object.
*/
- public function testGetArgumentOrder() {
+ public function testGetArgumentOrder(): void {
$a1 = $this->getMockBuilder('\Drupal\Tests\Component\Utility\Test1Interface')->getMock();
$a2 = $this->getMockBuilder('\Drupal\Tests\Component\Utility\TestClass')->getMock();
$a3 = $this->getMockBuilder('\Drupal\Tests\Component\Utility\Test2Interface')->getMock();
@@ -128,7 +128,7 @@ class ArgumentsResolverTest extends TestCase {
*
* Without the type hint, the wildcard object will not be passed to the callable.
*/
- public function testGetWildcardArgumentNoTypeHint() {
+ public function testGetWildcardArgumentNoTypeHint(): void {
$a = $this->getMockBuilder('\Drupal\Tests\Component\Utility\Test1Interface')->getMock();
$wildcards = [$a];
$resolver = new ArgumentsResolver([], [], $wildcards);
@@ -145,7 +145,7 @@ class ArgumentsResolverTest extends TestCase {
* Without the type hint, passing a value to a named parameter will still
* receive the provided value.
*/
- public function testGetArgumentRouteNoTypeHintAndValue() {
+ public function testGetArgumentRouteNoTypeHintAndValue(): void {
$scalars = ['route' => 'foo'];
$resolver = new ArgumentsResolver($scalars, [], []);
@@ -157,7 +157,7 @@ class ArgumentsResolverTest extends TestCase {
/**
* Tests handleUnresolvedArgument() for a scalar argument.
*/
- public function testHandleNotUpcastedArgument() {
+ public function testHandleNotUpcastedArgument(): void {
$objects = ['foo' => 'bar'];
$scalars = ['foo' => 'baz'];
$resolver = new ArgumentsResolver($scalars, $objects, []);
@@ -173,7 +173,7 @@ class ArgumentsResolverTest extends TestCase {
*
* @dataProvider providerTestHandleUnresolvedArgument
*/
- public function testHandleUnresolvedArgument($callable) {
+ public function testHandleUnresolvedArgument($callable): void {
$resolver = new ArgumentsResolver([], [], []);
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('requires a value for the "$foo" argument.');
diff --git a/core/tests/Drupal/Tests/Component/Utility/ColorTest.php b/core/tests/Drupal/Tests/Component/Utility/ColorTest.php
index f2a6a202f82..d79aabb136d 100644
--- a/core/tests/Drupal/Tests/Component/Utility/ColorTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/ColorTest.php
@@ -24,7 +24,7 @@ class ColorTest extends TestCase {
*
* @dataProvider providerTestValidateHex
*/
- public function testValidateHex($expected, $value) {
+ public function testValidateHex($expected, $value): void {
$this->assertSame($expected, Color::validateHex($value));
}
@@ -80,7 +80,7 @@ class ColorTest extends TestCase {
*
* @dataProvider providerTestHexToRgb
*/
- public function testHexToRgb($value, $expected, $invalid = FALSE) {
+ public function testHexToRgb($value, $expected, $invalid = FALSE): void {
if ($invalid) {
$this->expectException('InvalidArgumentException');
}
@@ -141,7 +141,7 @@ class ColorTest extends TestCase {
*
* @dataProvider providerTestRbgToHex
*/
- public function testRgbToHex($value, $expected) {
+ public function testRgbToHex($value, $expected): void {
$this->assertSame($expected, Color::rgbToHex($value));
}
@@ -208,7 +208,7 @@ class ColorTest extends TestCase {
*
* @dataProvider providerTestNormalizeHexLength
*/
- public function testNormalizeHexLength($value, $expected) {
+ public function testNormalizeHexLength($value, $expected): void {
$this->assertSame($expected, Color::normalizeHexLength($value));
}
diff --git a/core/tests/Drupal/Tests/Component/Utility/CryptTest.php b/core/tests/Drupal/Tests/Component/Utility/CryptTest.php
index 22c5081efb7..c29ded1e244 100644
--- a/core/tests/Drupal/Tests/Component/Utility/CryptTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/CryptTest.php
@@ -27,7 +27,7 @@ class CryptTest extends TestCase {
* @param string $expected_hash
* Expected result from hashing $data.
*/
- public function testHashBase64($data, $expected_hash) {
+ public function testHashBase64($data, $expected_hash): void {
$hash = Crypt::hashBase64($data);
$this->assertEquals($expected_hash, $hash, 'The correct hash was not calculated.');
}
@@ -45,7 +45,7 @@ class CryptTest extends TestCase {
* @param string $expected_hmac
* Expected result from hashing $data using $key.
*/
- public function testHmacBase64($data, $key, $expected_hmac) {
+ public function testHmacBase64($data, $key, $expected_hmac): void {
$hmac = Crypt::hmacBase64($data, $key);
$this->assertEquals($expected_hmac, $hmac, 'The correct hmac was not calculated.');
}
@@ -61,7 +61,7 @@ class CryptTest extends TestCase {
* @param string $key
* Key to use in hashing process.
*/
- public function testHmacBase64Invalid($data, $key) {
+ public function testHmacBase64Invalid($data, $key): void {
$this->expectException('InvalidArgumentException');
Crypt::hmacBase64($data, $key);
}
diff --git a/core/tests/Drupal/Tests/Component/Utility/DeprecationHelperTest.php b/core/tests/Drupal/Tests/Component/Utility/DeprecationHelperTest.php
index a44fe30c5ca..2383752bffd 100644
--- a/core/tests/Drupal/Tests/Component/Utility/DeprecationHelperTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/DeprecationHelperTest.php
@@ -21,7 +21,7 @@ class DeprecationHelperTest extends TestCase {
*
* @dataProvider deprecatedHelperTestCases
*/
- public function testDeprecationHelper(string $currentVersion, array $tests) {
+ public function testDeprecationHelper(string $currentVersion, array $tests): void {
foreach ($tests as $deprecatedVersion => $expectedCallable) {
$result = DeprecationHelper::backwardsCompatibleCall(
$currentVersion,
diff --git a/core/tests/Drupal/Tests/Component/Utility/EmailValidatorTest.php b/core/tests/Drupal/Tests/Component/Utility/EmailValidatorTest.php
index d5d4577baf5..b57f51c8b6a 100644
--- a/core/tests/Drupal/Tests/Component/Utility/EmailValidatorTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/EmailValidatorTest.php
@@ -19,7 +19,7 @@ class EmailValidatorTest extends TestCase {
/**
* @covers ::isValid
*/
- public function testIsValid() {
+ public function testIsValid(): void {
// Note that \Drupal\Component\Utility\EmailValidator wraps
// \Egulias\EmailValidator\EmailValidator so we don't do anything more than
// test that the wrapping works since the dependency has its own test
@@ -33,7 +33,7 @@ class EmailValidatorTest extends TestCase {
/**
* @covers ::isValid
*/
- public function testIsValidException() {
+ public function testIsValidException(): void {
$validator = new EmailValidator();
$this->expectException(\BadMethodCallException::class);
$this->expectExceptionMessage('Calling \Drupal\Component\Utility\EmailValidator::isValid() with the second argument is not supported. See https://www.drupal.org/node/2997196');
diff --git a/core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php b/core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php
index 7f0ef7f0c96..228d8bc50a9 100644
--- a/core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php
@@ -32,7 +32,7 @@ class EnvironmentTest extends TestCase {
* The expected return value from
* \Drupal\Component\Utility\Environment::checkMemoryLimit().
*/
- public function testCheckMemoryLimit($required, $custom_memory_limit, $expected) {
+ public function testCheckMemoryLimit($required, $custom_memory_limit, $expected): void {
$actual = Environment::checkMemoryLimit($required, $custom_memory_limit);
$this->assertEquals($expected, $actual);
}
diff --git a/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php b/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php
index 17fcabc59b0..a3f30dac659 100644
--- a/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php
@@ -46,7 +46,7 @@ class HtmlTest extends TestCase {
*
* @covers ::cleanCssIdentifier
*/
- public function testCleanCssIdentifier($expected, $source, $filter = NULL) {
+ public function testCleanCssIdentifier($expected, $source, $filter = NULL): void {
if ($filter !== NULL) {
$this->assertSame($expected, Html::cleanCssIdentifier($source, $filter));
}
@@ -92,7 +92,7 @@ class HtmlTest extends TestCase {
*
* @covers ::getClass
*/
- public function testHtmlClass() {
+ public function testHtmlClass(): void {
// Verify Drupal coding standards are enforced.
$this->assertSame('class-name--ü', Html::getClass('CLASS NAME_[Ü]'), 'Enforce Drupal coding standards.');
@@ -116,7 +116,7 @@ class HtmlTest extends TestCase {
*
* @covers ::getUniqueId
*/
- public function testHtmlGetUniqueId($expected, $source, $reset = FALSE) {
+ public function testHtmlGetUniqueId($expected, $source, $reset = FALSE): void {
if ($reset) {
Html::resetSeenIds();
}
@@ -159,7 +159,7 @@ class HtmlTest extends TestCase {
*
* @covers ::getUniqueId
*/
- public function testHtmlGetUniqueIdWithAjaxIds($expected, $source) {
+ public function testHtmlGetUniqueIdWithAjaxIds($expected, $source): void {
Html::setIsAjax(TRUE);
$id = Html::getUniqueId($source);
@@ -203,7 +203,7 @@ class HtmlTest extends TestCase {
*
* @covers ::getId
*/
- public function testHtmlGetId($expected, $source) {
+ public function testHtmlGetId($expected, $source): void {
Html::setIsAjax(FALSE);
$this->assertSame($expected, Html::getId($source));
}
@@ -237,7 +237,7 @@ class HtmlTest extends TestCase {
* @dataProvider providerDecodeEntities
* @covers ::decodeEntities
*/
- public function testDecodeEntities($text, $expected) {
+ public function testDecodeEntities($text, $expected): void {
$this->assertEquals($expected, Html::decodeEntities($text));
}
@@ -278,7 +278,7 @@ class HtmlTest extends TestCase {
* @dataProvider providerEscape
* @covers ::escape
*/
- public function testEscape($expected, $text) {
+ public function testEscape($expected, $text): void {
$this->assertEquals($expected, Html::escape($text));
}
@@ -312,7 +312,7 @@ class HtmlTest extends TestCase {
* @covers ::decodeEntities
* @covers ::escape
*/
- public function testDecodeEntitiesAndEscape() {
+ public function testDecodeEntitiesAndEscape(): void {
$string = "<em>répét&eacute;</em>";
$escaped = Html::escape($string);
$this->assertSame('&lt;em&gt;répét&amp;eacute;&lt;/em&gt;', $escaped);
@@ -332,7 +332,7 @@ class HtmlTest extends TestCase {
*
* @covers ::serialize
*/
- public function testSerialize() {
+ public function testSerialize(): void {
$document = new \DOMDocument();
$result = Html::serialize($document);
$this->assertSame('', $result);
@@ -342,7 +342,7 @@ class HtmlTest extends TestCase {
* @covers ::transformRootRelativeUrlsToAbsolute
* @dataProvider providerTestTransformRootRelativeUrlsToAbsolute
*/
- public function testTransformRootRelativeUrlsToAbsolute($html, $scheme_and_host, $expected_html) {
+ public function testTransformRootRelativeUrlsToAbsolute($html, $scheme_and_host, $expected_html): void {
$this->assertSame($expected_html ?: $html, Html::transformRootRelativeUrlsToAbsolute($html, $scheme_and_host));
}
@@ -350,7 +350,7 @@ class HtmlTest extends TestCase {
* @covers ::transformRootRelativeUrlsToAbsolute
* @dataProvider providerTestTransformRootRelativeUrlsToAbsoluteAssertion
*/
- public function testTransformRootRelativeUrlsToAbsoluteAssertion($scheme_and_host) {
+ public function testTransformRootRelativeUrlsToAbsoluteAssertion($scheme_and_host): void {
$this->expectException(\AssertionError::class);
Html::transformRootRelativeUrlsToAbsolute('', $scheme_and_host);
}
diff --git a/core/tests/Drupal/Tests/Component/Utility/ImageTest.php b/core/tests/Drupal/Tests/Component/Utility/ImageTest.php
index c41af317910..7d179e3145b 100644
--- a/core/tests/Drupal/Tests/Component/Utility/ImageTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/ImageTest.php
@@ -18,7 +18,7 @@ class ImageTest extends TestCase {
*
* @dataProvider providerTestScaleDimensions
*/
- public function testScaleDimensions($input, $output) {
+ public function testScaleDimensions($input, $output): void {
// Process the test dataset.
$return_value = Image::scaleDimensions($input['dimensions'], $input['width'], $input['height'], $input['upscale']);
diff --git a/core/tests/Drupal/Tests/Component/Utility/NestedArrayTest.php b/core/tests/Drupal/Tests/Component/Utility/NestedArrayTest.php
index a48d5bab73f..7a43bda8882 100644
--- a/core/tests/Drupal/Tests/Component/Utility/NestedArrayTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/NestedArrayTest.php
@@ -47,7 +47,7 @@ class NestedArrayTest extends TestCase {
*
* @covers ::getValue
*/
- public function testGetValue() {
+ public function testGetValue(): void {
// Verify getting a value of a nested element.
$value = NestedArray::getValue($this->form, $this->parents);
$this->assertSame('Nested element', $value['#value'], 'Nested element value found.');
@@ -77,7 +77,7 @@ class NestedArrayTest extends TestCase {
*
* @covers ::setValue
*/
- public function testSetValue() {
+ public function testSetValue(): void {
$new_value = [
'#value' => 'New value',
'#required' => TRUE,
@@ -98,7 +98,7 @@ class NestedArrayTest extends TestCase {
*
* @covers ::setValue
*/
- public function testSetValueForce() {
+ public function testSetValueForce(): void {
$new_value = [
'one',
];
@@ -113,7 +113,7 @@ class NestedArrayTest extends TestCase {
*
* @covers ::unsetValue
*/
- public function testUnsetValue() {
+ public function testUnsetValue(): void {
// Verify unsetting a non-existing nested element throws no errors and the
// non-existing key is properly reported.
$key_existed = NULL;
@@ -133,7 +133,7 @@ class NestedArrayTest extends TestCase {
/**
* Tests existence of array key.
*/
- public function testKeyExists() {
+ public function testKeyExists(): void {
// Verify that existing key is found.
$this->assertTrue(NestedArray::keyExists($this->form, $this->parents), 'Nested key found.');
@@ -149,7 +149,7 @@ class NestedArrayTest extends TestCase {
* @covers ::mergeDeep
* @covers ::mergeDeepArray
*/
- public function testMergeDeepArray() {
+ public function testMergeDeepArray(): void {
$link_options_1 = [
'fragment' => 'x',
'attributes' => ['title' => 'X', 'class' => ['a', 'b']],
@@ -176,7 +176,7 @@ class NestedArrayTest extends TestCase {
*
* @covers ::mergeDeepArray
*/
- public function testMergeImplicitKeys() {
+ public function testMergeImplicitKeys(): void {
$a = [
'subkey' => ['X', 'Y'],
];
@@ -197,7 +197,7 @@ class NestedArrayTest extends TestCase {
*
* @covers ::mergeDeepArray
*/
- public function testMergeExplicitKeys() {
+ public function testMergeExplicitKeys(): void {
$a = [
'subkey' => [
0 => 'A',
@@ -233,7 +233,7 @@ class NestedArrayTest extends TestCase {
*
* @covers ::mergeDeepArray
*/
- public function testMergeOutOfSequenceKeys() {
+ public function testMergeOutOfSequenceKeys(): void {
$a = [
'subkey' => [
10 => 'A',
@@ -264,7 +264,7 @@ class NestedArrayTest extends TestCase {
* @covers ::filter
* @dataProvider providerTestFilter
*/
- public function testFilter($array, $callable, $expected) {
+ public function testFilter($array, $callable, $expected): void {
$this->assertEquals($expected, NestedArray::filter($array, $callable));
}
diff --git a/core/tests/Drupal/Tests/Component/Utility/NumberTest.php b/core/tests/Drupal/Tests/Component/Utility/NumberTest.php
index 3e06711db90..17482990004 100644
--- a/core/tests/Drupal/Tests/Component/Utility/NumberTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/NumberTest.php
@@ -31,7 +31,7 @@ class NumberTest extends TestCase {
* @param bool $expected
* Expected return value from Number::validStep().
*/
- public function testValidStep($value, $step, $expected) {
+ public function testValidStep($value, $step, $expected): void {
$return = Number::validStep($value, $step);
$this->assertEquals($expected, $return);
}
@@ -51,7 +51,7 @@ class NumberTest extends TestCase {
* @param bool $expected
* Expected return value from Number::validStep().
*/
- public function testValidStepOffset($value, $step, $offset, $expected) {
+ public function testValidStepOffset($value, $step, $offset, $expected): void {
$return = Number::validStep($value, $step, $offset);
$this->assertEquals($expected, $return);
}
@@ -130,7 +130,7 @@ class NumberTest extends TestCase {
* @param string $expected
* The expected alphadecimal value.
*/
- public function testConversions($value, $expected) {
+ public function testConversions($value, $expected): void {
$this->assertSame(Number::intToAlphadecimal($value), $expected);
$this->assertSame($value, Number::alphadecimalToInt($expected));
}
diff --git a/core/tests/Drupal/Tests/Component/Utility/RandomTest.php b/core/tests/Drupal/Tests/Component/Utility/RandomTest.php
index fde2dbbb824..0f34c21d17b 100644
--- a/core/tests/Drupal/Tests/Component/Utility/RandomTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/RandomTest.php
@@ -30,7 +30,7 @@ class RandomTest extends TestCase {
*
* @covers ::string
*/
- public function testRandomStringUniqueness() {
+ public function testRandomStringUniqueness(): void {
$strings = [];
$random = new Random();
for ($i = 0; $i <= 50; $i++) {
@@ -45,7 +45,7 @@ class RandomTest extends TestCase {
*
* @covers ::name
*/
- public function testRandomNamesUniqueness() {
+ public function testRandomNamesUniqueness(): void {
$names = [];
$random = new Random();
for ($i = 0; $i <= 10; $i++) {
@@ -60,7 +60,7 @@ class RandomTest extends TestCase {
*
* @covers ::name
*/
- public function testRandomNameException() {
+ public function testRandomNameException(): void {
// There are fewer than 100 possibilities so an exception should occur to
// prevent infinite loops.
$random = new Random();
@@ -76,7 +76,7 @@ class RandomTest extends TestCase {
*
* @covers ::string
*/
- public function testRandomStringException() {
+ public function testRandomStringException(): void {
// There are fewer than 100 possibilities so an exception should occur to
// prevent infinite loops.
$random = new Random();
@@ -92,7 +92,7 @@ class RandomTest extends TestCase {
*
* @covers ::name
*/
- public function testRandomNameNonUnique() {
+ public function testRandomNameNonUnique(): void {
// There are fewer than 100 possibilities if we were forcing uniqueness so
// exception would occur.
$random = new Random();
@@ -107,7 +107,7 @@ class RandomTest extends TestCase {
*
* @covers ::string
*/
- public function testRandomStringNonUnique() {
+ public function testRandomStringNonUnique(): void {
// There are fewer than 100 possibilities if we were forcing uniqueness so
// exception would occur.
$random = new Random();
@@ -167,7 +167,7 @@ class RandomTest extends TestCase {
*
* @covers ::object
*/
- public function testRandomObject() {
+ public function testRandomObject(): void {
// For values of 0 and 1 \Drupal\Component\Utility\Random::object() will
// have different execution paths.
$random = new Random();
@@ -182,7 +182,7 @@ class RandomTest extends TestCase {
*
* @covers ::string
*/
- public function testRandomStringValidator() {
+ public function testRandomStringValidator(): void {
$random = new Random();
$this->firstStringGenerated = '';
$str = $random->string(1, TRUE, [$this, '_RandomStringValidate']);
@@ -194,7 +194,7 @@ class RandomTest extends TestCase {
*
* @covers ::word
*/
- public function testRandomWordValidator() {
+ public function testRandomWordValidator(): void {
$random = new Random();
$this->assertNotEquals($random->word(20), $random->word(20));
}
diff --git a/core/tests/Drupal/Tests/Component/Utility/RectangleTest.php b/core/tests/Drupal/Tests/Component/Utility/RectangleTest.php
index 79d42ff079d..f7a77f6e7db 100644
--- a/core/tests/Drupal/Tests/Component/Utility/RectangleTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/RectangleTest.php
@@ -18,7 +18,7 @@ class RectangleTest extends TestCase {
*
* @covers ::rotate
*/
- public function testWrongWidth() {
+ public function testWrongWidth(): void {
$this->expectException(\InvalidArgumentException::class);
$rect = new Rectangle(-40, 20);
}
@@ -28,7 +28,7 @@ class RectangleTest extends TestCase {
*
* @covers ::rotate
*/
- public function testWrongHeight() {
+ public function testWrongHeight(): void {
$this->expectException(\InvalidArgumentException::class);
$rect = new Rectangle(40, 0);
}
@@ -53,7 +53,7 @@ class RectangleTest extends TestCase {
*
* @dataProvider providerPhp55RotateDimensions
*/
- public function testRotateDimensions($width, $height, $angle, $exp_width, $exp_height) {
+ public function testRotateDimensions($width, $height, $angle, $exp_width, $exp_height): void {
$rect = new Rectangle($width, $height);
$rect->rotate($angle);
$this->assertEquals($exp_width, $rect->getBoundingWidth());
diff --git a/core/tests/Drupal/Tests/Component/Utility/ReflectionTest.php b/core/tests/Drupal/Tests/Component/Utility/ReflectionTest.php
index 1b15c34f331..c1ea6045939 100644
--- a/core/tests/Drupal/Tests/Component/Utility/ReflectionTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/ReflectionTest.php
@@ -22,7 +22,7 @@ class ReflectionTest extends TestCase {
* @covers ::getParameterClassName
* @dataProvider providerGetParameterClassName
*/
- public function testGetParameterClassName(?string $expected, \ReflectionParameter $parameter) {
+ public function testGetParameterClassName(?string $expected, \ReflectionParameter $parameter): void {
$this->assertEquals($expected, Reflection::getParameterClassName($parameter));
}
diff --git a/core/tests/Drupal/Tests/Component/Utility/SortArrayTest.php b/core/tests/Drupal/Tests/Component/Utility/SortArrayTest.php
index f23aaf4bd87..ceeefe20fe9 100644
--- a/core/tests/Drupal/Tests/Component/Utility/SortArrayTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/SortArrayTest.php
@@ -30,7 +30,7 @@ class SortArrayTest extends TestCase {
* @param int $expected
* The expected output from calling the method.
*/
- public function testSortByWeightElement($a, $b, $expected) {
+ public function testSortByWeightElement($a, $b, $expected): void {
$result = SortArray::sortByWeightElement($a, $b);
$this->assertBothNegativePositiveOrZero($expected, $result);
}
@@ -106,7 +106,7 @@ class SortArrayTest extends TestCase {
* @param int $expected
* The expected output from calling the method.
*/
- public function testSortByWeightProperty($a, $b, $expected) {
+ public function testSortByWeightProperty($a, $b, $expected): void {
$result = SortArray::sortByWeightProperty($a, $b);
$this->assertBothNegativePositiveOrZero($expected, $result);
}
@@ -182,7 +182,7 @@ class SortArrayTest extends TestCase {
* @param int $expected
* The expected output from calling the method.
*/
- public function testSortByTitleElement($a, $b, $expected) {
+ public function testSortByTitleElement($a, $b, $expected): void {
$result = SortArray::sortByTitleElement($a, $b);
$this->assertBothNegativePositiveOrZero($expected, $result);
}
@@ -251,7 +251,7 @@ class SortArrayTest extends TestCase {
* @param int $expected
* The expected output from calling the method.
*/
- public function testSortByTitleProperty($a, $b, $expected) {
+ public function testSortByTitleProperty($a, $b, $expected): void {
$result = SortArray::sortByTitleProperty($a, $b);
$this->assertBothNegativePositiveOrZero($expected, $result);
}
diff --git a/core/tests/Drupal/Tests/Component/Utility/TimerTest.php b/core/tests/Drupal/Tests/Component/Utility/TimerTest.php
index 3c12f9a19df..470ff1de13f 100644
--- a/core/tests/Drupal/Tests/Component/Utility/TimerTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/TimerTest.php
@@ -23,7 +23,7 @@ class TimerTest extends TestCase {
* @covers ::stop
* @covers ::read
*/
- public function testTimer() {
+ public function testTimer(): void {
Timer::start('test');
usleep(5000);
$value = Timer::read('test');
diff --git a/core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php b/core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php
index 29130453278..99ee8ff7e52 100644
--- a/core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php
@@ -24,7 +24,7 @@ class UnicodeTest extends TestCase {
* @dataProvider providerUcfirst
* @covers ::ucfirst
*/
- public function testUcfirst($text, $expected) {
+ public function testUcfirst($text, $expected): void {
$this->assertEquals($expected, Unicode::ucfirst($text));
}
@@ -55,7 +55,7 @@ class UnicodeTest extends TestCase {
* @dataProvider providerLcfirst
* @covers ::lcfirst
*/
- public function testLcfirst($text, $expected) {
+ public function testLcfirst($text, $expected): void {
$this->assertEquals($expected, Unicode::lcfirst($text));
}
@@ -86,7 +86,7 @@ class UnicodeTest extends TestCase {
* @dataProvider providerUcwords
* @covers ::ucwords
*/
- public function testUcwords($text, $expected) {
+ public function testUcwords($text, $expected): void {
$this->assertEquals($expected, Unicode::ucwords($text));
}
@@ -119,7 +119,7 @@ class UnicodeTest extends TestCase {
* @dataProvider providerTruncate
* @covers ::truncate
*/
- public function testTruncate($text, $max_length, $expected, $wordsafe = FALSE, $add_ellipsis = FALSE) {
+ public function testTruncate($text, $max_length, $expected, $wordsafe = FALSE, $add_ellipsis = FALSE): void {
$this->assertEquals($expected, Unicode::truncate($text, $max_length, $wordsafe, $add_ellipsis));
}
@@ -218,7 +218,7 @@ EOF;
* @param string $expected
* The expected return from Unicode::truncateBytes().
*/
- public function testTruncateBytes($text, $max_length, $expected) {
+ public function testTruncateBytes($text, $max_length, $expected): void {
$this->assertEquals($expected, Unicode::truncateBytes($text, $max_length), 'The string was not correctly truncated.');
}
@@ -253,7 +253,7 @@ EOF;
* @param string $message
* The message to display on failure.
*/
- public function testValidateUtf8($text, $expected, $message) {
+ public function testValidateUtf8($text, $expected, $message): void {
$this->assertEquals($expected, Unicode::validateUtf8($text), $message);
}
@@ -292,7 +292,7 @@ EOF;
* @param string|bool $expected
* The expected result.
*/
- public function testConvertToUtf8($data, $encoding, $expected) {
+ public function testConvertToUtf8($data, $encoding, $expected): void {
$this->assertEquals($expected, Unicode::convertToUtf8($data, $encoding));
}
diff --git a/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php b/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php
index d7431155f80..4e3e6a84f56 100644
--- a/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php
@@ -42,7 +42,7 @@ class UrlHelperTest extends TestCase {
* @param string $message
* The assertion message.
*/
- public function testBuildQuery($query, $expected, $message) {
+ public function testBuildQuery($query, $expected, $message): void {
$this->assertEquals(UrlHelper::buildQuery($query), $expected, $message);
}
@@ -112,7 +112,7 @@ class UrlHelperTest extends TestCase {
/**
* Tests that we get the same thing out that we put in.
*/
- public function testCompressUncompress() {
+ public function testCompressUncompress(): void {
$data = [];
while (count($data) < 30) {
$data[] = 'drupal/drupal' . count($data);
@@ -127,7 +127,7 @@ class UrlHelperTest extends TestCase {
/**
* Tests passing an invalid string as a compressed query parameter.
*/
- public function testUncompressInvalidString() {
+ public function testUncompressInvalidString(): void {
// Pass an invalid string to ::uncompressQueryParameter() and ensure it
// returns the passed string without resulting in a PHP warning.
$this->assertSame('llama', UrlHelper::uncompressQueryParameter('llama'));
@@ -230,7 +230,7 @@ class UrlHelperTest extends TestCase {
* @param array $expected
* An array containing query parameters.
*/
- public function testFilterQueryParameters($query, $exclude, $expected) {
+ public function testFilterQueryParameters($query, $exclude, $expected): void {
$filtered = UrlHelper::filterQueryParameters($query, $exclude);
$this->assertEquals($expected, $filtered, 'The query was not properly filtered.');
}
@@ -268,7 +268,7 @@ class UrlHelperTest extends TestCase {
* @param array $expected
* Associative array with expected parameters.
*/
- public function testParse($url, $expected) {
+ public function testParse($url, $expected): void {
$parsed = UrlHelper::parse($url);
$this->assertEquals($expected, $parsed, 'The URL was not properly parsed.');
}
@@ -390,7 +390,7 @@ class UrlHelperTest extends TestCase {
* @param string $expected
* The expected encoded path.
*/
- public function testEncodePath($path, $expected) {
+ public function testEncodePath($path, $expected): void {
$encoded = UrlHelper::encodePath($path);
$this->assertEquals($expected, $encoded);
}
@@ -418,7 +418,7 @@ class UrlHelperTest extends TestCase {
* @param bool $expected
* Expected result.
*/
- public function testIsExternal($path, $expected) {
+ public function testIsExternal($path, $expected): void {
$isExternal = UrlHelper::isExternal($path);
$this->assertEquals($expected, $isExternal);
}
@@ -480,7 +480,7 @@ class UrlHelperTest extends TestCase {
*
* @runInSeparateProcess
*/
- public function testFilterBadProtocol($uri, $expected, $protocols) {
+ public function testFilterBadProtocol($uri, $expected, $protocols): void {
UrlHelper::setAllowedProtocols($protocols);
$this->assertEquals($expected, UrlHelper::filterBadProtocol($uri));
// Multiple calls to UrlHelper::filterBadProtocol() do not cause double
@@ -521,7 +521,7 @@ class UrlHelperTest extends TestCase {
*
* @runInSeparateProcess
*/
- public function testStripDangerousProtocols($uri, $expected, $protocols) {
+ public function testStripDangerousProtocols($uri, $expected, $protocols): void {
UrlHelper::setAllowedProtocols($protocols);
$stripped = UrlHelper::stripDangerousProtocols($uri);
$this->assertEquals($expected, $stripped);
@@ -598,7 +598,7 @@ class UrlHelperTest extends TestCase {
* @covers ::externalIsLocal
* @dataProvider providerTestExternalIsLocal
*/
- public function testExternalIsLocal($url, $base_url, $expected) {
+ public function testExternalIsLocal($url, $base_url, $expected): void {
$this->assertSame($expected, UrlHelper::externalIsLocal($url, $base_url));
}
@@ -650,7 +650,7 @@ class UrlHelperTest extends TestCase {
* @covers ::externalIsLocal
* @dataProvider providerTestExternalIsLocalInvalid
*/
- public function testExternalIsLocalInvalid($url, $base_url) {
+ public function testExternalIsLocalInvalid($url, $base_url): void {
$this->expectException(\InvalidArgumentException::class);
UrlHelper::externalIsLocal($url, $base_url);
}
diff --git a/core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php b/core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php
index f0ee35429a6..b14d4327379 100644
--- a/core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php
@@ -74,7 +74,7 @@ class UserAgentTest extends TestCase {
* @dataProvider providerTestGetBestMatchingLangcode
* @covers ::getBestMatchingLangcode
*/
- public function testGetBestMatchingLangcode($accept_language, $expected) {
+ public function testGetBestMatchingLangcode($accept_language, $expected): void {
$result = UserAgent::getBestMatchingLangcode($accept_language, $this->getLanguages(), $this->getMappings());
$this->assertSame($expected, $result);
}
diff --git a/core/tests/Drupal/Tests/Component/Utility/VariableTest.php b/core/tests/Drupal/Tests/Component/Utility/VariableTest.php
index 0df91d37e95..16756235cfe 100644
--- a/core/tests/Drupal/Tests/Component/Utility/VariableTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/VariableTest.php
@@ -174,7 +174,7 @@ class VariableTest extends TestCase {
* @param mixed $variable
* The variable to be exported.
*/
- public function testExport($expected, $variable) {
+ public function testExport($expected, $variable): void {
$this->assertEquals($expected, Variable::export($variable));
}
diff --git a/core/tests/Drupal/Tests/Component/Utility/XssTest.php b/core/tests/Drupal/Tests/Component/Utility/XssTest.php
index e25dd3e5dfc..15b1f038434 100644
--- a/core/tests/Drupal/Tests/Component/Utility/XssTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/XssTest.php
@@ -68,7 +68,7 @@ class XssTest extends TestCase {
*
* @dataProvider providerTestFilterXssNormalized
*/
- public function testFilterXssNormalized($value, $expected, $message, ?array $allowed_tags = NULL) {
+ public function testFilterXssNormalized($value, $expected, $message, ?array $allowed_tags = NULL): void {
if ($allowed_tags === NULL) {
$value = Xss::filter($value);
}
@@ -135,7 +135,7 @@ class XssTest extends TestCase {
*
* @dataProvider providerTestFilterXssNotNormalized
*/
- public function testFilterXssNotNormalized($value, $expected, $message, ?array $allowed_tags = NULL) {
+ public function testFilterXssNotNormalized($value, $expected, $message, ?array $allowed_tags = NULL): void {
if ($allowed_tags === NULL) {
$value = Xss::filter($value);
}
@@ -448,7 +448,7 @@ class XssTest extends TestCase {
*
* @dataProvider providerTestInvalidMultiByte
*/
- public function testInvalidMultiByte($value, $expected, $message) {
+ public function testInvalidMultiByte($value, $expected, $message): void {
$this->assertEquals(Xss::filter($value), $expected, $message);
}
@@ -474,7 +474,7 @@ class XssTest extends TestCase {
/**
* Checks that strings starting with a question sign are correctly processed.
*/
- public function testQuestionSign() {
+ public function testQuestionSign(): void {
$value = Xss::filter('<?xml:namespace ns="urn:schemas-microsoft-com:time">');
$this->assertStringNotContainsStringIgnoringCase('<?xml', $value, 'HTML tag stripping evasion -- starting with a question sign (processing instructions).');
}
@@ -485,7 +485,7 @@ class XssTest extends TestCase {
* @covers ::attributes
* @dataProvider providerTestAttributes
*/
- public function testAttribute($value, $expected, $message, $allowed_tags = NULL) {
+ public function testAttribute($value, $expected, $message, $allowed_tags = NULL): void {
$value = Xss::filter($value, $allowed_tags);
$this->assertEquals($expected, $value, $message);
}
@@ -567,7 +567,7 @@ class XssTest extends TestCase {
/**
* Checks that \Drupal\Component\Utility\Xss::filterAdmin() correctly strips disallowed tags.
*/
- public function testFilterXSSAdmin() {
+ public function testFilterXSSAdmin(): void {
$value = Xss::filterAdmin('<style /><iframe /><frame /><frameset /><meta /><link /><embed /><applet /><param /><layer />');
$this->assertEquals('', $value, 'Admin HTML filter -- should never allow some tags.');
}
@@ -584,7 +584,7 @@ class XssTest extends TestCase {
*
* @dataProvider providerTestFilterXssAdminNotNormalized
*/
- public function testFilterXssAdminNotNormalized($value, $expected, $message) {
+ public function testFilterXssAdminNotNormalized($value, $expected, $message): void {
$this->assertNotNormalized(Xss::filterAdmin($value), $expected, $message);
}
@@ -612,7 +612,7 @@ class XssTest extends TestCase {
*
* @see \Drupal\Component\Utility\HtmlSerializerRules
*/
- public function testFilterNormalizedHtml5() {
+ public function testFilterNormalizedHtml5(): void {
$input = '<span data-caption="foo &lt;em&gt;bar&lt;/em&gt;"></span>';
$this->assertEquals($input, Xss::filter(Html::normalize($input), ['span']));
}
diff --git a/core/tests/Drupal/Tests/Component/Uuid/UuidTest.php b/core/tests/Drupal/Tests/Component/Uuid/UuidTest.php
index 77a5ed1fb96..a0c2dd8b9cd 100644
--- a/core/tests/Drupal/Tests/Component/Uuid/UuidTest.php
+++ b/core/tests/Drupal/Tests/Component/Uuid/UuidTest.php
@@ -23,7 +23,7 @@ class UuidTest extends TestCase {
*
* @dataProvider providerUuidInstances
*/
- public function testGenerateUuid(UuidInterface $instance) {
+ public function testGenerateUuid(UuidInterface $instance): void {
$this->assertTrue(Uuid::isValid($instance->generate()), sprintf('UUID generation for %s works.', get_class($instance)));
}
@@ -32,7 +32,7 @@ class UuidTest extends TestCase {
*
* @dataProvider providerUuidInstances
*/
- public function testUuidIsUnique(UuidInterface $instance) {
+ public function testUuidIsUnique(UuidInterface $instance): void {
$this->assertNotEquals($instance->generate(), $instance->generate(), sprintf('Same UUID was not generated twice with %s.', get_class($instance)));
}
@@ -71,7 +71,7 @@ class UuidTest extends TestCase {
*
* @dataProvider providerTestValidation
*/
- public function testValidation($uuid, $is_valid, $message) {
+ public function testValidation($uuid, $is_valid, $message): void {
$this->assertSame($is_valid, Uuid::isValid($uuid), $message);
}
diff --git a/core/tests/Drupal/Tests/Composer/ComposerTest.php b/core/tests/Drupal/Tests/Composer/ComposerTest.php
index 552f25c2166..47084472880 100644
--- a/core/tests/Drupal/Tests/Composer/ComposerTest.php
+++ b/core/tests/Drupal/Tests/Composer/ComposerTest.php
@@ -18,7 +18,7 @@ class ComposerTest extends UnitTestCase {
*
* @covers ::ensureComposerVersion
*/
- public function testEnsureComposerVersion() {
+ public function testEnsureComposerVersion(): void {
try {
$this->assertNull(Composer::ensureComposerVersion());
}
@@ -33,7 +33,7 @@ class ComposerTest extends UnitTestCase {
* Also ensure that the minimum php version in the root-level composer.json
* file exactly matches \Drupal::MINIMUM_PHP.
*/
- public function testEnsurePhpConfiguredVersion() {
+ public function testEnsurePhpConfiguredVersion(): void {
$composer_json = json_decode(file_get_contents($this->root . '/composer.json'), TRUE);
$composer_core_json = json_decode(file_get_contents($this->root . '/core/composer.json'), TRUE);
$this->assertEquals(\Drupal::MINIMUM_PHP, $composer_json['config']['platform']['php'], 'The \Drupal::MINIMUM_PHP constant should always be exactly the same as the config.platform.php in the root composer.json.');
diff --git a/core/tests/Drupal/Tests/Composer/Generator/BuilderTest.php b/core/tests/Drupal/Tests/Composer/Generator/BuilderTest.php
index a41153b4ee8..4c85ec8f114 100644
--- a/core/tests/Drupal/Tests/Composer/Generator/BuilderTest.php
+++ b/core/tests/Drupal/Tests/Composer/Generator/BuilderTest.php
@@ -88,7 +88,7 @@ class BuilderTest extends TestCase {
*
* @dataProvider builderTestData
*/
- public function testBuilder($builderClass, $expected) {
+ public function testBuilder($builderClass, $expected): void {
$fixtures = new Fixtures();
$drupalCoreInfo = $fixtures->drupalCoreComposerFixture();
diff --git a/core/tests/Drupal/Tests/Composer/Generator/MetapackageUpdateTest.php b/core/tests/Drupal/Tests/Composer/Generator/MetapackageUpdateTest.php
index dcadfe9989c..5a9df6df8f7 100644
--- a/core/tests/Drupal/Tests/Composer/Generator/MetapackageUpdateTest.php
+++ b/core/tests/Drupal/Tests/Composer/Generator/MetapackageUpdateTest.php
@@ -55,7 +55,7 @@ class MetapackageUpdateTest extends TestCase {
*
* @dataProvider updatedTestData
*/
- public function testUpdated($builderClass, $path) {
+ public function testUpdated($builderClass, $path): void {
// Create a DrupalCoreComposer for the System Under Test (current repo)
$repositoryRoot = dirname(__DIR__, 6);
$drupalCoreInfo = DrupalCoreComposer::createFromPath($repositoryRoot);
diff --git a/core/tests/Drupal/Tests/Composer/Generator/OverlapWithTopLevelDependenciesTest.php b/core/tests/Drupal/Tests/Composer/Generator/OverlapWithTopLevelDependenciesTest.php
index 2b0305f9850..503a78b1fc3 100644
--- a/core/tests/Drupal/Tests/Composer/Generator/OverlapWithTopLevelDependenciesTest.php
+++ b/core/tests/Drupal/Tests/Composer/Generator/OverlapWithTopLevelDependenciesTest.php
@@ -35,7 +35,7 @@ class OverlapWithTopLevelDependenciesTest extends TestCase {
* @param string $template_project_path
* The path of the project template to test.
*/
- public function testOverlapWithTemplateProject($template_project_path) {
+ public function testOverlapWithTemplateProject($template_project_path): void {
$root = dirname(__DIR__, 6);
// Read template project composer.json.
$top_level_composer_json = json_decode(file_get_contents("$root/$template_project_path/composer.json"), TRUE);
diff --git a/core/tests/Drupal/Tests/Composer/Plugin/ProjectMessage/ConfigTest.php b/core/tests/Drupal/Tests/Composer/Plugin/ProjectMessage/ConfigTest.php
index 8949cf51cd7..4c52c5600fb 100644
--- a/core/tests/Drupal/Tests/Composer/Plugin/ProjectMessage/ConfigTest.php
+++ b/core/tests/Drupal/Tests/Composer/Plugin/ProjectMessage/ConfigTest.php
@@ -59,7 +59,7 @@ class ConfigTest extends TestCase {
* @dataProvider provideGetMessageText
* @covers ::getText
*/
- public function testGetMessageText($expected, $config) {
+ public function testGetMessageText($expected, $config): void {
// Root package has our config.
$root = $this->createMock(RootPackageInterface::class);
$root->expects($this->once())
@@ -74,7 +74,7 @@ class ConfigTest extends TestCase {
/**
* @covers ::getText
*/
- public function testDefaultFile() {
+ public function testDefaultFile(): void {
// Root package has no extra field.
$root = $this->createMock(RootPackageInterface::class);
$root->expects($this->once())
diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php
index dda93939b66..7c7a10909c1 100644
--- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php
+++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php
@@ -77,7 +77,7 @@ class ComposerHookTest extends BuildTestBase {
/**
* Tests to see if scaffold operation runs at the correct times.
*/
- public function testComposerHooks() {
+ public function testComposerHooks(): void {
$topLevelProjectDir = 'composer-hooks-fixture';
$sut = $this->fixturesDir . '/' . $topLevelProjectDir;
// First test: run composer install. This is the same as composer update
@@ -126,7 +126,7 @@ class ComposerHookTest extends BuildTestBase {
/**
* Tests to see if scaffold messages are omitted when running scaffold twice.
*/
- public function testScaffoldMessagesDoNotPrintTwice() {
+ public function testScaffoldMessagesDoNotPrintTwice(): void {
$topLevelProjectDir = 'drupal-drupal';
$sut = $this->fixturesDir . '/' . $topLevelProjectDir;
// First test: run composer install. This is the same as composer update
diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php
index e61a716ff8b..634b4018c59 100644
--- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php
+++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php
@@ -102,7 +102,7 @@ class ManageGitIgnoreTest extends TestCase {
/**
* Tests scaffold command correctly manages the .gitignore file.
*/
- public function testManageGitIgnore() {
+ public function testManageGitIgnore(): void {
// Note that the drupal-composer-drupal-project fixture does not
// have any configuration settings related to .gitignore management.
$sut = $this->createSutWithGit('drupal-composer-drupal-project');
@@ -146,7 +146,7 @@ EOT;
/**
* Tests scaffold command does not manage the .gitignore file when disabled.
*/
- public function testUnmanagedGitIgnoreWhenDisabled() {
+ public function testUnmanagedGitIgnoreWhenDisabled(): void {
// Note that the drupal-drupal fixture has a configuration setting
// `"gitignore": false,` which disables .gitignore file handling.
$sut = $this->createSutWithGit('drupal-drupal');
@@ -167,7 +167,7 @@ EOT;
* .gitignore files, then we expect that the unmanaged file should not be
* added to the .gitignore file, because unmanaged files should be committed.
*/
- public function testAppendToEmptySettingsIsUnmanaged() {
+ public function testAppendToEmptySettingsIsUnmanaged(): void {
$sut = $this->createSutWithGit('drupal-drupal-append-settings');
$this->assertFileDoesNotExist($sut . '/autoload.php');
$this->assertFileDoesNotExist($sut . '/index.php');
@@ -187,7 +187,7 @@ EOT;
* The scaffold operation should still succeed if there is no 'git'
* executable.
*/
- public function testUnmanagedGitIgnoreWhenGitNotAvailable() {
+ public function testUnmanagedGitIgnoreWhenGitNotAvailable(): void {
// Note that the drupal-composer-drupal-project fixture does not have any
// configuration settings related to .gitignore management.
$sut = $this->createSutWithGit('drupal-composer-drupal-project');
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 012cc4590c4..951bca66264 100644
--- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php
+++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php
@@ -170,7 +170,7 @@ class ScaffoldTest extends TestCase {
*
* @dataProvider scaffoldExpectedExceptionTestValues
*/
- public function testScaffoldWithExpectedException($fixture_name, $expected_exception_message, $is_link) {
+ public function testScaffoldWithExpectedException($fixture_name, $expected_exception_message, $is_link): void {
// Test scaffold. Expect an error.
$this->expectException(\Exception::class);
$this->expectExceptionMessage($expected_exception_message);
@@ -180,7 +180,7 @@ class ScaffoldTest extends TestCase {
/**
* Try to scaffold a project that does not scaffold anything.
*/
- public function testEmptyProject() {
+ public function testEmptyProject(): void {
$fixture_name = 'empty-fixture';
$result = $this->scaffoldSut($fixture_name, FALSE, FALSE);
@@ -190,7 +190,7 @@ class ScaffoldTest extends TestCase {
/**
* Try to scaffold a project that allows a project with no scaffold files.
*/
- public function testProjectThatScaffoldsEmptyProject() {
+ public function testProjectThatScaffoldsEmptyProject(): void {
$fixture_name = 'project-allowing-empty-fixture';
$result = $this->scaffoldSut($fixture_name, FALSE, FALSE);
$this->assertStringContainsString('The allowed package fixtures/empty-fixture does not provide a file mapping for Composer Scaffold', $result->scaffoldOutput());
@@ -227,7 +227,7 @@ class ScaffoldTest extends TestCase {
*
* @dataProvider scaffoldOverridingSettingsExcludingHtaccessValues
*/
- public function testScaffoldOverridingSettingsExcludingHtaccess($fixture_name, $is_link, $relocated_docroot) {
+ public function testScaffoldOverridingSettingsExcludingHtaccess($fixture_name, $is_link, $relocated_docroot): void {
$result = $this->scaffoldSut($fixture_name, $is_link, $relocated_docroot);
$this->assertCommonDrupalAssetsWereScaffolded($result->docroot(), $is_link);
@@ -243,7 +243,7 @@ class ScaffoldTest extends TestCase {
* replaced, and that files that were not supposed to be replaced remain
* unchanged.
*/
- public function testDrupalDrupalFileWasReplaced() {
+ public function testDrupalDrupalFileWasReplaced(): void {
$fixture_name = 'drupal-drupal-test-overwrite';
$result = $this->scaffoldSut($fixture_name, FALSE, FALSE);
diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldUpgradeTest.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldUpgradeTest.php
index c9f34d95516..f0c687bc439 100644
--- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldUpgradeTest.php
+++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldUpgradeTest.php
@@ -53,7 +53,7 @@ class ScaffoldUpgradeTest extends TestCase {
/**
* Tests upgrading the Composer Scaffold plugin.
*/
- public function testScaffoldUpgrade() {
+ public function testScaffoldUpgrade(): void {
$composerVersionLine = exec('composer --version');
if (str_contains($composerVersionLine, 'Composer version 2')) {
$this->markTestSkipped('We cannot run the scaffold upgrade test with Composer 2 until we have a stable version of drupal/core-composer-scaffold to start from that we can install with Composer 2.x.');
diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/AppendOpTest.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/AppendOpTest.php
index 3cce05475a4..1363cb351b1 100644
--- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/AppendOpTest.php
+++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/AppendOpTest.php
@@ -19,7 +19,7 @@ class AppendOpTest extends TestCase {
/**
* @covers ::process
*/
- public function testProcess() {
+ public function testProcess(): void {
$fixtures = new Fixtures();
$destination = $fixtures->destinationPath('[web-root]/robots.txt');
$options = ScaffoldOptions::create([]);
diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/ReplaceOpTest.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/ReplaceOpTest.php
index a781d5b9c66..27053fe0eed 100644
--- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/ReplaceOpTest.php
+++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/ReplaceOpTest.php
@@ -19,7 +19,7 @@ class ReplaceOpTest extends TestCase {
/**
* @covers ::process
*/
- public function testProcess() {
+ public function testProcess(): void {
$fixtures = new Fixtures();
$destination = $fixtures->destinationPath('[web-root]/robots.txt');
$source = $fixtures->sourcePath('drupal-assets-fixture', 'robots.txt');
@@ -42,7 +42,7 @@ class ReplaceOpTest extends TestCase {
/**
* @covers ::process
*/
- public function testEmptyFile() {
+ public function testEmptyFile(): void {
$fixtures = new Fixtures();
$destination = $fixtures->destinationPath('[web-root]/empty_file.txt');
$source = $fixtures->sourcePath('empty-file', 'empty_file.txt');
diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/ScaffoldFileCollectionTest.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/ScaffoldFileCollectionTest.php
index 2741a77d338..05e89463c02 100644
--- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/ScaffoldFileCollectionTest.php
+++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/ScaffoldFileCollectionTest.php
@@ -20,7 +20,7 @@ class ScaffoldFileCollectionTest extends TestCase {
/**
* @covers ::__construct
*/
- public function testCreate() {
+ public function testCreate(): void {
$fixtures = new Fixtures();
$locationReplacements = $fixtures->getLocationReplacements();
$scaffold_file_fixtures = [
diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/SkipOpTest.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/SkipOpTest.php
index 5a13e34918a..ee5d3a566a1 100644
--- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/SkipOpTest.php
+++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/SkipOpTest.php
@@ -19,7 +19,7 @@ class SkipOpTest extends TestCase {
/**
* @covers ::process
*/
- public function testProcess() {
+ public function testProcess(): void {
$fixtures = new Fixtures();
$destination = $fixtures->destinationPath('[web-root]/robots.txt');
$options = ScaffoldOptions::create([]);
diff --git a/core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php b/core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php
index 66f28d2ed5e..77ceffae7ef 100644
--- a/core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php
+++ b/core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php
@@ -17,7 +17,7 @@ class ConfigTest extends TestCase {
/**
* @covers ::getPathsForPackage
*/
- public function testGetPathsForPackageMixedCase() {
+ public function testGetPathsForPackageMixedCase(): void {
$config = $this->getMockBuilder(Config::class)
->onlyMethods(['getAllCleanupPaths'])
->disableOriginalConstructor()
@@ -33,7 +33,7 @@ class ConfigTest extends TestCase {
/**
* @covers ::getAllCleanupPaths
*/
- public function testNoRootMergeConfig() {
+ public function testNoRootMergeConfig(): void {
// Root package has no extra field.
$root = $this->createMock(RootPackageInterface::class);
$root->expects($this->once())
@@ -54,7 +54,7 @@ class ConfigTest extends TestCase {
/**
* @covers ::getAllCleanupPaths
*/
- public function testRootMergeConfig() {
+ public function testRootMergeConfig(): void {
// Root package has configuration in extra.
$root = $this->createMock(RootPackageInterface::class);
$root->expects($this->once())
@@ -81,7 +81,7 @@ class ConfigTest extends TestCase {
*
* @runInSeparateProcess
*/
- public function testMixedCaseConfigCleanupPackages() {
+ public function testMixedCaseConfigCleanupPackages(): void {
// Root package has configuration in extra.
$root = $this->createMock(RootPackageInterface::class);
$root->expects($this->once())
diff --git a/core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/VendorHardeningPluginTest.php b/core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/VendorHardeningPluginTest.php
index 29c935fe144..7df0fc60129 100644
--- a/core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/VendorHardeningPluginTest.php
+++ b/core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/VendorHardeningPluginTest.php
@@ -42,7 +42,7 @@ class VendorHardeningPluginTest extends TestCase {
/**
* @covers ::cleanPackage
*/
- public function testCleanPackage() {
+ public function testCleanPackage(): void {
$config = $this->getMockBuilder(Config::class)
->disableOriginalConstructor()
@@ -78,7 +78,7 @@ class VendorHardeningPluginTest extends TestCase {
/**
* @covers ::cleanPathsForPackage
*/
- public function testCleanPathsForPackage() {
+ public function testCleanPathsForPackage(): void {
$plugin = $this->getMockBuilder(VendorHardeningPlugin::class)
->onlyMethods(['getInstallPathForPackage'])
->getMock();
@@ -106,7 +106,7 @@ class VendorHardeningPluginTest extends TestCase {
/**
* @covers ::cleanAllPackages
*/
- public function testCleanAllPackages() {
+ public function testCleanAllPackages(): void {
$config = $this->getMockBuilder(Config::class)
->disableOriginalConstructor()
->getMock();
@@ -146,7 +146,7 @@ class VendorHardeningPluginTest extends TestCase {
/**
* @covers ::writeAccessRestrictionFiles
*/
- public function testWriteAccessRestrictionFiles() {
+ public function testWriteAccessRestrictionFiles(): void {
$dir = vfsStream::url('vendor');
// Set up mocks so that writeAccessRestrictionFiles() can eventually use
@@ -219,7 +219,7 @@ class VendorHardeningPluginTest extends TestCase {
* @covers ::findBinOverlap
* @dataProvider providerFindBinOverlap
*/
- public function testFindBinOverlap($expected, $binaries, $clean_paths) {
+ public function testFindBinOverlap($expected, $binaries, $clean_paths): void {
$plugin = $this->getMockBuilder(VendorHardeningPlugin::class)
->disableOriginalConstructor()
->getMock();
diff --git a/core/tests/Drupal/Tests/ComposerIntegrationTest.php b/core/tests/Drupal/Tests/ComposerIntegrationTest.php
index 3ea8d0ba8e6..f2dfe4bf73c 100644
--- a/core/tests/Drupal/Tests/ComposerIntegrationTest.php
+++ b/core/tests/Drupal/Tests/ComposerIntegrationTest.php
@@ -25,7 +25,7 @@ class ComposerIntegrationTest extends UnitTestCase {
*
* @see https://www.drupal.org/about/core/policies/core-dependencies-policies/managing-composer-updates-for-drupal-core
*/
- public function testComposerLockHash() {
+ public function testComposerLockHash(): void {
$content_hash = self::getContentHash(file_get_contents($this->root . '/composer.json'));
$lock = json_decode(file_get_contents($this->root . '/composer.lock'), TRUE);
$this->assertSame($content_hash, $lock['content-hash']);
@@ -185,7 +185,7 @@ class ComposerIntegrationTest extends UnitTestCase {
*
* @dataProvider providerTestExpectedScaffoldFiles
*/
- public function testExpectedScaffoldFiles($destRelPath, $sourceRelPath, $expectedDestination = '[web-root]') {
+ public function testExpectedScaffoldFiles($destRelPath, $sourceRelPath, $expectedDestination = '[web-root]'): void {
// Grab the 'file-mapping' section of the core composer.json file.
$json = json_decode(file_get_contents($this->root . '/core/composer.json'));
$scaffold_file_mapping = (array) $json->extra->{'drupal-scaffold'}->{'file-mapping'};
diff --git a/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php b/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php
index 248cbeac54f..20862c77e43 100644
--- a/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php
@@ -132,7 +132,7 @@ class AccessManagerTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Access\AccessManager::setChecks().
*/
- public function testSetChecks() {
+ public function testSetChecks(): void {
// Check setChecks without any access checker defined yet.
$this->checkProvider->setChecks($this->routeCollection);
@@ -152,7 +152,7 @@ class AccessManagerTest extends UnitTestCase {
/**
* Tests setChecks with a dynamic access checker.
*/
- public function testSetChecksWithDynamicAccessChecker() {
+ public function testSetChecksWithDynamicAccessChecker(): void {
// Setup the dynamic access checker.
$access_check = $this->createMock('Drupal\Tests\Core\Access\TestAccessCheckInterface');
$this->container->set('test_access', $access_check);
@@ -183,7 +183,7 @@ class AccessManagerTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Access\AccessManager::check().
*/
- public function testCheck() {
+ public function testCheck(): void {
$route_matches = [];
// Construct route match objects.
@@ -225,7 +225,7 @@ class AccessManagerTest extends UnitTestCase {
*
* @covers ::check
*/
- public function testCheckWithNullAccount() {
+ public function testCheckWithNullAccount(): void {
$this->setupAccessChecker();
$this->checkProvider->setChecks($this->routeCollection);
@@ -299,7 +299,7 @@ class AccessManagerTest extends UnitTestCase {
*
* @dataProvider providerTestCheckConjunctions
*/
- public function testCheckConjunctions($name, $condition_one, $condition_two, $expected_access) {
+ public function testCheckConjunctions($name, $condition_one, $condition_two, $expected_access): void {
$this->setupAccessChecker();
$this->container->register('test_access_defined', DefinedTestAccessCheck::class);
$this->checkProvider->addCheckService('test_access_defined', 'access', ['_test_access']);
@@ -326,7 +326,7 @@ class AccessManagerTest extends UnitTestCase {
*
* @see \Drupal\Core\Access\AccessManager::checkNamedRoute()
*/
- public function testCheckNamedRoute() {
+ public function testCheckNamedRoute(): void {
$this->setupAccessChecker();
$this->checkProvider->setChecks($this->routeCollection);
$this->setupAccessArgumentsResolverFactory();
@@ -350,7 +350,7 @@ class AccessManagerTest extends UnitTestCase {
*
* @see \Drupal\Core\Access\AccessManager::checkNamedRoute()
*/
- public function testCheckNamedRouteWithUpcastedValues() {
+ public function testCheckNamedRouteWithUpcastedValues(): void {
$this->routeCollection = new RouteCollection();
$route = new Route('/test-route-1/{value}', [], ['_test_access' => 'TRUE']);
$this->routeCollection->add('test_route_1', $route);
@@ -398,7 +398,7 @@ class AccessManagerTest extends UnitTestCase {
*
* @covers ::checkNamedRoute
*/
- public function testCheckNamedRouteWithDefaultValue() {
+ public function testCheckNamedRouteWithDefaultValue(): void {
$this->routeCollection = new RouteCollection();
$route = new Route('/test-route-1/{value}', ['value' => 'example'], ['_test_access' => 'TRUE']);
$this->routeCollection->add('test_route_1', $route);
@@ -444,7 +444,7 @@ class AccessManagerTest extends UnitTestCase {
/**
* Tests checkNamedRoute given an invalid/non existing route name.
*/
- public function testCheckNamedRouteWithNonExistingRoute() {
+ public function testCheckNamedRouteWithNonExistingRoute(): void {
$this->routeProvider->expects($this->any())
->method('getRouteByName')
->will($this->throwException(new RouteNotFoundException()));
@@ -460,7 +460,7 @@ class AccessManagerTest extends UnitTestCase {
*
* @dataProvider providerCheckException
*/
- public function testCheckException($return_value) {
+ public function testCheckException($return_value): void {
$route_provider = $this->createMock('Drupal\Core\Routing\RouteProviderInterface');
// Setup a test route for each access configuration.
diff --git a/core/tests/Drupal/Tests/Core/Access/AccessResultForbiddenTest.php b/core/tests/Drupal/Tests/Core/Access/AccessResultForbiddenTest.php
index cdf7a8c99f6..1bedba8f7f2 100644
--- a/core/tests/Drupal/Tests/Core/Access/AccessResultForbiddenTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/AccessResultForbiddenTest.php
@@ -19,7 +19,7 @@ class AccessResultForbiddenTest extends UnitTestCase {
* @covers ::__construct
* @covers ::getReason
*/
- public function testConstruction() {
+ public function testConstruction(): void {
$a = new AccessResultForbidden();
$this->assertEquals(NULL, $a->getReason());
@@ -34,7 +34,7 @@ class AccessResultForbiddenTest extends UnitTestCase {
*
* @covers ::setReason
*/
- public function testSetReason() {
+ public function testSetReason(): void {
$a = new AccessResultForbidden();
$reason = $this->getRandomGenerator()->string();
diff --git a/core/tests/Drupal/Tests/Core/Access/AccessResultNeutralTest.php b/core/tests/Drupal/Tests/Core/Access/AccessResultNeutralTest.php
index 2a0c4f3bc2e..94fd5a73b24 100644
--- a/core/tests/Drupal/Tests/Core/Access/AccessResultNeutralTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/AccessResultNeutralTest.php
@@ -19,7 +19,7 @@ class AccessResultNeutralTest extends UnitTestCase {
* @covers ::__construct
* @covers ::getReason
*/
- public function testConstruction() {
+ public function testConstruction(): void {
$a = new AccessResultNeutral();
$this->assertEquals('', $a->getReason());
@@ -33,7 +33,7 @@ class AccessResultNeutralTest extends UnitTestCase {
*
* @covers ::setReason
*/
- public function testSetReason() {
+ public function testSetReason(): void {
$a = new AccessResultNeutral();
$reason = $this->getRandomGenerator()->string();
diff --git a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
index f61abb0f3f7..fad36f270dc 100644
--- a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
@@ -56,7 +56,7 @@ class AccessResultTest extends UnitTestCase {
*
* @covers ::neutral
*/
- public function testConstruction() {
+ public function testConstruction(): void {
$verify = function (AccessResult $access) {
$this->assertFalse($access->isAllowed());
$this->assertFalse($access->isForbidden());
@@ -81,7 +81,7 @@ class AccessResultTest extends UnitTestCase {
* @covers ::isForbidden
* @covers ::isNeutral
*/
- public function testAccessAllowed() {
+ public function testAccessAllowed(): void {
$verify = function (AccessResult $access) {
$this->assertTrue($access->isAllowed());
$this->assertFalse($access->isForbidden());
@@ -100,7 +100,7 @@ class AccessResultTest extends UnitTestCase {
* @covers ::isForbidden
* @covers ::isNeutral
*/
- public function testAccessForbidden() {
+ public function testAccessForbidden(): void {
$verify = function (AccessResult $access) {
$this->assertFalse($access->isAllowed());
$this->assertTrue($access->isForbidden());
@@ -116,7 +116,7 @@ class AccessResultTest extends UnitTestCase {
/**
* @covers ::forbidden
*/
- public function testAccessForbiddenReason() {
+ public function testAccessForbiddenReason(): void {
$verify = function (AccessResult $access, $reason) {
$this->assertInstanceOf(AccessResultReasonInterface::class, $access);
$this->assertSame($reason, $access->getReason());
@@ -139,7 +139,7 @@ class AccessResultTest extends UnitTestCase {
* @covers ::isForbidden
* @covers ::isNeutral
*/
- public function testAccessConditionallyAllowed() {
+ public function testAccessConditionallyAllowed(): void {
$verify = function (AccessResult $access, $allowed) {
$this->assertSame($allowed, $access->isAllowed());
$this->assertFalse($access->isForbidden());
@@ -159,7 +159,7 @@ class AccessResultTest extends UnitTestCase {
* @covers ::isForbidden
* @covers ::isNeutral
*/
- public function testAccessConditionallyForbidden() {
+ public function testAccessConditionallyForbidden(): void {
$verify = function (AccessResult $access, $forbidden) {
$this->assertFalse($access->isAllowed());
$this->assertSame($forbidden, $access->isForbidden());
@@ -176,7 +176,7 @@ class AccessResultTest extends UnitTestCase {
/**
* @covers ::andIf
*/
- public function testAndIf() {
+ public function testAndIf(): void {
$neutral = AccessResult::neutral('neutral message');
$allowed = AccessResult::allowed();
$forbidden = AccessResult::forbidden('forbidden message');
@@ -267,7 +267,7 @@ class AccessResultTest extends UnitTestCase {
/**
* @covers ::orIf
*/
- public function testOrIf() {
+ public function testOrIf(): void {
$neutral = AccessResult::neutral('neutral message');
$neutral_other = AccessResult::neutral('other neutral message');
$neutral_reasonless = AccessResult::neutral();
@@ -385,7 +385,7 @@ class AccessResultTest extends UnitTestCase {
* @covers ::setCacheMaxAge
* @covers ::getCacheMaxAge
*/
- public function testCacheMaxAge() {
+ public function testCacheMaxAge(): void {
$this->assertSame(Cache::PERMANENT, AccessResult::neutral()->getCacheMaxAge());
$this->assertSame(1337, AccessResult::neutral()->setCacheMaxAge(1337)->getCacheMaxAge());
}
@@ -398,7 +398,7 @@ class AccessResultTest extends UnitTestCase {
* @covers ::cachePerUser
* @covers ::allowedIfHasPermission
*/
- public function testCacheContexts() {
+ public function testCacheContexts(): void {
$verify = function (AccessResult $access, array $contexts) {
$this->assertFalse($access->isAllowed());
$this->assertFalse($access->isForbidden());
@@ -474,7 +474,7 @@ class AccessResultTest extends UnitTestCase {
* @covers ::getCacheTags
* @covers ::resetCacheTags
*/
- public function testCacheTags() {
+ public function testCacheTags(): void {
$verify = function (AccessResult $access, array $tags, array $contexts = [], $max_age = Cache::PERMANENT) {
$this->assertFalse($access->isAllowed());
$this->assertFalse($access->isForbidden());
@@ -532,7 +532,7 @@ class AccessResultTest extends UnitTestCase {
/**
* @covers ::inheritCacheability
*/
- public function testInheritCacheability() {
+ public function testInheritCacheability(): void {
// andIf(); 1st has defaults, 2nd has custom tags, contexts and max-age.
$access = AccessResult::allowed();
$other = AccessResult::allowed()->setCacheMaxAge(1500)->cachePerPermissions()->addCacheTags(['node:20011988']);
@@ -852,7 +852,7 @@ class AccessResultTest extends UnitTestCase {
*
* @dataProvider andOrCacheabilityPropagationProvider
*/
- public function testAndOrCacheabilityPropagation(AccessResultInterface $first, $op, AccessResultInterface $second, $implements_cacheable_dependency_interface, $is_cacheable) {
+ public function testAndOrCacheabilityPropagation(AccessResultInterface $first, $op, AccessResultInterface $second, $implements_cacheable_dependency_interface, $is_cacheable): void {
if ($op === 'OR') {
$result = $first->orIf($second);
}
@@ -884,7 +884,7 @@ class AccessResultTest extends UnitTestCase {
*
* @covers ::orIf
*/
- public function testOrIfCacheabilityMerging() {
+ public function testOrIfCacheabilityMerging(): void {
$merge_both_directions = function (AccessResult $a, AccessResult $b) {
// A globally cacheable access result.
$a->setCacheMaxAge(3600);
@@ -920,7 +920,7 @@ class AccessResultTest extends UnitTestCase {
* @param \Drupal\Core\Access\AccessResult $expected_access
* The expected access check result.
*/
- public function testAllowedIfHasPermissions($permissions, $conjunction, AccessResult $expected_access) {
+ public function testAllowedIfHasPermissions($permissions, $conjunction, AccessResult $expected_access): void {
$account = $this->createMock('\Drupal\Core\Session\AccountInterface');
$account->expects($this->any())
->method('hasPermission')
diff --git a/core/tests/Drupal/Tests/Core/Access/CsrfAccessCheckTest.php b/core/tests/Drupal/Tests/Core/Access/CsrfAccessCheckTest.php
index b6678722ecc..34bb870ef48 100644
--- a/core/tests/Drupal/Tests/Core/Access/CsrfAccessCheckTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/CsrfAccessCheckTest.php
@@ -55,7 +55,7 @@ class CsrfAccessCheckTest extends UnitTestCase {
/**
* Tests the access() method with a valid token.
*/
- public function testAccessTokenPass() {
+ public function testAccessTokenPass(): void {
$this->csrfToken->expects($this->once())
->method('validate')
->with('test_query', 'test-path/42')
@@ -74,7 +74,7 @@ class CsrfAccessCheckTest extends UnitTestCase {
/**
* @covers ::access
*/
- public function testCsrfTokenInvalid() {
+ public function testCsrfTokenInvalid(): void {
$this->csrfToken->expects($this->once())
->method('validate')
->with('test_query', 'test-path')
@@ -93,7 +93,7 @@ class CsrfAccessCheckTest extends UnitTestCase {
/**
* @covers ::access
*/
- public function testCsrfTokenMissing() {
+ public function testCsrfTokenMissing(): void {
$this->csrfToken->expects($this->once())
->method('validate')
->with('', 'test-path')
diff --git a/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php b/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php
index 011a8f2eba8..9282dc94d48 100644
--- a/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php
@@ -82,7 +82,7 @@ class CsrfTokenGeneratorTest extends UnitTestCase {
*
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
$this->setupDefaultExpectations();
$this->assertIsString($this->generator->get());
@@ -95,7 +95,7 @@ class CsrfTokenGeneratorTest extends UnitTestCase {
*
* @covers ::get
*/
- public function testGenerateSeedOnGet() {
+ public function testGenerateSeedOnGet(): void {
$key = Crypt::randomBytesBase64();
$this->privateKey->expects($this->any())
->method('get')
@@ -117,7 +117,7 @@ class CsrfTokenGeneratorTest extends UnitTestCase {
*
* @covers ::validate
*/
- public function testValidate() {
+ public function testValidate(): void {
$this->setupDefaultExpectations();
$token = $this->generator->get();
@@ -139,7 +139,7 @@ class CsrfTokenGeneratorTest extends UnitTestCase {
* @covers ::validate
* @dataProvider providerTestValidateParameterTypes
*/
- public function testValidateParameterTypes($token, $value) {
+ public function testValidateParameterTypes($token, $value): void {
$this->setupDefaultExpectations();
// The following check might throw PHP fatal errors and notices, so we
@@ -176,7 +176,7 @@ class CsrfTokenGeneratorTest extends UnitTestCase {
* @covers ::validate
* @dataProvider providerTestInvalidParameterTypes
*/
- public function testInvalidParameterTypes($token, $value = '') {
+ public function testInvalidParameterTypes($token, $value = ''): void {
$this->setupDefaultExpectations();
$this->expectException(\InvalidArgumentException::class);
@@ -203,7 +203,7 @@ class CsrfTokenGeneratorTest extends UnitTestCase {
*
* @covers ::get
*/
- public function testGetWithNoHashSalt() {
+ public function testGetWithNoHashSalt(): void {
// Update settings with no hash salt.
new Settings([]);
$generator = new CsrfTokenGenerator($this->privateKey, $this->sessionMetadata);
diff --git a/core/tests/Drupal/Tests/Core/Access/CustomAccessCheckTest.php b/core/tests/Drupal/Tests/Core/Access/CustomAccessCheckTest.php
index c487ded7c97..f4de1af1046 100644
--- a/core/tests/Drupal/Tests/Core/Access/CustomAccessCheckTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/CustomAccessCheckTest.php
@@ -54,7 +54,7 @@ class CustomAccessCheckTest extends UnitTestCase {
/**
* Tests the access method.
*/
- public function testAccess() {
+ public function testAccess(): void {
$route_match = $this->createMock('Drupal\Core\Routing\RouteMatchInterface');
$this->callableResolver
@@ -111,7 +111,7 @@ class CustomAccessCheckTest extends UnitTestCase {
/**
* Tests the access method exception for invalid access callbacks.
*/
- public function testAccessException() {
+ public function testAccessException(): void {
// Create callableResolver mock to return InvalidArgumentException.
$this->callableResolver = $this->getMockBuilder(CallableResolver::class)
->disableOriginalConstructor()
diff --git a/core/tests/Drupal/Tests/Core/Access/DefaultAccessCheckTest.php b/core/tests/Drupal/Tests/Core/Access/DefaultAccessCheckTest.php
index 372b3515984..58a90449265 100644
--- a/core/tests/Drupal/Tests/Core/Access/DefaultAccessCheckTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/DefaultAccessCheckTest.php
@@ -43,7 +43,7 @@ class DefaultAccessCheckTest extends UnitTestCase {
/**
* Tests the access method.
*/
- public function testAccess() {
+ public function testAccess(): void {
$request = new Request([]);
$route = new Route('/test-route', [], ['_access' => 'NULL']);
diff --git a/core/tests/Drupal/Tests/Core/Access/RouteProcessorCsrfTest.php b/core/tests/Drupal/Tests/Core/Access/RouteProcessorCsrfTest.php
index 6e356b7f244..621d79557c0 100644
--- a/core/tests/Drupal/Tests/Core/Access/RouteProcessorCsrfTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/RouteProcessorCsrfTest.php
@@ -46,7 +46,7 @@ class RouteProcessorCsrfTest extends UnitTestCase {
/**
* Tests the processOutbound() method with no _csrf_token route requirement.
*/
- public function testProcessOutboundNoRequirement() {
+ public function testProcessOutboundNoRequirement(): void {
$this->csrfToken->expects($this->never())
->method('get');
@@ -65,7 +65,7 @@ class RouteProcessorCsrfTest extends UnitTestCase {
/**
* Tests the processOutbound() method with a _csrf_token route requirement.
*/
- public function testProcessOutbound() {
+ public function testProcessOutbound(): void {
$route = new Route('/test-path', [], ['_csrf_token' => 'TRUE']);
$parameters = [];
@@ -87,7 +87,7 @@ class RouteProcessorCsrfTest extends UnitTestCase {
/**
* Tests the processOutbound() method with a dynamic path and one replacement.
*/
- public function testProcessOutboundDynamicOne() {
+ public function testProcessOutboundDynamicOne(): void {
$route = new Route('/test-path/{slug}', [], ['_csrf_token' => 'TRUE']);
$parameters = ['slug' => 100];
@@ -106,7 +106,7 @@ class RouteProcessorCsrfTest extends UnitTestCase {
/**
* Tests the processOutbound() method with two parameter replacements.
*/
- public function testProcessOutboundDynamicTwo() {
+ public function testProcessOutboundDynamicTwo(): void {
$route = new Route('{slug_1}/test-path/{slug_2}', [], ['_csrf_token' => 'TRUE']);
$parameters = ['slug_1' => 100, 'slug_2' => 'test'];
diff --git a/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php b/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php
index 276ce7955d7..58c37667be4 100644
--- a/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php
+++ b/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php
@@ -120,7 +120,7 @@ class AjaxCommandsTest extends UnitTestCase {
* @covers \Drupal\Core\Ajax\AddCssCommand
* @dataProvider providerCss
*/
- public function testAddCssCommand($css, $expected) {
+ public function testAddCssCommand($css, $expected): void {
$command = new AddCssCommand($css);
$this->assertEquals($expected, $command->render());
@@ -129,7 +129,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\AfterCommand
*/
- public function testAfterCommand() {
+ public function testAfterCommand(): void {
$command = new AfterCommand('#page-title', '<p>New Text!</p>', ['my-setting' => 'setting']);
$expected = [
@@ -146,7 +146,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\AlertCommand
*/
- public function testAlertCommand() {
+ public function testAlertCommand(): void {
$command = new AlertCommand('Set condition 1 throughout the ship!');
$expected = [
'command' => 'alert',
@@ -161,7 +161,7 @@ class AjaxCommandsTest extends UnitTestCase {
*
* @dataProvider announceCommandProvider
*/
- public function testAnnounceCommand($message, $priority, array $expected) {
+ public function testAnnounceCommand($message, $priority, array $expected): void {
if ($priority === NULL) {
$command = new AnnounceCommand($message);
}
@@ -214,7 +214,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\AppendCommand
*/
- public function testAppendCommand() {
+ public function testAppendCommand(): void {
$command = new AppendCommand('#page-title', '<p>New Text!</p>', ['my-setting' => 'setting']);
$expected = [
@@ -231,7 +231,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\BeforeCommand
*/
- public function testBeforeCommand() {
+ public function testBeforeCommand(): void {
$command = new BeforeCommand('#page-title', '<p>New Text!</p>', ['my-setting' => 'setting']);
$expected = [
@@ -248,7 +248,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\ChangedCommand
*/
- public function testChangedCommand() {
+ public function testChangedCommand(): void {
$command = new ChangedCommand('#page-title', '#page-title-changed');
$expected = [
@@ -263,7 +263,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\CssCommand
*/
- public function testCssCommand() {
+ public function testCssCommand(): void {
$command = new CssCommand('#page-title', ['text-decoration' => 'blink']);
$command->setProperty('font-size', '40px')->setProperty('font-weight', 'bold');
@@ -283,7 +283,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\DataCommand
*/
- public function testDataCommand() {
+ public function testDataCommand(): void {
$command = new DataCommand('#page-title', 'my-data', ['key' => 'value']);
$expected = [
@@ -299,7 +299,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\HtmlCommand
*/
- public function testHtmlCommand() {
+ public function testHtmlCommand(): void {
$command = new HtmlCommand('#page-title', '<p>New Text!</p>', ['my-setting' => 'setting']);
$expected = [
@@ -316,7 +316,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\InsertCommand
*/
- public function testInsertCommand() {
+ public function testInsertCommand(): void {
$command = new InsertCommand('#page-title', '<p>New Text!</p>', ['my-setting' => 'setting']);
$expected = [
@@ -333,7 +333,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\InvokeCommand
*/
- public function testInvokeCommand() {
+ public function testInvokeCommand(): void {
$command = new InvokeCommand('#page-title', 'myMethod', ['var1', 'var2']);
$expected = [
@@ -349,7 +349,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\PrependCommand
*/
- public function testPrependCommand() {
+ public function testPrependCommand(): void {
$command = new PrependCommand('#page-title', '<p>New Text!</p>', ['my-setting' => 'setting']);
$expected = [
@@ -366,7 +366,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\RemoveCommand
*/
- public function testRemoveCommand() {
+ public function testRemoveCommand(): void {
$command = new RemoveCommand('#page-title');
$expected = [
@@ -380,7 +380,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\ReplaceCommand
*/
- public function testReplaceCommand() {
+ public function testReplaceCommand(): void {
$command = new ReplaceCommand('#page-title', '<p>New Text!</p>', ['my-setting' => 'setting']);
$expected = [
@@ -397,7 +397,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\RestripeCommand
*/
- public function testRestripeCommand() {
+ public function testRestripeCommand(): void {
$command = new RestripeCommand('#page-title');
$expected = [
@@ -411,7 +411,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\SettingsCommand
*/
- public function testSettingsCommand() {
+ public function testSettingsCommand(): void {
$command = new SettingsCommand(['key' => 'value'], TRUE);
$expected = [
@@ -426,7 +426,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\OpenDialogCommand
*/
- public function testOpenDialogCommand() {
+ public function testOpenDialogCommand(): void {
$command = new OpenDialogCommand('#some-dialog', 'Title', '<p>Text!</p>', [
'url' => FALSE,
'width' => 500,
@@ -454,7 +454,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\OpenModalDialogCommand
*/
- public function testOpenModalDialogCommand() {
+ public function testOpenModalDialogCommand(): void {
$command = $this->getMockBuilder('Drupal\Core\Ajax\OpenModalDialogCommand')
->setConstructorArgs([
'Title', '<p>Text!</p>', [
@@ -489,7 +489,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\CloseModalDialogCommand
*/
- public function testCloseModalDialogCommand() {
+ public function testCloseModalDialogCommand(): void {
$command = new CloseModalDialogCommand();
$expected = [
'command' => 'closeDialog',
@@ -503,7 +503,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\CloseDialogCommand
*/
- public function testCloseDialogCommand() {
+ public function testCloseDialogCommand(): void {
$command = new CloseDialogCommand('#some-dialog', TRUE);
$expected = [
'command' => 'closeDialog',
@@ -517,7 +517,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\SetDialogOptionCommand
*/
- public function testSetDialogOptionCommand() {
+ public function testSetDialogOptionCommand(): void {
$command = new SetDialogOptionCommand('#some-dialog', 'width', '500');
$expected = [
'command' => 'setDialogOption',
@@ -532,7 +532,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\SetDialogTitleCommand
*/
- public function testSetDialogTitleCommand() {
+ public function testSetDialogTitleCommand(): void {
$command = new SetDialogTitleCommand('#some-dialog', 'Example');
$expected = [
'command' => 'setDialogOption',
@@ -547,7 +547,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\RedirectCommand
*/
- public function testRedirectCommand() {
+ public function testRedirectCommand(): void {
$command = new RedirectCommand('http://example.com');
$expected = [
'command' => 'redirect',
@@ -560,7 +560,7 @@ class AjaxCommandsTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Ajax\UpdateBuildIdCommand
*/
- public function testUpdateBuildIdCommand() {
+ public function testUpdateBuildIdCommand(): void {
$old = 'ThisStringIsOld';
$new = 'ThisStringIsNew';
$command = new UpdateBuildIdCommand($old, $new);
diff --git a/core/tests/Drupal/Tests/Core/Ajax/AjaxResponseTest.php b/core/tests/Drupal/Tests/Core/Ajax/AjaxResponseTest.php
index ac17d076509..ab5fce6d191 100644
--- a/core/tests/Drupal/Tests/Core/Ajax/AjaxResponseTest.php
+++ b/core/tests/Drupal/Tests/Core/Ajax/AjaxResponseTest.php
@@ -39,7 +39,7 @@ class AjaxResponseTest extends UnitTestCase {
* @see \Drupal\Core\Ajax\AjaxResponse::addCommand()
* @see \Drupal\Core\Ajax\AjaxResponse::getCommands()
*/
- public function testCommands() {
+ public function testCommands(): void {
$command_one = $this->createMock('Drupal\Core\Ajax\CommandInterface');
$command_one->expects($this->once())
->method('render')
@@ -79,7 +79,7 @@ class AjaxResponseTest extends UnitTestCase {
*
* @cover ::prepareResponse
*/
- public function testPrepareResponseForIeFormRequestsWithFileUpload() {
+ public function testPrepareResponseForIeFormRequestsWithFileUpload(): void {
$request = Request::create('/example', 'POST');
$request->headers->set('Accept', 'text/html');
$response = new AjaxResponse([]);
diff --git a/core/tests/Drupal/Tests/Core/Ajax/OpenOffCanvasDialogCommandTest.php b/core/tests/Drupal/Tests/Core/Ajax/OpenOffCanvasDialogCommandTest.php
index 1ad22f8905f..5065b543e9f 100644
--- a/core/tests/Drupal/Tests/Core/Ajax/OpenOffCanvasDialogCommandTest.php
+++ b/core/tests/Drupal/Tests/Core/Ajax/OpenOffCanvasDialogCommandTest.php
@@ -18,7 +18,7 @@ class OpenOffCanvasDialogCommandTest extends UnitTestCase {
*
* @dataProvider dialogPosition
*/
- public function testRender($position) {
+ public function testRender($position): void {
$command = new OpenOffCanvasDialogCommand('Title', '<p>Text!</p>', ['url' => 'example'], NULL, $position);
$expected = [
diff --git a/core/tests/Drupal/Tests/Core/Annotation/PluralTranslationTest.php b/core/tests/Drupal/Tests/Core/Annotation/PluralTranslationTest.php
index 48ef5569271..9e8d98240bd 100644
--- a/core/tests/Drupal/Tests/Core/Annotation/PluralTranslationTest.php
+++ b/core/tests/Drupal/Tests/Core/Annotation/PluralTranslationTest.php
@@ -19,7 +19,7 @@ class PluralTranslationTest extends UnitTestCase {
*
* @dataProvider providerTestGet
*/
- public function testGet(array $values) {
+ public function testGet(array $values): void {
$annotation = new PluralTranslation($values);
$default_values = [
@@ -53,7 +53,7 @@ class PluralTranslationTest extends UnitTestCase {
/**
* @dataProvider providerTestMissingData
*/
- public function testMissingData($data) {
+ public function testMissingData($data): void {
$this->expectException(\InvalidArgumentException::class);
new PluralTranslation($data);
}
diff --git a/core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php b/core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php
index 2a6e79aa48a..c8b355d72b8 100644
--- a/core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php
+++ b/core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php
@@ -36,7 +36,7 @@ class TranslationTest extends UnitTestCase {
*
* @dataProvider providerTestGet
*/
- public function testGet(array $values, $expected) {
+ public function testGet(array $values, $expected): void {
$container = new ContainerBuilder();
$container->set('string_translation', $this->translationManager);
\Drupal::setContainer($container);
diff --git a/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php b/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php
index 9a23e5d7cac..d5e2190439a 100644
--- a/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php
@@ -168,7 +168,7 @@ class AssetResolverTest extends UnitTestCase {
* @covers ::getCssAssets
* @dataProvider providerAttachedCssAssets
*/
- public function testGetCssAssets(AttachedAssetsInterface $assets_a, AttachedAssetsInterface $assets_b, $expected_css_cache_item_count) {
+ public function testGetCssAssets(AttachedAssetsInterface $assets_a, AttachedAssetsInterface $assets_b, $expected_css_cache_item_count): void {
$this->libraryDiscovery->expects($this->any())
->method('getLibraryByName')
->willReturnOnConsecutiveCalls(
@@ -203,7 +203,7 @@ class AssetResolverTest extends UnitTestCase {
* @covers ::getJsAssets
* @dataProvider providerAttachedJsAssets
*/
- public function testGetJsAssets(AttachedAssetsInterface $assets_a, AttachedAssetsInterface $assets_b, $expected_js_cache_item_count, $expected_multilingual_js_cache_item_count) {
+ public function testGetJsAssets(AttachedAssetsInterface $assets_a, AttachedAssetsInterface $assets_b, $expected_js_cache_item_count, $expected_multilingual_js_cache_item_count): void {
$this->libraryDiscovery->expects($this->any())
->method('getLibraryByName')
->willReturnOnConsecutiveCalls(
diff --git a/core/tests/Drupal/Tests/Core/Asset/CssCollectionGrouperUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/CssCollectionGrouperUnitTest.php
index 34adf3fe497..adc8da35669 100644
--- a/core/tests/Drupal/Tests/Core/Asset/CssCollectionGrouperUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/CssCollectionGrouperUnitTest.php
@@ -33,7 +33,7 @@ class CssCollectionGrouperUnitTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Asset\CssCollectionGrouper.
*/
- public function testGrouper() {
+ public function testGrouper(): void {
$css_assets = [
'system.base.css' => [
'group' => -100,
diff --git a/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
index 18fb5b7f712..3c38cfbac80 100644
--- a/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
@@ -280,14 +280,14 @@ class CssCollectionRendererUnitTest extends UnitTestCase {
*
* @dataProvider providerTestRender
*/
- public function testRender(array $css_assets, array $render_elements) {
+ public function testRender(array $css_assets, array $render_elements): void {
$this->assertSame($render_elements, $this->renderer->render($css_assets));
}
/**
* Tests a CSS asset group with the invalid 'type' => 'internal'.
*/
- public function testRenderInvalidType() {
+ public function testRenderInvalidType(): void {
$this->expectException('Exception');
$this->expectExceptionMessage('Invalid CSS asset type.');
diff --git a/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php
index 985cc785f59..b61bd1e4b65 100644
--- a/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php
@@ -239,7 +239,7 @@ class CssOptimizerUnitTest extends UnitTestCase {
*
* @dataProvider providerTestOptimize
*/
- public function testOptimize($css_asset, $expected) {
+ public function testOptimize($css_asset, $expected): void {
global $base_path;
$original_base_path = $base_path;
$base_path = '/';
@@ -252,7 +252,7 @@ class CssOptimizerUnitTest extends UnitTestCase {
/**
* Tests a file CSS asset with preprocessing disabled.
*/
- public function testTypeFilePreprocessingDisabled() {
+ public function testTypeFilePreprocessingDisabled(): void {
$this->expectException('Exception');
$this->expectExceptionMessage('Only file CSS assets with preprocessing enabled can be optimized.');
@@ -272,7 +272,7 @@ class CssOptimizerUnitTest extends UnitTestCase {
/**
* Tests a CSS asset with 'type' => 'external'.
*/
- public function testTypeExternal() {
+ public function testTypeExternal(): void {
$this->expectException('Exception');
$this->expectExceptionMessage('Only file CSS assets can be optimized.');
diff --git a/core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php
index e1da45e626a..6a6b3f80e8a 100644
--- a/core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php
@@ -73,7 +73,7 @@ class JsOptimizerUnitTest extends UnitTestCase {
*
* @dataProvider providerTestClean
*/
- public function testClean($js_asset, $expected) {
+ public function testClean($js_asset, $expected): void {
$this->assertEquals($expected, $this->optimizer->clean($js_asset));
}
@@ -139,7 +139,7 @@ class JsOptimizerUnitTest extends UnitTestCase {
*
* @dataProvider providerTestOptimize
*/
- public function testOptimize($js_asset, $expected) {
+ public function testOptimize($js_asset, $expected): void {
$this->assertEquals($expected, $this->optimizer->optimize($js_asset));
}
diff --git a/core/tests/Drupal/Tests/Core/Asset/LibrariesDirectoryFileFinderTest.php b/core/tests/Drupal/Tests/Core/Asset/LibrariesDirectoryFileFinderTest.php
index bf3a7f02d83..ad175404a96 100644
--- a/core/tests/Drupal/Tests/Core/Asset/LibrariesDirectoryFileFinderTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/LibrariesDirectoryFileFinderTest.php
@@ -18,7 +18,7 @@ class LibrariesDirectoryFileFinderTest extends UnitTestCase {
/**
* @covers ::find
*/
- public function testFind() {
+ public function testFind(): void {
// Place a library file in all the possible locations.
$structure = [
'sites' => [
diff --git a/core/tests/Drupal/Tests/Core/Asset/LibraryDependencyResolverTest.php b/core/tests/Drupal/Tests/Core/Asset/LibraryDependencyResolverTest.php
index 705461e915e..fa65a72ff51 100644
--- a/core/tests/Drupal/Tests/Core/Asset/LibraryDependencyResolverTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDependencyResolverTest.php
@@ -118,7 +118,7 @@ class LibraryDependencyResolverTest extends UnitTestCase {
*
* @dataProvider providerTestGetLibrariesWithDependencies
*/
- public function testGetLibrariesWithDependencies(array $libraries, array $expected) {
+ public function testGetLibrariesWithDependencies(array $libraries, array $expected): void {
$this->assertEquals($expected, $this->libraryDependencyResolver->getLibrariesWithDependencies($libraries));
}
@@ -172,14 +172,14 @@ class LibraryDependencyResolverTest extends UnitTestCase {
*
* @dataProvider providerTestGetMinimalRepresentativeSubset
*/
- public function testGetMinimalRepresentativeSubset(array $libraries, array $expected) {
+ public function testGetMinimalRepresentativeSubset(array $libraries, array $expected): void {
$this->assertEquals($expected, $this->libraryDependencyResolver->getMinimalRepresentativeSubset($libraries));
}
/**
* @covers ::getMinimalRepresentativeSubset
*/
- public function testGetMinimalRepresentativeSubsetInvalidInput() {
+ public function testGetMinimalRepresentativeSubsetInvalidInput(): void {
$this->expectException(\AssertionError::class);
$this->expectExceptionMessage('$libraries can\'t contain duplicate items.');
$this->libraryDependencyResolver->getMinimalRepresentativeSubset(['test/no_deps_a', 'test/no_deps_a']);
diff --git a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php
index 5528ca294fb..cecf44fc3b4 100644
--- a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php
@@ -106,7 +106,7 @@ class LibraryDiscoveryCollectorTest extends UnitTestCase {
*
* @covers ::resolveCacheMiss
*/
- public function testResolveCacheMiss() {
+ public function testResolveCacheMiss(): void {
$this->activeTheme = $this->getMockBuilder(ActiveTheme::class)
->disableOriginalConstructor()
->getMock();
@@ -132,7 +132,7 @@ class LibraryDiscoveryCollectorTest extends UnitTestCase {
*
* @covers ::destruct
*/
- public function testDestruct() {
+ public function testDestruct(): void {
$this->activeTheme = $this->getMockBuilder(ActiveTheme::class)
->disableOriginalConstructor()
->getMock();
@@ -176,7 +176,7 @@ class LibraryDiscoveryCollectorTest extends UnitTestCase {
*
* @covers ::applyLibrariesExtend
*/
- public function testLibrariesExtend() {
+ public function testLibrariesExtend(): void {
$this->activeTheme = $this->getMockBuilder(ActiveTheme::class)
->disableOriginalConstructor()
->getMock();
@@ -221,7 +221,7 @@ class LibraryDiscoveryCollectorTest extends UnitTestCase {
*
* @group legacy
*/
- public function testLibrariesExtendDeprecated() {
+ public function testLibrariesExtendDeprecated(): void {
$this->expectDeprecation('Theme "test" is extending a deprecated library. The "test/test_4" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use the test_3 library instead. See https://www.example.com');
$this->activeTheme = $this->getMockBuilder(ActiveTheme::class)
->disableOriginalConstructor()
diff --git a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php
index 67b440fb2f9..13ba2d41ad3 100644
--- a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php
@@ -124,7 +124,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @runInSeparateProcess
*/
- public function testBuildByExtensionSimple() {
+ public function testBuildByExtensionSimple(): void {
FileCacheFactory::setPrefix('testing');
// Use the default file cache configuration.
FileCacheFactory::setConfiguration([
@@ -164,7 +164,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::buildByExtension
*/
- public function testBuildByExtensionWithTheme() {
+ public function testBuildByExtensionWithTheme(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('example_theme')
@@ -191,7 +191,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::buildByExtension
*/
- public function testBuildByExtensionWithMissingLibraryFile() {
+ public function testBuildByExtensionWithMissingLibraryFile(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('example_module')
@@ -212,7 +212,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::buildByExtension
*/
- public function testInvalidLibrariesFile() {
+ public function testInvalidLibrariesFile(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('invalid_file')
@@ -234,7 +234,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::buildByExtension
*/
- public function testBuildByExtensionWithOnlyDependencies() {
+ public function testBuildByExtensionWithOnlyDependencies(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('example_module_only_dependencies')
@@ -256,7 +256,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::buildByExtension
*/
- public function testBuildByExtensionWithMissingInformation() {
+ public function testBuildByExtensionWithMissingInformation(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('example_module_missing_information')
@@ -279,7 +279,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::buildByExtension
*/
- public function testVersion() {
+ public function testVersion(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('versions')
@@ -312,7 +312,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::buildByExtension
*/
- public function testExternalLibraries() {
+ public function testExternalLibraries(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('external')
@@ -338,7 +338,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::buildByExtension
*/
- public function testDefaultCssWeights() {
+ public function testDefaultCssWeights(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('css_weights')
@@ -379,7 +379,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::buildByExtension
*/
- public function testJsWithPositiveWeight() {
+ public function testJsWithPositiveWeight(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('js_positive_weight')
@@ -401,7 +401,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::buildByExtension
*/
- public function testLibraryWithCssJsSetting() {
+ public function testLibraryWithCssJsSetting(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('css_js_settings')
@@ -434,7 +434,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::buildByExtension
*/
- public function testLibraryWithDependencies() {
+ public function testLibraryWithDependencies(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('dependencies')
@@ -460,7 +460,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::buildByExtension
*/
- public function testLibraryWithDataTypes() {
+ public function testLibraryWithDataTypes(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('data_types')
@@ -498,7 +498,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::buildByExtension
*/
- public function testLibraryWithJavaScript() {
+ public function testLibraryWithJavaScript(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('js')
@@ -524,7 +524,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::buildByExtension
*/
- public function testLibraryThirdPartyWithMissingLicense() {
+ public function testLibraryThirdPartyWithMissingLicense(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('licenses_missing_information')
@@ -547,7 +547,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::buildByExtension
*/
- public function testLibraryWithLicenses() {
+ public function testLibraryWithLicenses(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('licenses')
@@ -634,7 +634,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @covers ::applyLibrariesOverride
*/
- public function testLibraryOverride() {
+ public function testLibraryOverride(): void {
$mock_theme_path = 'mocked_themes/kittens';
$this->themeManager = $this->createMock(ThemeManagerInterface::class);
$this->activeTheme = $this->getMockBuilder(ActiveTheme::class)
@@ -689,7 +689,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @group legacy
*/
- public function testLibraryOverrideDeprecated() {
+ public function testLibraryOverrideDeprecated(): void {
$this->expectDeprecation('Theme "deprecated" is overriding a deprecated library. The "deprecated/deprecated" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com');
$mock_theme_path = 'mocked_themes/kittens';
$this->themeManager = $this->createMock(ThemeManagerInterface::class);
@@ -746,7 +746,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
*
* @dataProvider providerTestCssAssert
*/
- public function testCssAssert($extension, $exception_message) {
+ public function testCssAssert($extension, $exception_message): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with($extension)
@@ -778,7 +778,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
/**
* @covers ::buildByExtension
*/
- public function testNonCoreLibrariesFound() {
+ public function testNonCoreLibrariesFound(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('example_contrib_module')
@@ -809,7 +809,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
/**
* @covers ::buildByExtension
*/
- public function testNonCoreLibrariesNotFound() {
+ public function testNonCoreLibrariesNotFound(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('example_contrib_module')
@@ -844,7 +844,7 @@ class LibraryDiscoveryParserTest extends UnitTestCase {
/**
* @covers ::parseLibraryInfo
*/
- public function testEmptyLibraryFile() {
+ public function testEmptyLibraryFile(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('moduleExists')
->with('empty')
diff --git a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php
index 72bc4add577..a10dac0d043 100644
--- a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php
@@ -81,7 +81,7 @@ class LibraryDiscoveryTest extends UnitTestCase {
/**
* @covers ::getLibrariesByExtension
*/
- public function testGetLibrariesByExtension() {
+ public function testGetLibrariesByExtension(): void {
$this->libraryDiscovery->getLibrariesByExtension('test');
// Verify that subsequent calls don't trigger hook_library_info_alter()
// and hook_js_settings_alter() invocations, nor do they talk to the
@@ -97,14 +97,14 @@ class LibraryDiscoveryTest extends UnitTestCase {
*
* @covers ::getLibraryByName
*/
- public function testGetLibraryByName() {
+ public function testGetLibraryByName(): void {
$this->assertSame($this->libraryData['test_1'], $this->libraryDiscovery->getLibraryByName('test', 'test_1'));
}
/**
* Tests getting a deprecated library.
*/
- public function testAssetLibraryDeprecation() {
+ public function testAssetLibraryDeprecation(): void {
$previous_error_handler = set_error_handler(function ($severity, $message, $file, $line) use (&$previous_error_handler) {
// Convert deprecation error into a catchable exception.
if ($severity === E_USER_DEPRECATED) {
diff --git a/core/tests/Drupal/Tests/Core/Authentication/AuthenticationCollectorTest.php b/core/tests/Drupal/Tests/Core/Authentication/AuthenticationCollectorTest.php
index 9f19efe1113..0a6d68a3aad 100644
--- a/core/tests/Drupal/Tests/Core/Authentication/AuthenticationCollectorTest.php
+++ b/core/tests/Drupal/Tests/Core/Authentication/AuthenticationCollectorTest.php
@@ -23,7 +23,7 @@ class AuthenticationCollectorTest extends UnitTestCase {
* @covers ::getProvider
* @covers ::isGlobal
*/
- public function testAuthenticationCollector() {
+ public function testAuthenticationCollector(): void {
$providers = [];
$global = [];
$authentication_collector = new AuthenticationCollector();
diff --git a/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php b/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php
index c988388f73d..0bfc70450d0 100644
--- a/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php
@@ -25,7 +25,7 @@ class AuthenticationManagerTest extends UnitTestCase {
*
* @dataProvider providerTestDefaultFilter
*/
- public function testDefaultFilter($applies, $has_route, $auth_option, $provider_id, $global) {
+ public function testDefaultFilter($applies, $has_route, $auth_option, $provider_id, $global): void {
$auth_provider = $this->createMock('Drupal\Core\Authentication\AuthenticationProviderInterface');
$auth_collector = new AuthenticationCollector();
$auth_collector->addProvider($auth_provider, $provider_id, 0, $global);
@@ -46,7 +46,7 @@ class AuthenticationManagerTest extends UnitTestCase {
/**
* @covers ::applyFilter
*/
- public function testApplyFilterWithFilterProvider() {
+ public function testApplyFilterWithFilterProvider(): void {
$auth_provider = $this->createMock('Drupal\Tests\Core\Authentication\TestAuthenticationProviderInterface');
$auth_provider->expects($this->once())
->method('appliesToRoutedRequest')
diff --git a/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php b/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php
index 5971692a116..757a5c50660 100644
--- a/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php
@@ -22,7 +22,7 @@ class BatchBuilderTest extends UnitTestCase {
*
* @covers ::toArray
*/
- public function testDefaultValues() {
+ public function testDefaultValues(): void {
$batch = (new BatchBuilder())->toArray();
$this->assertIsArray($batch);
@@ -51,7 +51,7 @@ class BatchBuilderTest extends UnitTestCase {
*
* @covers ::setTitle
*/
- public function testSetTitle() {
+ public function testSetTitle(): void {
$batch = (new BatchBuilder())
->setTitle(new TranslatableMarkup('New Title'))
->toArray();
@@ -64,7 +64,7 @@ class BatchBuilderTest extends UnitTestCase {
*
* @covers ::setFinishCallback
*/
- public function testSetFinishCallback() {
+ public function testSetFinishCallback(): void {
$batch = (new BatchBuilder())
->setFinishCallback('\Drupal\Tests\Core\Batch\BatchBuilderTest::finishedCallback')
->toArray();
@@ -77,7 +77,7 @@ class BatchBuilderTest extends UnitTestCase {
*
* @covers ::setInitMessage
*/
- public function testSetInitMessage() {
+ public function testSetInitMessage(): void {
$batch = (new BatchBuilder())
->setInitMessage(new TranslatableMarkup('New initialization message.'))
->toArray();
@@ -90,7 +90,7 @@ class BatchBuilderTest extends UnitTestCase {
*
* @covers ::setProgressMessage
*/
- public function testSetProgressMessage() {
+ public function testSetProgressMessage(): void {
$batch = (new BatchBuilder())
->setProgressMessage(new TranslatableMarkup('Batch in progress...'))
->toArray();
@@ -101,7 +101,7 @@ class BatchBuilderTest extends UnitTestCase {
/**
* Tests setErrorMessage().
*/
- public function testSetErrorMessage() {
+ public function testSetErrorMessage(): void {
$batch = (new BatchBuilder())
->setErrorMessage(new TranslatableMarkup('Oops. An error has occurred :('))
->toArray();
@@ -114,7 +114,7 @@ class BatchBuilderTest extends UnitTestCase {
*
* @covers ::setFile
*/
- public function testSetFile() {
+ public function testSetFile(): void {
$filename = dirname(__DIR__, 6) . '/core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc';
$this->assertIsNotCallable('_batch_test_callback_1');
$this->assertIsNotCallable('_batch_test_finished_1');
@@ -136,7 +136,7 @@ class BatchBuilderTest extends UnitTestCase {
*
* @covers ::setLibraries
*/
- public function testAddingLibraries() {
+ public function testAddingLibraries(): void {
$batch = (new BatchBuilder())
->setLibraries(['only/library'])
->toArray();
@@ -149,7 +149,7 @@ class BatchBuilderTest extends UnitTestCase {
*
* @covers ::setProgressive
*/
- public function testSetProgressive() {
+ public function testSetProgressive(): void {
$batch_builder = new BatchBuilder();
$batch = $batch_builder
->setProgressive(FALSE)
@@ -169,7 +169,7 @@ class BatchBuilderTest extends UnitTestCase {
*
* @covers ::setQueue
*/
- public function testSetQueue() {
+ public function testSetQueue(): void {
$batch = (new BatchBuilder())
->setQueue('BatchName', '\Drupal\Core\Queue\Batch')
->toArray();
@@ -185,7 +185,7 @@ class BatchBuilderTest extends UnitTestCase {
*
* @covers ::setQueue
*/
- public function testQueueExists() {
+ public function testQueueExists(): void {
$batch_builder = (new BatchBuilder());
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Class \ThisIsNotAClass does not exist.');
@@ -197,7 +197,7 @@ class BatchBuilderTest extends UnitTestCase {
*
* @covers ::setQueue
*/
- public function testQueueImplements() {
+ public function testQueueImplements(): void {
$batch_builder = (new BatchBuilder());
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Class Exception does not implement \Drupal\Core\Queue\QueueInterface.');
@@ -209,7 +209,7 @@ class BatchBuilderTest extends UnitTestCase {
*
* @covers ::setUrlOptions
*/
- public function testSetUrlOptions() {
+ public function testSetUrlOptions(): void {
$options = [
'absolute' => TRUE,
'language' => 'de',
@@ -226,7 +226,7 @@ class BatchBuilderTest extends UnitTestCase {
*
* @covers ::addOperation
*/
- public function testAddOperation() {
+ public function testAddOperation(): void {
$batch_builder = new BatchBuilder();
$batch = $batch_builder
->addOperation('\Drupal\Tests\Core\Batch\BatchBuilderTest::operationCallback')
diff --git a/core/tests/Drupal/Tests/Core/Batch/PercentagesTest.php b/core/tests/Drupal/Tests/Core/Batch/PercentagesTest.php
index 2cfa8264442..afd9b1f1dbe 100644
--- a/core/tests/Drupal/Tests/Core/Batch/PercentagesTest.php
+++ b/core/tests/Drupal/Tests/Core/Batch/PercentagesTest.php
@@ -22,7 +22,7 @@ class PercentagesTest extends UnitTestCase {
* @dataProvider providerTestPercentages
* @covers ::format
*/
- public function testPercentages($total, $current, $expected_result) {
+ public function testPercentages($total, $current, $expected_result): void {
$actual_result = Percentage::format($total, $current);
$this->assertEquals($actual_result, $expected_result, sprintf('The expected the batch api percentage at the state %s/%s is %s%% and got %s%%.', $current, $total, $expected_result, $actual_result));
}
diff --git a/core/tests/Drupal/Tests/Core/Block/BlockBaseTest.php b/core/tests/Drupal/Tests/Core/Block/BlockBaseTest.php
index 5d4d2cbf4e1..4775100e59c 100644
--- a/core/tests/Drupal/Tests/Core/Block/BlockBaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Block/BlockBaseTest.php
@@ -27,7 +27,7 @@ class BlockBaseTest extends UnitTestCase {
*
* @dataProvider providerTestGetMachineNameSuggestion
*/
- public function testGetMachineNameSuggestion($label, $expected) {
+ public function testGetMachineNameSuggestion($label, $expected): void {
$module_handler = $this->createMock('Drupal\Core\Extension\ModuleHandlerInterface');
$transliteration = $this->getMockBuilder('Drupal\Core\Transliteration\PhpTransliteration')
->setConstructorArgs([NULL, $module_handler])
diff --git a/core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php b/core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php
index dc993a5faad..d11b3b8a001 100644
--- a/core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php
@@ -87,7 +87,7 @@ class BlockManagerTest extends UnitTestCase {
/**
* @covers ::getDefinitions
*/
- public function testDefinitions() {
+ public function testDefinitions(): void {
$definitions = $this->blockManager->getDefinitions();
$this->assertSame(['broken', 'block1', 'block2', 'block3'], array_keys($definitions));
}
@@ -95,7 +95,7 @@ class BlockManagerTest extends UnitTestCase {
/**
* @covers ::getSortedDefinitions
*/
- public function testSortedDefinitions() {
+ public function testSortedDefinitions(): void {
$definitions = $this->blockManager->getSortedDefinitions();
$this->assertSame(['block2', 'block3', 'block1'], array_keys($definitions));
}
@@ -103,7 +103,7 @@ class BlockManagerTest extends UnitTestCase {
/**
* @covers ::getGroupedDefinitions
*/
- public function testGroupedDefinitions() {
+ public function testGroupedDefinitions(): void {
$definitions = $this->blockManager->getGroupedDefinitions();
$this->assertSame(['Group 1', 'Group 2'], array_keys($definitions));
$this->assertSame(['block2'], array_keys($definitions['Group 1']));
@@ -113,7 +113,7 @@ class BlockManagerTest extends UnitTestCase {
/**
* @covers ::handlePluginNotFound
*/
- public function testHandlePluginNotFound() {
+ public function testHandlePluginNotFound(): void {
$this->logger->warning('The "%plugin_id" was not found', ['%plugin_id' => 'invalid'])->shouldBeCalled();
$plugin = $this->blockManager->createInstance('invalid');
$this->assertSame('broken', $plugin->getPluginId());
diff --git a/core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php b/core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php
index 579a7168636..92054fedc72 100644
--- a/core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php
@@ -66,7 +66,7 @@ class BreadcrumbManagerTest extends UnitTestCase {
/**
* Tests the breadcrumb manager without any set breadcrumb.
*/
- public function testBuildWithoutBuilder() {
+ public function testBuildWithoutBuilder(): void {
$route_match = $this->createMock('Drupal\Core\Routing\RouteMatchInterface');
$this->moduleHandler->expects($this->once())
->method('alter')
@@ -82,7 +82,7 @@ class BreadcrumbManagerTest extends UnitTestCase {
/**
* Tests the build method with a single breadcrumb builder.
*/
- public function testBuildWithSingleBuilder() {
+ public function testBuildWithSingleBuilder(): void {
$builder = $this->createMock('Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface');
$links = ['<a href="/example">Test</a>'];
$this->breadcrumb->setLinks($links);
@@ -113,7 +113,7 @@ class BreadcrumbManagerTest extends UnitTestCase {
/**
* Tests multiple breadcrumb builder with different priority.
*/
- public function testBuildWithMultipleApplyingBuilders() {
+ public function testBuildWithMultipleApplyingBuilders(): void {
$builder1 = $this->createMock('Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface');
$builder1->expects($this->never())
->method('applies');
@@ -150,7 +150,7 @@ class BreadcrumbManagerTest extends UnitTestCase {
/**
* Tests multiple breadcrumb builders of which one returns NULL.
*/
- public function testBuildWithOneNotApplyingBuilders() {
+ public function testBuildWithOneNotApplyingBuilders(): void {
$builder1 = $this->createMock('Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface');
$builder1->expects($this->once())
->method('applies')
@@ -188,7 +188,7 @@ class BreadcrumbManagerTest extends UnitTestCase {
/**
* Tests a breadcrumb builder with a bad return value.
*/
- public function testBuildWithInvalidBreadcrumbResult() {
+ public function testBuildWithInvalidBreadcrumbResult(): void {
$builder = $this->createMock('Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface');
$builder->expects($this->once())
->method('applies')
diff --git a/core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php b/core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php
index c0f91db54a6..4932f17e9c9 100644
--- a/core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php
+++ b/core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbTest.php
@@ -18,7 +18,7 @@ class BreadcrumbTest extends UnitTestCase {
/**
* @covers ::setLinks
*/
- public function testSetLinks() {
+ public function testSetLinks(): void {
$breadcrumb = new Breadcrumb();
$breadcrumb->setLinks([new Link('Home', Url::fromRoute('<front>'))]);
$this->expectException(\LogicException::class);
diff --git a/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php b/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php
index 43e94f18d93..dd46ae78eb2 100644
--- a/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php
@@ -90,7 +90,7 @@ class BackendChainImplementationUnitTest extends UnitTestCase {
/**
* Tests the get feature.
*/
- public function testGet() {
+ public function testGet(): void {
$cached = $this->chain->get('t123');
$this->assertNotFalse($cached, 'Got key that is on all backends');
$this->assertSame(1231, $cached->data, 'Got the key from the backend 1');
@@ -107,7 +107,7 @@ class BackendChainImplementationUnitTest extends UnitTestCase {
/**
* Tests the get multiple feature.
*/
- public function testGetMultiple() {
+ public function testGetMultiple(): void {
$cids = ['t123', 't23', 't3', 't4'];
$ret = $this->chain->getMultiple($cids);
@@ -125,7 +125,7 @@ class BackendChainImplementationUnitTest extends UnitTestCase {
/**
* Tests that set will propagate.
*/
- public function testSet() {
+ public function testSet(): void {
$this->chain->set('test', 123);
$cached = $this->firstBackend->get('test');
@@ -144,7 +144,7 @@ class BackendChainImplementationUnitTest extends UnitTestCase {
/**
* Tests that delete will propagate.
*/
- public function testDelete() {
+ public function testDelete(): void {
$this->chain->set('test', 5);
$cached = $this->firstBackend->get('test');
@@ -167,7 +167,7 @@ class BackendChainImplementationUnitTest extends UnitTestCase {
/**
* Ensure get values propagation to previous backends.
*/
- public function testGetHasPropagated() {
+ public function testGetHasPropagated(): void {
$this->chain->get('t23');
$cached = $this->firstBackend->get('t23');
$this->assertNotFalse($cached, 'Test 2 has been propagated to the first backend');
@@ -182,7 +182,7 @@ class BackendChainImplementationUnitTest extends UnitTestCase {
/**
* Ensure get multiple values propagation to previous backends.
*/
- public function testGetMultipleHasPropagated() {
+ public function testGetMultipleHasPropagated(): void {
$cids = ['t3', 't23'];
$this->chain->getMultiple($cids);
@@ -201,7 +201,7 @@ class BackendChainImplementationUnitTest extends UnitTestCase {
/**
* Tests that the delete all operation is propagated to all chained backends.
*/
- public function testDeleteAllPropagation() {
+ public function testDeleteAllPropagation(): void {
// Set both expiring and permanent keys.
$this->chain->set('test1', 1, Cache::PERMANENT);
$this->chain->set('test2', 3, time() + 1000);
@@ -218,7 +218,7 @@ class BackendChainImplementationUnitTest extends UnitTestCase {
/**
* Tests that the delete tags operation is propagated to all chained backends.
*/
- public function testDeleteTagsPropagation() {
+ public function testDeleteTagsPropagation(): void {
// Create two cache entries with the same tag and tag value.
$this->chain->set('test_cid_clear1', 'foo', Cache::PERMANENT, ['test_tag:2']);
$this->chain->set('test_cid_clear2', 'foo', Cache::PERMANENT, ['test_tag:2']);
@@ -294,7 +294,7 @@ class BackendChainImplementationUnitTest extends UnitTestCase {
/**
* Tests that removing bin propagates to all backends.
*/
- public function testRemoveBin() {
+ public function testRemoveBin(): void {
$chain = new BackendChain();
for ($i = 0; $i < 3; $i++) {
$backend = $this->createMock('Drupal\Core\Cache\CacheBackendInterface');
diff --git a/core/tests/Drupal/Tests/Core/Cache/CacheCollectorTest.php b/core/tests/Drupal/Tests/Core/Cache/CacheCollectorTest.php
index fd7f0682391..a070a22f3d0 100644
--- a/core/tests/Drupal/Tests/Core/Cache/CacheCollectorTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/CacheCollectorTest.php
@@ -66,7 +66,7 @@ class CacheCollectorTest extends UnitTestCase {
/**
* Tests the resolve cache miss function.
*/
- public function testResolveCacheMiss() {
+ public function testResolveCacheMiss(): void {
$key = $this->randomMachineName();
$value = $this->randomMachineName();
$this->collector->setCacheMissData($key, $value);
@@ -77,7 +77,7 @@ class CacheCollectorTest extends UnitTestCase {
/**
* Tests setting and getting values when the cache is empty.
*/
- public function testSetAndGet() {
+ public function testSetAndGet(): void {
$key = $this->randomMachineName();
$value = $this->randomMachineName();
@@ -91,7 +91,7 @@ class CacheCollectorTest extends UnitTestCase {
/**
* Makes sure that NULL is a valid value and is collected.
*/
- public function testSetAndGetNull() {
+ public function testSetAndGetNull(): void {
$key = $this->randomMachineName();
$value = NULL;
@@ -112,7 +112,7 @@ class CacheCollectorTest extends UnitTestCase {
/**
* Tests returning value from the collected cache.
*/
- public function testGetFromCache() {
+ public function testGetFromCache(): void {
$key = $this->randomMachineName();
$value = $this->randomMachineName();
@@ -132,7 +132,7 @@ class CacheCollectorTest extends UnitTestCase {
/**
* Tests setting and deleting values.
*/
- public function testDelete() {
+ public function testDelete(): void {
$key = $this->randomMachineName();
$value = $this->randomMachineName();
@@ -153,7 +153,7 @@ class CacheCollectorTest extends UnitTestCase {
/**
* Tests updating the cache when no changes were made.
*/
- public function testUpdateCacheNoChanges() {
+ public function testUpdateCacheNoChanges(): void {
$this->lock->expects($this->never())
->method('acquire');
$this->cacheBackend->expects($this->never())
@@ -166,7 +166,7 @@ class CacheCollectorTest extends UnitTestCase {
/**
* Tests updating the cache after a set.
*/
- public function testUpdateCache() {
+ public function testUpdateCache(): void {
$key = $this->randomMachineName();
$value = $this->randomMachineName();
@@ -197,7 +197,7 @@ class CacheCollectorTest extends UnitTestCase {
/**
* Tests updating the cache when the lock acquire fails.
*/
- public function testUpdateCacheLockFail() {
+ public function testUpdateCacheLockFail(): void {
$key = $this->randomMachineName();
$value = $this->randomMachineName();
@@ -219,7 +219,7 @@ class CacheCollectorTest extends UnitTestCase {
/**
* Tests updating the cache when there is a conflict after cache invalidation.
*/
- public function testUpdateCacheInvalidatedConflict() {
+ public function testUpdateCacheInvalidatedConflict(): void {
$key = $this->randomMachineName();
$value = $this->randomMachineName();
@@ -263,7 +263,7 @@ class CacheCollectorTest extends UnitTestCase {
/**
* Tests a cache hit, then item updated by a different request.
*/
- public function testUpdateCacheMerge() {
+ public function testUpdateCacheMerge(): void {
$key = $this->randomMachineName();
$value = $this->randomMachineName();
@@ -300,7 +300,7 @@ class CacheCollectorTest extends UnitTestCase {
/**
* Tests a cache miss, then item created by another request.
*/
- public function testUpdateCacheRace() {
+ public function testUpdateCacheRace(): void {
$key = $this->randomMachineName();
$value = $this->randomMachineName();
@@ -330,7 +330,7 @@ class CacheCollectorTest extends UnitTestCase {
/**
* Tests updating the cache after a delete.
*/
- public function testUpdateCacheDelete() {
+ public function testUpdateCacheDelete(): void {
$key = $this->randomMachineName();
$value = $this->randomMachineName();
@@ -370,7 +370,7 @@ class CacheCollectorTest extends UnitTestCase {
/**
* Tests a reset of the cache collector.
*/
- public function testUpdateCacheReset() {
+ public function testUpdateCacheReset(): void {
$key = $this->randomMachineName();
$value = $this->randomMachineName();
@@ -391,7 +391,7 @@ class CacheCollectorTest extends UnitTestCase {
/**
* Tests a clear of the cache collector.
*/
- public function testUpdateCacheClear() {
+ public function testUpdateCacheClear(): void {
$key = $this->randomMachineName();
$value = $this->randomMachineName();
@@ -417,7 +417,7 @@ class CacheCollectorTest extends UnitTestCase {
/**
* Tests a clear of the cache collector using tags.
*/
- public function testUpdateCacheClearTags() {
+ public function testUpdateCacheClearTags(): void {
$key = $this->randomMachineName();
$value = $this->randomMachineName();
$tags = [$this->randomMachineName()];
diff --git a/core/tests/Drupal/Tests/Core/Cache/CacheFactoryTest.php b/core/tests/Drupal/Tests/Core/Cache/CacheFactoryTest.php
index 8c555465c75..618c51fa38f 100644
--- a/core/tests/Drupal/Tests/Core/Cache/CacheFactoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/CacheFactoryTest.php
@@ -21,7 +21,7 @@ class CacheFactoryTest extends UnitTestCase {
* @covers ::__construct
* @covers ::get
*/
- public function testCacheFactoryWithDefaultSettings() {
+ public function testCacheFactoryWithDefaultSettings(): void {
$settings = new Settings([]);
$cache_factory = new CacheFactory($settings);
@@ -47,7 +47,7 @@ class CacheFactoryTest extends UnitTestCase {
* @covers ::__construct
* @covers ::get
*/
- public function testCacheFactoryWithCustomizedDefaultBackend() {
+ public function testCacheFactoryWithCustomizedDefaultBackend(): void {
$settings = new Settings([
'cache' => [
'default' => 'cache.backend.custom',
@@ -77,7 +77,7 @@ class CacheFactoryTest extends UnitTestCase {
* @covers ::__construct
* @covers ::get
*/
- public function testCacheFactoryWithDefaultBinBackend() {
+ public function testCacheFactoryWithDefaultBinBackend(): void {
// Ensure the default bin backends are used before the configured default.
$settings = new Settings([
'cache' => [
@@ -113,7 +113,7 @@ class CacheFactoryTest extends UnitTestCase {
* @covers ::__construct
* @covers ::get
*/
- public function testCacheFactoryWithSpecifiedPerBinBackend() {
+ public function testCacheFactoryWithSpecifiedPerBinBackend(): void {
// Ensure the per-bin configuration is used before the configured default
// and per-bin defaults.
$settings = new Settings([
diff --git a/core/tests/Drupal/Tests/Core/Cache/CacheTagsInvalidatorTest.php b/core/tests/Drupal/Tests/Core/Cache/CacheTagsInvalidatorTest.php
index 61527df595e..2a118b36867 100644
--- a/core/tests/Drupal/Tests/Core/Cache/CacheTagsInvalidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/CacheTagsInvalidatorTest.php
@@ -18,7 +18,7 @@ class CacheTagsInvalidatorTest extends UnitTestCase {
/**
* @covers ::invalidateTags
*/
- public function testInvalidateTagsWithInvalidTags() {
+ public function testInvalidateTagsWithInvalidTags(): void {
$cache_tags_invalidator = new CacheTagsInvalidator();
$this->expectException(\AssertionError::class);
$cache_tags_invalidator->invalidateTags(['node' => [2, 3, 5, 8, 13]]);
@@ -29,7 +29,7 @@ class CacheTagsInvalidatorTest extends UnitTestCase {
* @covers ::addInvalidator
* @covers ::addBin
*/
- public function testInvalidateTags() {
+ public function testInvalidateTags(): void {
$cache_tags_invalidator = new CacheTagsInvalidator();
$invalidator_cache_bin = $this->createMock(InvalidatingCacheBackendInterface::class);
diff --git a/core/tests/Drupal/Tests/Core/Cache/CacheTest.php b/core/tests/Drupal/Tests/Core/Cache/CacheTest.php
index a3712c0d356..dc005bc3f09 100644
--- a/core/tests/Drupal/Tests/Core/Cache/CacheTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/CacheTest.php
@@ -68,7 +68,7 @@ class CacheTest extends UnitTestCase {
*
* @dataProvider mergeTagsProvider
*/
- public function testMergeTags(array $expected, ...$cache_tags) {
+ public function testMergeTags(array $expected, ...$cache_tags): void {
$this->assertEqualsCanonicalizing($expected, Cache::mergeTags(...$cache_tags));
}
@@ -107,7 +107,7 @@ class CacheTest extends UnitTestCase {
*
* @dataProvider mergeMaxAgesProvider
*/
- public function testMergeMaxAges($expected, ...$max_ages) {
+ public function testMergeMaxAges($expected, ...$max_ages): void {
$this->assertSame($expected, Cache::mergeMaxAges(...$max_ages));
}
@@ -141,7 +141,7 @@ class CacheTest extends UnitTestCase {
*
* @dataProvider mergeCacheContextsProvide
*/
- public function testMergeCacheContexts(array $expected, ...$contexts) {
+ public function testMergeCacheContexts(array $expected, ...$contexts): void {
$cache_contexts_manager = $this->prophesize(CacheContextsManager::class);
$cache_contexts_manager->assertValidTokens(Argument::any())->willReturn(TRUE);
$container = $this->prophesize(Container::class);
@@ -182,7 +182,7 @@ class CacheTest extends UnitTestCase {
*
* @dataProvider buildTagsProvider
*/
- public function testBuildTags($prefix, array $suffixes, array $expected, $glue = ':') {
+ public function testBuildTags($prefix, array $suffixes, array $expected, $glue = ':'): void {
$this->assertEquals($expected, Cache::buildTags($prefix, $suffixes, $glue));
}
diff --git a/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php b/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php
index ef813ef4b36..9162ecf21cd 100644
--- a/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php
@@ -29,7 +29,7 @@ class CacheableMetadataTest extends UnitTestCase {
* @covers ::merge
* @dataProvider providerTestMerge
*/
- public function testMerge(CacheableMetadata $a, CacheableMetadata $b, CacheableMetadata $expected) {
+ public function testMerge(CacheableMetadata $a, CacheableMetadata $b, CacheableMetadata $expected): void {
$cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
->disableOriginalConstructor()
->getMock();
@@ -55,7 +55,7 @@ class CacheableMetadataTest extends UnitTestCase {
* @covers ::addCacheableDependency
* @dataProvider providerTestMerge
*/
- public function testAddCacheableDependency(CacheableMetadata $a, CacheableMetadata $b, CacheableMetadata $expected) {
+ public function testAddCacheableDependency(CacheableMetadata $a, CacheableMetadata $b, CacheableMetadata $expected): void {
$cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
->disableOriginalConstructor()
->getMock();
@@ -90,7 +90,7 @@ class CacheableMetadataTest extends UnitTestCase {
*
* @covers ::addCacheTags
*/
- public function testAddCacheTags() {
+ public function testAddCacheTags(): void {
$metadata = new CacheableMetadata();
$add_expected = [
[[], []],
@@ -114,7 +114,7 @@ class CacheableMetadataTest extends UnitTestCase {
* @covers ::setCacheMaxAge
* @dataProvider providerSetCacheMaxAge
*/
- public function testSetCacheMaxAge($data, $expect_exception) {
+ public function testSetCacheMaxAge($data, $expect_exception): void {
$metadata = new CacheableMetadata();
if ($expect_exception) {
$this->expectException('\InvalidArgumentException');
@@ -142,7 +142,7 @@ class CacheableMetadataTest extends UnitTestCase {
* @covers ::createFromRenderArray
* @dataProvider providerTestCreateFromRenderArray
*/
- public function testCreateFromRenderArray(array $render_array, CacheableMetadata $expected) {
+ public function testCreateFromRenderArray(array $render_array, CacheableMetadata $expected): void {
$this->assertEquals($expected, CacheableMetadata::createFromRenderArray($render_array));
}
@@ -178,7 +178,7 @@ class CacheableMetadataTest extends UnitTestCase {
* @covers ::createFromObject
* @dataProvider providerTestCreateFromObject
*/
- public function testCreateFromObject($object, CacheableMetadata $expected) {
+ public function testCreateFromObject($object, CacheableMetadata $expected): void {
$this->assertEquals($expected, CacheableMetadata::createFromObject($object));
}
diff --git a/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendFactoryTest.php b/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendFactoryTest.php
index 436db6dc00c..012a0ce5237 100644
--- a/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendFactoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendFactoryTest.php
@@ -20,7 +20,7 @@ class ChainedFastBackendFactoryTest extends UnitTestCase {
/**
* Test if the same name is provided for consistent and fast services.
*/
- public function testIdenticalService() {
+ public function testIdenticalService(): void {
$container = $this->createMock(ContainerInterface::class);
$testCacheFactory = $this->createMock(CacheFactoryInterface::class);
$testCacheBackend = $this->createMock(CacheBackendInterface::class);
@@ -47,7 +47,7 @@ class ChainedFastBackendFactoryTest extends UnitTestCase {
/**
* Test if different names are provided for consistent and fast services.
*/
- public function testDifferentServices() {
+ public function testDifferentServices(): void {
$container = $this->createMock(ContainerInterface::class);
$testConsistentCacheFactory = $this->createMock(CacheFactoryInterface::class);
$testFastCacheFactory = $this->createMock(CacheFactoryInterface::class);
diff --git a/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php b/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php
index 47a495e9d99..653f5d7b552 100644
--- a/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php
@@ -39,7 +39,7 @@ class ChainedFastBackendTest extends UnitTestCase {
/**
* Tests a get() on the fast backend, with no hit on the consistent backend.
*/
- public function testGetDoesNotHitConsistentBackend() {
+ public function testGetDoesNotHitConsistentBackend(): void {
$consistent_cache = $this->createMock('Drupal\Core\Cache\CacheBackendInterface');
$timestamp_cid = ChainedFastBackend::LAST_WRITE_TIMESTAMP_PREFIX . 'cache_foo';
// Use the request time because that is what we will be comparing against.
@@ -64,7 +64,7 @@ class ChainedFastBackendTest extends UnitTestCase {
/**
* Tests a fast cache miss gets data from the consistent cache backend.
*/
- public function testFallThroughToConsistentCache() {
+ public function testFallThroughToConsistentCache(): void {
$timestamp_item = (object) [
'cid' => ChainedFastBackend::LAST_WRITE_TIMESTAMP_PREFIX . 'cache_foo',
// Time travel is easy.
diff --git a/core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php b/core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php
index 51afa3a9d42..afc6999420d 100644
--- a/core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php
@@ -25,7 +25,7 @@ class CacheContextsManagerTest extends UnitTestCase {
*
* @dataProvider providerTestOptimizeTokens
*/
- public function testOptimizeTokens(array $context_tokens, array $optimized_context_tokens) {
+ public function testOptimizeTokens(array $context_tokens, array $optimized_context_tokens): void {
$container = $this->getMockBuilder('Drupal\Core\DependencyInjection\Container')
->disableOriginalConstructor()
->getMock();
@@ -104,7 +104,7 @@ class CacheContextsManagerTest extends UnitTestCase {
/**
* @covers ::convertTokensToKeys
*/
- public function testConvertTokensToKeys() {
+ public function testConvertTokensToKeys(): void {
$container = $this->getMockContainer();
$cache_contexts_manager = new CacheContextsManager($container, $this->getContextsFixture());
@@ -125,7 +125,7 @@ class CacheContextsManagerTest extends UnitTestCase {
/**
* @covers ::convertTokensToKeys
*/
- public function testInvalidContext() {
+ public function testInvalidContext(): void {
$container = $this->getMockContainer();
$cache_contexts_manager = new CacheContextsManager($container, $this->getContextsFixture());
@@ -138,7 +138,7 @@ class CacheContextsManagerTest extends UnitTestCase {
*
* @dataProvider providerTestInvalidCalculatedContext
*/
- public function testInvalidCalculatedContext($context_token) {
+ public function testInvalidCalculatedContext($context_token): void {
$container = $this->getMockContainer();
$cache_contexts_manager = new CacheContextsManager($container, $this->getContextsFixture());
@@ -156,13 +156,13 @@ class CacheContextsManagerTest extends UnitTestCase {
];
}
- public function testAvailableContextStrings() {
+ public function testAvailableContextStrings(): void {
$cache_contexts_manager = new CacheContextsManager($this->getMockContainer(), $this->getContextsFixture());
$contexts = $cache_contexts_manager->getAll();
$this->assertEquals(["foo", "baz"], $contexts);
}
- public function testAvailableContextLabels() {
+ public function testAvailableContextLabels(): void {
$container = $this->getMockContainer();
$cache_contexts_manager = new CacheContextsManager($container, $this->getContextsFixture());
$labels = $cache_contexts_manager->getLabels();
@@ -232,7 +232,7 @@ class CacheContextsManagerTest extends UnitTestCase {
*
* @dataProvider validateTokensProvider
*/
- public function testValidateContexts(array $contexts, $expected_exception_message) {
+ public function testValidateContexts(array $contexts, $expected_exception_message): void {
$container = new ContainerBuilder();
$cache_contexts_manager = new CacheContextsManager($container, ['foo', 'foo.bar', 'baz']);
if ($expected_exception_message !== FALSE) {
diff --git a/core/tests/Drupal/Tests/Core/Cache/Context/CookieCacheContextTest.php b/core/tests/Drupal/Tests/Core/Cache/Context/CookieCacheContextTest.php
index 8eef5a40506..5a7c0835e1b 100644
--- a/core/tests/Drupal/Tests/Core/Cache/Context/CookieCacheContextTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/Context/CookieCacheContextTest.php
@@ -20,7 +20,7 @@ class CookieCacheContextTest extends UnitTestCase {
*
* @dataProvider providerTestGetContext
*/
- public function testGetContext($cookies, $cookie_name, $context) {
+ public function testGetContext($cookies, $cookie_name, $context): void {
$request_stack = new RequestStack();
$request = Request::create('/', 'GET');
foreach ($cookies as $cookie => $value) {
diff --git a/core/tests/Drupal/Tests/Core/Cache/Context/HeadersCacheContextTest.php b/core/tests/Drupal/Tests/Core/Cache/Context/HeadersCacheContextTest.php
index f691ffe9da5..7197a6283ed 100644
--- a/core/tests/Drupal/Tests/Core/Cache/Context/HeadersCacheContextTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/Context/HeadersCacheContextTest.php
@@ -20,7 +20,7 @@ class HeadersCacheContextTest extends UnitTestCase {
*
* @dataProvider providerTestGetContext
*/
- public function testGetContext($headers, $header_name, $context) {
+ public function testGetContext($headers, $header_name, $context): void {
$request_stack = new RequestStack();
$request = Request::create('/', 'GET');
// Request defaults could change, so compare with default values instead of
diff --git a/core/tests/Drupal/Tests/Core/Cache/Context/IsFrontPathCacheContextTest.php b/core/tests/Drupal/Tests/Core/Cache/Context/IsFrontPathCacheContextTest.php
index ef732eb9cec..b54554dae0f 100644
--- a/core/tests/Drupal/Tests/Core/Cache/Context/IsFrontPathCacheContextTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/Context/IsFrontPathCacheContextTest.php
@@ -17,7 +17,7 @@ class IsFrontPathCacheContextTest extends UnitTestCase {
/**
* @covers ::getContext
*/
- public function testGetContextFront() {
+ public function testGetContextFront(): void {
$cache_context = new IsFrontPathCacheContext($this->createPathMatcher(TRUE)->reveal());
$this->assertSame('is_front.1', $cache_context->getContext());
}
@@ -25,7 +25,7 @@ class IsFrontPathCacheContextTest extends UnitTestCase {
/**
* @covers ::getContext
*/
- public function testGetContextNotFront() {
+ public function testGetContextNotFront(): void {
$cache_context = new IsFrontPathCacheContext($this->createPathMatcher(FALSE)->reveal());
$this->assertSame('is_front.0', $cache_context->getContext());
}
diff --git a/core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php b/core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php
index 1d5b652ddbc..3eed80e3db3 100644
--- a/core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php
@@ -20,7 +20,7 @@ class PathParentCacheContextTest extends UnitTestCase {
*
* @dataProvider providerTestGetContext
*/
- public function testGetContext($original_path, $context) {
+ public function testGetContext($original_path, $context): void {
$request_stack = new RequestStack();
$request = Request::create($original_path);
$request_stack->push($request);
diff --git a/core/tests/Drupal/Tests/Core/Cache/Context/ProtocolVersionCacheContextTest.php b/core/tests/Drupal/Tests/Core/Cache/Context/ProtocolVersionCacheContextTest.php
index 673cd4cc387..12f3c641a65 100644
--- a/core/tests/Drupal/Tests/Core/Cache/Context/ProtocolVersionCacheContextTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/Context/ProtocolVersionCacheContextTest.php
@@ -20,7 +20,7 @@ class ProtocolVersionCacheContextTest extends UnitTestCase {
*
* @dataProvider providerTestGetContext
*/
- public function testGetContext($protocol, $context) {
+ public function testGetContext($protocol, $context): void {
$request_stack = new RequestStack();
$request = Request::create('/');
$request->server->set('SERVER_PROTOCOL', $protocol);
diff --git a/core/tests/Drupal/Tests/Core/Cache/Context/QueryArgsCacheContextTest.php b/core/tests/Drupal/Tests/Core/Cache/Context/QueryArgsCacheContextTest.php
index 4ed09f3ae4d..0556773defe 100644
--- a/core/tests/Drupal/Tests/Core/Cache/Context/QueryArgsCacheContextTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/Context/QueryArgsCacheContextTest.php
@@ -20,7 +20,7 @@ class QueryArgsCacheContextTest extends UnitTestCase {
*
* @dataProvider providerTestGetContext
*/
- public function testGetContext(array $query_args, $cache_context_parameter, $context) {
+ public function testGetContext(array $query_args, $cache_context_parameter, $context): void {
$request_stack = new RequestStack();
$request = Request::create('/', 'GET', $query_args);
$request_stack->push($request);
diff --git a/core/tests/Drupal/Tests/Core/Cache/Context/SessionCacheContextTest.php b/core/tests/Drupal/Tests/Core/Cache/Context/SessionCacheContextTest.php
index 5d2dce80a73..b085377be46 100644
--- a/core/tests/Drupal/Tests/Core/Cache/Context/SessionCacheContextTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/Context/SessionCacheContextTest.php
@@ -54,7 +54,7 @@ class SessionCacheContextTest extends UnitTestCase {
/**
* @covers ::getContext
*/
- public function testSameContextForSameSession() {
+ public function testSameContextForSameSession(): void {
$this->request->setSession($this->session);
$cache_context = new SessionCacheContext($this->requestStack);
@@ -73,7 +73,7 @@ class SessionCacheContextTest extends UnitTestCase {
/**
* @covers ::getContext
*/
- public function testDifferentContextForDifferentSession() {
+ public function testDifferentContextForDifferentSession(): void {
$this->request->setSession($this->session);
$cache_context = new SessionCacheContext($this->requestStack);
diff --git a/core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php b/core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php
index 93666f28daf..60438d2063a 100644
--- a/core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php
@@ -24,7 +24,7 @@ class DatabaseBackendFactoryTest extends UnitTestCase {
* @covers ::get
* @dataProvider getProvider
*/
- public function testGet(array $settings, $expected_max_rows_foo, $expected_max_rows_bar) {
+ public function testGet(array $settings, $expected_max_rows_foo, $expected_max_rows_bar): void {
$database_backend_factory = new DatabaseBackendFactory(
$this->prophesize(Connection::class)->reveal(),
$this->prophesize(CacheTagsChecksumInterface::class)->reveal(),
diff --git a/core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php b/core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php
index e5067a697d8..51a6699585c 100644
--- a/core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php
@@ -17,7 +17,7 @@ class NullBackendTest extends UnitTestCase {
/**
* Tests that the NullBackend does not actually store variables.
*/
- public function testNullBackend() {
+ public function testNullBackend(): void {
$null_cache = new NullBackend('test');
$key = $this->randomMachineName();
diff --git a/core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php b/core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
index 64a11e90de4..61b058b7e2f 100644
--- a/core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
@@ -184,7 +184,7 @@ class VariationCacheTest extends UnitTestCase {
* @covers ::get
* @covers ::set
*/
- public function testNoVariations() {
+ public function testNoVariations(): void {
$data = 'You have a nice house!';
$cacheability = (new CacheableMetadata())->setCacheTags(['bar', 'foo']);
$initial_cacheability = (new CacheableMetadata())->setCacheTags(['foo']);
@@ -198,7 +198,7 @@ class VariationCacheTest extends UnitTestCase {
* @covers ::get
* @covers ::set
*/
- public function testSingleVariation() {
+ public function testSingleVariation(): void {
$cacheability = $this->housingTypeCacheability;
$house_data = [
@@ -221,7 +221,7 @@ class VariationCacheTest extends UnitTestCase {
* @covers ::get
* @covers ::set
*/
- public function testNestedVariations() {
+ public function testNestedVariations(): void {
// We are running this scenario in the best possible outcome: The redirects
// are stored in expanding order, meaning the simplest one is stored first
// and the nested ones are stored in subsequent ::set() calls. This means no
@@ -273,7 +273,7 @@ class VariationCacheTest extends UnitTestCase {
*
* @depends testNestedVariations
*/
- public function testNestedVariationsSelfHealing() {
+ public function testNestedVariationsSelfHealing(): void {
// This is the worst possible scenario: A very specific item was stored
// first, followed by a less specific one. This means an overly specific
// cache redirect was stored that needs to be dumbed down. After this
@@ -330,7 +330,7 @@ class VariationCacheTest extends UnitTestCase {
* @covers ::get
* @covers ::set
*/
- public function testSplitVariationsSelfHealing() {
+ public function testSplitVariationsSelfHealing(): void {
// This is an edge case. Something varies by AB where some values of B
// trigger the whole to vary by either C, D or nothing extra. But due to an
// unfortunate series of requests, only ABC and ABD variations were cached.
@@ -402,7 +402,7 @@ class VariationCacheTest extends UnitTestCase {
* @covers ::get
* @covers ::set
*/
- public function testIncompatibleVariationsException() {
+ public function testIncompatibleVariationsException(): void {
// This should never happen. When someone first stores something in the
// cache using context A and then tries to store something using context B,
// something is wrong. There should always be at least one shared context at
diff --git a/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php b/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php
index 688b54b753f..74139e1b9ba 100644
--- a/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php
+++ b/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php
@@ -86,7 +86,7 @@ class QuickStartTest extends TestCase {
/**
* Tests the quick-start command.
*/
- public function testQuickStartCommand() {
+ public function testQuickStartCommand(): void {
$sqlite = (new \PDO('sqlite::memory:'))->query('select sqlite_version()')->fetch()[0];
if (version_compare($sqlite, Tasks::SQLITE_MINIMUM_VERSION) < 0) {
$this->markTestSkipped();
@@ -142,7 +142,7 @@ class QuickStartTest extends TestCase {
/**
* Tests the quick-start commands.
*/
- public function testQuickStartInstallAndServerCommands() {
+ public function testQuickStartInstallAndServerCommands(): void {
$sqlite = (new \PDO('sqlite::memory:'))->query('select sqlite_version()')->fetch()[0];
if (version_compare($sqlite, Tasks::SQLITE_MINIMUM_VERSION) < 0) {
$this->markTestSkipped();
@@ -224,7 +224,7 @@ class QuickStartTest extends TestCase {
/**
* Tests the install command with an invalid profile.
*/
- public function testQuickStartCommandProfileValidation() {
+ public function testQuickStartCommandProfileValidation(): void {
// Install a site using the standard profile to ensure the one time login
// link generation works.
$install_command = [
@@ -242,7 +242,7 @@ class QuickStartTest extends TestCase {
/**
* Tests the server command when there is no installation.
*/
- public function testServerWithNoInstall() {
+ public function testServerWithNoInstall(): void {
$server_command = [
$this->php,
'core/scripts/drupal',
diff --git a/core/tests/Drupal/Tests/Core/Common/AttributesTest.php b/core/tests/Drupal/Tests/Core/Common/AttributesTest.php
index 49321a4fa2a..e051a1338bb 100644
--- a/core/tests/Drupal/Tests/Core/Common/AttributesTest.php
+++ b/core/tests/Drupal/Tests/Core/Common/AttributesTest.php
@@ -54,14 +54,14 @@ class AttributesTest extends UnitTestCase {
*
* @dataProvider providerTestAttributeData
*/
- public function testDrupalAttributes($attributes, $expected, $message) {
+ public function testDrupalAttributes($attributes, $expected, $message): void {
$this->assertSame($expected, (string) new Attribute($attributes), $message);
}
/**
* Tests attribute iteration.
*/
- public function testAttributeIteration() {
+ public function testAttributeIteration(): void {
$attribute = new Attribute(['key1' => 'value1']);
foreach ($attribute as $value) {
$this->assertSame((string) $value, 'value1', 'Iterate over attribute.');
@@ -71,7 +71,7 @@ class AttributesTest extends UnitTestCase {
/**
* Tests AttributeValueBase copy.
*/
- public function testAttributeValueBaseCopy() {
+ public function testAttributeValueBaseCopy(): void {
$original_attributes = new Attribute([
'checked' => TRUE,
'class' => ['who', 'is', 'on'],
diff --git a/core/tests/Drupal/Tests/Core/Common/DiffArrayTest.php b/core/tests/Drupal/Tests/Core/Common/DiffArrayTest.php
index 3394fca907f..77d1776f35a 100644
--- a/core/tests/Drupal/Tests/Core/Common/DiffArrayTest.php
+++ b/core/tests/Drupal/Tests/Core/Common/DiffArrayTest.php
@@ -60,7 +60,7 @@ class DiffArrayTest extends UnitTestCase {
/**
* Tests DiffArray::diffAssocRecursive().
*/
- public function testDiffAssocRecursive() {
+ public function testDiffAssocRecursive(): void {
$expected = [
'different' => 'no',
'int_diff' => 1,
diff --git a/core/tests/Drupal/Tests/Core/Common/TagsTest.php b/core/tests/Drupal/Tests/Core/Common/TagsTest.php
index 9c97fa5e28c..d4fc3a936e2 100644
--- a/core/tests/Drupal/Tests/Core/Common/TagsTest.php
+++ b/core/tests/Drupal/Tests/Core/Common/TagsTest.php
@@ -26,7 +26,7 @@ class TagsTest extends UnitTestCase {
/**
* Explodes a series of tags.
*/
- public function testExplodeTags() {
+ public function testExplodeTags(): void {
$string = implode(', ', array_keys($this->validTags));
$tags = Tags::explode($string);
$this->assertEquals(array_values($this->validTags), $tags);
@@ -35,7 +35,7 @@ class TagsTest extends UnitTestCase {
/**
* Implodes a series of tags.
*/
- public function testImplodeTags() {
+ public function testImplodeTags(): void {
$tags = array_values($this->validTags);
// Let's explode and implode to our heart's content.
for ($i = 0; $i < 10; $i++) {
diff --git a/core/tests/Drupal/Tests/Core/Condition/ConditionAccessResolverTraitTest.php b/core/tests/Drupal/Tests/Core/Condition/ConditionAccessResolverTraitTest.php
index e90931e54b3..0fb4073b424 100644
--- a/core/tests/Drupal/Tests/Core/Condition/ConditionAccessResolverTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Condition/ConditionAccessResolverTraitTest.php
@@ -20,7 +20,7 @@ class ConditionAccessResolverTraitTest extends UnitTestCase {
*
* @dataProvider providerTestResolveConditions
*/
- public function testResolveConditions($conditions, $logic, $expected) {
+ public function testResolveConditions($conditions, $logic, $expected): void {
$mocks['true'] = $this->createMock('Drupal\Core\Condition\ConditionInterface');
$mocks['true']->expects($this->any())
->method('execute')
diff --git a/core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php b/core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php
index 32bb2b0fde0..fd440f70734 100644
--- a/core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/CachedStorageTest.php
@@ -23,7 +23,7 @@ class CachedStorageTest extends UnitTestCase {
/**
* Tests listAll static cache.
*/
- public function testListAllStaticCache() {
+ public function testListAllStaticCache(): void {
$prefix = __FUNCTION__;
$storage = $this->createMock('Drupal\Core\Config\StorageInterface');
diff --git a/core/tests/Drupal/Tests/Core/Config/ConfigDependencyManagerTest.php b/core/tests/Drupal/Tests/Core/Config/ConfigDependencyManagerTest.php
index a84b4f22bc5..557360b0c6f 100644
--- a/core/tests/Drupal/Tests/Core/Config/ConfigDependencyManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/ConfigDependencyManagerTest.php
@@ -19,7 +19,7 @@ class ConfigDependencyManagerTest extends UnitTestCase {
/**
* @dataProvider providerTestSortAll
*/
- public function testSortAll(array $data, array $expected_order) {
+ public function testSortAll(array $data, array $expected_order): void {
$dependency_manager = new ConfigDependencyManager();
$dependency_manager->setData($data);
$this->assertEquals($expected_order, $dependency_manager->sortAll());
diff --git a/core/tests/Drupal/Tests/Core/Config/ConfigFactoryOverrideBaseTest.php b/core/tests/Drupal/Tests/Core/Config/ConfigFactoryOverrideBaseTest.php
index 8a01635b81f..744e668f842 100644
--- a/core/tests/Drupal/Tests/Core/Config/ConfigFactoryOverrideBaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/ConfigFactoryOverrideBaseTest.php
@@ -19,7 +19,7 @@ class ConfigFactoryOverrideBaseTest extends UnitTestCase {
/**
* @dataProvider providerTestFilterNestedArray
*/
- public function testFilterNestedArray(array $original_data, array $override_data_before, array $override_data_after, $changed) {
+ public function testFilterNestedArray(array $original_data, array $override_data_before, array $override_data_after, $changed): void {
$config_factory = new TestConfigFactoryOverrideBase();
$result = $config_factory->doFilterNestedArray($original_data, $override_data_before);
$this->assertEquals($changed, $result);
diff --git a/core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php b/core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php
index ae0944489eb..d893f970d49 100644
--- a/core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php
@@ -71,7 +71,7 @@ class ConfigFactoryTest extends UnitTestCase {
/**
* @covers ::rename
*/
- public function testRename() {
+ public function testRename(): void {
$old = new Config($this->randomMachineName(), $this->storage, $this->eventDispatcher, $this->typedConfig);
$new = new Config($this->randomMachineName(), $this->storage, $this->eventDispatcher, $this->typedConfig);
diff --git a/core/tests/Drupal/Tests/Core/Config/ConfigTest.php b/core/tests/Drupal/Tests/Core/Config/ConfigTest.php
index 4ba8a31f727..e313731c9eb 100644
--- a/core/tests/Drupal/Tests/Core/Config/ConfigTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/ConfigTest.php
@@ -77,7 +77,7 @@ class ConfigTest extends UnitTestCase {
* @covers ::setName
* @dataProvider setNameProvider
*/
- public function testSetName($name) {
+ public function testSetName($name): void {
// Set the name.
$this->config->setName($name);
@@ -110,7 +110,7 @@ class ConfigTest extends UnitTestCase {
/**
* @covers ::isNew
*/
- public function testIsNew() {
+ public function testIsNew(): void {
// Config should be new by default.
$this->assertTrue($this->config->isNew());
@@ -123,7 +123,7 @@ class ConfigTest extends UnitTestCase {
* @covers ::setData
* @dataProvider nestedDataProvider
*/
- public function testSetData($data) {
+ public function testSetData($data): void {
$this->config->setData($data);
$this->assertEquals($data, $this->config->getRawData());
$this->assertConfigDataEquals($data);
@@ -133,7 +133,7 @@ class ConfigTest extends UnitTestCase {
* @covers ::save
* @dataProvider nestedDataProvider
*/
- public function testSaveNew($data) {
+ public function testSaveNew($data): void {
$this->cacheTagsInvalidator->expects($this->never())
->method('invalidateTags');
@@ -159,7 +159,7 @@ class ConfigTest extends UnitTestCase {
* @covers ::save
* @dataProvider nestedDataProvider
*/
- public function testSaveExisting($data) {
+ public function testSaveExisting($data): void {
$this->cacheTagsInvalidator->expects($this->once())
->method('invalidateTags')
->with(['config:config.test']);
@@ -183,7 +183,7 @@ class ConfigTest extends UnitTestCase {
* @covers ::hasOverrides
* @dataProvider overrideDataProvider
*/
- public function testOverrideData($data, $module_data, $setting_data) {
+ public function testOverrideData($data, $module_data, $setting_data): void {
// Set initial data.
$this->config->setData($data);
@@ -253,7 +253,7 @@ class ConfigTest extends UnitTestCase {
* @covers ::set
* @dataProvider nestedDataProvider
*/
- public function testSetValue($data) {
+ public function testSetValue($data): void {
foreach ($data as $key => $value) {
$this->config->set($key, $value);
}
@@ -263,7 +263,7 @@ class ConfigTest extends UnitTestCase {
/**
* @covers ::set
*/
- public function testSetValidation() {
+ public function testSetValidation(): void {
$this->expectException(ConfigValueException::class);
$this->config->set('testData', ['dot.key' => 1]);
}
@@ -271,7 +271,7 @@ class ConfigTest extends UnitTestCase {
/**
* @covers ::set
*/
- public function testSetIllegalOffsetValue() {
+ public function testSetIllegalOffsetValue(): void {
// Set a single value.
$this->config->set('testData', 1);
@@ -285,7 +285,7 @@ class ConfigTest extends UnitTestCase {
* @covers ::initWithData
* @dataProvider nestedDataProvider
*/
- public function testInitWithData($data) {
+ public function testInitWithData($data): void {
$config = $this->config->initWithData($data);
// Should return the Config object.
@@ -308,7 +308,7 @@ class ConfigTest extends UnitTestCase {
* @covers ::clear
* @dataProvider simpleDataProvider
*/
- public function testClear($data) {
+ public function testClear($data): void {
foreach ($data as $key => $value) {
// Check that values are cleared.
$this->config->set($key, $value);
@@ -322,7 +322,7 @@ class ConfigTest extends UnitTestCase {
* @covers ::clear
* @dataProvider nestedDataProvider
*/
- public function testNestedClear($data) {
+ public function testNestedClear($data): void {
foreach ($data as $key => $value) {
// Check that values are cleared.
$this->config->set($key, $value);
@@ -340,7 +340,7 @@ class ConfigTest extends UnitTestCase {
* @covers ::delete
* @dataProvider overrideDataProvider
*/
- public function testDelete($data, $module_data) {
+ public function testDelete($data, $module_data): void {
$this->cacheTagsInvalidator->expects($this->once())
->method('invalidateTags')
->with(['config:config.test']);
@@ -385,7 +385,7 @@ class ConfigTest extends UnitTestCase {
* @covers ::merge
* @dataProvider mergeDataProvider
*/
- public function testMerge($data, $data_to_merge, $merged_data) {
+ public function testMerge($data, $data_to_merge, $merged_data): void {
// Set initial data.
$this->config->setData($data);
@@ -418,7 +418,7 @@ class ConfigTest extends UnitTestCase {
* @covers ::validateName
* @dataProvider validateNameProvider
*/
- public function testValidateNameException($name, $exception_message) {
+ public function testValidateNameException($name, $exception_message): void {
$this->expectException('\Drupal\Core\Config\ConfigNameException');
$this->expectExceptionMessage($exception_message);
$this->config->validateName($name);
@@ -427,7 +427,7 @@ class ConfigTest extends UnitTestCase {
/**
* @covers ::getCacheTags
*/
- public function testGetCacheTags() {
+ public function testGetCacheTags(): void {
$this->assertSame(['config:' . $this->config->getName()], $this->config->getCacheTags());
}
@@ -615,7 +615,7 @@ class ConfigTest extends UnitTestCase {
* @covers ::set
* @covers ::initWithData
*/
- public function testSafeStringHandling() {
+ public function testSafeStringHandling(): void {
// Safe strings are cast when using ::set().
$safe_string = Markup::create('bar');
$this->config->set('foo', $safe_string);
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigDependencyManagerTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigDependencyManagerTest.php
index 1bf92c0ec49..587ccbcf48a 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigDependencyManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigDependencyManagerTest.php
@@ -14,12 +14,12 @@ use Drupal\Core\Config\Entity\ConfigDependencyManager;
*/
class ConfigDependencyManagerTest extends UnitTestCase {
- public function testNoConfiguration() {
+ public function testNoConfiguration(): void {
$dep_manger = new ConfigDependencyManager();
$this->assertEmpty($dep_manger->getDependentEntities('config', 'config_test.dynamic.entity_id:745b0ce0-aece-42dd-a800-ade5b8455e84'));
}
- public function testNoConfigEntities() {
+ public function testNoConfigEntities(): void {
$dep_manger = new ConfigDependencyManager();
$dep_manger->setData([
'simple.config' => [
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
index 35316ac0dcf..63e02c778f4 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
@@ -170,7 +170,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
* @covers ::calculateDependencies
* @covers ::getDependencies
*/
- public function testCalculateDependencies() {
+ public function testCalculateDependencies(): void {
// Calculating dependencies will reset the dependencies array.
$this->entity->set('dependencies', ['module' => ['node']]);
$this->assertEmpty($this->entity->calculateDependencies()->getDependencies());
@@ -186,7 +186,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::preSave
*/
- public function testPreSaveDuringSync() {
+ public function testPreSaveDuringSync(): void {
$this->moduleHandler->moduleExists('node')->willReturn(TRUE);
$query = $this->createMock('\Drupal\Core\Entity\Query\QueryInterface');
@@ -221,7 +221,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::addDependency
*/
- public function testAddDependency() {
+ public function testAddDependency(): void {
$method = new \ReflectionMethod('\Drupal\Core\Config\Entity\ConfigEntityBase', 'addDependency');
$method->invoke($this->entity, 'module', static::PROVIDER);
$method->invoke($this->entity, 'module', 'core');
@@ -334,7 +334,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
* @covers ::getDependencies
* @covers ::onDependencyRemoval
*/
- public function testCalculateDependenciesWithThirdPartySettings() {
+ public function testCalculateDependenciesWithThirdPartySettings(): void {
$this->entity = $this->getMockBuilder(ConfigEntityBaseMockableClass::class)
->setConstructorArgs([[], $this->entityTypeId])
->onlyMethods([])
@@ -354,7 +354,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::__sleep
*/
- public function testSleepWithPluginCollections() {
+ public function testSleepWithPluginCollections(): void {
$instance_id = 'the_instance_id';
$instance = new TestConfigurablePlugin([], $instance_id, []);
@@ -393,7 +393,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
* @covers ::setOriginalId
* @covers ::getOriginalId
*/
- public function testGetOriginalId() {
+ public function testGetOriginalId(): void {
$new_id = $this->randomMachineName();
$this->entity->set('id', $new_id);
$this->assertSame($this->id, $this->entity->getOriginalId());
@@ -413,7 +413,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::isNew
*/
- public function testIsNew() {
+ public function testIsNew(): void {
$this->assertFalse($this->entity->isNew());
$this->assertSame($this->entity, $this->entity->enforceIsNew());
$this->assertTrue($this->entity->isNew());
@@ -425,7 +425,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
* @covers ::set
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
$name = 'id';
$value = $this->randomMachineName();
$this->assertSame($this->id, $this->entity->get($name));
@@ -437,7 +437,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
* @covers ::setStatus
* @covers ::status
*/
- public function testSetStatus() {
+ public function testSetStatus(): void {
$this->assertTrue($this->entity->status());
$this->assertSame($this->entity, $this->entity->setStatus(FALSE));
$this->assertFalse($this->entity->status());
@@ -449,7 +449,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
* @covers ::enable
* @depends testSetStatus
*/
- public function testEnable() {
+ public function testEnable(): void {
$this->entity->setStatus(FALSE);
$this->assertSame($this->entity, $this->entity->enable());
$this->assertTrue($this->entity->status());
@@ -459,7 +459,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
* @covers ::disable
* @depends testSetStatus
*/
- public function testDisable() {
+ public function testDisable(): void {
$this->entity->setStatus(TRUE);
$this->assertSame($this->entity, $this->entity->disable());
$this->assertFalse($this->entity->status());
@@ -469,7 +469,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
* @covers ::setSyncing
* @covers ::isSyncing
*/
- public function testIsSyncing() {
+ public function testIsSyncing(): void {
$this->assertFalse($this->entity->isSyncing());
$this->assertSame($this->entity, $this->entity->setSyncing(TRUE));
$this->assertTrue($this->entity->isSyncing());
@@ -480,7 +480,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::createDuplicate
*/
- public function testCreateDuplicate() {
+ public function testCreateDuplicate(): void {
$this->entityType->expects($this->exactly(2))
->method('getKey')
->willReturnMap([
@@ -512,7 +512,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::sort
*/
- public function testSort() {
+ public function testSort(): void {
$this->entityTypeManager->expects($this->any())
->method('getDefinition')
->with($this->entityTypeId)
@@ -555,7 +555,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::toArray
*/
- public function testToArray() {
+ public function testToArray(): void {
$this->typedConfigManager->expects($this->never())
->method('getDefinition');
$this->entityType->expects($this->any())
@@ -569,7 +569,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::toArray
*/
- public function testToArrayIdKey() {
+ public function testToArrayIdKey(): void {
$entity = $this->getMockBuilder(ConfigEntityBaseMockableClass::class)
->setConstructorArgs([[], $this->entityTypeId])
->onlyMethods(['id', 'get'])
@@ -602,7 +602,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
* @covers ::unsetThirdPartySetting
* @covers ::getThirdPartyProviders
*/
- public function testThirdPartySettings() {
+ public function testThirdPartySettings(): void {
$key = 'test';
$third_party = 'test_provider';
$value = $this->getRandomGenerator()->string();
@@ -632,7 +632,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::toArray
*/
- public function testToArraySchemaException() {
+ public function testToArraySchemaException(): void {
$this->entityType->expects($this->any())
->method('getPropertiesToExport')
->willReturn(NULL);
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityDependencyTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityDependencyTest.php
index d41ac6d92c3..c367978ccb2 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityDependencyTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityDependencyTest.php
@@ -14,7 +14,7 @@ use Drupal\Core\Config\Entity\ConfigEntityDependency;
*/
class ConfigEntityDependencyTest extends UnitTestCase {
- public function testEmptyDependencies() {
+ public function testEmptyDependencies(): void {
$dep = new ConfigEntityDependency('config_test.dynamic.entity_id', []);
$this->assertEquals('config_test.dynamic.entity_id', $dep->getConfigDependencyName());
@@ -25,7 +25,7 @@ class ConfigEntityDependencyTest extends UnitTestCase {
$this->assertFalse($dep->hasDependency('module', 'views'));
}
- public function testWithDependencies() {
+ public function testWithDependencies(): void {
$values = [
'uuid' => '60db47f4-54fb-4c86-a439-5769fbda4bd1',
'dependencies' => [
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
index 85b7461b6fb..ca7f7f05d27 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
@@ -170,7 +170,7 @@ class ConfigEntityStorageTest extends UnitTestCase {
* @covers ::create
* @covers ::doCreate
*/
- public function testCreateWithPredefinedUuid() {
+ public function testCreateWithPredefinedUuid(): void {
$this->cacheTagsInvalidator->invalidateTags(Argument::cetera())->shouldNotBeCalled();
$entity = $this->getMockEntity();
@@ -227,7 +227,7 @@ class ConfigEntityStorageTest extends UnitTestCase {
* @covers ::create
* @covers ::doCreate
*/
- public function testCreateWithCurrentLanguage() {
+ public function testCreateWithCurrentLanguage(): void {
$this->languageManager->getLanguage('hu')->willReturn(new Language(['id' => 'hu']));
$entity = $this->entityStorage->create(['id' => 'foo']);
@@ -238,7 +238,7 @@ class ConfigEntityStorageTest extends UnitTestCase {
* @covers ::create
* @covers ::doCreate
*/
- public function testCreateWithExplicitLanguage() {
+ public function testCreateWithExplicitLanguage(): void {
$this->languageManager->getLanguage('en')->willReturn(new Language(['id' => 'en']));
$entity = $this->entityStorage->create(['id' => 'foo', 'langcode' => 'en']);
@@ -364,7 +364,7 @@ class ConfigEntityStorageTest extends UnitTestCase {
*
* @depends testSaveInsert
*/
- public function testSaveRename(ConfigEntityInterface $entity) {
+ public function testSaveRename(ConfigEntityInterface $entity): void {
$immutable_config_object = $this->prophesize(ImmutableConfig::class);
$immutable_config_object->isNew()->willReturn(FALSE);
@@ -410,7 +410,7 @@ class ConfigEntityStorageTest extends UnitTestCase {
/**
* @covers ::save
*/
- public function testSaveInvalid() {
+ public function testSaveInvalid(): void {
$this->cacheTagsInvalidator->invalidateTags(Argument::cetera())
->shouldNotBeCalled();
@@ -424,7 +424,7 @@ class ConfigEntityStorageTest extends UnitTestCase {
* @covers ::save
* @covers ::doSave
*/
- public function testSaveDuplicate() {
+ public function testSaveDuplicate(): void {
$config_object = $this->prophesize(ImmutableConfig::class);
$config_object->isNew()->willReturn(FALSE);
@@ -445,7 +445,7 @@ class ConfigEntityStorageTest extends UnitTestCase {
* @covers ::save
* @covers ::doSave
*/
- public function testSaveMismatch() {
+ public function testSaveMismatch(): void {
$config_object = $this->prophesize(ImmutableConfig::class);
$config_object->isNew()->willReturn(TRUE);
@@ -468,7 +468,7 @@ class ConfigEntityStorageTest extends UnitTestCase {
* @covers ::save
* @covers ::doSave
*/
- public function testSaveNoMismatch() {
+ public function testSaveNoMismatch(): void {
$immutable_config_object = $this->prophesize(ImmutableConfig::class);
$immutable_config_object->isNew()->willReturn(TRUE);
@@ -510,7 +510,7 @@ class ConfigEntityStorageTest extends UnitTestCase {
* @covers ::save
* @covers ::doSave
*/
- public function testSaveChangedUuid() {
+ public function testSaveChangedUuid(): void {
$config_object = $this->prophesize(ImmutableConfig::class);
$config_object->get()->willReturn(['id' => 'foo']);
$config_object->get('id')->willReturn('foo');
@@ -546,7 +546,7 @@ class ConfigEntityStorageTest extends UnitTestCase {
* @covers ::mapFromStorageRecords
* @covers ::doLoadMultiple
*/
- public function testLoad() {
+ public function testLoad(): void {
$config_object = $this->prophesize(ImmutableConfig::class);
$config_object->get()->willReturn(['id' => 'foo']);
$config_object->get('id')->willReturn('foo');
@@ -573,7 +573,7 @@ class ConfigEntityStorageTest extends UnitTestCase {
* @covers ::mapFromStorageRecords
* @covers ::doLoadMultiple
*/
- public function testLoadMultipleAll() {
+ public function testLoadMultipleAll(): void {
$foo_config_object = $this->prophesize(ImmutableConfig::class);
$foo_config_object->get()->willReturn(['id' => 'foo']);
$foo_config_object->get('id')->willReturn('foo');
@@ -611,7 +611,7 @@ class ConfigEntityStorageTest extends UnitTestCase {
* @covers ::mapFromStorageRecords
* @covers ::doLoadMultiple
*/
- public function testLoadMultipleIds() {
+ public function testLoadMultipleIds(): void {
$config_object = $this->prophesize(ImmutableConfig::class);
$config_object->get()->willReturn(['id' => 'foo']);
$config_object->get('id')->willReturn('foo');
@@ -634,7 +634,7 @@ class ConfigEntityStorageTest extends UnitTestCase {
* @covers ::delete
* @covers ::doDelete
*/
- public function testDelete() {
+ public function testDelete(): void {
// Dependencies are tested in
// \Drupal\Tests\config\Kernel\ConfigDependencyTest.
$this->configManager
@@ -676,7 +676,7 @@ class ConfigEntityStorageTest extends UnitTestCase {
* @covers ::delete
* @covers ::doDelete
*/
- public function testDeleteNothing() {
+ public function testDeleteNothing(): void {
$this->moduleHandler->invokeAll(Argument::cetera())->shouldNotBeCalled();
$this->configFactory->get(Argument::cetera())->shouldNotBeCalled();
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php
index 9b22d95d0b6..b3b29d0d517 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php
@@ -60,7 +60,7 @@ class ConfigEntityTypeTest extends UnitTestCase {
*
* @covers ::getConfigPrefix
*/
- public function testConfigPrefixLengthExceeds() {
+ public function testConfigPrefixLengthExceeds(): void {
// A provider length of 24 and config_prefix length of 59 (+1 for the .)
// results in a config length of 84, which is too long.
$definition = [
@@ -81,7 +81,7 @@ class ConfigEntityTypeTest extends UnitTestCase {
*
* @covers ::getConfigPrefix
*/
- public function testConfigPrefixLengthValid() {
+ public function testConfigPrefixLengthValid(): void {
// A provider length of 24 and config_prefix length of 58 (+1 for the .)
// results in a config length of 83, which is right at the limit.
$definition = [
@@ -96,7 +96,7 @@ class ConfigEntityTypeTest extends UnitTestCase {
/**
* @covers ::__construct
*/
- public function testConstruct() {
+ public function testConstruct(): void {
$config_entity = new ConfigEntityType([
'id' => 'example_config_entity_type',
]);
@@ -106,7 +106,7 @@ class ConfigEntityTypeTest extends UnitTestCase {
/**
* @covers ::__construct
*/
- public function testConstructBadStorage() {
+ public function testConstructBadStorage(): void {
$this->expectException(ConfigEntityStorageClassException::class);
$this->expectExceptionMessage('\Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage is not \Drupal\Core\Config\Entity\ConfigEntityStorage or it does not extend it');
new ConfigEntityType([
@@ -118,7 +118,7 @@ class ConfigEntityTypeTest extends UnitTestCase {
/**
* @covers ::setStorageClass
*/
- public function testSetStorageClass() {
+ public function testSetStorageClass(): void {
$config_entity = $this->setUpConfigEntityType([]);
$this->expectException(ConfigEntityStorageClassException::class);
$this->expectExceptionMessage('\Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage is not \Drupal\Core\Config\Entity\ConfigEntityStorage or it does not extend it');
@@ -132,7 +132,7 @@ class ConfigEntityTypeTest extends UnitTestCase {
*
* @covers ::getConfigPrefix
*/
- public function testGetConfigPrefix($definition, $expected) {
+ public function testGetConfigPrefix($definition, $expected): void {
$entity_type = $this->setUpConfigEntityType($definition);
$this->assertSame($expected, $entity_type->getConfigPrefix());
}
@@ -152,7 +152,7 @@ class ConfigEntityTypeTest extends UnitTestCase {
*
* @dataProvider providerGetPropertiesToExport
*/
- public function testGetPropertiesToExport($definition, $expected) {
+ public function testGetPropertiesToExport($definition, $expected): void {
$entity_type = $this->setUpConfigEntityType($definition);
$properties_to_export = $entity_type->getPropertiesToExport();
$this->assertSame($expected, $properties_to_export);
@@ -202,7 +202,7 @@ class ConfigEntityTypeTest extends UnitTestCase {
/**
* @covers ::getPropertiesToExport
*/
- public function testGetPropertiesToExportNoFallback() {
+ public function testGetPropertiesToExportNoFallback(): void {
$config_entity_type = new ConfigEntityType([
'id' => 'example_config_entity_type',
]);
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php
index 010bc319174..a45e3d10bd2 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php
@@ -34,7 +34,7 @@ class EntityDisplayBaseTest extends UnitTestCase {
/**
* @covers ::getTargetEntityTypeId
*/
- public function testGetTargetEntityTypeId() {
+ public function testGetTargetEntityTypeId(): void {
$reflection = new \ReflectionProperty($this->entityDisplay, 'targetEntityType');
$reflection->setValue($this->entityDisplay, 'test');
$this->assertEquals('test', $this->entityDisplay->getTargetEntityTypeId());
@@ -43,7 +43,7 @@ class EntityDisplayBaseTest extends UnitTestCase {
/**
* @covers ::getMode
*/
- public function testGetMode() {
+ public function testGetMode(): void {
$reflection = new \ReflectionProperty($this->entityDisplay, 'mode');
$reflection->setValue($this->entityDisplay, 'test');
$this->assertEquals('test', $this->entityDisplay->getMode());
@@ -52,7 +52,7 @@ class EntityDisplayBaseTest extends UnitTestCase {
/**
* @covers ::getOriginalMode
*/
- public function testGetOriginalMode() {
+ public function testGetOriginalMode(): void {
$reflection = new \ReflectionProperty($this->entityDisplay, 'originalMode');
$reflection->setValue($this->entityDisplay, 'test');
$this->assertEquals('test', $this->entityDisplay->getOriginalMode());
@@ -61,7 +61,7 @@ class EntityDisplayBaseTest extends UnitTestCase {
/**
* @covers ::getTargetBundle
*/
- public function testGetTargetBundle() {
+ public function testGetTargetBundle(): void {
$reflection = new \ReflectionProperty($this->entityDisplay, 'bundle');
$reflection->setValue($this->entityDisplay, 'test');
$this->assertEquals('test', $this->entityDisplay->getTargetBundle());
@@ -70,7 +70,7 @@ class EntityDisplayBaseTest extends UnitTestCase {
/**
* @covers ::setTargetBundle
*/
- public function testSetTargetBundle() {
+ public function testSetTargetBundle(): void {
$reflection = new \ReflectionProperty($this->entityDisplay, 'bundle');
$this->entityDisplay->setTargetBundle('test');
$this->assertEquals('test', $reflection->getValue($this->entityDisplay));
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayModeBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayModeBaseUnitTest.php
index c71a84836c3..8cf5161535a 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayModeBaseUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayModeBaseUnitTest.php
@@ -77,7 +77,7 @@ class EntityDisplayModeBaseUnitTest extends UnitTestCase {
/**
* @covers ::calculateDependencies
*/
- public function testCalculateDependencies() {
+ public function testCalculateDependencies(): void {
$target_entity_type_id = $this->randomMachineName(16);
$target_entity_type = $this->createMock('\Drupal\Core\Entity\EntityTypeInterface');
@@ -101,7 +101,7 @@ class EntityDisplayModeBaseUnitTest extends UnitTestCase {
/**
* @covers ::setTargetType
*/
- public function testSetTargetType() {
+ public function testSetTargetType(): void {
// Generate mock.
$mock = $this->getMockBuilder('Drupal\Core\Entity\EntityDisplayModeBase')
->onlyMethods([])
@@ -128,7 +128,7 @@ class EntityDisplayModeBaseUnitTest extends UnitTestCase {
/**
* @covers ::getTargetType
*/
- public function testGetTargetType() {
+ public function testGetTargetType(): void {
// Generate mock.
$mock = $this->getMockBuilder('Drupal\Core\Entity\EntityDisplayModeBase')
->onlyMethods([])
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/Query/QueryFactoryTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/Query/QueryFactoryTest.php
index f46f41db513..f8a36d4cc20 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/Query/QueryFactoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/Query/QueryFactoryTest.php
@@ -105,7 +105,7 @@ class QueryFactoryTest extends UnitTestCase {
* @covers ::getKeys
* @covers ::getValues
*/
- public function testGetKeysWildCardEnd() {
+ public function testGetKeysWildCardEnd(): void {
$config_factory = $this->createMock('Drupal\Core\Config\ConfigFactoryInterface');
$key_value_factory = $this->createMock('Drupal\Core\KeyValueStore\KeyValueFactoryInterface');
$config_manager = $this->createMock('Drupal\Core\Config\ConfigManagerInterface');
diff --git a/core/tests/Drupal/Tests/Core/Config/ExtensionInstallStorageTest.php b/core/tests/Drupal/Tests/Core/Config/ExtensionInstallStorageTest.php
index 4444073b087..94254800e37 100644
--- a/core/tests/Drupal/Tests/Core/Config/ExtensionInstallStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/ExtensionInstallStorageTest.php
@@ -19,7 +19,7 @@ class ExtensionInstallStorageTest extends UnitTestCase {
/**
* @covers ::createCollection
*/
- public function testCreateCollection() {
+ public function testCreateCollection(): void {
$memory = new MemoryStorage();
$include_profile = FALSE;
$profile = $this->randomMachineName();
diff --git a/core/tests/Drupal/Tests/Core/Config/ImmutableConfigTest.php b/core/tests/Drupal/Tests/Core/Config/ImmutableConfigTest.php
index 29375c3e525..0b32fdbc718 100644
--- a/core/tests/Drupal/Tests/Core/Config/ImmutableConfigTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/ImmutableConfigTest.php
@@ -35,7 +35,7 @@ class ImmutableConfigTest extends UnitTestCase {
/**
* @covers ::set
*/
- public function testSet() {
+ public function testSet(): void {
$this->expectException(ImmutableConfigException::class);
$this->expectExceptionMessage('Can not set values on immutable configuration test:name. Use \Drupal\Core\Config\ConfigFactoryInterface::getEditable() to retrieve a mutable configuration object');
$this->config->set('name', 'value');
@@ -44,7 +44,7 @@ class ImmutableConfigTest extends UnitTestCase {
/**
* @covers ::clear
*/
- public function testClear() {
+ public function testClear(): void {
$this->expectException(ImmutableConfigException::class);
$this->expectExceptionMessage('Can not clear name key in immutable configuration test. Use \Drupal\Core\Config\ConfigFactoryInterface::getEditable() to retrieve a mutable configuration object');
$this->config->clear('name');
@@ -53,7 +53,7 @@ class ImmutableConfigTest extends UnitTestCase {
/**
* @covers ::save
*/
- public function testSave() {
+ public function testSave(): void {
$this->expectException(ImmutableConfigException::class);
$this->expectExceptionMessage('Can not save immutable configuration test. Use \Drupal\Core\Config\ConfigFactoryInterface::getEditable() to retrieve a mutable configuration object');
$this->config->save();
@@ -62,7 +62,7 @@ class ImmutableConfigTest extends UnitTestCase {
/**
* @covers ::delete
*/
- public function testDelete() {
+ public function testDelete(): void {
$this->expectException(ImmutableConfigException::class);
$this->expectExceptionMessage('Can not delete immutable configuration test. Use \Drupal\Core\Config\ConfigFactoryInterface::getEditable() to retrieve a mutable configuration object');
$this->config->delete();
diff --git a/core/tests/Drupal/Tests/Core/Config/NullStorageTest.php b/core/tests/Drupal/Tests/Core/Config/NullStorageTest.php
index 1a8f9228787..b81cf2c24fc 100644
--- a/core/tests/Drupal/Tests/Core/Config/NullStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/NullStorageTest.php
@@ -18,7 +18,7 @@ class NullStorageTest extends UnitTestCase {
/**
* Tests createCollection.
*/
- public function testCollection() {
+ public function testCollection(): void {
$nullStorage = new NullStorage();
$collection = $nullStorage->createCollection('test');
$this->assertInstanceOf(StorageInterface::class, $collection);
diff --git a/core/tests/Drupal/Tests/Core/Config/ReadOnlyStorageTest.php b/core/tests/Drupal/Tests/Core/Config/ReadOnlyStorageTest.php
index 980d5fd4721..7d5dc0eed6b 100644
--- a/core/tests/Drupal/Tests/Core/Config/ReadOnlyStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/ReadOnlyStorageTest.php
@@ -53,7 +53,7 @@ class ReadOnlyStorageTest extends UnitTestCase {
*
* @dataProvider readMethodsProvider
*/
- public function testReadOperations($method, $arguments, $fixture) {
+ public function testReadOperations($method, $arguments, $fixture): void {
$this->setRandomFixtureConfig($fixture);
$expected = call_user_func_array([$this->memory, $method], $arguments);
@@ -93,7 +93,7 @@ class ReadOnlyStorageTest extends UnitTestCase {
*
* @dataProvider writeMethodsProvider
*/
- public function testWriteOperations($method, $arguments, $fixture) {
+ public function testWriteOperations($method, $arguments, $fixture): void {
$this->setRandomFixtureConfig($fixture);
// Create an independent memory storage as a backup.
@@ -143,7 +143,7 @@ class ReadOnlyStorageTest extends UnitTestCase {
* @covers ::getCollectionName
* @covers ::createCollection
*/
- public function testCollections() {
+ public function testCollections(): void {
$fixture = [
StorageInterface::DEFAULT_COLLECTION => [$this->randomMachineName()],
'A' => [$this->randomMachineName()],
@@ -165,7 +165,7 @@ class ReadOnlyStorageTest extends UnitTestCase {
* @covers ::encode
* @covers ::decode
*/
- public function testEncodeDecode() {
+ public function testEncodeDecode(): void {
$array = (array) $this->getRandomGenerator()->object();
$string = $this->getRandomGenerator()->string();
diff --git a/core/tests/Drupal/Tests/Core/Config/StorageComparerTest.php b/core/tests/Drupal/Tests/Core/Config/StorageComparerTest.php
index a3c7e63fea2..a9f0a881ce1 100644
--- a/core/tests/Drupal/Tests/Core/Config/StorageComparerTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/StorageComparerTest.php
@@ -110,7 +110,7 @@ class StorageComparerTest extends UnitTestCase {
/**
* @covers ::createChangelist
*/
- public function testCreateChangelistNoChange() {
+ public function testCreateChangelistNoChange(): void {
$config_data = $this->getConfigData();
$config_files = array_keys($config_data);
$this->sourceStorage->expects($this->once())
@@ -141,7 +141,7 @@ class StorageComparerTest extends UnitTestCase {
/**
* @covers ::createChangelist
*/
- public function testCreateChangelistCreate() {
+ public function testCreateChangelistCreate(): void {
$target_data = $source_data = $this->getConfigData();
unset($target_data['field.storage.node.body']);
unset($target_data['field.field.node.article.body']);
@@ -180,7 +180,7 @@ class StorageComparerTest extends UnitTestCase {
/**
* @covers ::createChangelist
*/
- public function testCreateChangelistDelete() {
+ public function testCreateChangelistDelete(): void {
$target_data = $source_data = $this->getConfigData();
unset($source_data['field.storage.node.body']);
unset($source_data['field.field.node.article.body']);
@@ -219,7 +219,7 @@ class StorageComparerTest extends UnitTestCase {
/**
* @covers ::createChangelist
*/
- public function testCreateChangelistUpdate() {
+ public function testCreateChangelistUpdate(): void {
$target_data = $source_data = $this->getConfigData();
$source_data['system.site']['title'] = 'Drupal New!';
$source_data['field.field.node.article.body']['new_config_key'] = 'new data';
@@ -258,7 +258,7 @@ class StorageComparerTest extends UnitTestCase {
/**
* @covers ::createChangelist
*/
- public function testDifferentCollections() {
+ public function testDifferentCollections(): void {
$source = new MemoryStorage();
$target = new MemoryStorage();
diff --git a/core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php b/core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php
index 2dc0b1fd0ca..ef2e486a54d 100644
--- a/core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php
@@ -26,7 +26,7 @@ class StorageCopyTraitTest extends UnitTestCase {
*
* @dataProvider providerTestReplaceStorageContents
*/
- public function testReplaceStorageContents($source_collections, $target_collections) {
+ public function testReplaceStorageContents($source_collections, $target_collections): void {
$source = new MemoryStorage();
$target = new MemoryStorage();
// Empty the storage should be the same.
@@ -121,7 +121,7 @@ class StorageCopyTraitTest extends UnitTestCase {
*
* @covers ::replaceStorageContents
*/
- public function testWithInvalidConfiguration() {
+ public function testWithInvalidConfiguration(): void {
$source = new TestStorage();
$this->generateRandomData($source);
diff --git a/core/tests/Drupal/Tests/Core/Controller/AjaxRendererTest.php b/core/tests/Drupal/Tests/Core/Controller/AjaxRendererTest.php
index a1d4e38e27f..c6e1e92df25 100644
--- a/core/tests/Drupal/Tests/Core/Controller/AjaxRendererTest.php
+++ b/core/tests/Drupal/Tests/Core/Controller/AjaxRendererTest.php
@@ -68,7 +68,7 @@ class AjaxRendererTest extends UnitTestCase {
*
* @covers ::renderResponse
*/
- public function testRenderWithFragmentObject() {
+ public function testRenderWithFragmentObject(): void {
$main_content = ['#markup' => 'example content'];
$request = new Request();
$route_match = $this->createMock('Drupal\Core\Routing\RouteMatchInterface');
diff --git a/core/tests/Drupal/Tests/Core/Controller/ControllerBaseTest.php b/core/tests/Drupal/Tests/Core/Controller/ControllerBaseTest.php
index 0ddb46e121a..6e58e56896a 100644
--- a/core/tests/Drupal/Tests/Core/Controller/ControllerBaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Controller/ControllerBaseTest.php
@@ -32,7 +32,7 @@ class ControllerBaseTest extends UnitTestCase {
/**
* Tests the config method.
*/
- public function testGetConfig() {
+ public function testGetConfig(): void {
$config_factory = $this->getConfigFactoryStub([
'config_name' => [
'key' => 'value',
diff --git a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
index bfc368dd08d..4634e966fe9 100644
--- a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
+++ b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
@@ -52,7 +52,7 @@ class ControllerResolverTest extends UnitTestCase {
*
* @dataProvider providerTestCreateController
*/
- public function testCreateController($controller, $class, $output) {
+ public function testCreateController($controller, $class, $output): void {
$this->container->set('some_service', new MockController());
$result = $this->controllerResolver->getControllerFromDefinition($controller);
$this->assertCallableController($result, $class, $output);
@@ -75,7 +75,7 @@ class ControllerResolverTest extends UnitTestCase {
/**
* Tests createController() with a non-existent class.
*/
- public function testCreateControllerNonExistentClass() {
+ public function testCreateControllerNonExistentClass(): void {
$this->expectException(\InvalidArgumentException::class);
$this->controllerResolver->getControllerFromDefinition('Class::method');
}
@@ -83,7 +83,7 @@ class ControllerResolverTest extends UnitTestCase {
/**
* Tests createController() with an invalid name.
*/
- public function testCreateControllerInvalidName() {
+ public function testCreateControllerInvalidName(): void {
$this->expectException(\LogicException::class);
$this->controllerResolver->getControllerFromDefinition('ClassWithoutMethod');
}
@@ -93,7 +93,7 @@ class ControllerResolverTest extends UnitTestCase {
*
* @dataProvider providerTestGetController
*/
- public function testGetController($attributes, $class, $output = NULL) {
+ public function testGetController($attributes, $class, $output = NULL): void {
$request = new Request([], [], $attributes);
$result = $this->controllerResolver->getController($request);
if ($class) {
@@ -125,7 +125,7 @@ class ControllerResolverTest extends UnitTestCase {
*
* @dataProvider providerTestGetControllerFromDefinition
*/
- public function testGetControllerFromDefinition($definition, $output) {
+ public function testGetControllerFromDefinition($definition, $output): void {
$this->container->set('invoke_service', new MockInvokeController());
$controller = $this->controllerResolver->getControllerFromDefinition($definition);
$this->assertCallableController($controller, NULL, $output);
@@ -152,7 +152,7 @@ class ControllerResolverTest extends UnitTestCase {
/**
* Tests getControllerFromDefinition() without a callable.
*/
- public function testGetControllerFromDefinitionNotCallable() {
+ public function testGetControllerFromDefinitionNotCallable(): void {
$this->expectException(\InvalidArgumentException::class);
$this->controllerResolver->getControllerFromDefinition('Drupal\Tests\Core\Controller\MockController::bananas');
}
diff --git a/core/tests/Drupal/Tests/Core/Controller/TitleResolverTest.php b/core/tests/Drupal/Tests/Core/Controller/TitleResolverTest.php
index 7ce370711b8..f27c647a047 100644
--- a/core/tests/Drupal/Tests/Core/Controller/TitleResolverTest.php
+++ b/core/tests/Drupal/Tests/Core/Controller/TitleResolverTest.php
@@ -63,7 +63,7 @@ class TitleResolverTest extends UnitTestCase {
*
* @see \Drupal\Core\Controller\TitleResolver::getTitle()
*/
- public function testStaticTitle() {
+ public function testStaticTitle(): void {
$request = new Request();
$route = new Route('/test-route', ['_title' => 'static title']);
$this->assertEquals(new TranslatableMarkup('static title', [], [], $this->translationManager), $this->titleResolver->getTitle($request, $route));
@@ -74,7 +74,7 @@ class TitleResolverTest extends UnitTestCase {
*
* @see \Drupal\Core\Controller\TitleResolver::getTitle()
*/
- public function testStaticTitleZero() {
+ public function testStaticTitleZero(): void {
$request = new Request();
$route = new Route('/test-route', ['_title' => '0', '_title_context' => '0']);
$this->assertEquals(new TranslatableMarkup('0', [], ['context' => '0'], $this->translationManager), $this->titleResolver->getTitle($request, $route));
@@ -85,7 +85,7 @@ class TitleResolverTest extends UnitTestCase {
*
* @see \Drupal\Core\Controller\TitleResolver::getTitle()
*/
- public function testStaticTitleWithContext() {
+ public function testStaticTitleWithContext(): void {
$request = new Request();
$route = new Route('/test-route', ['_title' => 'static title', '_title_context' => 'context']);
$this->assertEquals(new TranslatableMarkup('static title', [], ['context' => 'context'], $this->translationManager), $this->titleResolver->getTitle($request, $route));
@@ -96,7 +96,7 @@ class TitleResolverTest extends UnitTestCase {
*
* @see \Drupal\Core\Controller\TitleResolver::getTitle()
*/
- public function testStaticTitleWithParameter() {
+ public function testStaticTitleWithParameter(): void {
$raw_variables = new InputBag(['test' => 'value', 'test2' => 'value2']);
$request = new Request();
$request->attributes->set('_raw_variables', $raw_variables);
@@ -113,7 +113,7 @@ class TitleResolverTest extends UnitTestCase {
*
* @see \Drupal\Core\Controller\TitleResolver::getTitle()
*/
- public function testStaticTitleWithNullAndArrayValueParameter() {
+ public function testStaticTitleWithNullAndArrayValueParameter(): void {
$raw_variables = new InputBag(['test1' => NULL, 'test2' => ['foo' => 'bar'], 'test3' => 'value']);
$request = new Request();
$request->attributes->set('_raw_variables', $raw_variables);
@@ -134,7 +134,7 @@ class TitleResolverTest extends UnitTestCase {
*
* @see \Drupal\Core\Controller\TitleResolver::getTitle()
*/
- public function testDynamicTitle() {
+ public function testDynamicTitle(): void {
$request = new Request();
$route = new Route('/test-route', ['_title' => 'static title', '_title_callback' => 'Drupal\Tests\Core\Controller\TitleCallback::example']);
diff --git a/core/tests/Drupal/Tests/Core/CronTest.php b/core/tests/Drupal/Tests/Core/CronTest.php
index d10be2b26f0..6326f4c38d6 100644
--- a/core/tests/Drupal/Tests/Core/CronTest.php
+++ b/core/tests/Drupal/Tests/Core/CronTest.php
@@ -192,7 +192,7 @@ class CronTest extends UnitTestCase {
* @covers ::processQueues
* @dataProvider processQueuesTestData
*/
- public function testProcessQueues($item, $message_logged_assertion, $count_post_run) {
+ public function testProcessQueues($item, $message_logged_assertion, $count_post_run): void {
$this->resetTestingState();
$this->queue->createItem($item);
$this->assertFalse($this->state->get('cron_test.message_logged'));
@@ -205,7 +205,7 @@ class CronTest extends UnitTestCase {
/**
* Verify that RequeueException causes an item to be processed multiple times.
*/
- public function testRequeueException() {
+ public function testRequeueException(): void {
$this->resetTestingState();
$this->queue->createItem('RequeueException');
$this->cron->run();
diff --git a/core/tests/Drupal/Tests/Core/Database/ConditionTest.php b/core/tests/Drupal/Tests/Core/Database/ConditionTest.php
index 908b6265028..9cda46bd7b3 100644
--- a/core/tests/Drupal/Tests/Core/Database/ConditionTest.php
+++ b/core/tests/Drupal/Tests/Core/Database/ConditionTest.php
@@ -39,7 +39,7 @@ class ConditionTest extends UnitTestCase {
* @covers ::compile
* @dataProvider providerSimpleCondition
*/
- public function testSimpleCondition($expected, $field_name) {
+ public function testSimpleCondition($expected, $field_name): void {
$connection = $this->prophesize(Connection::class);
$connection->escapeField($field_name)->will(function ($args) {
return preg_replace('/[^A-Za-z0-9_.]+/', '', $args[0]);
@@ -81,7 +81,7 @@ class ConditionTest extends UnitTestCase {
* @param mixed $expected_arguments
* (optional) The expected set arguments.
*/
- public function testCompileWithKnownOperators($expected, $field, $value, $operator, $expected_arguments = NULL) {
+ public function testCompileWithKnownOperators($expected, $field, $value, $operator, $expected_arguments = NULL): void {
$connection = $this->prophesize(Connection::class);
$connection->escapeField(Argument::any())->will(function ($args) {
return preg_replace('/[^A-Za-z0-9_.]+/', '', $args[0]);
@@ -150,7 +150,7 @@ class ConditionTest extends UnitTestCase {
*
* @dataProvider providerTestCompileWithSqlInjectionForOperator
*/
- public function testCompileWithSqlInjectionForOperator($operator) {
+ public function testCompileWithSqlInjectionForOperator($operator): void {
$connection = $this->prophesize(Connection::class);
$connection->escapeField(Argument::any())->will(function ($args) {
return preg_replace('/[^A-Za-z0-9_.]+/', '', $args[0]);
@@ -188,7 +188,7 @@ class ConditionTest extends UnitTestCase {
/**
* Tests that the core Condition can be overridden.
*/
- public function testContribCondition() {
+ public function testContribCondition(): void {
$connection = new StubConnection($this->createMock(StubPDO::class), [
'namespace' => 'Drupal\mock\Driver\Database\mock',
'prefix' => '',
diff --git a/core/tests/Drupal/Tests/Core/Database/ConnectionTest.php b/core/tests/Drupal/Tests/Core/Database/ConnectionTest.php
index fc3a4ddb519..7e9ae828063 100644
--- a/core/tests/Drupal/Tests/Core/Database/ConnectionTest.php
+++ b/core/tests/Drupal/Tests/Core/Database/ConnectionTest.php
@@ -50,7 +50,7 @@ class ConnectionTest extends UnitTestCase {
*
* @dataProvider providerPrefixRoundTrip
*/
- public function testPrefixRoundTrip($expected, $prefix_info) {
+ public function testPrefixRoundTrip($expected, $prefix_info): void {
$mock_pdo = $this->createMock('Drupal\Tests\Core\Database\Stub\StubPDO');
$connection = new StubConnection($mock_pdo, []);
@@ -110,7 +110,7 @@ class ConnectionTest extends UnitTestCase {
*
* @dataProvider providerTestPrefixTables
*/
- public function testPrefixTables($expected, $prefix_info, $query, array $quote_identifier = ['"', '"']) {
+ public function testPrefixTables($expected, $prefix_info, $query, array $quote_identifier = ['"', '"']): void {
$mock_pdo = $this->createMock('Drupal\Tests\Core\Database\Stub\StubPDO');
$connection = new StubConnection($mock_pdo, ['prefix' => $prefix_info], $quote_identifier);
$this->assertEquals($expected, $connection->prefixTables($query));
@@ -319,7 +319,7 @@ class ConnectionTest extends UnitTestCase {
* @dataProvider providerGetDriverClass
* @group legacy
*/
- public function testGetDriverClass($expected, $namespace, $class) {
+ public function testGetDriverClass($expected, $namespace, $class): void {
$additional_class_loader = new ClassLoader();
$additional_class_loader->addPsr4("Drupal\\core_fake\\Driver\\Database\\CoreFake\\", __DIR__ . "/../../../../../tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFake");
$additional_class_loader->addPsr4("Drupal\\core_fake\\Driver\\Database\\CoreFakeWithAllCustomClasses\\", __DIR__ . "/../../../../../tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFakeWithAllCustomClasses");
@@ -369,7 +369,7 @@ class ConnectionTest extends UnitTestCase {
*
* @dataProvider providerSchema
*/
- public function testSchema($expected, $driver, $namespace) {
+ public function testSchema($expected, $driver, $namespace): void {
$mock_pdo = $this->createMock('Drupal\Tests\Core\Database\Stub\StubPDO');
$connection = new StubConnection($mock_pdo, ['namespace' => $namespace]);
$connection->driver = $driver;
@@ -406,7 +406,7 @@ class ConnectionTest extends UnitTestCase {
*
* @dataProvider providerMakeComments
*/
- public function testMakeComments($expected, $comment_array) {
+ public function testMakeComments($expected, $comment_array): void {
$mock_pdo = $this->createMock('Drupal\Tests\Core\Database\Stub\StubPDO');
$connection = new StubConnection($mock_pdo, []);
$this->assertEquals($expected, $connection->makeComment($comment_array));
@@ -433,7 +433,7 @@ class ConnectionTest extends UnitTestCase {
*
* @dataProvider providerFilterComments
*/
- public function testFilterComments($expected, $comment) {
+ public function testFilterComments($expected, $comment): void {
$mock_pdo = $this->createMock('Drupal\Tests\Core\Database\Stub\StubPDO');
$connection = new StubConnection($mock_pdo, []);
@@ -475,7 +475,7 @@ class ConnectionTest extends UnitTestCase {
* @covers ::escapeTable
* @dataProvider providerEscapeTables
*/
- public function testEscapeTable($expected, $name, array $identifier_quote = ['"', '"']) {
+ public function testEscapeTable($expected, $name, array $identifier_quote = ['"', '"']): void {
$mock_pdo = $this->createMock(StubPDO::class);
$connection = new StubConnection($mock_pdo, [], $identifier_quote);
@@ -506,7 +506,7 @@ class ConnectionTest extends UnitTestCase {
* @covers ::escapeAlias
* @dataProvider providerEscapeAlias
*/
- public function testEscapeAlias($expected, $name, array $identifier_quote = ['"', '"']) {
+ public function testEscapeAlias($expected, $name, array $identifier_quote = ['"', '"']): void {
$mock_pdo = $this->createMock(StubPDO::class);
$connection = new StubConnection($mock_pdo, [], $identifier_quote);
@@ -540,7 +540,7 @@ class ConnectionTest extends UnitTestCase {
* @covers ::escapeField
* @dataProvider providerEscapeFields
*/
- public function testEscapeField($expected, $name, array $identifier_quote = ['"', '"']) {
+ public function testEscapeField($expected, $name, array $identifier_quote = ['"', '"']): void {
$mock_pdo = $this->createMock(StubPDO::class);
$connection = new StubConnection($mock_pdo, [], $identifier_quote);
@@ -569,7 +569,7 @@ class ConnectionTest extends UnitTestCase {
* @covers ::escapeDatabase
* @dataProvider providerEscapeDatabase
*/
- public function testEscapeDatabase($expected, $name, array $identifier_quote = ['"', '"']) {
+ public function testEscapeDatabase($expected, $name, array $identifier_quote = ['"', '"']): void {
$mock_pdo = $this->createMock(StubPDO::class);
$connection = new StubConnection($mock_pdo, [], $identifier_quote);
@@ -579,7 +579,7 @@ class ConnectionTest extends UnitTestCase {
/**
* @covers ::__construct
*/
- public function testIdentifierQuotesAssertCount() {
+ public function testIdentifierQuotesAssertCount(): void {
$this->expectException(\AssertionError::class);
$this->expectExceptionMessage('\Drupal\Core\Database\Connection::$identifierQuotes must contain 2 string values');
$mock_pdo = $this->createMock(StubPDO::class);
@@ -589,7 +589,7 @@ class ConnectionTest extends UnitTestCase {
/**
* @covers ::__construct
*/
- public function testIdentifierQuotesAssertString() {
+ public function testIdentifierQuotesAssertString(): void {
$this->expectException(\AssertionError::class);
$this->expectExceptionMessage('\Drupal\Core\Database\Connection::$identifierQuotes must contain 2 string values');
$mock_pdo = $this->createMock(StubPDO::class);
@@ -599,7 +599,7 @@ class ConnectionTest extends UnitTestCase {
/**
* @covers ::__construct
*/
- public function testNamespaceDefault() {
+ public function testNamespaceDefault(): void {
$mock_pdo = $this->createMock(StubPDO::class);
$connection = new StubConnection($mock_pdo, []);
$this->assertSame('Drupal\Tests\Core\Database\Stub', $connection->getConnectionOptions()['namespace']);
@@ -610,7 +610,7 @@ class ConnectionTest extends UnitTestCase {
*
* @dataProvider provideQueriesToTrim
*/
- public function testQueryTrim($expected, $query, $options) {
+ public function testQueryTrim($expected, $query, $options): void {
$mock_pdo = $this->getMockBuilder(StubPdo::class)->getMock();
$connection = new StubConnection($mock_pdo, []);
@@ -669,7 +669,7 @@ class ConnectionTest extends UnitTestCase {
* @covers ::removeDatabaseEntriesFromDebugBacktrace
* @covers ::getDebugBacktrace
*/
- public function testFindCallerFromDebugBacktrace() {
+ public function testFindCallerFromDebugBacktrace(): void {
Database::addConnectionInfo('default', 'default', [
'driver' => 'test',
'namespace' => 'Drupal\Tests\Core\Database\Stub',
diff --git a/core/tests/Drupal/Tests/Core/Database/OrderByTest.php b/core/tests/Drupal/Tests/Core/Database/OrderByTest.php
index f6b21a04c24..a031d24d495 100644
--- a/core/tests/Drupal/Tests/Core/Database/OrderByTest.php
+++ b/core/tests/Drupal/Tests/Core/Database/OrderByTest.php
@@ -37,7 +37,7 @@ class OrderByTest extends UnitTestCase {
/**
* Checks that invalid sort directions in ORDER BY get converted to ASC.
*/
- public function testInvalidDirection() {
+ public function testInvalidDirection(): void {
$this->query->orderBy('test', 'invalid direction');
$order_bys = $this->query->getOrderBy();
$this->assertEquals('ASC', $order_bys['test'], 'Invalid order by direction is converted to ASC.');
@@ -46,7 +46,7 @@ class OrderByTest extends UnitTestCase {
/**
* Tests that fields passed for ordering get escaped properly.
*/
- public function testFieldEscaping() {
+ public function testFieldEscaping(): void {
$this->query->orderBy('x; DROP table node; --');
$sql = $this->query->__toString();
$this->assertStringEndsWith('ORDER BY xDROPtablenode ASC', $sql, 'Order by field is escaped correctly.');
diff --git a/core/tests/Drupal/Tests/Core/Database/RowCountExceptionTest.php b/core/tests/Drupal/Tests/Core/Database/RowCountExceptionTest.php
index aa978be52e6..411bec228ea 100644
--- a/core/tests/Drupal/Tests/Core/Database/RowCountExceptionTest.php
+++ b/core/tests/Drupal/Tests/Core/Database/RowCountExceptionTest.php
@@ -35,7 +35,7 @@ class RowCountExceptionTest extends UnitTestCase {
* @covers ::__construct
* @dataProvider providerTestExceptionMessage
*/
- public function testExceptionMessage($expected, $message) {
+ public function testExceptionMessage($expected, $message): void {
$e = new RowCountException($message);
$this->assertSame($expected, $e->getMessage());
}
@@ -44,7 +44,7 @@ class RowCountExceptionTest extends UnitTestCase {
* @covers ::__construct
* @group legacy
*/
- public function testExceptionMessageNull() {
+ public function testExceptionMessageNull(): void {
$e = new RowCountException(NULL);
$this->assertSame(static::DEFAULT_EXCEPTION_MESSAGE, $e->getMessage());
}
diff --git a/core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php b/core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php
index c2e8f135233..4548ed42c3d 100644
--- a/core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php
+++ b/core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php
@@ -28,7 +28,7 @@ class UrlConversionTest extends UnitTestCase {
*
* @dataProvider providerConvertDbUrlToConnectionInfo
*/
- public function testDbUrlToConnectionConversion($url, $database_array, $include_test_drivers) {
+ public function testDbUrlToConnectionConversion($url, $database_array, $include_test_drivers): void {
$result = Database::convertDbUrlToConnectionInfo($url, $this->root, $include_test_drivers);
$this->assertEquals($database_array, $result);
}
@@ -278,7 +278,7 @@ class UrlConversionTest extends UnitTestCase {
*
* @dataProvider providerInvalidArgumentsUrlConversion
*/
- public function testGetInvalidArgumentExceptionInUrlConversion($url, $root, $expected_exception_message) {
+ public function testGetInvalidArgumentExceptionInUrlConversion($url, $root, $expected_exception_message): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage($expected_exception_message);
Database::convertDbUrlToConnectionInfo($url, $root);
@@ -310,7 +310,7 @@ class UrlConversionTest extends UnitTestCase {
*
* @dataProvider providerGetConnectionInfoAsUrl
*/
- public function testGetConnectionInfoAsUrl(array $info, $expected_url) {
+ public function testGetConnectionInfoAsUrl(array $info, $expected_url): void {
Database::addConnectionInfo('default', 'default', $info);
$url = Database::getConnectionInfoAsUrl();
$this->assertEquals($expected_url, $url);
@@ -461,7 +461,7 @@ class UrlConversionTest extends UnitTestCase {
*
* @dataProvider providerInvalidArgumentGetConnectionInfoAsUrl
*/
- public function testGetInvalidArgumentGetConnectionInfoAsUrl(array $connection_options, $expected_exception_message) {
+ public function testGetInvalidArgumentGetConnectionInfoAsUrl(array $connection_options, $expected_exception_message): void {
Database::addConnectionInfo('default', 'default', $connection_options);
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage($expected_exception_message);
@@ -493,7 +493,7 @@ class UrlConversionTest extends UnitTestCase {
/**
* @covers ::convertDbUrlToConnectionInfo
*/
- public function testDriverModuleDoesNotExist() {
+ public function testDriverModuleDoesNotExist(): void {
$url = 'foo_bar_mysql://test_user:test_pass@test_host:3306/test_database?module=foo_bar';
$this->expectException(UnknownExtensionException::class);
$this->expectExceptionMessage("The database_driver Drupal\\foo_bar\\Driver\\Database\\foo_bar_mysql does not exist.");
@@ -503,7 +503,7 @@ class UrlConversionTest extends UnitTestCase {
/**
* @covers ::convertDbUrlToConnectionInfo
*/
- public function testModuleDriverDoesNotExist() {
+ public function testModuleDriverDoesNotExist(): void {
$url = 'driver_test_mysql://test_user:test_pass@test_host:3306/test_database?module=driver_test';
$this->expectException(UnknownExtensionException::class);
$this->expectExceptionMessage("The database_driver Drupal\\driver_test\\Driver\\Database\\driver_test_mysql does not exist.");
diff --git a/core/tests/Drupal/Tests/Core/Datetime/DateHelperTest.php b/core/tests/Drupal/Tests/Core/Datetime/DateHelperTest.php
index 40111e41eec..432b9bc083d 100644
--- a/core/tests/Drupal/Tests/Core/Datetime/DateHelperTest.php
+++ b/core/tests/Drupal/Tests/Core/Datetime/DateHelperTest.php
@@ -49,7 +49,7 @@ class DateHelperTest extends UnitTestCase {
* @covers ::weekDaysOrdered
* @dataProvider providerTestWeekDaysOrdered
*/
- public function testWeekDaysOrdered($first_day, $expected) {
+ public function testWeekDaysOrdered($first_day, $expected): void {
$container = new ContainerBuilder();
$config = ['system.date' => ['first_day' => $first_day]];
$container->set('config.factory', $this->getConfigFactoryStub($config));
@@ -164,7 +164,7 @@ class DateHelperTest extends UnitTestCase {
/**
* @covers ::daysInMonth
*/
- public function testDaysInMonth() {
+ public function testDaysInMonth(): void {
// @todo Consider deprecating passing NULL in
// https://www.drupal.org/project/drupal/issues/3299788
// Passing NULL, FALSE, or an empty string should default to now. Just
@@ -189,7 +189,7 @@ class DateHelperTest extends UnitTestCase {
/**
* @covers ::daysInYear
*/
- public function testDaysInYear() {
+ public function testDaysInYear(): void {
// Passing NULL, FALSE, or an empty string should default to now. Just
// check these are NOT null to avoid copying the implementation here.
$this->assertNotNull(DateHelper::daysInYear());
@@ -213,7 +213,7 @@ class DateHelperTest extends UnitTestCase {
/**
* @covers ::dayOfWeek
*/
- public function testDayOfWeek() {
+ public function testDayOfWeek(): void {
// Passing NULL, FALSE, or an empty string should default to now. Just
// check these are NOT null to avoid copying the implementation here.
$this->assertNotNull(DateHelper::dayOfWeek());
@@ -238,7 +238,7 @@ class DateHelperTest extends UnitTestCase {
/**
* @covers ::dayOfWeekName
*/
- public function testDayOfWeekName() {
+ public function testDayOfWeekName(): void {
// Passing NULL, FALSE, or an empty string should default to now. Just
// check these are NOT null to avoid copying the implementation here.
$this->assertNotNull(DateHelper::dayOfWeekName());
diff --git a/core/tests/Drupal/Tests/Core/Datetime/DateTest.php b/core/tests/Drupal/Tests/Core/Datetime/DateTest.php
index a31757d9ef8..f049ecf5a4c 100644
--- a/core/tests/Drupal/Tests/Core/Datetime/DateTest.php
+++ b/core/tests/Drupal/Tests/Core/Datetime/DateTest.php
@@ -102,7 +102,7 @@ class DateTest extends UnitTestCase {
*
* @covers ::formatInterval
*/
- public function testFormatInterval($interval, $granularity, $expected, $langcode = NULL) {
+ public function testFormatInterval($interval, $granularity, $expected, $langcode = NULL): void {
// Mocks a simple formatPlural implementation.
$this->stringTranslation->expects($this->any())
->method('translateString')
@@ -159,7 +159,7 @@ class DateTest extends UnitTestCase {
/**
* Tests the formatInterval method for 0 second.
*/
- public function testFormatIntervalZeroSecond() {
+ public function testFormatIntervalZeroSecond(): void {
$result = $this->dateFormatter->formatInterval(0, 1, 'xxx-lolspeak');
$this->assertEquals(new TranslatableMarkup('0 sec', [], ['langcode' => 'xxx-lolspeak'], $this->stringTranslation), $result);
}
@@ -169,7 +169,7 @@ class DateTest extends UnitTestCase {
*
* @covers \Drupal\Core\Datetime\DateFormatter::getSampleDateFormats
*/
- public function testGetSampleDateFormats() {
+ public function testGetSampleDateFormats(): void {
$timestamp = strtotime('2015-03-22 14:23:00');
$expected = $this->dateFormatter->getSampleDateFormats('en', $timestamp, 'Australia/Sydney');
@@ -189,7 +189,7 @@ class DateTest extends UnitTestCase {
*
* @covers ::formatTimeDiffUntil
*/
- public function testFormatTimeDiffUntil() {
+ public function testFormatTimeDiffUntil(): void {
$expected = '1 second';
$request_time = self::createTimestamp('2013-12-11 10:09:08');
$timestamp = self::createTimestamp('2013-12-11 10:09:09');
@@ -222,7 +222,7 @@ class DateTest extends UnitTestCase {
*
* @covers ::formatTimeDiffSince
*/
- public function testFormatTimeDiffSince() {
+ public function testFormatTimeDiffSince(): void {
$expected = '1 second';
$timestamp = self::createTimestamp('2013-12-11 10:09:07');
$request_time = self::createTimestamp('2013-12-11 10:09:08');
@@ -404,7 +404,7 @@ class DateTest extends UnitTestCase {
* @covers \Drupal\Core\Datetime\FormattedDateDiff::getString
* @covers \Drupal\Core\Datetime\FormattedDateDiff::getCacheMaxAge
*/
- public function testFormattedDateDiff() {
+ public function testFormattedDateDiff(): void {
$string = '10 minutes';
$max_age = 60;
$object = new FormattedDateDiff($string, $max_age);
diff --git a/core/tests/Drupal/Tests/Core/Datetime/DrupalDateTimeTest.php b/core/tests/Drupal/Tests/Core/Datetime/DrupalDateTimeTest.php
index b523f4e0aaf..150c3b2d4ed 100644
--- a/core/tests/Drupal/Tests/Core/Datetime/DrupalDateTimeTest.php
+++ b/core/tests/Drupal/Tests/Core/Datetime/DrupalDateTimeTest.php
@@ -30,7 +30,7 @@ class DrupalDateTimeTest extends UnitTestCase {
*
* @dataProvider providerTestDateDiff
*/
- public function testDateDiff($input1, $input2, $absolute, \DateInterval $expected) {
+ public function testDateDiff($input1, $input2, $absolute, \DateInterval $expected): void {
$interval = $input1->diff($input2, $absolute);
$this->assertEquals($interval, $expected);
}
@@ -47,7 +47,7 @@ class DrupalDateTimeTest extends UnitTestCase {
*
* @dataProvider providerTestInvalidDateDiff
*/
- public function testInvalidDateDiff($input1, $input2, $absolute) {
+ public function testInvalidDateDiff($input1, $input2, $absolute): void {
$this->expectException(\BadMethodCallException::class);
$this->expectExceptionMessage('Method Drupal\Component\Datetime\DateTimePlus::diff expects parameter 1 to be a \DateTime or \Drupal\Component\Datetime\DateTimePlus object');
$interval = $input1->diff($input2, $absolute);
@@ -165,7 +165,7 @@ class DrupalDateTimeTest extends UnitTestCase {
/**
* Tests setting the default time for date-only objects.
*/
- public function testDefaultDateTime() {
+ public function testDefaultDateTime(): void {
$utc = new \DateTimeZone('UTC');
$date = DrupalDateTime::createFromFormat('Y-m-d H:i:s', '2017-05-23 22:58:00', $utc, ['langcode' => 'en']);
@@ -179,7 +179,7 @@ class DrupalDateTimeTest extends UnitTestCase {
*
* @covers ::__call
*/
- public function testChainable() {
+ public function testChainable(): void {
$tz = new \DateTimeZone(date_default_timezone_get());
$date = new DrupalDateTime('now', $tz, ['langcode' => 'en']);
@@ -197,7 +197,7 @@ class DrupalDateTimeTest extends UnitTestCase {
*
* @covers ::__call
*/
- public function testChainableNonChainable() {
+ public function testChainableNonChainable(): void {
$tz = new \DateTimeZone(date_default_timezone_get());
$datetime1 = new DrupalDateTime('2009-10-11 12:00:00', $tz, ['langcode' => 'en']);
$datetime2 = new DrupalDateTime('2009-10-13 12:00:00', $tz, ['langcode' => 'en']);
@@ -211,7 +211,7 @@ class DrupalDateTimeTest extends UnitTestCase {
*
* @covers ::__call
*/
- public function testChainableNonCallable() {
+ public function testChainableNonCallable(): void {
$this->expectException(\BadMethodCallException::class);
$this->expectExceptionMessage('Call to undefined method Drupal\Core\Datetime\DrupalDateTime::nonexistent()');
$tz = new \DateTimeZone(date_default_timezone_get());
@@ -222,7 +222,7 @@ class DrupalDateTimeTest extends UnitTestCase {
/**
* @covers ::getPhpDateTime
*/
- public function testGetPhpDateTime() {
+ public function testGetPhpDateTime(): void {
$new_york = new \DateTimeZone('America/New_York');
$berlin = new \DateTimeZone('Europe/Berlin');
@@ -251,7 +251,7 @@ class DrupalDateTimeTest extends UnitTestCase {
*
* @covers ::format
*/
- public function testRfc2822DateFormat() {
+ public function testRfc2822DateFormat(): void {
$language_manager = $this->createMock(LanguageManager::class);
$language_manager->expects($this->any())
->method('getCurrentLanguage')
diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/AuthenticationProviderPassTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/AuthenticationProviderPassTest.php
index 7e106cefcc6..5e8ab648e60 100644
--- a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/AuthenticationProviderPassTest.php
+++ b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/AuthenticationProviderPassTest.php
@@ -19,7 +19,7 @@ class AuthenticationProviderPassTest extends UnitTestCase {
/**
* @covers ::process
*/
- public function testEncoders() {
+ public function testEncoders(): void {
$container = new ContainerBuilder();
$definition = new Definition(Serializer::class, [[], []]);
$definition->setPublic(TRUE);
diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
index a906bd949ae..1edc10dbe64 100644
--- a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
+++ b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
@@ -37,7 +37,7 @@ class BackendCompilerPassTest extends UnitTestCase {
*
* @covers ::process
*/
- public function testProcess() {
+ public function testProcess(): void {
// Add a container with no set default_backend.
$prefix = __NAMESPACE__ . '\\ServiceClass';
$service = (new Definition($prefix . 'Default'))->addTag('backend_overridable');
diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/ProxyServicesPassTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/ProxyServicesPassTest.php
index 8936501d590..63aa1f55d00 100644
--- a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/ProxyServicesPassTest.php
+++ b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/ProxyServicesPassTest.php
@@ -35,7 +35,7 @@ class ProxyServicesPassTest extends UnitTestCase {
/**
* @covers ::process
*/
- public function testContainerWithoutLazyServices() {
+ public function testContainerWithoutLazyServices(): void {
$container = new ContainerBuilder();
$container->register('lock', 'Drupal\Core\Lock\DatabaseLockBackend');
@@ -48,7 +48,7 @@ class ProxyServicesPassTest extends UnitTestCase {
/**
* @covers ::process
*/
- public function testContainerWithLazyServices() {
+ public function testContainerWithLazyServices(): void {
$container = new ContainerBuilder();
$container->register('lock', 'Drupal\Core\Lock\DatabaseLockBackend')
->setLazy(TRUE);
@@ -68,7 +68,7 @@ class ProxyServicesPassTest extends UnitTestCase {
/**
* @covers ::process
*/
- public function testContainerWithLazyServicesWithoutProxyClass() {
+ public function testContainerWithLazyServicesWithoutProxyClass(): void {
$container = new ContainerBuilder();
$container->register('path.current', CurrentPathStack::class)
->setLazy(TRUE);
diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/StackedKernelPassTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/StackedKernelPassTest.php
index ec95f280199..2443817c8d2 100644
--- a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/StackedKernelPassTest.php
+++ b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/StackedKernelPassTest.php
@@ -46,7 +46,7 @@ class StackedKernelPassTest extends UnitTestCase {
/**
* @covers ::process
*/
- public function testProcessWithStackedKernel() {
+ public function testProcessWithStackedKernel(): void {
$stacked_kernel = new Definition(StackedHttpKernel::class);
$stacked_kernel->setPublic(TRUE);
$this->containerBuilder->setDefinition('http_kernel', $stacked_kernel);
@@ -88,7 +88,7 @@ class StackedKernelPassTest extends UnitTestCase {
/**
* @covers ::process
*/
- public function testProcessWithHttpKernel() {
+ public function testProcessWithHttpKernel(): void {
$kernel = new Definition('Symfony\Component\HttpKernel\HttpKernelInterface');
$kernel->setPublic(TRUE);
$this->containerBuilder->setDefinition('http_kernel', $kernel);
diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php
index ed07b2fb7ce..e61dd318b15 100644
--- a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php
+++ b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php
@@ -27,7 +27,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
*
* @covers ::process
*/
- public function testProcessNoConsumers() {
+ public function testProcessNoConsumers(): void {
$container = $this->buildContainer();
$container
->register('consumer_id', __NAMESPACE__ . '\ValidConsumer');
@@ -44,7 +44,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
*
* @covers ::process
*/
- public function testProcessRequiredHandlers() {
+ public function testProcessRequiredHandlers(): void {
$container = $this->buildContainer();
$container
->register('consumer_id', __NAMESPACE__ . '\ValidConsumer')
@@ -64,7 +64,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
* @covers ::process
* @covers ::processServiceIdCollectorPass
*/
- public function testIdCollectorProcessRequiredHandlers() {
+ public function testIdCollectorProcessRequiredHandlers(): void {
$this->expectException(LogicException::class);
$this->expectExceptionMessage("At least one service tagged with 'consumer_id' is required.");
$container = $this->buildContainer();
@@ -83,7 +83,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
*
* @covers ::process
*/
- public function testProcessMissingInterface() {
+ public function testProcessMissingInterface(): void {
$container = $this->buildContainer();
$container
->register('consumer_id0', __NAMESPACE__ . '\ValidConsumer')
@@ -103,7 +103,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
*
* @covers ::process
*/
- public function testProcess() {
+ public function testProcess(): void {
$container = $this->buildContainer();
$container
->register('consumer_id', __NAMESPACE__ . '\ValidConsumer')
@@ -128,7 +128,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
*
* @covers ::process
*/
- public function testServiceIdProcess() {
+ public function testServiceIdProcess(): void {
$container = $this->buildContainer();
$container
->register('consumer_id', __NAMESPACE__ . '\ValidConsumer')
@@ -154,7 +154,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
*
* @covers ::process
*/
- public function testProcessPriority() {
+ public function testProcessPriority(): void {
$container = $this->buildContainer();
$container
->register('consumer_id', __NAMESPACE__ . '\ValidConsumer')
@@ -185,7 +185,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
*
* @covers ::process
*/
- public function testServiceIdProcessPriority() {
+ public function testServiceIdProcessPriority(): void {
$container = $this->buildContainer();
$container
->register('consumer_id', __NAMESPACE__ . '\ValidConsumer')
@@ -218,7 +218,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
*
* @covers ::process
*/
- public function testProcessNoPriorityParam() {
+ public function testProcessNoPriorityParam(): void {
$container = $this->buildContainer();
$container
->register('consumer_id', __NAMESPACE__ . '\ValidConsumer')
@@ -251,7 +251,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
*
* @covers ::process
*/
- public function testProcessWithIdParameter() {
+ public function testProcessWithIdParameter(): void {
$container = $this->buildContainer();
$container
->register('consumer_id', __NAMESPACE__ . '\ValidConsumer')
@@ -286,7 +286,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
*
* @covers ::process
*/
- public function testProcessInterfaceMismatch() {
+ public function testProcessInterfaceMismatch(): void {
$container = $this->buildContainer();
$container
@@ -311,7 +311,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
*
* @covers ::process
*/
- public function testProcessWithExtraArguments() {
+ public function testProcessWithExtraArguments(): void {
$container = $this->buildContainer();
$container
@@ -341,7 +341,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
*
* @covers ::process
*/
- public function testProcessNoPriorityAndExtraArguments() {
+ public function testProcessNoPriorityAndExtraArguments(): void {
$container = $this->buildContainer();
$container
@@ -370,7 +370,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
*
* @covers ::process
*/
- public function testProcessWithIdAndExtraArguments() {
+ public function testProcessWithIdAndExtraArguments(): void {
$container = $this->buildContainer();
$container
@@ -402,7 +402,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
*
* @covers ::process
*/
- public function testProcessWithDifferentArgumentsOrderAndDefaultValue() {
+ public function testProcessWithDifferentArgumentsOrderAndDefaultValue(): void {
$container = $this->buildContainer();
$container
diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php
index 32f4c3cfaf8..dd45b97b6ce 100644
--- a/core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/DependencyInjection/ContainerBuilderTest.php
@@ -18,7 +18,7 @@ class ContainerBuilderTest extends UnitTestCase {
/**
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
$container = new ContainerBuilder();
$container->register('bar', 'Drupal\Tests\Core\DependencyInjection\Fixture\BarClass');
@@ -29,7 +29,7 @@ class ContainerBuilderTest extends UnitTestCase {
/**
* @covers ::setParameter
*/
- public function testSetParameterException() {
+ public function testSetParameterException(): void {
$container = new ContainerBuilder();
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Parameter names must be lowercase: Buzz');
@@ -39,7 +39,7 @@ class ContainerBuilderTest extends UnitTestCase {
/**
* @covers ::register
*/
- public function testRegister() {
+ public function testRegister(): void {
$container = new ContainerBuilder();
$service = $container->register('bar');
$this->assertTrue($service->isPublic());
@@ -48,7 +48,7 @@ class ContainerBuilderTest extends UnitTestCase {
/**
* @covers ::setDefinition
*/
- public function testSetDefinition() {
+ public function testSetDefinition(): void {
// Test a service with public set to true.
$container = new ContainerBuilder();
$definition = new Definition();
@@ -66,7 +66,7 @@ class ContainerBuilderTest extends UnitTestCase {
/**
* @covers ::setAlias
*/
- public function testSetAlias() {
+ public function testSetAlias(): void {
$container = new ContainerBuilder();
$container->register('bar');
$alias = $container->setAlias('foo', 'bar');
@@ -76,7 +76,7 @@ class ContainerBuilderTest extends UnitTestCase {
/**
* Tests serialization.
*/
- public function testSerialize() {
+ public function testSerialize(): void {
$container = new ContainerBuilder();
$this->expectException(\AssertionError::class);
serialize($container);
@@ -91,7 +91,7 @@ class ContainerBuilderTest extends UnitTestCase {
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
- public function testConstructor() {
+ public function testConstructor(): void {
class_alias(TestInterface::class, 'Symfony\Component\Config\Resource\ResourceInterface');
$container = new ContainerBuilder();
$this->assertFalse($container->isTrackingResources());
diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/ContainerTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/ContainerTest.php
index 426d392bf30..36757451767 100644
--- a/core/tests/Drupal/Tests/Core/DependencyInjection/ContainerTest.php
+++ b/core/tests/Drupal/Tests/Core/DependencyInjection/ContainerTest.php
@@ -16,7 +16,7 @@ class ContainerTest extends UnitTestCase {
/**
* Tests serialization.
*/
- public function testSerialize() {
+ public function testSerialize(): void {
$container = new Container();
$this->expectException(\AssertionError::class);
serialize($container);
diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/DependencySerializationTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/DependencySerializationTest.php
index 085f8a01846..d41703afe30 100644
--- a/core/tests/Drupal/Tests/Core/DependencyInjection/DependencySerializationTest.php
+++ b/core/tests/Drupal/Tests/Core/DependencyInjection/DependencySerializationTest.php
@@ -20,7 +20,7 @@ class DependencySerializationTest extends UnitTestCase {
* @covers ::__sleep
* @covers ::__wakeup
*/
- public function testSerialization() {
+ public function testSerialization(): void {
// Create a pseudo service and dependency injected object.
$service = new \stdClass();
$container = TestKernel::setContainerWithKernel();
diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/YamlFileLoaderTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/YamlFileLoaderTest.php
index 0fc5c0203e8..b4ed2ca57c3 100644
--- a/core/tests/Drupal/Tests/Core/DependencyInjection/YamlFileLoaderTest.php
+++ b/core/tests/Drupal/Tests/Core/DependencyInjection/YamlFileLoaderTest.php
@@ -28,7 +28,7 @@ class YamlFileLoaderTest extends UnitTestCase {
FileCacheFactory::setPrefix('example');
}
- public function testParseDefinitionsWithProvider() {
+ public function testParseDefinitionsWithProvider(): void {
$yml = <<<YAML
services:
example_service_1:
@@ -80,7 +80,7 @@ YAML;
/**
* @dataProvider providerTestExceptions
*/
- public function testExceptions($yml, $message) {
+ public function testExceptions($yml, $message): void {
vfsStream::setup('drupal', NULL, [
'modules' => [
'example' => [
diff --git a/core/tests/Drupal/Tests/Core/Discovery/YamlDiscoveryTest.php b/core/tests/Drupal/Tests/Core/Discovery/YamlDiscoveryTest.php
index b5094f06759..78b1840320e 100644
--- a/core/tests/Drupal/Tests/Core/Discovery/YamlDiscoveryTest.php
+++ b/core/tests/Drupal/Tests/Core/Discovery/YamlDiscoveryTest.php
@@ -30,7 +30,7 @@ class YamlDiscoveryTest extends TestCase {
/**
* Tests if filename is output for a broken YAML file.
*/
- public function testFilenameForBrokenYml() {
+ public function testFilenameForBrokenYml(): void {
vfsStreamWrapper::register();
$root = new vfsStreamDirectory('modules');
vfsStreamWrapper::setRoot($root);
diff --git a/core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php b/core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php
index e8555b9bc3f..56b5ad551da 100644
--- a/core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php
+++ b/core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php
@@ -36,7 +36,7 @@ class DisplayVariantTest extends UnitTestCase {
*
* @covers ::label
*/
- public function testLabel() {
+ public function testLabel(): void {
$display_variant = $this->setUpDisplayVariant(['label' => 'foo']);
$this->assertSame('foo', $display_variant->label());
}
@@ -46,7 +46,7 @@ class DisplayVariantTest extends UnitTestCase {
*
* @covers ::label
*/
- public function testLabelDefault() {
+ public function testLabelDefault(): void {
$display_variant = $this->setUpDisplayVariant();
$this->assertSame('', $display_variant->label());
}
@@ -56,7 +56,7 @@ class DisplayVariantTest extends UnitTestCase {
*
* @covers ::getWeight
*/
- public function testGetWeight() {
+ public function testGetWeight(): void {
$display_variant = $this->setUpDisplayVariant(['weight' => 5]);
$this->assertSame(5, $display_variant->getWeight());
}
@@ -66,7 +66,7 @@ class DisplayVariantTest extends UnitTestCase {
*
* @covers ::getWeight
*/
- public function testGetWeightDefault() {
+ public function testGetWeightDefault(): void {
$display_variant = $this->setUpDisplayVariant();
$this->assertSame(0, $display_variant->getWeight());
}
@@ -78,7 +78,7 @@ class DisplayVariantTest extends UnitTestCase {
*
* @dataProvider providerTestGetConfiguration
*/
- public function testGetConfiguration($configuration, $expected) {
+ public function testGetConfiguration($configuration, $expected): void {
$display_variant = $this->setUpDisplayVariant($configuration);
$this->assertSame($expected, $display_variant->getConfiguration());
@@ -124,7 +124,7 @@ class DisplayVariantTest extends UnitTestCase {
*
* @covers ::access
*/
- public function testAccess() {
+ public function testAccess(): void {
$display_variant = $this->setUpDisplayVariant();
$this->assertTrue($display_variant->access());
}
@@ -134,7 +134,7 @@ class DisplayVariantTest extends UnitTestCase {
*
* @covers ::submitConfigurationForm
*/
- public function testSubmitConfigurationForm() {
+ public function testSubmitConfigurationForm(): void {
$display_variant = $this->setUpDisplayVariant();
$this->assertSame('', $display_variant->label());
diff --git a/core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php b/core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php
index 2763f40b530..50954cafa43 100644
--- a/core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php
+++ b/core/tests/Drupal/Tests/Core/DrupalKernel/DiscoverServiceProvidersTest.php
@@ -20,7 +20,7 @@ class DiscoverServiceProvidersTest extends UnitTestCase {
*
* @covers ::discoverServiceProviders
*/
- public function testDiscoverServiceCustom() {
+ public function testDiscoverServiceCustom(): void {
new Settings([
'container_yamls' => [
__DIR__ . '/fixtures/custom.yml',
@@ -46,7 +46,7 @@ class DiscoverServiceProvidersTest extends UnitTestCase {
/**
* Tests the exception when container_yamls is not set.
*/
- public function testDiscoverServiceNoContainerYamls() {
+ public function testDiscoverServiceNoContainerYamls(): void {
new Settings([]);
$kernel = new DrupalKernel('prod', new ClassLoader());
$kernel->discoverServiceProviders();
diff --git a/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php b/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php
index ab15a6a71e7..e01add01477 100644
--- a/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php
+++ b/core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php
@@ -23,7 +23,7 @@ class DrupalKernelTest extends UnitTestCase {
* @covers ::setupTrustedHosts
* @dataProvider providerTestTrustedHosts
*/
- public function testTrustedHosts($host, $server_name, $message, $expected = FALSE) {
+ public function testTrustedHosts($host, $server_name, $message, $expected = FALSE): void {
$request = new Request();
$trusted_host_patterns = [
@@ -114,7 +114,7 @@ class DrupalKernelTest extends UnitTestCase {
* @covers ::findSitePath
* @runInSeparateProcess
*/
- public function testFindSitePath() {
+ public function testFindSitePath(): void {
$vfs_root = vfsStream::setup('drupal_root');
$sites_php = <<<'EOD'
<?php
@@ -143,7 +143,7 @@ EOD;
* @covers ::terminate
* @runInSeparateProcess
*/
- public function testUnBootedTerminate() {
+ public function testUnBootedTerminate(): void {
$kernel = new DrupalKernel('test', new ClassLoader());
$kernel->terminate(new Request(), new Response());
$this->assertTrue(TRUE, "\Drupal\Core\DrupalKernel::terminate() called without error on kernel which has not booted");
diff --git a/core/tests/Drupal/Tests/Core/DrupalKernel/ValidateHostnameTest.php b/core/tests/Drupal/Tests/Core/DrupalKernel/ValidateHostnameTest.php
index 4be76598eeb..2c2ad89f4c9 100644
--- a/core/tests/Drupal/Tests/Core/DrupalKernel/ValidateHostnameTest.php
+++ b/core/tests/Drupal/Tests/Core/DrupalKernel/ValidateHostnameTest.php
@@ -18,7 +18,7 @@ class ValidateHostnameTest extends UnitTestCase {
* @covers ::validateHostname
* @dataProvider providerTestValidateHostname
*/
- public function testValidateHostname($hostname, $message, $expected = FALSE) {
+ public function testValidateHostname($hostname, $message, $expected = FALSE): void {
$server = ['HTTP_HOST' => $hostname];
$request = new Request([], [], [], [], [], $server);
$validated_hostname = DrupalKernel::validateHostname($request);
diff --git a/core/tests/Drupal/Tests/Core/DrupalTest.php b/core/tests/Drupal/Tests/Core/DrupalTest.php
index 49c6226f6ae..a009151df0b 100644
--- a/core/tests/Drupal/Tests/Core/DrupalTest.php
+++ b/core/tests/Drupal/Tests/Core/DrupalTest.php
@@ -43,7 +43,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::getContainer
*/
- public function testSetContainer() {
+ public function testSetContainer(): void {
\Drupal::setContainer($this->container);
$this->assertSame($this->container, \Drupal::getContainer());
}
@@ -51,7 +51,7 @@ class DrupalTest extends UnitTestCase {
/**
* @covers ::getContainer
*/
- public function testGetContainerException() {
+ public function testGetContainerException(): void {
$this->expectException(ContainerNotInitializedException::class);
$this->expectExceptionMessage('\Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container.');
\Drupal::getContainer();
@@ -62,7 +62,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::service
*/
- public function testService() {
+ public function testService(): void {
$this->setMockContainerService('test_service');
$this->assertNotNull(\Drupal::service('test_service'));
}
@@ -72,7 +72,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::currentUser
*/
- public function testCurrentUser() {
+ public function testCurrentUser(): void {
$this->setMockContainerService('current_user');
$this->assertNotNull(\Drupal::currentUser());
}
@@ -82,7 +82,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::entityTypeManager
*/
- public function testEntityTypeManager() {
+ public function testEntityTypeManager(): void {
$this->setMockContainerService('entity_type.manager');
$this->assertNotNull(\Drupal::entityTypeManager());
}
@@ -92,7 +92,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::database
*/
- public function testDatabase() {
+ public function testDatabase(): void {
$this->setMockContainerService('database');
$this->assertNotNull(\Drupal::database());
}
@@ -102,7 +102,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::cache
*/
- public function testCache() {
+ public function testCache(): void {
$this->setMockContainerService('cache.test');
$this->assertNotNull(\Drupal::cache('test'));
}
@@ -112,7 +112,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::classResolver
*/
- public function testClassResolver() {
+ public function testClassResolver(): void {
$class_resolver = $this->prophesize(ClassResolverInterface::class);
$this->setMockContainerService('class_resolver', $class_resolver->reveal());
$this->assertInstanceOf(ClassResolverInterface::class, \Drupal::classResolver());
@@ -123,7 +123,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::classResolver
*/
- public function testClassResolverWithClass() {
+ public function testClassResolverWithClass(): void {
$class_resolver = $this->prophesize(ClassResolverInterface::class);
$class_resolver->getInstanceFromDefinition(static::class)->willReturn($this);
$this->setMockContainerService('class_resolver', $class_resolver->reveal());
@@ -135,7 +135,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::keyValueExpirable
*/
- public function testKeyValueExpirable() {
+ public function testKeyValueExpirable(): void {
$keyvalue = $this->getMockBuilder('Drupal\Core\KeyValueStore\KeyValueExpirableFactory')
->disableOriginalConstructor()
->getMock();
@@ -153,7 +153,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::lock
*/
- public function testLock() {
+ public function testLock(): void {
$this->setMockContainerService('lock');
$this->assertNotNull(\Drupal::lock());
}
@@ -163,7 +163,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::config
*/
- public function testConfig() {
+ public function testConfig(): void {
$config = $this->createMock('Drupal\Core\Config\ConfigFactoryInterface');
$config->expects($this->once())
->method('get')
@@ -180,7 +180,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::queue
*/
- public function testQueue() {
+ public function testQueue(): void {
$queue = $this->getMockBuilder('Drupal\Core\Queue\QueueFactory')
->disableOriginalConstructor()
->getMock();
@@ -198,7 +198,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::requestStack
*/
- public function testRequestStack() {
+ public function testRequestStack(): void {
$request_stack = new RequestStack();
$this->setMockContainerService('request_stack', $request_stack);
@@ -210,7 +210,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::keyValue
*/
- public function testKeyValue() {
+ public function testKeyValue(): void {
$keyvalue = $this->getMockBuilder('Drupal\Core\KeyValueStore\KeyValueFactory')
->disableOriginalConstructor()
->getMock();
@@ -228,7 +228,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::state
*/
- public function testState() {
+ public function testState(): void {
$this->setMockContainerService('state');
$this->assertNotNull(\Drupal::state());
}
@@ -238,7 +238,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::httpClient
*/
- public function testHttpClient() {
+ public function testHttpClient(): void {
$this->setMockContainerService('http_client');
$this->assertNotNull(\Drupal::httpClient());
}
@@ -248,7 +248,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::entityQuery
*/
- public function testEntityQuery() {
+ public function testEntityQuery(): void {
$query = $this->createMock(QueryInterface::class);
$storage = $this->createMock(EntityStorageInterface::class);
$storage
@@ -274,7 +274,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::entityQueryAggregate
*/
- public function testEntityQueryAggregate() {
+ public function testEntityQueryAggregate(): void {
$query = $this->createMock(QueryAggregateInterface::class);
$storage = $this->createMock(EntityStorageInterface::class);
$storage
@@ -300,7 +300,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::flood
*/
- public function testFlood() {
+ public function testFlood(): void {
$this->setMockContainerService('flood');
$this->assertNotNull(\Drupal::flood());
}
@@ -310,7 +310,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::moduleHandler
*/
- public function testModuleHandler() {
+ public function testModuleHandler(): void {
$this->setMockContainerService('module_handler');
$this->assertNotNull(\Drupal::moduleHandler());
}
@@ -320,7 +320,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::typedDataManager
*/
- public function testTypedDataManager() {
+ public function testTypedDataManager(): void {
$this->setMockContainerService('typed_data_manager');
$this->assertNotNull(\Drupal::typedDataManager());
}
@@ -330,7 +330,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::token
*/
- public function testToken() {
+ public function testToken(): void {
$this->setMockContainerService('token');
$this->assertNotNull(\Drupal::token());
}
@@ -340,7 +340,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::urlGenerator
*/
- public function testUrlGenerator() {
+ public function testUrlGenerator(): void {
$this->setMockContainerService('url_generator');
$this->assertNotNull(\Drupal::urlGenerator());
}
@@ -350,7 +350,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::linkGenerator
*/
- public function testLinkGenerator() {
+ public function testLinkGenerator(): void {
$this->setMockContainerService('link_generator');
$this->assertNotNull(\Drupal::linkGenerator());
}
@@ -360,7 +360,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::translation
*/
- public function testTranslation() {
+ public function testTranslation(): void {
$this->setMockContainerService('string_translation');
$this->assertNotNull(\Drupal::translation());
}
@@ -370,7 +370,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::languageManager
*/
- public function testLanguageManager() {
+ public function testLanguageManager(): void {
$this->setMockContainerService('language_manager');
$this->assertNotNull(\Drupal::languageManager());
}
@@ -380,7 +380,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::csrfToken
*/
- public function testCsrfToken() {
+ public function testCsrfToken(): void {
$this->setMockContainerService('csrf_token');
$this->assertNotNull(\Drupal::csrfToken());
}
@@ -390,7 +390,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::transliteration
*/
- public function testTransliteration() {
+ public function testTransliteration(): void {
$this->setMockContainerService('transliteration');
$this->assertNotNull(\Drupal::transliteration());
}
@@ -400,7 +400,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::formBuilder
*/
- public function testFormBuilder() {
+ public function testFormBuilder(): void {
$this->setMockContainerService('form_builder');
$this->assertNotNull(\Drupal::formBuilder());
}
@@ -410,7 +410,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::menuTree
*/
- public function testMenuTree() {
+ public function testMenuTree(): void {
$this->setMockContainerService('menu.link_tree');
$this->assertNotNull(\Drupal::menuTree());
}
@@ -420,7 +420,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::pathValidator
*/
- public function testPathValidator() {
+ public function testPathValidator(): void {
$this->setMockContainerService('path.validator');
$this->assertNotNull(\Drupal::pathValidator());
}
@@ -430,7 +430,7 @@ class DrupalTest extends UnitTestCase {
*
* @covers ::accessManager
*/
- public function testAccessManager() {
+ public function testAccessManager(): void {
$this->setMockContainerService('access_manager');
$this->assertNotNull(\Drupal::accessManager());
}
@@ -438,7 +438,7 @@ class DrupalTest extends UnitTestCase {
/**
* Tests the PHP constants have consistent values.
*/
- public function testPhpConstants() {
+ public function testPhpConstants(): void {
// RECOMMENDED_PHP can be just MAJOR.MINOR so normalize it to allow using
// version_compare().
$normalizer = function (string $version): string {
diff --git a/core/tests/Drupal/Tests/Core/Enhancer/EntityRevisionRouteEnhancerTest.php b/core/tests/Drupal/Tests/Core/Enhancer/EntityRevisionRouteEnhancerTest.php
index d5a691dd951..f1a68f6b8ab 100644
--- a/core/tests/Drupal/Tests/Core/Enhancer/EntityRevisionRouteEnhancerTest.php
+++ b/core/tests/Drupal/Tests/Core/Enhancer/EntityRevisionRouteEnhancerTest.php
@@ -34,7 +34,7 @@ class EntityRevisionRouteEnhancerTest extends UnitTestCase {
/**
* @covers ::enhance
*/
- public function testEnhanceWithoutParameter() {
+ public function testEnhanceWithoutParameter(): void {
$route = new Route('/test-path/{entity_test}');
$request = Request::create('/test-path');
@@ -47,7 +47,7 @@ class EntityRevisionRouteEnhancerTest extends UnitTestCase {
/**
* @covers ::enhance
*/
- public function testEnhanceWithoutEntityRevision() {
+ public function testEnhanceWithoutEntityRevision(): void {
$route = new Route('/test-path/{entity_test}', [], [], ['parameters' => ['entity_test' => ['type' => 'entity:entity_test']]]);
$request = Request::create('/test-path/123');
$entity = $this->prophesize(EntityInterface::class);
@@ -61,7 +61,7 @@ class EntityRevisionRouteEnhancerTest extends UnitTestCase {
/**
* @covers ::enhance
*/
- public function testEnhanceWithEntityRevision() {
+ public function testEnhanceWithEntityRevision(): void {
$route = new Route('/test-path/{entity_test_revision}', [], [], ['parameters' => ['entity_test_revision' => ['type' => 'entity_revision:entity_test']]]);
$request = Request::create('/test-path/123');
$entity = $this->prophesize(EntityInterface::class);
diff --git a/core/tests/Drupal/Tests/Core/Enhancer/ParamConversionEnhancerTest.php b/core/tests/Drupal/Tests/Core/Enhancer/ParamConversionEnhancerTest.php
index 261a93590a6..2f6bb549e86 100644
--- a/core/tests/Drupal/Tests/Core/Enhancer/ParamConversionEnhancerTest.php
+++ b/core/tests/Drupal/Tests/Core/Enhancer/ParamConversionEnhancerTest.php
@@ -40,7 +40,7 @@ class ParamConversionEnhancerTest extends UnitTestCase {
/**
* @covers ::enhance
*/
- public function testEnhance() {
+ public function testEnhance(): void {
$route = new Route('/test/{id}/{literal}/{null}');
$raw_variables = [
@@ -75,7 +75,7 @@ class ParamConversionEnhancerTest extends UnitTestCase {
/**
* @covers ::copyRawVariables
*/
- public function testCopyRawVariables() {
+ public function testCopyRawVariables(): void {
$route = new Route('/test/{id}');
$route->setDefault('node_type', 'page');
$defaults = [
diff --git a/core/tests/Drupal/Tests/Core/Entity/Access/EntityFormDisplayAccessControlHandlerTest.php b/core/tests/Drupal/Tests/Core/Entity/Access/EntityFormDisplayAccessControlHandlerTest.php
index df0e46e0d9d..01216173fce 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Access/EntityFormDisplayAccessControlHandlerTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Access/EntityFormDisplayAccessControlHandlerTest.php
@@ -215,7 +215,7 @@ class EntityFormDisplayAccessControlHandlerTest extends UnitTestCase {
* @covers ::access
* @covers ::checkAccess
*/
- public function testAccess() {
+ public function testAccess(): void {
$this->assertAllowOperations([], $this->anon);
$this->assertAllowOperations(['view', 'update', 'delete'], $this->member);
$this->assertAllowOperations(['view', 'update', 'delete'], $this->parentMember);
diff --git a/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php b/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php
index 43c436c475c..a70c9b4c8ce 100644
--- a/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php
@@ -79,7 +79,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
*
* @covers ::getName
*/
- public function testFieldName() {
+ public function testFieldName(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$field_name = $this->randomMachineName();
$definition->setName($field_name);
@@ -91,7 +91,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
*
* @covers ::getLabel
*/
- public function testFieldLabel() {
+ public function testFieldLabel(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$label = $this->randomMachineName();
$definition->setLabel($label);
@@ -103,7 +103,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
*
* @covers ::getDescription
*/
- public function testFieldDescription() {
+ public function testFieldDescription(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$description = $this->randomMachineName();
$definition->setDescription($description);
@@ -115,7 +115,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
*
* @covers ::getType
*/
- public function testFieldType() {
+ public function testFieldType(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$this->assertEquals($this->fieldType, $definition->getType());
}
@@ -127,7 +127,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
* @covers ::setSetting
* @covers ::getSettings
*/
- public function testFieldSettings() {
+ public function testFieldSettings(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$setting = $this->randomMachineName();
$value = $this->randomMachineName();
@@ -144,7 +144,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
* @covers ::setSetting
* @covers ::getSettings
*/
- public function testDefaultFieldSettings() {
+ public function testDefaultFieldSettings(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$expected_settings = $this->fieldTypeDefinition['storage_settings'] + $this->fieldTypeDefinition['field_settings'];
$this->assertEquals($expected_settings, $definition->getSettings());
@@ -159,7 +159,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
* @covers ::getDefaultValue
* @covers ::setDefaultValue
*/
- public function testFieldDefaultValue() {
+ public function testFieldDefaultValue(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$default_value = [
'value' => $this->randomMachineName(),
@@ -207,7 +207,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
* @covers ::getInitialValue
* @covers ::setInitialValue
*/
- public function testFieldInitialValue() {
+ public function testFieldInitialValue(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$definition->setItemDefinition(DataDefinition::createFromDataType('string')->setClass(FieldItemBase::class));
$default_value = [
@@ -255,7 +255,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
* @covers ::isTranslatable
* @covers ::setTranslatable
*/
- public function testFieldTranslatable() {
+ public function testFieldTranslatable(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$this->assertFalse($definition->isTranslatable());
$definition->setTranslatable(TRUE);
@@ -270,7 +270,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
* @covers ::isRevisionable
* @covers ::setRevisionable
*/
- public function testFieldRevisionable() {
+ public function testFieldRevisionable(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$this->assertFalse($definition->isRevisionable());
$definition->setRevisionable(TRUE);
@@ -285,7 +285,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
* @covers ::getCardinality
* @covers ::setCardinality
*/
- public function testFieldCardinality() {
+ public function testFieldCardinality(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$this->assertEquals(1, $definition->getCardinality());
$definition->setCardinality(2);
@@ -300,7 +300,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
* @covers ::isRequired
* @covers ::setRequired
*/
- public function testFieldRequired() {
+ public function testFieldRequired(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$this->assertFalse($definition->isRequired());
$definition->setRequired(TRUE);
@@ -315,7 +315,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
* @covers ::isStorageRequired
* @covers ::setStorageRequired
*/
- public function testFieldStorageRequired() {
+ public function testFieldStorageRequired(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$this->assertFalse($definition->isStorageRequired());
$definition->setStorageRequired(TRUE);
@@ -330,7 +330,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
* @covers ::getProvider
* @covers ::setProvider
*/
- public function testFieldProvider() {
+ public function testFieldProvider(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$provider = $this->randomMachineName();
$definition->setProvider($provider);
@@ -343,7 +343,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
* @covers ::hasCustomStorage
* @covers ::setCustomStorage
*/
- public function testCustomStorage() {
+ public function testCustomStorage(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$this->assertFalse($definition->hasCustomStorage());
$definition->setCustomStorage(TRUE);
@@ -357,7 +357,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
*
* @covers ::setDefaultValueCallback
*/
- public function testDefaultValueCallback() {
+ public function testDefaultValueCallback(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
$callback = static::class . '::mockDefaultValueCallback';
// setDefaultValueCallback returns $this.
@@ -369,7 +369,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
*
* @covers ::setDefaultValueCallback
*/
- public function testInvalidDefaultValueCallback() {
+ public function testInvalidDefaultValueCallback(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
// setDefaultValueCallback returns $this.
$this->expectException(\InvalidArgumentException::class);
@@ -381,7 +381,7 @@ class BaseFieldDefinitionTest extends UnitTestCase {
*
* @covers ::setDefaultValueCallback
*/
- public function testNullDefaultValueCallback() {
+ public function testNullDefaultValueCallback(): void {
$definition = BaseFieldDefinition::create($this->fieldType);
// setDefaultValueCallback returns $this.
$this->assertSame($definition, $definition->setDefaultValueCallback(NULL));
diff --git a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
index d5a79f8b8a5..785443b1f65 100644
--- a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
@@ -227,7 +227,7 @@ class ContentEntityBaseUnitTest extends UnitTestCase {
* @covers ::isNewRevision
* @covers ::setNewRevision
*/
- public function testIsNewRevision() {
+ public function testIsNewRevision(): void {
// Set up the entity type so that on the first call there is no revision key
// and on the second call there is one.
$this->entityType->expects($this->exactly(4))
@@ -262,7 +262,7 @@ class ContentEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::setNewRevision
*/
- public function testSetNewRevisionException() {
+ public function testSetNewRevisionException(): void {
$this->entityType->expects($this->once())
->method('hasKey')
->with('revision')
@@ -275,7 +275,7 @@ class ContentEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::isDefaultRevision
*/
- public function testIsDefaultRevision() {
+ public function testIsDefaultRevision(): void {
// The default value is TRUE.
$this->assertTrue($this->entity->isDefaultRevision());
// Change the default revision, verify that the old value is returned.
@@ -293,7 +293,7 @@ class ContentEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::getRevisionId
*/
- public function testGetRevisionId() {
+ public function testGetRevisionId(): void {
// The default getRevisionId() implementation returns NULL.
$this->assertNull($this->entity->getRevisionId());
}
@@ -301,7 +301,7 @@ class ContentEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::isTranslatable
*/
- public function testIsTranslatable() {
+ public function testIsTranslatable(): void {
$this->entityTypeBundleInfo->expects($this->any())
->method('getBundleInfo')
->with($this->entityTypeId)
@@ -325,7 +325,7 @@ class ContentEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::isTranslatable
*/
- public function testIsTranslatableForMonolingual() {
+ public function testIsTranslatableForMonolingual(): void {
$this->languageManager->expects($this->any())
->method('isMultilingual')
->willReturn(FALSE);
@@ -335,7 +335,7 @@ class ContentEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::preSaveRevision
*/
- public function testPreSaveRevision() {
+ public function testPreSaveRevision(): void {
// This method is internal, so check for errors on calling it only.
$storage = $this->createMock('\Drupal\Core\Entity\EntityStorageInterface');
$record = new \stdClass();
@@ -424,7 +424,7 @@ class ContentEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidate() {
+ public function testValidate(): void {
$validator = $this->createMock(ValidatorInterface::class);
/** @var \Symfony\Component\Validator\ConstraintViolationList $empty_violation_list */
$empty_violation_list = new ConstraintViolationList();
@@ -451,7 +451,7 @@ class ContentEntityBaseUnitTest extends UnitTestCase {
* @covers ::save
* @covers ::preSave
*/
- public function testRequiredValidation() {
+ public function testRequiredValidation(): void {
$validator = $this->createMock(ValidatorInterface::class);
/** @var \Symfony\Component\Validator\ConstraintViolationList $empty_violation_list */
$empty_violation_list = new ConstraintViolationList();
@@ -500,14 +500,14 @@ class ContentEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::bundle
*/
- public function testBundle() {
+ public function testBundle(): void {
$this->assertSame($this->bundle, $this->entity->bundle());
}
/**
* @covers ::access
*/
- public function testAccess() {
+ public function testAccess(): void {
$access = $this->createMock('\Drupal\Core\Entity\EntityAccessControlHandlerInterface');
$operation = $this->randomMachineName();
$access->expects($this->exactly(2))
@@ -550,7 +550,7 @@ class ContentEntityBaseUnitTest extends UnitTestCase {
* @covers ::get
* @dataProvider providerGet
*/
- public function testGet($expected, $field_name, $active_langcode, $fields) {
+ public function testGet($expected, $field_name, $active_langcode, $fields): void {
// Mock ContentEntityBase.
$mock_base = $this->getMockBuilder(ContentEntityBaseMockableClass::class)
->disableOriginalConstructor()
@@ -610,7 +610,7 @@ class ContentEntityBaseUnitTest extends UnitTestCase {
* @covers ::getFields
* @dataProvider providerGetFields
*/
- public function testGetFields($expected, $include_computed, $is_computed, $field_definitions) {
+ public function testGetFields($expected, $include_computed, $is_computed, $field_definitions): void {
// Mock ContentEntityBase.
$mock_base = $this->getMockBuilder(ContentEntityBaseMockableClass::class)
->disableOriginalConstructor()
@@ -660,7 +660,7 @@ class ContentEntityBaseUnitTest extends UnitTestCase {
/**
* @covers ::set
*/
- public function testSet() {
+ public function testSet(): void {
// Exercise set(), check if it returns $this
$this->assertSame(
$this->entity,
diff --git a/core/tests/Drupal/Tests/Core/Entity/Enhancer/EntityRouteEnhancerTest.php b/core/tests/Drupal/Tests/Core/Entity/Enhancer/EntityRouteEnhancerTest.php
index 5df0b8c7a6e..7f38aecf8da 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Enhancer/EntityRouteEnhancerTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Enhancer/EntityRouteEnhancerTest.php
@@ -21,7 +21,7 @@ class EntityRouteEnhancerTest extends UnitTestCase {
*
* @see \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer::enhancer()
*/
- public function testEnhancer() {
+ public function testEnhancer(): void {
$route_enhancer = new EntityRouteEnhancer();
// Set a controller to ensure it is not overridden.
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php
index c5028fc654c..f3cf79f5118 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php
@@ -43,7 +43,7 @@ class EntityAccessCheckTest extends UnitTestCase {
/**
* Tests the method for checking access to routes.
*/
- public function testAccess() {
+ public function testAccess(): void {
$route = new Route('/foo/{var_name}', [], ['_entity_access' => 'var_name.update'], ['parameters' => ['var_name' => ['type' => 'entity:node']]]);
/** @var \Drupal\Core\Session\AccountInterface $account */
$account = $this->prophesize(AccountInterface::class)->reveal();
@@ -66,7 +66,7 @@ class EntityAccessCheckTest extends UnitTestCase {
/**
* @covers ::access
*/
- public function testAccessWithTypePlaceholder() {
+ public function testAccessWithTypePlaceholder(): void {
$route = new Route('/foo/{entity_type}/{var_name}', [], ['_entity_access' => 'var_name.update'], ['parameters' => ['var_name' => ['type' => 'entity:{entity_type}']]]);
/** @var \Drupal\Core\Session\AccountInterface $account */
$account = $this->prophesize(AccountInterface::class)->reveal();
@@ -86,7 +86,7 @@ class EntityAccessCheckTest extends UnitTestCase {
/**
* @covers ::access
*/
- public function testAccessWithDifferentRouteParameters() {
+ public function testAccessWithDifferentRouteParameters(): void {
$route = new Route(
'/foo/{var_name}',
[],
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php
index 6aeda12d3d5..47de82b7100 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php
@@ -20,7 +20,7 @@ class EntityConstraintViolationListTest extends UnitTestCase {
/**
* @covers ::filterByFields
*/
- public function testFilterByFields() {
+ public function testFilterByFields(): void {
$account = $this->prophesize('\Drupal\Core\Session\AccountInterface')->reveal();
$entity = $this->setupEntity($account);
@@ -35,7 +35,7 @@ class EntityConstraintViolationListTest extends UnitTestCase {
/**
* @covers ::filterByFields
*/
- public function testFilterByFieldsWithCompositeConstraints() {
+ public function testFilterByFieldsWithCompositeConstraints(): void {
$account = $this->prophesize('\Drupal\Core\Session\AccountInterface')->reveal();
$entity = $this->setupEntity($account);
@@ -50,7 +50,7 @@ class EntityConstraintViolationListTest extends UnitTestCase {
/**
* @covers ::filterByFieldAccess
*/
- public function testFilterByFieldAccess() {
+ public function testFilterByFieldAccess(): void {
$account = $this->prophesize('\Drupal\Core\Session\AccountInterface')->reveal();
$entity = $this->setupEntity($account);
@@ -65,7 +65,7 @@ class EntityConstraintViolationListTest extends UnitTestCase {
/**
* @covers ::filterByFieldAccess
*/
- public function testFilterByFieldAccessWithCompositeConstraint() {
+ public function testFilterByFieldAccessWithCompositeConstraint(): void {
$account = $this->prophesize('\Drupal\Core\Session\AccountInterface')->reveal();
$entity = $this->setupEntity($account);
@@ -80,7 +80,7 @@ class EntityConstraintViolationListTest extends UnitTestCase {
/**
* @covers ::findByCodes
*/
- public function testFindByCodes() {
+ public function testFindByCodes(): void {
$account = $this->prophesize('\Drupal\Core\Session\AccountInterface')->reveal();
$entity = $this->setupEntity($account);
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php
index 66b4e94d0cd..f2868d22ab7 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php
@@ -70,7 +70,7 @@ class EntityCreateAccessCheckTest extends UnitTestCase {
*
* @dataProvider providerTestAccess
*/
- public function testAccess($entity_bundle, $requirement, $access, $expected, $expect_permission_context = TRUE) {
+ public function testAccess($entity_bundle, $requirement, $access, $expected, $expect_permission_context = TRUE): void {
// Set up the access result objects for allowing or denying access.
$access_result = $access ? AccessResult::allowed()->cachePerPermissions() : AccessResult::neutral()->cachePerPermissions();
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php
index 08c3823c0bb..8a56ad19a8a 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php
@@ -223,7 +223,7 @@ class EntityFieldManagerTest extends UnitTestCase {
* @covers ::getBaseFieldDefinitions
* @covers ::buildBaseFieldDefinitions
*/
- public function testGetBaseFieldDefinitions() {
+ public function testGetBaseFieldDefinitions(): void {
$field_definition = $this->setUpEntityWithFieldDefinition();
$expected = ['id' => $field_definition];
@@ -236,7 +236,7 @@ class EntityFieldManagerTest extends UnitTestCase {
* @covers ::getFieldDefinitions
* @covers ::buildBundleFieldDefinitions
*/
- public function testGetFieldDefinitions() {
+ public function testGetFieldDefinitions(): void {
$field_definition = $this->setUpEntityWithFieldDefinition();
$bundle_field_definition = $this->prophesize()
@@ -295,7 +295,7 @@ class EntityFieldManagerTest extends UnitTestCase {
* @covers ::getFieldStorageDefinitions
* @covers ::buildFieldStorageDefinitions
*/
- public function testGetFieldStorageDefinitions() {
+ public function testGetFieldStorageDefinitions(): void {
$field_definition = $this->setUpEntityWithFieldDefinition(TRUE);
$field_storage_definition = $this->prophesize(FieldStorageDefinitionInterface::class);
$field_storage_definition->getName()->willReturn('field_storage');
@@ -339,7 +339,7 @@ class EntityFieldManagerTest extends UnitTestCase {
*
* @dataProvider providerTestGetBaseFieldDefinitionsTranslatableEntityTypeDefaultLangcode
*/
- public function testGetBaseFieldDefinitionsTranslatableEntityTypeDefaultLangcode($default_langcode_key) {
+ public function testGetBaseFieldDefinitionsTranslatableEntityTypeDefaultLangcode($default_langcode_key): void {
$this->setUpEntityWithFieldDefinition(FALSE, 'id', ['langcode' => 'langcode', 'default_langcode' => $default_langcode_key]);
$field_definition = $this->prophesize()->willImplement(FieldDefinitionInterface::class)->willImplement(FieldStorageDefinitionInterface::class);
@@ -376,7 +376,7 @@ class EntityFieldManagerTest extends UnitTestCase {
*
* @dataProvider providerTestGetBaseFieldDefinitionsTranslatableEntityTypeLangcode
*/
- public function testGetBaseFieldDefinitionsTranslatableEntityTypeLangcode($provide_key, $provide_field, $translatable) {
+ public function testGetBaseFieldDefinitionsTranslatableEntityTypeLangcode($provide_key, $provide_field, $translatable): void {
$keys = $provide_key ? ['langcode' => 'langcode'] : [];
$this->setUpEntityWithFieldDefinition(FALSE, 'id', $keys);
@@ -418,7 +418,7 @@ class EntityFieldManagerTest extends UnitTestCase {
*
* @covers ::getBaseFieldDefinitions
*/
- public function testGetBaseFieldDefinitionsWithCaching() {
+ public function testGetBaseFieldDefinitionsWithCaching(): void {
$field_definition = $this->setUpEntityWithFieldDefinition();
$expected = ['id' => $field_definition];
@@ -446,7 +446,7 @@ class EntityFieldManagerTest extends UnitTestCase {
*
* @covers ::getFieldDefinitions
*/
- public function testGetFieldDefinitionsWithCaching() {
+ public function testGetFieldDefinitionsWithCaching(): void {
$field_definition = $this->setUpEntityWithFieldDefinition(FALSE, 'id');
$expected = ['id' => $field_definition];
@@ -477,7 +477,7 @@ class EntityFieldManagerTest extends UnitTestCase {
*
* @covers ::getFieldStorageDefinitions
*/
- public function testGetFieldStorageDefinitionsWithCaching() {
+ public function testGetFieldStorageDefinitionsWithCaching(): void {
$field_definition = $this->setUpEntityWithFieldDefinition(TRUE, 'id');
$field_storage_definition = $this->prophesize(FieldStorageDefinitionInterface::class);
$field_storage_definition->getName()->willReturn('field_storage');
@@ -526,7 +526,7 @@ class EntityFieldManagerTest extends UnitTestCase {
* @covers ::getBaseFieldDefinitions
* @covers ::buildBaseFieldDefinitions
*/
- public function testGetBaseFieldDefinitionsInvalidDefinition() {
+ public function testGetBaseFieldDefinitionsInvalidDefinition(): void {
$this->setUpEntityWithFieldDefinition(FALSE, 'langcode', ['langcode' => 'langcode']);
$this->entityType->isTranslatable()->willReturn(TRUE);
@@ -542,7 +542,7 @@ class EntityFieldManagerTest extends UnitTestCase {
* @covers ::getFieldDefinitions
* @covers ::buildBundleFieldDefinitions
*/
- public function testGetFieldDefinitionsProvider() {
+ public function testGetFieldDefinitionsProvider(): void {
$this->setUpEntityWithFieldDefinition(TRUE);
$module = 'entity_field_manager_test_module';
@@ -646,7 +646,7 @@ class EntityFieldManagerTest extends UnitTestCase {
*
* @covers ::clearCachedFieldDefinitions
*/
- public function testClearCachedFieldDefinitions() {
+ public function testClearCachedFieldDefinitions(): void {
$this->setUpEntityTypeDefinitions();
$this->cacheTagsInvalidator->invalidateTags(['entity_field_info'])->shouldBeCalled();
@@ -660,7 +660,7 @@ class EntityFieldManagerTest extends UnitTestCase {
/**
* @covers ::getExtraFields
*/
- public function testGetExtraFields() {
+ public function testGetExtraFields(): void {
$this->setUpEntityTypeDefinitions();
$entity_type_id = $this->randomMachineName();
@@ -701,7 +701,7 @@ class EntityFieldManagerTest extends UnitTestCase {
/**
* @covers ::getFieldMap
*/
- public function testGetFieldMap() {
+ public function testGetFieldMap(): void {
$this->entityTypeBundleInfo->getBundleInfo('test_entity_type')->willReturn([])->shouldBeCalled();
// Set up a content entity type.
@@ -777,7 +777,7 @@ class EntityFieldManagerTest extends UnitTestCase {
/**
* @covers ::getFieldMap
*/
- public function testGetFieldMapFromCache() {
+ public function testGetFieldMapFromCache(): void {
$expected = [
'test_entity_type' => [
'id' => [
@@ -801,7 +801,7 @@ class EntityFieldManagerTest extends UnitTestCase {
/**
* @covers ::getFieldMapByFieldType
*/
- public function testGetFieldMapByFieldType() {
+ public function testGetFieldMapByFieldType(): void {
// Set up a content entity type.
$entity_type = $this->prophesize(ContentEntityTypeInterface::class);
$entity_class = EntityTypeManagerTestEntity::class;
@@ -871,7 +871,7 @@ class TestEntityFieldManager extends EntityFieldManager {
/**
* Allows the static caches to be cleared.
*/
- public function testClearEntityFieldInfo() {
+ public function testClearEntityFieldInfo(): void {
$this->baseFieldDefinitions = [];
$this->fieldDefinitions = [];
$this->fieldStorageDefinitions = [];
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php
index aecf223435e..5709fc3b375 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityFormBuilderTest.php
@@ -50,7 +50,7 @@ class EntityFormBuilderTest extends UnitTestCase {
*
* @covers ::getForm
*/
- public function testGetForm() {
+ public function testGetForm(): void {
$form_controller = $this->createMock('Drupal\Core\Entity\EntityFormInterface');
$form_controller->expects($this->any())
->method('getFormId')
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php
index 8e30610eab4..b16345420dd 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php
@@ -51,7 +51,7 @@ class EntityFormTest extends UnitTestCase {
*
* @dataProvider providerTestFormIds
*/
- public function testFormId($expected, $definition) {
+ public function testFormId($expected, $definition): void {
$this->entityType->set('entity_keys', ['bundle' => $definition['bundle']]);
$entity = $this->getMockForAbstractClass('Drupal\Core\Entity\EntityBase', [[], $definition['entity_type']], '', TRUE, TRUE, TRUE, ['getEntityType', 'bundle']);
@@ -120,7 +120,7 @@ class EntityFormTest extends UnitTestCase {
/**
* @covers ::copyFormValuesToEntity
*/
- public function testCopyFormValuesToEntity() {
+ public function testCopyFormValuesToEntity(): void {
$entity_id = 'test_config_entity_id';
$values = ['id' => $entity_id];
$entity = $this->getMockBuilder('\Drupal\Tests\Core\Config\Entity\Fixtures\ConfigEntityBaseWithPluginCollections')
@@ -150,7 +150,7 @@ class EntityFormTest extends UnitTestCase {
*
* @covers ::getEntityFromRouteMatch
*/
- public function testGetEntityFromRouteMatchEditDelete() {
+ public function testGetEntityFromRouteMatchEditDelete(): void {
$entity = $this->prophesize(EntityInterface::class)->reveal();
$id = $this->entityType->id();
$route_match = new RouteMatch(
@@ -168,7 +168,7 @@ class EntityFormTest extends UnitTestCase {
*
* @covers ::getEntityFromRouteMatch
*/
- public function testGetEntityFromRouteMatchAdd() {
+ public function testGetEntityFromRouteMatchAdd(): void {
$entity = $this->prophesize(EntityInterface::class)->reveal();
$this->setUpStorage()->create([])->willReturn($entity);
$route_match = new RouteMatch('test_route', new Route('/entity-test/add'));
@@ -181,7 +181,7 @@ class EntityFormTest extends UnitTestCase {
*
* @covers ::getEntityFromRouteMatch
*/
- public function testGetEntityFromRouteMatchAddStatic() {
+ public function testGetEntityFromRouteMatchAddStatic(): void {
$entity = $this->prophesize(EntityInterface::class)->reveal();
$bundle_key = 'bundle';
$bundle = 'test_bundle';
@@ -211,7 +211,7 @@ class EntityFormTest extends UnitTestCase {
*
* @covers ::getEntityFromRouteMatch
*/
- public function testGetEntityFromRouteMatchAddEntity() {
+ public function testGetEntityFromRouteMatchAddEntity(): void {
$entity = $this->prophesize(EntityInterface::class)->reveal();
$bundle_entity_type_id = 'entity_test_bundle';
$bundle = 'test_entity_bundle';
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php
index 745e78cc07e..6e59c427088 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php
@@ -62,7 +62,7 @@ class EntityLinkTest extends UnitTestCase {
*
* @dataProvider providerTestLink
*/
- public function testToLink($entity_label, $link_text, $expected_text, $link_rel = 'canonical', array $link_options = []) {
+ public function testToLink($entity_label, $link_text, $expected_text, $link_rel = 'canonical', array $link_options = []): void {
$language = new Language(['id' => 'es']);
$link_options += ['language' => $language];
$this->languageManager->expects($this->any())
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php
index 4ab0e17c0ba..9a7531d5f2c 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php
@@ -95,7 +95,7 @@ class EntityListBuilderTest extends UnitTestCase {
/**
* @covers ::getOperations
*/
- public function testGetOperations() {
+ public function testGetOperations(): void {
$operation_name = $this->randomMachineName();
$operations = [
$operation_name => [
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityRepositoryTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityRepositoryTest.php
index 7048f2fbac7..d06cfa7335a 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityRepositoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityRepositoryTest.php
@@ -66,7 +66,7 @@ class EntityRepositoryTest extends UnitTestCase {
*
* @covers ::getTranslationFromContext
*/
- public function testGetTranslationFromContext() {
+ public function testGetTranslationFromContext(): void {
$language = new Language(['id' => 'en']);
$this->languageManager->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)
->willReturn($language)
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php
index f148e18af83..1c34d09d194 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php
@@ -72,7 +72,7 @@ class EntityResolverManagerTest extends UnitTestCase {
*
* @dataProvider providerTestSetRouteOptionsWithStandardRoute
*/
- public function testSetRouteOptionsWithStandardRoute($controller) {
+ public function testSetRouteOptionsWithStandardRoute($controller): void {
$route = new Route('/example', [
'_controller' => $controller,
]);
@@ -101,7 +101,7 @@ class EntityResolverManagerTest extends UnitTestCase {
*
* @dataProvider providerTestSetRouteOptionsWithStandardRouteWithArgument
*/
- public function testSetRouteOptionsWithStandardRouteWithArgument($controller) {
+ public function testSetRouteOptionsWithStandardRouteWithArgument($controller): void {
$route = new Route('/example/{argument}', [
'_controller' => $controller,
'argument' => 'test',
@@ -131,7 +131,7 @@ class EntityResolverManagerTest extends UnitTestCase {
*
* @dataProvider providerTestSetRouteOptionsWithContentController
*/
- public function testSetRouteOptionsWithContentController($controller) {
+ public function testSetRouteOptionsWithContentController($controller): void {
$route = new Route('/example/{argument}', [
'_controller' => $controller,
'argument' => 'test',
@@ -163,7 +163,7 @@ class EntityResolverManagerTest extends UnitTestCase {
*
* @dataProvider providerTestSetRouteOptionsWithEntityTypeNoUpcasting
*/
- public function testSetRouteOptionsWithEntityTypeNoUpcasting($controller) {
+ public function testSetRouteOptionsWithEntityTypeNoUpcasting($controller): void {
$this->setupEntityTypes();
$route = new Route('/example/{entity_test}', [
@@ -196,7 +196,7 @@ class EntityResolverManagerTest extends UnitTestCase {
*
* @dataProvider providerTestSetRouteOptionsWithEntityTypeUpcasting
*/
- public function testSetRouteOptionsWithEntityTypeUpcasting($controller) {
+ public function testSetRouteOptionsWithEntityTypeUpcasting($controller): void {
$this->setupEntityTypes();
$route = new Route('/example/{entity_test}', [
@@ -228,7 +228,7 @@ class EntityResolverManagerTest extends UnitTestCase {
* @covers ::getEntityTypes
* @covers ::setParametersFromReflection
*/
- public function testSetRouteOptionsWithEntityFormUpcasting() {
+ public function testSetRouteOptionsWithEntityFormUpcasting(): void {
$this->setupEntityTypes();
$route = new Route('/example/{entity_test}', [
@@ -250,7 +250,7 @@ class EntityResolverManagerTest extends UnitTestCase {
* @covers ::getEntityTypes
* @covers ::setParametersFromReflection
*/
- public function testSetRouteOptionsWithEntityUpcastingNoCreate() {
+ public function testSetRouteOptionsWithEntityUpcastingNoCreate(): void {
$this->setupEntityTypes();
$route = new Route('/example/{entity_test}', [
@@ -272,7 +272,7 @@ class EntityResolverManagerTest extends UnitTestCase {
* @covers ::getEntityTypes
* @covers ::setParametersFromReflection
*/
- public function testSetRouteOptionsWithEntityFormNoUpcasting() {
+ public function testSetRouteOptionsWithEntityFormNoUpcasting(): void {
$this->setupEntityTypes();
$route = new Route('/example/{entity_test}', [
@@ -294,7 +294,7 @@ class EntityResolverManagerTest extends UnitTestCase {
* @covers ::setParametersFromReflection
* @covers ::setParametersFromEntityInformation
*/
- public function testSetRouteOptionsWithEntityViewRouteAndManualParameters() {
+ public function testSetRouteOptionsWithEntityViewRouteAndManualParameters(): void {
$this->setupEntityTypes();
$route = new Route('/example/{foo}',
[
@@ -326,7 +326,7 @@ class EntityResolverManagerTest extends UnitTestCase {
* @covers ::setParametersFromReflection
* @covers ::setParametersFromEntityInformation
*/
- public function testSetRouteOptionsWithEntityViewRoute() {
+ public function testSetRouteOptionsWithEntityViewRoute(): void {
$this->setupEntityTypes();
$route = new Route('/example/{entity_test}', [
'_entity_view' => 'entity_test.view',
@@ -348,7 +348,7 @@ class EntityResolverManagerTest extends UnitTestCase {
* @covers ::setParametersFromReflection
* @covers ::setParametersFromEntityInformation
*/
- public function testSetRouteOptionsWithEntityListRoute() {
+ public function testSetRouteOptionsWithEntityListRoute(): void {
$this->setupEntityTypes();
$route = new Route('/example/{entity_test}', [
'_entity_list' => 'entity_test',
@@ -370,7 +370,7 @@ class EntityResolverManagerTest extends UnitTestCase {
* @covers ::setParametersFromReflection
* @covers ::setParametersFromEntityInformation
*/
- public function testSetRouteOptionsWithEntityFormRoute() {
+ public function testSetRouteOptionsWithEntityFormRoute(): void {
$this->setupEntityTypes();
$route = new Route('/example/{entity_test}', [
'_entity_form' => 'entity_test.edit',
@@ -395,7 +395,7 @@ class EntityResolverManagerTest extends UnitTestCase {
* @covers ::setParametersFromReflection
* @covers ::setParametersFromEntityInformation
*/
- public function testSetRouteOptionsWithEntityFormRouteAndArgument() {
+ public function testSetRouteOptionsWithEntityFormRouteAndArgument(): void {
$this->setupEntityTypes();
$route = new Route('/example/{argument}/{entity_test}', [
'_entity_form' => 'entity_test.edit',
@@ -424,7 +424,7 @@ class EntityResolverManagerTest extends UnitTestCase {
* @covers ::setParametersFromReflection
* @covers ::setParametersFromEntityInformation
*/
- public function testSetRouteOptionsWithEntityAddFormRoute() {
+ public function testSetRouteOptionsWithEntityAddFormRoute(): void {
$this->setupEntityTypes();
$route = new Route('/example/add', [
'_entity_form' => 'entity_test.add',
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeBundleInfoTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeBundleInfoTest.php
index 256a06e9448..55742942e03 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeBundleInfoTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeBundleInfoTest.php
@@ -145,7 +145,7 @@ class EntityTypeBundleInfoTest extends UnitTestCase {
*
* @covers ::clearCachedBundles
*/
- public function testClearCachedBundles() {
+ public function testClearCachedBundles(): void {
$this->setUpEntityTypeDefinitions();
$this->typedDataManager->clearCachedDefinitions()->shouldBeCalled();
@@ -162,7 +162,7 @@ class EntityTypeBundleInfoTest extends UnitTestCase {
*
* @dataProvider providerTestGetBundleInfo
*/
- public function testGetBundleInfo($entity_type_id, $expected) {
+ public function testGetBundleInfo($entity_type_id, $expected): void {
$this->moduleHandler->invokeAll('entity_bundle_info')->willReturn([]);
$this->moduleHandler->alter('entity_bundle_info', Argument::type('array'))->willReturn(NULL);
@@ -212,7 +212,7 @@ class EntityTypeBundleInfoTest extends UnitTestCase {
*
* @covers ::getAllBundleInfo
*/
- public function testGetAllBundleInfo() {
+ public function testGetAllBundleInfo(): void {
$this->moduleHandler->invokeAll('entity_bundle_info')->willReturn([]);
$this->moduleHandler->alter('entity_bundle_info', Argument::type('array'))->willReturn(NULL);
@@ -270,7 +270,7 @@ class EntityTypeBundleInfoTest extends UnitTestCase {
/**
* @covers ::getAllBundleInfo
*/
- public function testGetAllBundleInfoWithEntityBundleInfo() {
+ public function testGetAllBundleInfoWithEntityBundleInfo(): void {
// Ensure that EntityTypeBundleInfo::getAllBundleInfo() does not add
// additional bundles if hook_entity_bundle_info() defines some and the
// entity_type does not define a bundle entity type.
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php
index bf2ce4b160d..a3e5953ea58 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php
@@ -135,7 +135,7 @@ class EntityTypeManagerTest extends UnitTestCase {
*
* @dataProvider providerTestHasHandler
*/
- public function testHasHandler($entity_type_id, $expected) {
+ public function testHasHandler($entity_type_id, $expected): void {
$apple = $this->prophesize(EntityTypeInterface::class);
$apple->hasHandlerClass('storage')->willReturn(TRUE);
@@ -170,7 +170,7 @@ class EntityTypeManagerTest extends UnitTestCase {
*
* @covers ::getStorage
*/
- public function testGetStorage() {
+ public function testGetStorage(): void {
$class = $this->getTestHandlerClass();
$entity = $this->prophesize(EntityTypeInterface::class);
$entity->getHandlerClass('storage')->willReturn($class);
@@ -184,7 +184,7 @@ class EntityTypeManagerTest extends UnitTestCase {
*
* @covers ::getListBuilder
*/
- public function testGetListBuilder() {
+ public function testGetListBuilder(): void {
$class = $this->getTestHandlerClass();
$entity = $this->prophesize(EntityTypeInterface::class);
$entity->getHandlerClass('list_builder')->willReturn($class);
@@ -198,7 +198,7 @@ class EntityTypeManagerTest extends UnitTestCase {
*
* @covers ::getViewBuilder
*/
- public function testGetViewBuilder() {
+ public function testGetViewBuilder(): void {
$class = $this->getTestHandlerClass();
$entity = $this->prophesize(EntityTypeInterface::class);
$entity->getHandlerClass('view_builder')->willReturn($class);
@@ -212,7 +212,7 @@ class EntityTypeManagerTest extends UnitTestCase {
*
* @covers ::getAccessControlHandler
*/
- public function testGetAccessControlHandler() {
+ public function testGetAccessControlHandler(): void {
$class = $this->getTestHandlerClass();
$entity = $this->prophesize(EntityTypeInterface::class);
$entity->getHandlerClass('access')->willReturn($class);
@@ -226,7 +226,7 @@ class EntityTypeManagerTest extends UnitTestCase {
*
* @covers ::getFormObject
*/
- public function testGetFormObject() {
+ public function testGetFormObject(): void {
$apple = $this->prophesize(EntityTypeInterface::class);
$apple->getFormClass('default')->willReturn(TestEntityForm::class);
@@ -301,7 +301,7 @@ class EntityTypeManagerTest extends UnitTestCase {
*
* @covers ::getHandler
*/
- public function testGetHandler() {
+ public function testGetHandler(): void {
$class = get_class($this->getMockForAbstractClass(TestEntityHandlerBase::class));
$apple = $this->prophesize(EntityTypeInterface::class);
$apple->getHandlerClass('storage')->willReturn($class);
@@ -364,7 +364,7 @@ class EntityTypeManagerTest extends UnitTestCase {
/**
* @covers ::getRouteProviders
*/
- public function testGetRouteProviders() {
+ public function testGetRouteProviders(): void {
$apple = $this->prophesize(EntityTypeInterface::class);
$apple->getRouteProviderClasses()->willReturn(['default' => TestRouteProvider::class]);
@@ -383,7 +383,7 @@ class EntityTypeManagerTest extends UnitTestCase {
*
* @covers ::processDefinition
*/
- public function testProcessDefinition() {
+ public function testProcessDefinition(): void {
$apple = $this->prophesize(EntityTypeInterface::class);
$this->setUpEntityTypeDefinitions(['apple' => $apple]);
@@ -402,7 +402,7 @@ class EntityTypeManagerTest extends UnitTestCase {
*
* @dataProvider providerTestGetDefinition
*/
- public function testGetDefinition($entity_type_id, $expected) {
+ public function testGetDefinition($entity_type_id, $expected): void {
$entity = $this->prophesize(EntityTypeInterface::class);
$this->setUpEntityTypeDefinitions([
@@ -438,7 +438,7 @@ class EntityTypeManagerTest extends UnitTestCase {
*
* @covers ::getDefinition
*/
- public function testGetDefinitionInvalidException() {
+ public function testGetDefinitionInvalidException(): void {
$this->setUpEntityTypeDefinitions();
$this->expectException(PluginNotFoundException::class);
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeRepositoryTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeRepositoryTest.php
index 5afc6db038f..a5d46ebb761 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeRepositoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeRepositoryTest.php
@@ -97,7 +97,7 @@ class EntityTypeRepositoryTest extends UnitTestCase {
*
* @covers ::getEntityTypeLabels
*/
- public function testGetEntityTypeLabels() {
+ public function testGetEntityTypeLabels(): void {
$apple = $this->prophesize(EntityTypeInterface::class);
$apple->getLabel()->willReturn('Apple');
$apple->getBundleOf()->willReturn(NULL);
@@ -121,7 +121,7 @@ class EntityTypeRepositoryTest extends UnitTestCase {
/**
* @covers ::getEntityTypeFromClass
*/
- public function testGetEntityTypeFromClass() {
+ public function testGetEntityTypeFromClass(): void {
$apple = $this->prophesize(EntityTypeInterface::class);
$banana = $this->prophesize(EntityTypeInterface::class);
@@ -147,7 +147,7 @@ class EntityTypeRepositoryTest extends UnitTestCase {
/**
* @covers ::getEntityTypeFromClass
*/
- public function testGetEntityTypeFromClassNoMatch() {
+ public function testGetEntityTypeFromClassNoMatch(): void {
$apple = $this->prophesize(EntityTypeInterface::class);
$banana = $this->prophesize(EntityTypeInterface::class);
@@ -167,7 +167,7 @@ class EntityTypeRepositoryTest extends UnitTestCase {
/**
* @covers ::getEntityTypeFromClass
*/
- public function testGetEntityTypeFromClassAmbiguous() {
+ public function testGetEntityTypeFromClassAmbiguous(): void {
$jazz = $this->prophesize(EntityTypeInterface::class);
$jazz->getOriginalClass()->willReturn('\Drupal\apple\Entity\Apple');
$jazz->id()->willReturn('jazz');
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
index 071b5d41912..c70a98aded4 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
@@ -37,7 +37,7 @@ class EntityTypeTest extends UnitTestCase {
*
* @dataProvider providerTestGet
*/
- public function testGet(array $definition, $key, $expected) {
+ public function testGet(array $definition, $key, $expected): void {
$entity_type = $this->setUpEntityType($definition);
$this->assertSame($expected, $entity_type->get($key));
}
@@ -48,7 +48,7 @@ class EntityTypeTest extends UnitTestCase {
*
* @dataProvider providerTestSet
*/
- public function testSet($key, $value) {
+ public function testSet($key, $value): void {
$entity_type = $this->setUpEntityType([]);
$this->assertInstanceOf('Drupal\Core\Entity\EntityTypeInterface', $entity_type->set($key, $value));
$this->assertSame($value, $entity_type->get($key));
@@ -60,7 +60,7 @@ class EntityTypeTest extends UnitTestCase {
*
* @dataProvider providerTestGetKeys
*/
- public function testGetKeys($entity_keys, $expected) {
+ public function testGetKeys($entity_keys, $expected): void {
$entity_type = $this->setUpEntityType(['entity_keys' => $entity_keys]);
$expected += [
'default_langcode' => 'default_langcode',
@@ -74,7 +74,7 @@ class EntityTypeTest extends UnitTestCase {
*
* @dataProvider providerTestGetKeys
*/
- public function testGetKey($entity_keys, $expected) {
+ public function testGetKey($entity_keys, $expected): void {
$entity_type = $this->setUpEntityType(['entity_keys' => $entity_keys]);
$this->assertSame($expected['bundle'], $entity_type->getKey('bundle'));
$this->assertFalse($entity_type->getKey('bananas'));
@@ -85,7 +85,7 @@ class EntityTypeTest extends UnitTestCase {
*
* @dataProvider providerTestGetKeys
*/
- public function testHasKey($entity_keys, $expected) {
+ public function testHasKey($entity_keys, $expected): void {
$entity_type = $this->setUpEntityType(['entity_keys' => $entity_keys]);
$this->assertSame(!empty($expected['bundle']), $entity_type->hasKey('bundle'));
$this->assertSame(!empty($expected['id']), $entity_type->hasKey('id'));
@@ -134,7 +134,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* Tests the isInternal() method.
*/
- public function testIsInternal() {
+ public function testIsInternal(): void {
$entity_type = $this->setUpEntityType(['internal' => TRUE]);
$this->assertTrue($entity_type->isInternal());
$entity_type = $this->setUpEntityType(['internal' => FALSE]);
@@ -146,7 +146,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* Tests the isRevisionable() method.
*/
- public function testIsRevisionable() {
+ public function testIsRevisionable(): void {
$entity_type = $this->setUpEntityType(['entity_keys' => ['id' => 'id']]);
$this->assertFalse($entity_type->isRevisionable());
$entity_type = $this->setUpEntityType(['entity_keys' => ['id' => 'id', 'revision' => FALSE]]);
@@ -158,7 +158,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* Tests the getHandler() method.
*/
- public function testGetHandler() {
+ public function testGetHandler(): void {
$controller = $this->getTestHandlerClass();
$entity_type = $this->setUpEntityType([
'handlers' => [
@@ -177,7 +177,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* Tests the getStorageClass() method.
*/
- public function testGetStorageClass() {
+ public function testGetStorageClass(): void {
$controller = $this->getTestHandlerClass();
$entity_type = $this->setUpEntityType([
'handlers' => [
@@ -190,7 +190,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* Tests the setStorageClass() method.
*/
- public function testSetStorageClass() {
+ public function testSetStorageClass(): void {
$controller = $this->getTestHandlerClass();
$entity_type = $this->setUpEntityType([]);
$this->assertSame($entity_type, $entity_type->setStorageClass($controller));
@@ -199,7 +199,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* Tests the getListBuilderClass() method.
*/
- public function testGetListBuilderClass() {
+ public function testGetListBuilderClass(): void {
$controller = $this->getTestHandlerClass();
$entity_type = $this->setUpEntityType([
'handlers' => [
@@ -212,7 +212,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* Tests the getAccessControlClass() method.
*/
- public function testGetAccessControlClass() {
+ public function testGetAccessControlClass(): void {
$controller = $this->getTestHandlerClass();
$entity_type = $this->setUpEntityType([
'handlers' => [
@@ -225,7 +225,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* Tests the getFormClass() method.
*/
- public function testGetFormClass() {
+ public function testGetFormClass(): void {
$controller = $this->getTestHandlerClass();
$operation = 'default';
$entity_type = $this->setUpEntityType([
@@ -241,7 +241,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* Tests the hasFormClasses() method.
*/
- public function testHasFormClasses() {
+ public function testHasFormClasses(): void {
$controller = $this->getTestHandlerClass();
$operation = 'default';
$entity_type1 = $this->setUpEntityType([
@@ -261,7 +261,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* Tests the getViewBuilderClass() method.
*/
- public function testGetViewBuilderClass() {
+ public function testGetViewBuilderClass(): void {
$controller = $this->getTestHandlerClass();
$entity_type = $this->setUpEntityType([
'handlers' => [
@@ -274,7 +274,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* @covers ::__construct
*/
- public function testIdExceedsMaxLength() {
+ public function testIdExceedsMaxLength(): void {
$id = $this->randomMachineName(33);
$message = 'Attempt to create an entity type with an ID longer than 32 characters: ' . $id;
$this->expectException('Drupal\Core\Entity\Exception\EntityTypeIdLengthException');
@@ -285,7 +285,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* @covers ::getOriginalClass
*/
- public function testGetOriginalClassUnchanged() {
+ public function testGetOriginalClassUnchanged(): void {
$class = $this->randomMachineName();
$entity_type = $this->setUpEntityType(['class' => $class]);
$this->assertEquals($class, $entity_type->getOriginalClass());
@@ -295,7 +295,7 @@ class EntityTypeTest extends UnitTestCase {
* @covers ::setClass
* @covers ::getOriginalClass
*/
- public function testGetOriginalClassChanged() {
+ public function testGetOriginalClassChanged(): void {
$class = $this->randomMachineName();
$entity_type = $this->setUpEntityType(['class' => $class]);
$entity_type->setClass($this->randomMachineName());
@@ -305,7 +305,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* @covers ::id
*/
- public function testId() {
+ public function testId(): void {
$id = $this->randomMachineName(32);
$entity_type = $this->setUpEntityType(['id' => $id]);
$this->assertEquals($id, $entity_type->id());
@@ -314,7 +314,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* @covers ::getLabel
*/
- public function testGetLabel() {
+ public function testGetLabel(): void {
$translatable_label = new TranslatableMarkup($this->randomMachineName());
$entity_type = $this->setUpEntityType(['label' => $translatable_label]);
$this->assertSame($translatable_label, $entity_type->getLabel());
@@ -327,7 +327,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* @covers ::getGroupLabel
*/
- public function testGetGroupLabel() {
+ public function testGetGroupLabel(): void {
$translatable_group_label = new TranslatableMarkup($this->randomMachineName());
$entity_type = $this->setUpEntityType(['group_label' => $translatable_group_label]);
$this->assertSame($translatable_group_label, $entity_type->getGroupLabel());
@@ -344,7 +344,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* @covers ::getCollectionLabel
*/
- public function testGetCollectionLabel() {
+ public function testGetCollectionLabel(): void {
$translatable_label = new TranslatableMarkup('Entity test collection', [], [], $this->getStringTranslationStub());
$entity_type = $this->setUpEntityType(['label_collection' => $translatable_label]);
$entity_type->setStringTranslation($this->getStringTranslationStub());
@@ -354,7 +354,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* @covers ::getSingularLabel
*/
- public function testGetSingularLabel() {
+ public function testGetSingularLabel(): void {
$translatable_label = new TranslatableMarkup('entity test singular', [], [], $this->getStringTranslationStub());
$entity_type = $this->setUpEntityType(['label_singular' => $translatable_label]);
$entity_type->setStringTranslation($this->getStringTranslationStub());
@@ -364,7 +364,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* @covers ::getSingularLabel
*/
- public function testGetSingularLabelDefault() {
+ public function testGetSingularLabelDefault(): void {
$entity_type = $this->setUpEntityType(['label' => 'Entity test Singular']);
$entity_type->setStringTranslation($this->getStringTranslationStub());
$this->assertEquals('entity test singular', $entity_type->getSingularLabel());
@@ -373,7 +373,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* @covers ::getPluralLabel
*/
- public function testGetPluralLabel() {
+ public function testGetPluralLabel(): void {
$translatable_label = new TranslatableMarkup('entity test plural', [], [], $this->getStringTranslationStub());
$entity_type = $this->setUpEntityType(['label_plural' => $translatable_label]);
$entity_type->setStringTranslation($this->getStringTranslationStub());
@@ -383,7 +383,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* @covers ::getPluralLabel
*/
- public function testGetPluralLabelDefault() {
+ public function testGetPluralLabelDefault(): void {
$entity_type = $this->setUpEntityType(['label' => 'Entity test Plural']);
$entity_type->setStringTranslation($this->getStringTranslationStub());
$this->assertEquals('entity test plural entities', $entity_type->getPluralLabel());
@@ -392,7 +392,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* @covers ::getCountLabel
*/
- public function testGetCountLabel() {
+ public function testGetCountLabel(): void {
$entity_type = $this->setUpEntityType(['label_count' => ['singular' => 'one entity test', 'plural' => '@count entity test']]);
$entity_type->setStringTranslation($this->getStringTranslationStub());
$this->assertEquals('one entity test', $entity_type->getCountLabel(1));
@@ -409,7 +409,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* @covers ::getCountLabel
*/
- public function testGetCountLabelDefault() {
+ public function testGetCountLabelDefault(): void {
$entity_type = $this->setUpEntityType(['label' => 'Entity test Plural']);
$entity_type->setStringTranslation($this->getStringTranslationStub());
$this->assertEquals('1 entity test plural', $entity_type->getCountLabel(1));
@@ -424,7 +424,7 @@ class EntityTypeTest extends UnitTestCase {
* @covers ::getBundleLabel
* @dataProvider providerTestGetBundleLabel
*/
- public function testGetBundleLabel($definition, $expected) {
+ public function testGetBundleLabel($definition, $expected): void {
$entity_type = $this->setUpEntityType($definition);
$entity_type->setStringTranslation($this->getStringTranslationStub());
$this->assertEquals($expected, $entity_type->getBundleLabel());
@@ -453,7 +453,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* @covers ::setLinkTemplate
*/
- public function testSetLinkTemplateWithInvalidPath() {
+ public function testSetLinkTemplateWithInvalidPath(): void {
$entity_type = $this->setUpEntityType(['id' => $this->randomMachineName()]);
$this->expectException(\InvalidArgumentException::class);
$entity_type->setLinkTemplate('test', 'invalid-path');
@@ -466,7 +466,7 @@ class EntityTypeTest extends UnitTestCase {
* @covers ::setConstraints
* @covers ::addConstraint
*/
- public function testConstraintMethods() {
+ public function testConstraintMethods(): void {
$definition = [
'constraints' => [
'EntityChanged' => [],
@@ -496,7 +496,7 @@ class EntityTypeTest extends UnitTestCase {
/**
* @covers ::entityClassImplements
*/
- public function testEntityClassImplements() {
+ public function testEntityClassImplements(): void {
$entity_type = $this->setUpEntityType(['class' => EntityFormMode::class]);
$this->assertTrue($entity_type->entityClassImplements(ConfigEntityInterface::class));
$this->assertFalse($entity_type->entityClassImplements(\DateTimeInterface::class));
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php
index cfc633fa1d2..43816924d15 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php
@@ -133,14 +133,14 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::id
*/
- public function testId() {
+ public function testId(): void {
$this->assertSame($this->values['id'], $this->entity->id());
}
/**
* @covers ::uuid
*/
- public function testUuid() {
+ public function testUuid(): void {
$this->assertSame($this->values['uuid'], $this->entity->uuid());
}
@@ -148,7 +148,7 @@ class EntityUnitTest extends UnitTestCase {
* @covers ::isNew
* @covers ::enforceIsNew
*/
- public function testIsNew() {
+ public function testIsNew(): void {
// We provided an ID, so the entity is not new.
$this->assertFalse($this->entity->isNew());
// Force it to be new.
@@ -159,21 +159,21 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::getEntityType
*/
- public function testGetEntityType() {
+ public function testGetEntityType(): void {
$this->assertSame($this->entityType, $this->entity->getEntityType());
}
/**
* @covers ::bundle
*/
- public function testBundle() {
+ public function testBundle(): void {
$this->assertSame($this->entityTypeId, $this->entity->bundle());
}
/**
* @covers ::label
*/
- public function testLabel() {
+ public function testLabel(): void {
$property_label = $this->randomMachineName();
$this->entityType->expects($this->atLeastOnce())
->method('getKey')
@@ -198,7 +198,7 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::access
*/
- public function testAccess() {
+ public function testAccess(): void {
$access = $this->createMock('\Drupal\Core\Entity\EntityAccessControlHandlerInterface');
$operation = $this->randomMachineName();
$access->expects($this->once())
@@ -219,7 +219,7 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::language
*/
- public function testLanguage() {
+ public function testLanguage(): void {
$this->entityType->expects($this->any())
->method('getKey')
->willReturnMap([
@@ -253,7 +253,7 @@ class EntityUnitTest extends UnitTestCase {
*
* @covers ::load
*/
- public function testLoad() {
+ public function testLoad(): void {
$this->setupTestLoad();
$class_name = get_class($this->entity);
@@ -288,7 +288,7 @@ class EntityUnitTest extends UnitTestCase {
*
* @covers ::loadMultiple
*/
- public function testLoadMultiple() {
+ public function testLoadMultiple(): void {
$this->setupTestLoad();
$class_name = get_class($this->entity);
@@ -320,7 +320,7 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::create
*/
- public function testCreate() {
+ public function testCreate(): void {
$this->setupTestLoad();
$class_name = get_class($this->entity);
@@ -352,7 +352,7 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::save
*/
- public function testSave() {
+ public function testSave(): void {
$storage = $this->createMock('\Drupal\Core\Entity\EntityStorageInterface');
$storage->expects($this->once())
->method('save')
@@ -369,7 +369,7 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::delete
*/
- public function testDelete() {
+ public function testDelete(): void {
$this->entity->id = $this->randomMachineName();
$storage = $this->createMock('\Drupal\Core\Entity\EntityStorageInterface');
// Testing the argument of the delete() method consumes too much memory.
@@ -387,14 +387,14 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::getEntityTypeId
*/
- public function testGetEntityTypeId() {
+ public function testGetEntityTypeId(): void {
$this->assertSame($this->entityTypeId, $this->entity->getEntityTypeId());
}
/**
* @covers ::preSave
*/
- public function testPreSave() {
+ public function testPreSave(): void {
// This method is internal, so check for errors on calling it only.
$storage = $this->createMock('\Drupal\Core\Entity\EntityStorageInterface');
// Our mocked entity->preSave() returns NULL, so assert that.
@@ -404,7 +404,7 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::postSave
*/
- public function testPostSave() {
+ public function testPostSave(): void {
// This method is internal, so check for errors on calling it only.
$storage = $this->createMock('\Drupal\Core\Entity\EntityStorageInterface');
@@ -426,7 +426,7 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::postSave
*/
- public function testPostSaveBundle() {
+ public function testPostSaveBundle(): void {
$this->entityType->expects($this->atLeastOnce())
->method('hasKey')
->with('bundle')
@@ -456,7 +456,7 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::preCreate
*/
- public function testPreCreate() {
+ public function testPreCreate(): void {
// This method is internal, so check for errors on calling it only.
$storage = $this->createMock('\Drupal\Core\Entity\EntityStorageInterface');
$values = [];
@@ -467,7 +467,7 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::postCreate
*/
- public function testPostCreate() {
+ public function testPostCreate(): void {
// This method is internal, so check for errors on calling it only.
$storage = $this->createMock('\Drupal\Core\Entity\EntityStorageInterface');
// Our mocked entity->postCreate() returns NULL, so assert that.
@@ -477,7 +477,7 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::preDelete
*/
- public function testPreDelete() {
+ public function testPreDelete(): void {
// This method is internal, so check for errors on calling it only.
$storage = $this->createMock('\Drupal\Core\Entity\EntityStorageInterface');
// Our mocked entity->preDelete() returns NULL, so assert that.
@@ -487,7 +487,7 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::postDelete
*/
- public function testPostDelete() {
+ public function testPostDelete(): void {
$storage = $this->createMock('\Drupal\Core\Entity\EntityStorageInterface');
$storage->expects($this->once())
->method('getEntityType')
@@ -505,7 +505,7 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::postDelete
*/
- public function testPostDeleteBundle() {
+ public function testPostDeleteBundle(): void {
$this->entityType->expects($this->atLeastOnce())
->method('hasKey')
->with('bundle')
@@ -530,7 +530,7 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::postLoad
*/
- public function testPostLoad() {
+ public function testPostLoad(): void {
// This method is internal, so check for errors on calling it only.
$storage = $this->createMock('\Drupal\Core\Entity\EntityStorageInterface');
$entities = [$this->entity];
@@ -541,7 +541,7 @@ class EntityUnitTest extends UnitTestCase {
/**
* @covers ::referencedEntities
*/
- public function testReferencedEntities() {
+ public function testReferencedEntities(): void {
$this->assertSame([], $this->entity->referencedEntities());
}
@@ -550,7 +550,7 @@ class EntityUnitTest extends UnitTestCase {
* @covers ::getCacheTagsToInvalidate
* @covers ::addCacheTags
*/
- public function testCacheTags() {
+ public function testCacheTags(): void {
// Ensure that both methods return the same by default.
$this->assertEqualsCanonicalizing([$this->entityTypeId . ':' . 1], $this->entity->getCacheTags());
$this->assertEqualsCanonicalizing([$this->entityTypeId . ':' . 1], $this->entity->getCacheTagsToInvalidate());
@@ -570,7 +570,7 @@ class EntityUnitTest extends UnitTestCase {
* @covers ::getCacheContexts
* @covers ::addCacheContexts
*/
- public function testCacheContexts() {
+ public function testCacheContexts(): void {
$cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
->disableOriginalConstructor()
->getMock();
@@ -592,7 +592,7 @@ class EntityUnitTest extends UnitTestCase {
* @covers ::getCacheMaxAge
* @covers ::mergeCacheMaxAge
*/
- public function testCacheMaxAge() {
+ public function testCacheMaxAge(): void {
// Cache max age is permanent by default.
$this->assertEquals(Cache::PERMANENT, $this->entity->getCacheMaxAge());
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
index d9278aea237..378efcbb593 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
@@ -95,7 +95,7 @@ class EntityUrlTest extends UnitTestCase {
*
* @covers ::toUrl
*/
- public function testToUrlNoId() {
+ public function testToUrlNoId(): void {
$entity = $this->getEntity(UrlTestEntity::class, []);
$this->expectException(EntityMalformedException::class);
@@ -166,7 +166,7 @@ class EntityUrlTest extends UnitTestCase {
* @covers ::linkTemplates
* @covers ::urlRouteParameters
*/
- public function testToUrlLinkTemplates($link_template, $expected_route_name) {
+ public function testToUrlLinkTemplates($link_template, $expected_route_name): void {
$values = ['id' => static::ENTITY_ID, 'langcode' => $this->langcode];
$entity = $this->getEntity(UrlTestEntity::class, $values);
$this->registerLinkTemplate($link_template);
@@ -264,7 +264,7 @@ class EntityUrlTest extends UnitTestCase {
* @covers ::linkTemplates
* @covers ::urlRouteParameters
*/
- public function testToUrlLinkTemplateNoId($link_template, $expected_route_name) {
+ public function testToUrlLinkTemplateNoId($link_template, $expected_route_name): void {
$entity = $this->getEntity(UrlTestEntity::class, ['id' => static::ENTITY_ID]);
$this->registerLinkTemplate($link_template);
@@ -354,7 +354,7 @@ class EntityUrlTest extends UnitTestCase {
* @covers ::toUrl
* @covers ::linkTemplates
*/
- public function testToUrlUriCallbackUndefined(array $bundle_info, $uri_callback) {
+ public function testToUrlUriCallbackUndefined(array $bundle_info, $uri_callback): void {
$entity = $this->getEntity(UrlTestEntity::class, ['id' => static::ENTITY_ID]);
$this->registerBundleInfo($bundle_info);
@@ -432,7 +432,7 @@ class EntityUrlTest extends UnitTestCase {
*
* @covers ::uriRelationships
*/
- public function testUriRelationships() {
+ public function testUriRelationships(): void {
$entity = $this->getEntity(UrlTestEntity::class, ['id' => static::ENTITY_ID]);
$container_builder = new ContainerBuilder();
diff --git a/core/tests/Drupal/Tests/Core/Entity/FieldDefinitionTest.php b/core/tests/Drupal/Tests/Core/Entity/FieldDefinitionTest.php
index ea7f1f36b70..0ba944f287c 100644
--- a/core/tests/Drupal/Tests/Core/Entity/FieldDefinitionTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/FieldDefinitionTest.php
@@ -102,7 +102,7 @@ class FieldDefinitionTest extends UnitTestCase {
* @covers ::getName
* @dataProvider factoryTypeProvider
*/
- public function testFieldName($factory_name) {
+ public function testFieldName($factory_name): void {
$definition = $this->initializeFieldUsingFactory($factory_name);
$this->assertEquals($this->storageDefinition->getName(), $definition->getName());
}
@@ -111,7 +111,7 @@ class FieldDefinitionTest extends UnitTestCase {
* @covers ::getLabel
* @dataProvider factoryTypeProvider
*/
- public function testFieldLabel($factory_name) {
+ public function testFieldLabel($factory_name): void {
$definition = $this->initializeFieldUsingFactory($factory_name);
$label = $this->randomMachineName();
$definition->setLabel($label);
@@ -123,7 +123,7 @@ class FieldDefinitionTest extends UnitTestCase {
* @covers ::getTargetBundle
* @dataProvider factoryTypeProvider
*/
- public function testBundle($factory_name) {
+ public function testBundle($factory_name): void {
$definition = $this->initializeFieldUsingFactory($factory_name);
$bundle = $this->randomMachineName();
$definition->setTargetBundle($bundle);
@@ -134,7 +134,7 @@ class FieldDefinitionTest extends UnitTestCase {
* @covers ::getDescription
* @dataProvider factoryTypeProvider
*/
- public function testFieldDescription($factory_name) {
+ public function testFieldDescription($factory_name): void {
$definition = $this->initializeFieldUsingFactory($factory_name);
$description = $this->randomMachineName();
$definition->setDescription($description);
@@ -145,7 +145,7 @@ class FieldDefinitionTest extends UnitTestCase {
* @covers ::getType
* @dataProvider factoryTypeProvider
*/
- public function testFieldType($factory_name) {
+ public function testFieldType($factory_name): void {
$definition = $this->initializeFieldUsingFactory($factory_name);
$this->assertEquals($this->fieldType, $definition->getType());
}
@@ -156,7 +156,7 @@ class FieldDefinitionTest extends UnitTestCase {
* @covers ::getSettings
* @dataProvider factoryTypeProvider
*/
- public function testFieldSettings($factory_name) {
+ public function testFieldSettings($factory_name): void {
$definition = $this->initializeFieldUsingFactory($factory_name);
$setting = $this->randomMachineName();
$value = $this->randomMachineName();
@@ -172,7 +172,7 @@ class FieldDefinitionTest extends UnitTestCase {
* @covers ::getSettings
* @dataProvider factoryTypeProvider
*/
- public function testDefaultFieldSettings($factory_name) {
+ public function testDefaultFieldSettings($factory_name): void {
$definition = $this->initializeFieldUsingFactory($factory_name);
$expected_settings = $this->fieldTypeDefinition['field_settings'] + $this->fieldTypeDefinition['storage_settings'];
$this->assertEquals($expected_settings, $definition->getSettings());
@@ -186,7 +186,7 @@ class FieldDefinitionTest extends UnitTestCase {
* @covers ::setDefaultValue
* @dataProvider factoryTypeProvider
*/
- public function testFieldDefaultValue($factory_name) {
+ public function testFieldDefaultValue($factory_name): void {
$definition = $this->initializeFieldUsingFactory($factory_name);
$this->assertEquals([], $definition->getDefaultValueLiteral());
@@ -236,7 +236,7 @@ class FieldDefinitionTest extends UnitTestCase {
* @covers ::setTranslatable
* @dataProvider factoryTypeProvider
*/
- public function testFieldTranslatable($factory_name) {
+ public function testFieldTranslatable($factory_name): void {
$definition = $this->initializeFieldUsingFactory($factory_name);
$this->assertFalse($definition->isTranslatable());
$definition->setTranslatable(TRUE);
@@ -257,7 +257,7 @@ class FieldDefinitionTest extends UnitTestCase {
* @covers ::setRequired
* @dataProvider factoryTypeProvider
*/
- public function testFieldRequired($factory_name) {
+ public function testFieldRequired($factory_name): void {
$definition = $this->initializeFieldUsingFactory($factory_name);
$this->assertFalse($definition->isRequired());
$definition->setRequired(TRUE);
@@ -272,7 +272,7 @@ class FieldDefinitionTest extends UnitTestCase {
* @covers ::setDefaultValueCallback
* @dataProvider factoryTypeProvider
*/
- public function testDefaultValueCallback($factory_name) {
+ public function testDefaultValueCallback($factory_name): void {
$definition = $this->initializeFieldUsingFactory($factory_name);
$callback = static::class . '::mockDefaultValueCallback';
// setDefaultValueCallback returns $this.
@@ -286,7 +286,7 @@ class FieldDefinitionTest extends UnitTestCase {
* @covers ::setDefaultValueCallback
* @dataProvider factoryTypeProvider
*/
- public function testInvalidDefaultValueCallback($factory_name) {
+ public function testInvalidDefaultValueCallback($factory_name): void {
$definition = $this->initializeFieldUsingFactory($factory_name);
// setDefaultValueCallback returns $this.
$this->expectException(\InvalidArgumentException::class);
@@ -299,7 +299,7 @@ class FieldDefinitionTest extends UnitTestCase {
* @covers ::setDefaultValueCallback
* @dataProvider factoryTypeProvider
*/
- public function testNullDefaultValueCallback($factory_name) {
+ public function testNullDefaultValueCallback($factory_name): void {
$definition = $this->initializeFieldUsingFactory($factory_name);
// setDefaultValueCallback returns $this.
$this->assertSame($definition, $definition->setDefaultValueCallback(NULL));
@@ -313,7 +313,7 @@ class FieldDefinitionTest extends UnitTestCase {
* @covers ::getDisplayOptions
* @dataProvider factoryTypeProvider
*/
- public function testDisplayConfigurationSettings($factory_name) {
+ public function testDisplayConfigurationSettings($factory_name): void {
$definition = $this->initializeFieldUsingFactory($factory_name);
$this->assertEquals(FALSE, $definition->isDisplayConfigurable('foo'));
$this->assertEquals(NULL, $definition->getDisplayOptions('foo'));
diff --git a/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
index 0a25eabc845..d7c944852d2 100644
--- a/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
@@ -153,7 +153,7 @@ class KeyValueEntityStorageTest extends UnitTestCase {
* @covers ::create
* @covers ::doCreate
*/
- public function testCreateWithPredefinedUuid() {
+ public function testCreateWithPredefinedUuid(): void {
$this->entityType->expects($this->once())
->method('getClass')
->willReturn(get_class($this->getMockEntity()));
@@ -178,7 +178,7 @@ class KeyValueEntityStorageTest extends UnitTestCase {
* @covers ::create
* @covers ::doCreate
*/
- public function testCreateWithoutUuidKey() {
+ public function testCreateWithoutUuidKey(): void {
// Set up the entity storage to expect no UUID key.
$this->entityType->expects($this->once())
->method('getClass')
@@ -358,7 +358,7 @@ class KeyValueEntityStorageTest extends UnitTestCase {
*
* @depends testSaveConfigEntity
*/
- public function testSaveRenameConfigEntity(ConfigEntityInterface $entity) {
+ public function testSaveRenameConfigEntity(ConfigEntityInterface $entity): void {
$this->entityType->expects($this->once())
->method('getClass')
->willReturn(get_class($entity));
@@ -397,7 +397,7 @@ class KeyValueEntityStorageTest extends UnitTestCase {
* @covers ::save
* @covers ::doSave
*/
- public function testSaveContentEntity() {
+ public function testSaveContentEntity(): void {
$this->entityType->expects($this->any())
->method('getKeys')
->willReturn([
@@ -432,7 +432,7 @@ class KeyValueEntityStorageTest extends UnitTestCase {
* @covers ::save
* @covers ::doSave
*/
- public function testSaveInvalid() {
+ public function testSaveInvalid(): void {
$this->setUpKeyValueEntityStorage();
$entity = $this->getMockEntity('Drupal\Core\Config\Entity\ConfigEntityBase');
@@ -451,7 +451,7 @@ class KeyValueEntityStorageTest extends UnitTestCase {
* @covers ::save
* @covers ::doSave
*/
- public function testSaveDuplicate() {
+ public function testSaveDuplicate(): void {
$this->setUpKeyValueEntityStorage();
$entity = $this->getMockEntity(EntityBaseTest::class, [['id' => 'foo']]);
@@ -472,7 +472,7 @@ class KeyValueEntityStorageTest extends UnitTestCase {
* @covers ::load
* @covers ::postLoad
*/
- public function testLoad() {
+ public function testLoad(): void {
$entity = $this->getMockEntity();
$this->entityType->expects($this->once())
->method('getClass')
@@ -491,7 +491,7 @@ class KeyValueEntityStorageTest extends UnitTestCase {
/**
* @covers ::load
*/
- public function testLoadMissingEntity() {
+ public function testLoadMissingEntity(): void {
$this->setUpKeyValueEntityStorage();
$this->keyValueStore->expects($this->once())
@@ -508,7 +508,7 @@ class KeyValueEntityStorageTest extends UnitTestCase {
* @covers ::mapFromStorageRecords
* @covers ::doLoadMultiple
*/
- public function testLoadMultipleAll() {
+ public function testLoadMultipleAll(): void {
$expected['foo'] = $this->getMockEntity(EntityBaseTest::class, [['id' => 'foo']]);
$expected['bar'] = $this->getMockEntity(EntityBaseTest::class, [['id' => 'bar']]);
$this->entityType->expects($this->once())
@@ -533,7 +533,7 @@ class KeyValueEntityStorageTest extends UnitTestCase {
* @covers ::mapFromStorageRecords
* @covers ::doLoadMultiple
*/
- public function testLoadMultipleIds() {
+ public function testLoadMultipleIds(): void {
$entity = $this->getMockEntity(EntityBaseTest::class, [['id' => 'foo']]);
$this->entityType->expects($this->once())
->method('getClass')
@@ -556,7 +556,7 @@ class KeyValueEntityStorageTest extends UnitTestCase {
* @covers ::delete
* @covers ::doDelete
*/
- public function testDelete() {
+ public function testDelete(): void {
$entities['foo'] = $this->getMockEntity(EntityBaseTest::class, [['id' => 'foo']]);
$entities['bar'] = $this->getMockEntity(EntityBaseTest::class, [['id' => 'bar']]);
$this->setUpKeyValueEntityStorage();
@@ -587,7 +587,7 @@ class KeyValueEntityStorageTest extends UnitTestCase {
* @covers ::delete
* @covers ::doDelete
*/
- public function testDeleteNothing() {
+ public function testDeleteNothing(): void {
$this->setUpKeyValueEntityStorage();
$this->moduleHandler->expects($this->never())
diff --git a/core/tests/Drupal/Tests/Core/Entity/Query/Sql/QueryTest.php b/core/tests/Drupal/Tests/Core/Entity/Query/Sql/QueryTest.php
index fcaa9b6a0a7..0c721ac908d 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Query/Sql/QueryTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Query/Sql/QueryTest.php
@@ -49,7 +49,7 @@ class QueryTest extends UnitTestCase {
*
* @covers ::prepare
*/
- public function testNoBaseTable() {
+ public function testNoBaseTable(): void {
$this->expectException(QueryException::class);
$this->expectExceptionMessage('No base table for example_entity_query, invalid query.');
$this->query->execute();
@@ -60,7 +60,7 @@ class QueryTest extends UnitTestCase {
*
* @covers ::prepare
*/
- public function testNoRevisionTable() {
+ public function testNoRevisionTable(): void {
$this->expectException(QueryException::class);
$this->expectExceptionMessage('No revision table for example_entity_query, invalid query.');
$this->query->allRevisions()->execute();
diff --git a/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php b/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php
index db044f7e35d..c66e726693d 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php
@@ -61,7 +61,7 @@ class DefaultHtmlRouteProviderTest extends UnitTestCase {
* @covers ::getAddPageRoute
* @dataProvider providerTestGetAddPageRoute
*/
- public function testGetAddPageRoute(?Route $expected, EntityTypeInterface $entity_type) {
+ public function testGetAddPageRoute(?Route $expected, EntityTypeInterface $entity_type): void {
$route = $this->routeProvider->getAddPageRoute($entity_type);
$this->assertEquals($expected, $route);
}
@@ -99,7 +99,7 @@ class DefaultHtmlRouteProviderTest extends UnitTestCase {
* @covers ::getAddFormRoute
* @dataProvider providerTestGetAddFormRoute
*/
- public function testGetAddFormRoute(?Route $expected, EntityTypeInterface $entity_type, ?EntityTypeInterface $bundle_entity_type = NULL, ?FieldStorageDefinitionInterface $field_storage_definition = NULL) {
+ public function testGetAddFormRoute(?Route $expected, EntityTypeInterface $entity_type, ?EntityTypeInterface $bundle_entity_type = NULL, ?FieldStorageDefinitionInterface $field_storage_definition = NULL): void {
if ($bundle_entity_type) {
$this->entityTypeManager->getDefinition('the_bundle_entity_type_id')->willReturn($bundle_entity_type);
@@ -200,7 +200,7 @@ class DefaultHtmlRouteProviderTest extends UnitTestCase {
* @covers ::getCanonicalRoute
* @dataProvider providerTestGetCanonicalRoute
*/
- public function testGetCanonicalRoute(?Route $expected, EntityTypeInterface $entity_type, ?FieldStorageDefinitionInterface $field_storage_definition = NULL) {
+ public function testGetCanonicalRoute(?Route $expected, EntityTypeInterface $entity_type, ?FieldStorageDefinitionInterface $field_storage_definition = NULL): void {
if ($field_storage_definition) {
$this->entityFieldManager->getFieldStorageDefinitions($entity_type->id())
->willReturn([$entity_type->getKey('id') => $field_storage_definition]);
@@ -260,7 +260,7 @@ class DefaultHtmlRouteProviderTest extends UnitTestCase {
* @covers ::getCollectionRoute
* @dataProvider providerTestGetCollectionRoute
*/
- public function testGetCollectionRoute(?Route $expected, EntityTypeInterface $entity_type) {
+ public function testGetCollectionRoute(?Route $expected, EntityTypeInterface $entity_type): void {
$route = $this->routeProvider->getCollectionRoute($entity_type);
$this->assertEquals($expected, $route);
}
@@ -352,7 +352,7 @@ class DefaultHtmlRouteProviderTest extends UnitTestCase {
/**
* @covers ::getEntityTypeIdKeyType
*/
- public function testGetEntityTypeIdKeyType() {
+ public function testGetEntityTypeIdKeyType(): void {
$entity_type = $this->prophesize(EntityTypeInterface::class);
$entity_type->entityClassImplements(FieldableEntityInterface::class)->willReturn(TRUE);
$entity_type->id()->willReturn('the_entity_type_id');
@@ -369,7 +369,7 @@ class DefaultHtmlRouteProviderTest extends UnitTestCase {
/**
* @covers ::getEntityTypeIdKeyType
*/
- public function testGetEntityTypeIdKeyTypeNotFieldable() {
+ public function testGetEntityTypeIdKeyTypeNotFieldable(): void {
$entity_type = $this->prophesize(EntityTypeInterface::class);
$entity_type->entityClassImplements(FieldableEntityInterface::class)->willReturn(FALSE);
$this->entityFieldManager->getFieldStorageDefinitions(Argument::any())->shouldNotBeCalled();
diff --git a/core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php b/core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php
index 7351ae89439..4d468847ac8 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Sql/DefaultTableMappingTest.php
@@ -39,7 +39,7 @@ class DefaultTableMappingTest extends UnitTestCase {
*
* @covers ::getTableNames
*/
- public function testGetTableNames() {
+ public function testGetTableNames(): void {
// The storage definitions are only used in getColumnNames() so we do not
// need to provide any here.
$table_mapping = new TestDefaultTableMapping($this->entityType, []);
@@ -70,7 +70,7 @@ class DefaultTableMappingTest extends UnitTestCase {
* @covers ::getExtraColumns
* @covers ::setExtraColumns
*/
- public function testGetAllColumns() {
+ public function testGetAllColumns(): void {
// Set up single-column and multi-column definitions.
$definitions['id'] = $this->setUpDefinition('id', ['value']);
$definitions['name'] = $this->setUpDefinition('name', ['value']);
@@ -176,7 +176,7 @@ class DefaultTableMappingTest extends UnitTestCase {
* @covers ::getFieldNames
* @covers ::setFieldNames
*/
- public function testGetFieldNames() {
+ public function testGetFieldNames(): void {
// The storage definitions are only used in getColumnNames() so we do not
// need to provide any here.
$table_mapping = new TestDefaultTableMapping($this->entityType, []);
@@ -206,7 +206,7 @@ class DefaultTableMappingTest extends UnitTestCase {
* @covers ::__construct
* @covers ::getColumnNames
*/
- public function testGetColumnNames() {
+ public function testGetColumnNames(): void {
$definitions['test'] = $this->setUpDefinition('test', []);
$table_mapping = new TestDefaultTableMapping($this->entityType, $definitions);
$expected = [];
@@ -238,7 +238,7 @@ class DefaultTableMappingTest extends UnitTestCase {
* @covers ::getExtraColumns
* @covers ::setExtraColumns
*/
- public function testGetExtraColumns() {
+ public function testGetExtraColumns(): void {
// The storage definitions are only used in getColumnNames() so we do not
// need to provide any here.
$table_mapping = new TestDefaultTableMapping($this->entityType, []);
@@ -279,7 +279,7 @@ class DefaultTableMappingTest extends UnitTestCase {
*
* @dataProvider providerTestGetFieldColumnName
*/
- public function testGetFieldColumnName($base_field, $columns, $column, $expected) {
+ public function testGetFieldColumnName($base_field, $columns, $column, $expected): void {
$definitions['test'] = $this->setUpDefinition('test', $columns, $base_field);
$table_mapping = new TestDefaultTableMapping($this->entityType, $definitions);
$result = $table_mapping->getFieldColumnName($definitions['test'], $column);
@@ -301,7 +301,7 @@ class DefaultTableMappingTest extends UnitTestCase {
*
* @dataProvider providerTestGetFieldColumnName
*/
- public function testGetFieldColumnNameInvalid($base_field, $columns, $column) {
+ public function testGetFieldColumnNameInvalid($base_field, $columns, $column): void {
$definitions['test'] = $this->setUpDefinition('test', $columns, $base_field);
// Mark field storage definition as custom storage.
@@ -355,7 +355,7 @@ class DefaultTableMappingTest extends UnitTestCase {
*
* @dataProvider providerTestGetFieldTableName
*/
- public function testGetFieldTableName($table_names, $expected) {
+ public function testGetFieldTableName($table_names, $expected): void {
$field_name = 'test';
$columns = ['test'];
@@ -444,7 +444,7 @@ class DefaultTableMappingTest extends UnitTestCase {
*
* @covers ::getFieldTableName
*/
- public function testGetFieldTableNameInvalid() {
+ public function testGetFieldTableNameInvalid(): void {
$table_mapping = new TestDefaultTableMapping($this->entityType, []);
$this->expectException(SqlContentEntityStorageException::class);
$this->expectExceptionMessage("Table information not available for the 'invalid_field_name' field.");
@@ -457,7 +457,7 @@ class DefaultTableMappingTest extends UnitTestCase {
*
* @dataProvider providerTestGetDedicatedTableName
*/
- public function testGetDedicatedTableName($info, $expected_data_table, $expected_revision_table) {
+ public function testGetDedicatedTableName($info, $expected_data_table, $expected_revision_table): void {
$entity_type_id = $info['entity_type_id'];
$field_name = $info['field_name'];
diff --git a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
index 5a20b34b6c4..e37afd82ab2 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
@@ -117,7 +117,7 @@ class SqlContentEntityStorageSchemaTest extends UnitTestCase {
* @covers ::getFieldSchemaData
* @covers ::processIdentifierSchema
*/
- public function testGetSchemaBase() {
+ public function testGetSchemaBase(): void {
$this->entityType = new ContentEntityType([
'id' => 'entity_test',
'entity_keys' => ['id' => 'id'],
@@ -410,7 +410,7 @@ class SqlContentEntityStorageSchemaTest extends UnitTestCase {
* @covers ::getEntityIndexName
* @covers ::processIdentifierSchema
*/
- public function testGetSchemaRevisionable() {
+ public function testGetSchemaRevisionable(): void {
$this->entityType = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityType')
->setConstructorArgs([
[
@@ -514,7 +514,7 @@ class SqlContentEntityStorageSchemaTest extends UnitTestCase {
* @covers ::getEntityIndexName
* @covers ::processDataTable
*/
- public function testGetSchemaTranslatable() {
+ public function testGetSchemaTranslatable(): void {
$this->entityType = new ContentEntityType([
'id' => 'entity_test',
'entity_keys' => [
@@ -626,7 +626,7 @@ class SqlContentEntityStorageSchemaTest extends UnitTestCase {
* @covers ::initializeRevisionDataTable
* @covers ::processRevisionDataTable
*/
- public function testGetSchemaRevisionableTranslatable() {
+ public function testGetSchemaRevisionableTranslatable(): void {
$this->entityType = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityType')
->setConstructorArgs([
[
@@ -838,7 +838,7 @@ class SqlContentEntityStorageSchemaTest extends UnitTestCase {
* @covers ::getDedicatedTableSchema
* @covers ::createDedicatedTableSchema
*/
- public function testDedicatedTableSchema() {
+ public function testDedicatedTableSchema(): void {
$entity_type_id = 'entity_test';
$this->entityType = new ContentEntityType([
'id' => 'entity_test',
@@ -1015,7 +1015,7 @@ class SqlContentEntityStorageSchemaTest extends UnitTestCase {
* @covers ::getDedicatedTableSchema
* @covers ::createDedicatedTableSchema
*/
- public function testDedicatedTableSchemaForEntityWithStringIdentifier() {
+ public function testDedicatedTableSchemaForEntityWithStringIdentifier(): void {
$entity_type_id = 'entity_test';
$this->entityType = new ContentEntityType([
'id' => 'entity_test',
@@ -1453,7 +1453,7 @@ class SqlContentEntityStorageSchemaTest extends UnitTestCase {
/**
* ::onEntityTypeUpdate.
*/
- public function testonEntityTypeUpdateWithNewIndex() {
+ public function testonEntityTypeUpdateWithNewIndex(): void {
$this->entityType = $original_entity_type = new ContentEntityType([
'id' => 'entity_test',
'entity_keys' => ['id' => 'id'],
@@ -1554,7 +1554,7 @@ class SqlContentEntityStorageSchemaTest extends UnitTestCase {
* @dataProvider providerSchemaCastValue
* @covers ::castValue
*/
- public function testCastValue($expected, $value, array $schema) {
+ public function testCastValue($expected, $value, array $schema): void {
$this->assertSame($expected, SqlContentEntityStorageSchema::castValue($schema, $value));
}
diff --git a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
index 998795a9500..e27a27dbed7 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
@@ -155,7 +155,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
*
* @dataProvider providerTestGetBaseTable
*/
- public function testGetBaseTable($base_table, $expected) {
+ public function testGetBaseTable($base_table, $expected): void {
$this->entityType->expects($this->once())
->method('getBaseTable')
->willReturn($base_table);
@@ -197,7 +197,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
*
* @dataProvider providerTestGetRevisionTable
*/
- public function testGetRevisionTable($revision_table, $expected) {
+ public function testGetRevisionTable($revision_table, $expected): void {
$this->entityType->expects($this->any())
->method('isRevisionable')
->willReturn(TRUE);
@@ -238,7 +238,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
* @covers ::__construct
* @covers ::getDataTable
*/
- public function testGetDataTable() {
+ public function testGetDataTable(): void {
$this->entityType->expects($this->any())
->method('isTranslatable')
->willReturn(TRUE);
@@ -268,7 +268,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
*
* @dataProvider providerTestGetRevisionDataTable
*/
- public function testGetRevisionDataTable($revision_data_table, $expected) {
+ public function testGetRevisionDataTable($revision_data_table, $expected): void {
$this->entityType->expects($this->any())
->method('isRevisionable')
->willReturn(TRUE);
@@ -315,7 +315,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
*
* @covers ::setTableMapping
*/
- public function testSetTableMapping() {
+ public function testSetTableMapping(): void {
$this->entityType->expects($this->any())
->method('isRevisionable')
->willReturn(FALSE);
@@ -362,7 +362,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
* @covers ::onEntityTypeCreate
* @covers ::getTableMapping
*/
- public function testOnEntityTypeCreate() {
+ public function testOnEntityTypeCreate(): void {
$columns = [
'value' => [
'type' => 'int',
@@ -456,7 +456,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
* @covers ::__construct
* @covers ::getTableMapping
*/
- public function testGetTableMappingEmpty() {
+ public function testGetTableMappingEmpty(): void {
$this->setUpEntityStorage();
$mapping = $this->entityStorage->getTableMapping();
@@ -476,7 +476,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
*
* @dataProvider providerTestGetTableMappingSimple
*/
- public function testGetTableMappingSimple(array $entity_keys) {
+ public function testGetTableMappingSimple(array $entity_keys): void {
$this->entityType->expects($this->any())
->method('getKey')
->willReturnMap([
@@ -508,7 +508,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
*
* @dataProvider providerTestGetTableMappingSimple
*/
- public function testGetTableMappingSimpleWithFields(array $entity_keys) {
+ public function testGetTableMappingSimpleWithFields(array $entity_keys): void {
$base_field_names = ['title', 'description', 'owner'];
$field_names = array_merge(array_values(array_filter($entity_keys)), $base_field_names);
$this->fieldDefinitions = $this->mockFieldDefinitions($field_names);
@@ -542,7 +542,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
* @covers ::__construct
* @covers ::getTableMapping
*/
- public function testGetTableMappingSimpleWithDedicatedStorageFields() {
+ public function testGetTableMappingSimpleWithDedicatedStorageFields(): void {
$base_field_names = ['multi_valued_base_field'];
// Set up one entity key in order to have a base table.
@@ -583,7 +583,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
*
* @dataProvider providerTestGetTableMappingSimple
*/
- public function testGetTableMappingRevisionable(array $entity_keys) {
+ public function testGetTableMappingRevisionable(array $entity_keys): void {
// This allows to re-use the data provider.
$entity_keys = [
'id' => $entity_keys['id'],
@@ -634,7 +634,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
*
* @dataProvider providerTestGetTableMappingSimple
*/
- public function testGetTableMappingRevisionableWithFields(array $entity_keys) {
+ public function testGetTableMappingRevisionableWithFields(array $entity_keys): void {
// This allows to re-use the data provider.
$entity_keys = [
'id' => $entity_keys['id'],
@@ -712,7 +712,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
*
* @dataProvider providerTestGetTableMappingSimple
*/
- public function testGetTableMappingTranslatable(array $entity_keys) {
+ public function testGetTableMappingTranslatable(array $entity_keys): void {
// This allows to re-use the data provider.
$entity_keys['langcode'] = 'langcode';
@@ -768,7 +768,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
*
* @dataProvider providerTestGetTableMappingSimple
*/
- public function testGetTableMappingTranslatableWithFields(array $entity_keys) {
+ public function testGetTableMappingTranslatableWithFields(array $entity_keys): void {
// This allows to re-use the data provider.
$entity_keys['langcode'] = 'langcode';
@@ -828,7 +828,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
*
* @dataProvider providerTestGetTableMappingSimple
*/
- public function testGetTableMappingRevisionableTranslatable(array $entity_keys) {
+ public function testGetTableMappingRevisionableTranslatable(array $entity_keys): void {
// This allows to re-use the data provider.
$entity_keys = [
'id' => $entity_keys['id'],
@@ -939,7 +939,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
*
* @dataProvider providerTestGetTableMappingSimple
*/
- public function testGetTableMappingRevisionableTranslatableWithFields(array $entity_keys) {
+ public function testGetTableMappingRevisionableTranslatableWithFields(array $entity_keys): void {
// This allows to re-use the data provider.
$entity_keys = [
'id' => $entity_keys['id'],
@@ -1064,7 +1064,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
/**
* @covers ::create
*/
- public function testCreate() {
+ public function testCreate(): void {
$language_manager = $this->createMock('Drupal\Core\Language\LanguageManagerInterface');
$language = new Language(['id' => 'en']);
@@ -1186,7 +1186,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
* @covers ::buildCacheId
* @covers ::getFromPersistentCache
*/
- public function testLoadMultiplePersistentCached() {
+ public function testLoadMultiplePersistentCached(): void {
$this->setUpModuleHandlerNoImplementations();
$key = 'values:' . $this->entityTypeId . ':1';
@@ -1222,7 +1222,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
* @covers ::getFromPersistentCache
* @covers ::setPersistentCache
*/
- public function testLoadMultipleNoPersistentCache() {
+ public function testLoadMultipleNoPersistentCache(): void {
$this->setUpModuleHandlerNoImplementations();
$id = 1;
@@ -1273,7 +1273,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
* @covers ::getFromPersistentCache
* @covers ::setPersistentCache
*/
- public function testLoadMultiplePersistentCacheMiss() {
+ public function testLoadMultiplePersistentCacheMiss(): void {
$this->setUpModuleHandlerNoImplementations();
$id = 1;
@@ -1330,7 +1330,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
/**
* @covers ::hasData
*/
- public function testHasData() {
+ public function testHasData(): void {
$query = $this->createMock('Drupal\Core\Entity\Query\QueryInterface');
$query->expects(($this->once()))
->method('accessCheck')
@@ -1382,7 +1382,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
/**
* Tests entity ID sanitization.
*/
- public function testCleanIds() {
+ public function testCleanIds(): void {
$valid_ids = [
-1,
0,
diff --git a/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php
index c3ec63df95e..e921327e0be 100644
--- a/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php
@@ -226,42 +226,42 @@ class EntityAdapterUnitTest extends UnitTestCase {
/**
* @covers ::getConstraints
*/
- public function testGetConstraints() {
+ public function testGetConstraints(): void {
$this->assertIsArray($this->entityAdapter->getConstraints());
}
/**
* @covers ::getName
*/
- public function testGetName() {
+ public function testGetName(): void {
$this->assertNull($this->entityAdapter->getName());
}
/**
* @covers ::getRoot
*/
- public function testGetRoot() {
+ public function testGetRoot(): void {
$this->assertSame(spl_object_hash($this->entityAdapter), spl_object_hash($this->entityAdapter->getRoot()));
}
/**
* @covers ::getPropertyPath
*/
- public function testGetPropertyPath() {
+ public function testGetPropertyPath(): void {
$this->assertSame('', $this->entityAdapter->getPropertyPath());
}
/**
* @covers ::getParent
*/
- public function testGetParent() {
+ public function testGetParent(): void {
$this->assertNull($this->entityAdapter->getParent());
}
/**
* @covers ::setContext
*/
- public function testSetContext() {
+ public function testSetContext(): void {
$name = $this->randomMachineName();
$parent = $this->createMock('\Drupal\Core\TypedData\TraversableTypedDataInterface');
// Our mocked entity->setContext() returns NULL, so assert that.
@@ -273,21 +273,21 @@ class EntityAdapterUnitTest extends UnitTestCase {
/**
* @covers ::getValue
*/
- public function testGetValue() {
+ public function testGetValue(): void {
$this->assertEquals($this->entity, $this->entityAdapter->getValue());
}
/**
* @covers ::getEntity
*/
- public function testGetEntity() {
+ public function testGetEntity(): void {
$this->assertSame($this->entity, $this->entityAdapter->getEntity());
}
/**
* @covers ::setValue
*/
- public function testSetValue() {
+ public function testSetValue(): void {
$this->entityAdapter->setValue(NULL);
$this->assertNull($this->entityAdapter->getValue());
}
@@ -295,14 +295,14 @@ class EntityAdapterUnitTest extends UnitTestCase {
/**
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
$this->assertInstanceOf('\Drupal\Core\Field\FieldItemListInterface', $this->entityAdapter->get('id'));
}
/**
* @covers ::get
*/
- public function testGetInvalidField() {
+ public function testGetInvalidField(): void {
$this->expectException(\InvalidArgumentException::class);
$this->entityAdapter->get('invalid');
}
@@ -310,7 +310,7 @@ class EntityAdapterUnitTest extends UnitTestCase {
/**
* @covers ::get
*/
- public function testGetWithoutData() {
+ public function testGetWithoutData(): void {
$this->entityAdapter->setValue(NULL);
$this->expectException(MissingDataException::class);
$this->entityAdapter->get('id');
@@ -319,7 +319,7 @@ class EntityAdapterUnitTest extends UnitTestCase {
/**
* @covers ::set
*/
- public function testSet() {
+ public function testSet(): void {
$id_items = [['value' => $this->id + 1]];
$this->fieldItemList->expects($this->once())
@@ -332,7 +332,7 @@ class EntityAdapterUnitTest extends UnitTestCase {
/**
* @covers ::set
*/
- public function testSetWithoutData() {
+ public function testSetWithoutData(): void {
$this->entityAdapter->setValue(NULL);
$id_items = [['value' => $this->id + 1]];
$this->expectException(MissingDataException::class);
@@ -342,7 +342,7 @@ class EntityAdapterUnitTest extends UnitTestCase {
/**
* @covers ::getProperties
*/
- public function testGetProperties() {
+ public function testGetProperties(): void {
$fields = $this->entityAdapter->getProperties();
$this->assertInstanceOf('Drupal\Core\Field\FieldItemListInterface', $fields['id']);
$this->assertInstanceOf('Drupal\Core\Field\FieldItemListInterface', $fields['revision_id']);
@@ -351,7 +351,7 @@ class EntityAdapterUnitTest extends UnitTestCase {
/**
* @covers ::toArray
*/
- public function testToArray() {
+ public function testToArray(): void {
$array = $this->entityAdapter->toArray();
// Mock field objects return NULL values, so test keys only.
$this->assertArrayHasKey('id', $array);
@@ -362,7 +362,7 @@ class EntityAdapterUnitTest extends UnitTestCase {
/**
* @covers ::toArray
*/
- public function testToArrayWithoutData() {
+ public function testToArrayWithoutData(): void {
$this->entityAdapter->setValue(NULL);
$this->expectException(MissingDataException::class);
$this->entityAdapter->toArray();
@@ -371,7 +371,7 @@ class EntityAdapterUnitTest extends UnitTestCase {
/**
* @covers ::isEmpty
*/
- public function testIsEmpty() {
+ public function testIsEmpty(): void {
$this->assertFalse($this->entityAdapter->isEmpty());
$this->entityAdapter->setValue(NULL);
$this->assertTrue($this->entityAdapter->isEmpty());
@@ -380,7 +380,7 @@ class EntityAdapterUnitTest extends UnitTestCase {
/**
* @covers ::onChange
*/
- public function testOnChange() {
+ public function testOnChange(): void {
$entity = $this->createMock('\Drupal\Core\Entity\ContentEntityInterface');
$entity->expects($this->once())
->method('onChange')
@@ -393,7 +393,7 @@ class EntityAdapterUnitTest extends UnitTestCase {
/**
* @covers ::getDataDefinition
*/
- public function testGetDataDefinition() {
+ public function testGetDataDefinition(): void {
$definition = $this->entityAdapter->getDataDefinition();
$this->assertInstanceOf('\Drupal\Core\Entity\TypedData\EntityDataDefinitionInterface', $definition);
$this->assertEquals($definition->getEntityTypeId(), $this->entityTypeId);
@@ -403,7 +403,7 @@ class EntityAdapterUnitTest extends UnitTestCase {
/**
* @covers ::getString
*/
- public function testGetString() {
+ public function testGetString(): void {
$entity = $this->createMock('\Drupal\Core\Entity\ContentEntityInterface');
$entity->expects($this->once())
->method('label')
@@ -417,7 +417,7 @@ class EntityAdapterUnitTest extends UnitTestCase {
/**
* @covers ::applyDefaultValue
*/
- public function testApplyDefaultValue() {
+ public function testApplyDefaultValue(): void {
// For each field on the entity the mock method has to be invoked once.
$this->fieldItemList->expects($this->exactly(2))
->method('applyDefaultValue');
@@ -427,7 +427,7 @@ class EntityAdapterUnitTest extends UnitTestCase {
/**
* @covers ::getIterator
*/
- public function testGetIterator() {
+ public function testGetIterator(): void {
// Content entity test.
$iterator = $this->entityAdapter->getIterator();
$fields = iterator_to_array($iterator);
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php
index e25dd83077c..cdd08cfbf43 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php
@@ -401,7 +401,7 @@ class ActiveLinkResponseFilterTest extends UnitTestCase {
* @dataProvider providerTestSetLinkActiveClass
* @covers ::setLinkActiveClass
*/
- public function testSetLinkActiveClass($html_markup, $current_path, $is_front, $url_language, array $query, $expected_html_markup) {
+ public function testSetLinkActiveClass($html_markup, $current_path, $is_front, $url_language, array $query, $expected_html_markup): void {
$this->assertSame($expected_html_markup, ActiveLinkResponseFilter::setLinkActiveClass($html_markup, $current_path, $is_front, $url_language, $query));
}
@@ -410,7 +410,7 @@ class ActiveLinkResponseFilterTest extends UnitTestCase {
*
* @covers ::onResponse
*/
- public function testOnlyHtml() {
+ public function testOnlyHtml(): void {
$session = new AnonymousUserSession();
$language_manager = new LanguageManager(new LanguageDefault([]));
$request_stack = new RequestStack();
@@ -449,7 +449,7 @@ class ActiveLinkResponseFilterTest extends UnitTestCase {
*
* @covers ::onResponse
*/
- public function testSkipCertainResponseTypes() {
+ public function testSkipCertainResponseTypes(): void {
$session = new AnonymousUserSession();
$language_manager = new LanguageManager(new LanguageDefault([]));
$request_stack = new RequestStack();
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php
index 50cbfb2e147..1560d467141 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/CustomPageExceptionHtmlSubscriberTest.php
@@ -130,7 +130,7 @@ class CustomPageExceptionHtmlSubscriberTest extends UnitTestCase {
/**
* Tests onHandleException with a POST request.
*/
- public function testHandleWithPostRequest() {
+ public function testHandleWithPostRequest(): void {
$request = Request::create('/test', 'POST', ['name' => 'druplicon', 'pass' => '12345']);
$request_context = new RequestContext();
@@ -156,7 +156,7 @@ class CustomPageExceptionHtmlSubscriberTest extends UnitTestCase {
/**
* Tests onHandleException with a GET request.
*/
- public function testHandleWithGetRequest() {
+ public function testHandleWithGetRequest(): void {
$request = Request::create('/test', 'GET', ['name' => 'druplicon', 'pass' => '12345']);
$request->attributes->set(AccessAwareRouterInterface::ACCESS_RESULT, AccessResult::forbidden()->addCacheTags(['druplicon']));
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/ExceptionJsonSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/ExceptionJsonSubscriberTest.php
index db86952b950..12a1e02d97d 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/ExceptionJsonSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/ExceptionJsonSubscriberTest.php
@@ -26,7 +26,7 @@ class ExceptionJsonSubscriberTest extends UnitTestCase {
* @covers ::on4xx
* @dataProvider providerTestOn4xx
*/
- public function testOn4xx(HttpExceptionInterface $exception, $expected_response_class) {
+ public function testOn4xx(HttpExceptionInterface $exception, $expected_response_class): void {
$kernel = $this->prophesize(HttpKernelInterface::class);
$request = Request::create('/test');
$event = new ExceptionEvent($kernel->reveal(), $request, HttpKernelInterface::MAIN_REQUEST, $exception);
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/FinalExceptionSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/FinalExceptionSubscriberTest.php
index 5ed6330240d..b871ebedeac 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/FinalExceptionSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/FinalExceptionSubscriberTest.php
@@ -21,7 +21,7 @@ class FinalExceptionSubscriberTest extends UnitTestCase {
/**
* @covers ::onException
*/
- public function testOnExceptionWithUnknownFormat() {
+ public function testOnExceptionWithUnknownFormat(): void {
$config_factory = $this->getConfigFactoryStub();
$kernel = $this->prophesize(HttpKernelInterface::class);
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/FinishResponseSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/FinishResponseSubscriberTest.php
index bcab1e7c65e..9c927c4da3d 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/FinishResponseSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/FinishResponseSubscriberTest.php
@@ -82,7 +82,7 @@ class FinishResponseSubscriberTest extends UnitTestCase {
*
* @covers ::onRespond
*/
- public function testDefaultHeaders() {
+ public function testDefaultHeaders(): void {
$finishSubscriber = new FinishResponseSubscriber(
$this->languageManager,
$this->getConfigFactoryStub(),
@@ -113,7 +113,7 @@ class FinishResponseSubscriberTest extends UnitTestCase {
*
* @covers ::onRespond
*/
- public function testExistingHeaders() {
+ public function testExistingHeaders(): void {
$finishSubscriber = new FinishResponseSubscriber(
$this->languageManager,
$this->getConfigFactoryStub(),
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php
index 6b9b68be9b7..008a1b2008e 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php
@@ -54,7 +54,7 @@ class ModuleRouteSubscriberTest extends UnitTestCase {
* @param bool $removed
* Whether or not the route is expected to be removed from the collection.
*/
- public function testRemoveRoute($route_name, array $requirements, $removed) {
+ public function testRemoveRoute($route_name, array $requirements, $removed): void {
$collection = new RouteCollection();
$route = new Route('', [], $requirements);
$collection->add($route_name, $route);
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/OptionsRequestSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/OptionsRequestSubscriberTest.php
index 23d8fcd1878..9aa556a63da 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/OptionsRequestSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/OptionsRequestSubscriberTest.php
@@ -22,7 +22,7 @@ class OptionsRequestSubscriberTest extends UnitTestCase {
/**
* @covers ::onRequest
*/
- public function testWithNonOptionRequest() {
+ public function testWithNonOptionRequest(): void {
$kernel = $this->prophesize(HttpKernelInterface::class);
$request = Request::create('/example', 'GET');
@@ -39,7 +39,7 @@ class OptionsRequestSubscriberTest extends UnitTestCase {
/**
* @covers ::onRequest
*/
- public function testWithoutMatchingRoutes() {
+ public function testWithoutMatchingRoutes(): void {
$kernel = $this->prophesize(HttpKernelInterface::class);
$request = Request::create('/example', 'OPTIONS');
@@ -57,7 +57,7 @@ class OptionsRequestSubscriberTest extends UnitTestCase {
* @covers ::onRequest
* @dataProvider providerTestOnRequestWithOptionsRequest
*/
- public function testWithOptionsRequest(RouteCollection $collection, $expected_header) {
+ public function testWithOptionsRequest(RouteCollection $collection, $expected_header): void {
$kernel = $this->prophesize(HttpKernelInterface::class);
$request = Request::create('/example', 'OPTIONS');
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/PathRootsSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/PathRootsSubscriberTest.php
index 705de806814..75c73a7ef14 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/PathRootsSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/PathRootsSubscriberTest.php
@@ -46,7 +46,7 @@ class PathRootsSubscriberTest extends UnitTestCase {
* @covers ::onRouteAlter
* @covers ::onRouteFinished
*/
- public function testSubscribing() {
+ public function testSubscribing(): void {
// Ensure that onRouteFinished can be called without throwing notices
// when no path roots got set.
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php
index e8fbd62b3f8..de743a1bdc2 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php
@@ -55,7 +55,7 @@ class PsrResponseSubscriberTest extends UnitTestCase {
*
* @covers ::onKernelView
*/
- public function testConvertsControllerResult() {
+ public function testConvertsControllerResult(): void {
$event = $this->createEvent($this->createMock('Psr\Http\Message\ResponseInterface'));
$this->psrResponseSubscriber->onKernelView($event);
$this->assertInstanceOf(Response::class, $event->getResponse());
@@ -66,7 +66,7 @@ class PsrResponseSubscriberTest extends UnitTestCase {
*
* @covers ::onKernelView
*/
- public function testDoesNotConvertControllerResult() {
+ public function testDoesNotConvertControllerResult(): void {
$event = $this->createEvent([]);
$this->psrResponseSubscriber->onKernelView($event);
$this->assertNull($event->getResponse());
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php
index c567bc03980..92049c11098 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php
@@ -86,7 +86,7 @@ class RedirectResponseSubscriberTest extends UnitTestCase {
* @covers ::checkRedirectUrl
* @dataProvider providerTestDestinationRedirect
*/
- public function testDestinationRedirect(Request $request, $expected) {
+ public function testDestinationRedirect(Request $request, $expected): void {
$dispatcher = new EventDispatcher();
$kernel = $this->createMock('Symfony\Component\HttpKernel\HttpKernelInterface');
$response = new RedirectResponse('http://example.com/drupal');
@@ -127,7 +127,7 @@ class RedirectResponseSubscriberTest extends UnitTestCase {
/**
* @dataProvider providerTestDestinationRedirectToExternalUrl
*/
- public function testDestinationRedirectToExternalUrl($request, $expected) {
+ public function testDestinationRedirectToExternalUrl($request, $expected): void {
$dispatcher = new EventDispatcher();
$kernel = $this->createMock('Symfony\Component\HttpKernel\HttpKernelInterface');
$response = new RedirectResponse('http://other-example.com');
@@ -142,7 +142,7 @@ class RedirectResponseSubscriberTest extends UnitTestCase {
/**
* @covers ::checkRedirectUrl
*/
- public function testRedirectWithOptInExternalUrl() {
+ public function testRedirectWithOptInExternalUrl(): void {
$dispatcher = new EventDispatcher();
$kernel = $this->createMock('Symfony\Component\HttpKernel\HttpKernelInterface');
$response = new TrustedRedirectResponse('http://external-url.com');
@@ -175,7 +175,7 @@ class RedirectResponseSubscriberTest extends UnitTestCase {
/**
* @dataProvider providerTestDestinationRedirectWithInvalidUrl
*/
- public function testDestinationRedirectWithInvalidUrl(Request $request) {
+ public function testDestinationRedirectWithInvalidUrl(Request $request): void {
$dispatcher = new EventDispatcher();
$kernel = $this->createMock('Symfony\Component\HttpKernel\HttpKernelInterface');
$response = new RedirectResponse('http://example.com/drupal');
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php
index debe1fa9daf..b4727398e9a 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php
@@ -114,7 +114,7 @@ RSS;
* @param string $expected_content
* The expected content from the response.
*/
- public function testOnResponse($content, $expected_content) {
+ public function testOnResponse($content, $expected_content): void {
$event = new ResponseEvent(
$this->prophesize(HttpKernelInterface::class)->reveal(),
Request::create('/'),
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php
index 1317ad61af2..eda539762b2 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php
@@ -76,7 +76,7 @@ class SpecialAttributesRouteSubscriberTest extends UnitTestCase {
*
* @covers ::onAlterRoutes
*/
- public function testOnRouteBuildingValidVariables(Route $route) {
+ public function testOnRouteBuildingValidVariables(Route $route): void {
$route_collection = new RouteCollection();
$route_collection->add('test', $route);
@@ -94,7 +94,7 @@ class SpecialAttributesRouteSubscriberTest extends UnitTestCase {
* @dataProvider providerTestOnRouteBuildingInvalidVariables
* @covers ::onAlterRoutes
*/
- public function testOnRouteBuildingInvalidVariables(Route $route) {
+ public function testOnRouteBuildingInvalidVariables(Route $route): void {
$route_collection = new RouteCollection();
$route_collection->add('test', $route);
diff --git a/core/tests/Drupal/Tests/Core/Extension/DefaultConfigTest.php b/core/tests/Drupal/Tests/Core/Extension/DefaultConfigTest.php
index 5818422fdcd..e05fcf10701 100644
--- a/core/tests/Drupal/Tests/Core/Extension/DefaultConfigTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/DefaultConfigTest.php
@@ -24,7 +24,7 @@ class DefaultConfigTest extends UnitTestCase {
* that were never installed. The default configuration of such extensions
* would not exist. Installation hooks would never be executed.
*/
- public function testConfigIsEmpty() {
+ public function testConfigIsEmpty(): void {
$config = Yaml::parse(file_get_contents($this->root . '/core/config/install/core.extension.yml'));
$expected = [
'module' => [],
diff --git a/core/tests/Drupal/Tests/Core/Extension/DependencyTest.php b/core/tests/Drupal/Tests/Core/Extension/DependencyTest.php
index b3f81fd2977..345a9ff7fc7 100644
--- a/core/tests/Drupal/Tests/Core/Extension/DependencyTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/DependencyTest.php
@@ -18,7 +18,7 @@ class DependencyTest extends UnitTestCase {
* @covers ::createFromString
* @dataProvider providerCreateFromString
*/
- public function testCreateFromString($string, $expected_name, $expected_project, $expected_constraint) {
+ public function testCreateFromString($string, $expected_name, $expected_project, $expected_constraint): void {
$dependency = Dependency::createFromString($string);
$this->assertSame($expected_name, $dependency->getName());
$this->assertSame($expected_project, $dependency->getProject());
@@ -40,7 +40,7 @@ class DependencyTest extends UnitTestCase {
/**
* @covers ::isCompatible
*/
- public function testIsCompatible() {
+ public function testIsCompatible(): void {
$dependency = new Dependency('paragraphs_demo', 'paragraphs', '>8.x-1.1');
$this->assertFalse($dependency->isCompatible('1.1'));
$this->assertTrue($dependency->isCompatible('1.2'));
@@ -51,7 +51,7 @@ class DependencyTest extends UnitTestCase {
*
* @covers ::__sleep
*/
- public function testSerialization() {
+ public function testSerialization(): void {
$dependency = new Dependency('paragraphs_demo', 'paragraphs', '>8.x-1.1');
$this->assertTrue($dependency->isCompatible('1.2'));
$reflected_constraint = (new \ReflectionObject($dependency))->getProperty('constraint');
diff --git a/core/tests/Drupal/Tests/Core/Extension/ExtensionDiscoveryTest.php b/core/tests/Drupal/Tests/Core/Extension/ExtensionDiscoveryTest.php
index 75d14c6c938..ff9d1a7d050 100644
--- a/core/tests/Drupal/Tests/Core/Extension/ExtensionDiscoveryTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/ExtensionDiscoveryTest.php
@@ -24,7 +24,7 @@ class ExtensionDiscoveryTest extends UnitTestCase {
*
* @covers ::scan
*/
- public function testExtensionDiscoveryVfs() {
+ public function testExtensionDiscoveryVfs(): void {
// Set up the file system.
$filesystem = [];
@@ -72,7 +72,7 @@ class ExtensionDiscoveryTest extends UnitTestCase {
* @covers ::scan
* @runInSeparateProcess
*/
- public function testExtensionDiscoveryCache() {
+ public function testExtensionDiscoveryCache(): void {
// Set up an extension object in the cache to mimic site prior to changing
// \Drupal\Core\Extension\ExtensionDiscovery::scanDirectory() to cache an
// array instead of an object. Note we cannot use the VFS file system
diff --git a/core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php b/core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php
index c5f1f4b7f5d..bdacfc99a14 100644
--- a/core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php
@@ -26,7 +26,7 @@ class ExtensionListTest extends UnitTestCase {
/**
* @covers ::getName
*/
- public function testGetNameWithNonExistingExtension() {
+ public function testGetNameWithNonExistingExtension(): void {
[$cache, $info_parser, $module_handler, $state] = $this->getMocks();
$test_extension_list = new TestExtension($this->randomMachineName(), 'test_extension', $cache->reveal(), $info_parser->reveal(), $module_handler->reveal(), $state->reveal(), 'testing');
@@ -41,7 +41,7 @@ class ExtensionListTest extends UnitTestCase {
/**
* @covers ::getName
*/
- public function testGetName() {
+ public function testGetName(): void {
$test_extension_list = $this->setupTestExtensionList();
$this->assertEquals('test name', $test_extension_list->getName('test_name'));
@@ -50,7 +50,7 @@ class ExtensionListTest extends UnitTestCase {
/**
* @covers ::get
*/
- public function testGetWithNonExistingExtension() {
+ public function testGetWithNonExistingExtension(): void {
[$cache, $info_parser, $module_handler, $state] = $this->getMocks();
$test_extension_list = new TestExtension($this->randomMachineName(), 'test_extension', $cache->reveal(), $info_parser->reveal(), $module_handler->reveal(), $state->reveal(), 'testing');
@@ -65,7 +65,7 @@ class ExtensionListTest extends UnitTestCase {
/**
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
$test_extension_list = $this->setupTestExtensionList();
$extension = $test_extension_list->get('test_name');
@@ -76,7 +76,7 @@ class ExtensionListTest extends UnitTestCase {
/**
* @covers ::getList
*/
- public function testGetList() {
+ public function testGetList(): void {
$test_extension_list = $this->setupTestExtensionList();
$extensions = $test_extension_list->getList();
@@ -88,7 +88,7 @@ class ExtensionListTest extends UnitTestCase {
* @covers ::getExtensionInfo
* @covers ::getAllInstalledInfo
*/
- public function testGetExtensionInfo() {
+ public function testGetExtensionInfo(): void {
$test_extension_list = $this->setupTestExtensionList();
$test_extension_list->setInstalledExtensions(['test_name']);
@@ -104,7 +104,7 @@ class ExtensionListTest extends UnitTestCase {
/**
* @covers ::getAllAvailableInfo
*/
- public function testGetAllAvailableInfo() {
+ public function testGetAllAvailableInfo(): void {
$test_extension_list = $this->setupTestExtensionList();
$infos = $test_extension_list->getAllAvailableInfo();
@@ -121,7 +121,7 @@ class ExtensionListTest extends UnitTestCase {
/**
* @covers ::getAllInstalledInfo
*/
- public function testGetAllInstalledInfo() {
+ public function testGetAllInstalledInfo(): void {
$test_extension_list = $this->setupTestExtensionList(['test_name', 'test_name_2']);
$test_extension_list->setInstalledExtensions(['test_name_2']);
@@ -139,7 +139,7 @@ class ExtensionListTest extends UnitTestCase {
/**
* @covers ::getPathNames
*/
- public function testGetPathNames() {
+ public function testGetPathNames(): void {
$test_extension_list = $this->setupTestExtensionList();
$filenames = $test_extension_list->getPathNames();
@@ -151,7 +151,7 @@ class ExtensionListTest extends UnitTestCase {
/**
* @covers ::getPathname
*/
- public function testGetPathname() {
+ public function testGetPathname(): void {
$test_extension_list = $this->setupTestExtensionList();
$pathname = $test_extension_list->getPathname('test_name');
@@ -162,7 +162,7 @@ class ExtensionListTest extends UnitTestCase {
* @covers ::setPathname
* @covers ::getPathname
*/
- public function testSetPathname() {
+ public function testSetPathname(): void {
$test_extension_list = $this->setupTestExtensionList();
$test_extension_list->setPathname('test_name', 'vfs://drupal_root/example2/test_name/test_name.info.yml');
@@ -172,7 +172,7 @@ class ExtensionListTest extends UnitTestCase {
/**
* @covers ::getPath
*/
- public function testGetPath() {
+ public function testGetPath(): void {
$test_extension_list = $this->setupTestExtensionList();
$path = $test_extension_list->getPath('test_name');
@@ -182,7 +182,7 @@ class ExtensionListTest extends UnitTestCase {
/**
* @covers ::reset
*/
- public function testReset() {
+ public function testReset(): void {
$test_extension_list = $this->setupTestExtensionList();
$path = $test_extension_list->getPath('test_name');
@@ -212,7 +212,7 @@ class ExtensionListTest extends UnitTestCase {
*
* @dataProvider providerCheckIncompatibility
*/
- public function testCheckIncompatibility($additional_settings, $expected) {
+ public function testCheckIncompatibility($additional_settings, $expected): void {
$test_extension_list = $this->setupTestExtensionList(['test_name'], $additional_settings);
$this->assertSame($expected, $test_extension_list->checkIncompatibility('test_name'));
}
diff --git a/core/tests/Drupal/Tests/Core/Extension/ExtensionSerializationTest.php b/core/tests/Drupal/Tests/Core/Extension/ExtensionSerializationTest.php
index 8016d36ed1c..d939774a769 100644
--- a/core/tests/Drupal/Tests/Core/Extension/ExtensionSerializationTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/ExtensionSerializationTest.php
@@ -45,7 +45,7 @@ class ExtensionSerializationTest extends UnitTestCase {
* @covers ::__sleep
* @covers ::__wakeup
*/
- public function testServiceAppRouteUsage() {
+ public function testServiceAppRouteUsage(): void {
$container = new ContainerBuilder();
// Set a dummy container app.root to test against.
$container->setParameter('app.root', 'vfs://dummy_app_root');
@@ -70,7 +70,7 @@ class ExtensionSerializationTest extends UnitTestCase {
* @covers ::__sleep
* @covers ::__wakeup
*/
- public function testPublicProperties() {
+ public function testPublicProperties(): void {
$container = new ContainerBuilder();
// Set a dummy container app.root to test against.
$container->setParameter('app.root', 'vfs://dummy_app_root');
diff --git a/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php b/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php
index 4709d288b19..ebe81790854 100644
--- a/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php
@@ -46,7 +46,7 @@ class InfoParserUnitTest extends UnitTestCase {
*
* @covers ::parse
*/
- public function testInfoParserNonExisting() {
+ public function testInfoParserNonExisting(): void {
vfsStream::setup('modules');
$this->expectException('\Drupal\Core\Extension\InfoParserException');
$this->expectExceptionMessage('Unable to parse vfs://modules/does_not_exist.info.txt as it does not exist');
@@ -128,7 +128,7 @@ YML,
*
* @covers ::parse
*/
- public function testInfoParserBroken() {
+ public function testInfoParserBroken(): void {
$broken_info = <<<BROKEN_INFO
# info.yml for testing broken YAML parsing exception handling.
name: File
@@ -158,7 +158,7 @@ BROKEN_INFO;
*
* @covers ::parse
*/
- public function testTestingPackageMissingCoreVersionRequirement() {
+ public function testTestingPackageMissingCoreVersionRequirement(): void {
$missing_core_version_requirement = <<<MISSING_CORE_VERSION_REQUIREMENT
# info.yml for testing core_version_requirement.
package: Testing
@@ -182,7 +182,7 @@ MISSING_CORE_VERSION_REQUIREMENT;
*
* @covers ::parse
*/
- public function testInfoParserCommonInfo() {
+ public function testInfoParserCommonInfo(): void {
$common = <<<COMMON
core_version_requirement: '*'
name: common_test
@@ -215,7 +215,7 @@ COMMON;
*
* @covers ::parse
*/
- public function testInfoParserCoreInfo() {
+ public function testInfoParserCoreInfo(): void {
$common = <<<CORE
name: core_test
type: module
@@ -242,7 +242,7 @@ CORE;
*
* @dataProvider providerCoreIncompatibility
*/
- public function testCoreIncompatibility($test_case, $constraint, $expected) {
+ public function testCoreIncompatibility($test_case, $constraint, $expected): void {
$core_incompatibility = <<<CORE_INCOMPATIBILITY
core_version_requirement: $constraint
name: common_test
@@ -303,7 +303,7 @@ CORE_INCOMPATIBILITY;
/**
* Tests a profile info file.
*/
- public function testProfile() {
+ public function testProfile(): void {
$profile = <<<PROFILE_TEST
core_version_requirement: '*'
name: The Perfect Profile
@@ -326,7 +326,7 @@ PROFILE_TEST;
*
* @covers ::parse
*/
- public function testUnparsableCoreVersionRequirement() {
+ public function testUnparsableCoreVersionRequirement(): void {
$unparsable_core_version_requirement = <<<UNPARSABLE_CORE_VERSION_REQUIREMENT
# info.yml for testing invalid core_version_requirement value.
name: Not this module
@@ -355,7 +355,7 @@ UNPARSABLE_CORE_VERSION_REQUIREMENT;
*
* @dataProvider providerValidLifecycle
*/
- public function testValidLifecycle($lifecycle, $expected) {
+ public function testValidLifecycle($lifecycle, $expected): void {
$info = <<<INFO
package: Core
core_version_requirement: '*'
@@ -415,7 +415,7 @@ INFO;
*
* @dataProvider providerInvalidLifecycle
*/
- public function testInvalidLifecycle($lifecycle, $exception_message) {
+ public function testInvalidLifecycle($lifecycle, $exception_message): void {
$info = <<<INFO
package: Core
core_version_requirement: '*'
@@ -464,7 +464,7 @@ INFO;
*
* @dataProvider providerLifecycleLink
*/
- public function testLifecycleLink($lifecycle, $lifecycle_link = NULL, $exception_message = NULL) {
+ public function testLifecycleLink($lifecycle, $lifecycle_link = NULL, $exception_message = NULL): void {
$info = <<<INFO
package: Core
core_version_requirement: '*'
diff --git a/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php b/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php
index e411229d8bd..384a7ffc564 100644
--- a/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php
@@ -65,7 +65,7 @@ class ModuleHandlerTest extends UnitTestCase {
*
* @covers ::load
*/
- public function testLoadModule() {
+ public function testLoadModule(): void {
$module_handler = $this->getModuleHandler();
$this->assertFalse(function_exists('module_handler_test_hook'));
$this->assertTrue($module_handler->load('module_handler_test'));
@@ -85,7 +85,7 @@ class ModuleHandlerTest extends UnitTestCase {
*
* @covers ::loadAll
*/
- public function testLoadAllModules() {
+ public function testLoadAllModules(): void {
$module_handler = $this->getModuleHandler();
$module_handler->addModule('module_handler_test_all1', 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all1');
$module_handler->addModule('module_handler_test_all2', 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all2');
@@ -101,7 +101,7 @@ class ModuleHandlerTest extends UnitTestCase {
*
* @covers ::reload
*/
- public function testModuleReloading() {
+ public function testModuleReloading(): void {
$module_handler = $this->getMockBuilder(ModuleHandler::class)
->setConstructorArgs([
$this->root,
@@ -137,7 +137,7 @@ class ModuleHandlerTest extends UnitTestCase {
*
* @covers ::isLoaded
*/
- public function testIsLoaded() {
+ public function testIsLoaded(): void {
$module_handler = $this->getModuleHandler();
$this->assertFalse($module_handler->isLoaded());
$module_handler->loadAll();
@@ -149,7 +149,7 @@ class ModuleHandlerTest extends UnitTestCase {
*
* @covers ::getModuleList
*/
- public function testGetModuleList() {
+ public function testGetModuleList(): void {
$this->assertEquals($this->getModuleHandler()->getModuleList(), [
'module_handler_test' => new Extension($this->root, 'module', 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/module_handler_test.info.yml', 'module_handler_test.module'),
]);
@@ -160,14 +160,14 @@ class ModuleHandlerTest extends UnitTestCase {
*
* @covers ::getModule
*/
- public function testGetModuleWithExistingModule() {
+ public function testGetModuleWithExistingModule(): void {
$this->assertEquals($this->getModuleHandler()->getModule('module_handler_test'), new Extension($this->root, 'module', 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/module_handler_test.info.yml', 'module_handler_test.module'));
}
/**
* @covers ::getModule
*/
- public function testGetModuleWithNonExistingModule() {
+ public function testGetModuleWithNonExistingModule(): void {
$this->expectException(UnknownExtensionException::class);
$this->getModuleHandler()->getModule('claire_alice_watch_my_little_pony_module_that_does_not_exist');
}
@@ -177,7 +177,7 @@ class ModuleHandlerTest extends UnitTestCase {
*
* @covers ::setModuleList
*/
- public function testSetModuleList() {
+ public function testSetModuleList(): void {
$fixture_module_handler = $this->getModuleHandler();
$module_handler = $this->getMockBuilder(ModuleHandler::class)
->setConstructorArgs([
@@ -205,7 +205,7 @@ class ModuleHandlerTest extends UnitTestCase {
* @covers ::addModule
* @covers ::add
*/
- public function testAddModule() {
+ public function testAddModule(): void {
$module_handler = $this->getMockBuilder(ModuleHandler::class)
->setConstructorArgs([
@@ -227,7 +227,7 @@ class ModuleHandlerTest extends UnitTestCase {
* @covers ::addProfile
* @covers ::add
*/
- public function testAddProfile() {
+ public function testAddProfile(): void {
$module_handler = $this->getMockBuilder(ModuleHandler::class)
->setConstructorArgs([
@@ -249,7 +249,7 @@ class ModuleHandlerTest extends UnitTestCase {
*
* @covers ::moduleExists
*/
- public function testModuleExists() {
+ public function testModuleExists(): void {
$module_handler = $this->getModuleHandler();
$this->assertTrue($module_handler->moduleExists('module_handler_test'));
$this->assertFalse($module_handler->moduleExists('module_handler_test_added'));
@@ -258,7 +258,7 @@ class ModuleHandlerTest extends UnitTestCase {
/**
* @covers ::loadAllIncludes
*/
- public function testLoadAllIncludes() {
+ public function testLoadAllIncludes(): void {
$this->assertTrue(TRUE);
$module_handler = $this->getMockBuilder(ModuleHandler::class)
->setConstructorArgs([
@@ -288,7 +288,7 @@ class ModuleHandlerTest extends UnitTestCase {
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
- public function testLoadInclude() {
+ public function testLoadInclude(): void {
$module_handler = $this->getModuleHandler();
// Include exists.
$this->assertEquals(__DIR__ . '/modules/module_handler_test/hook_include.inc', $module_handler->loadInclude('module_handler_test', 'inc', 'hook_include'));
@@ -302,7 +302,7 @@ class ModuleHandlerTest extends UnitTestCase {
*
* @covers ::invoke
*/
- public function testInvokeModuleEnabled() {
+ public function testInvokeModuleEnabled(): void {
$module_handler = $this->getModuleHandler();
$this->assertTrue($module_handler->invoke('module_handler_test', 'hook', [TRUE]), 'Installed module runs hook.');
$this->assertFalse($module_handler->invoke('module_handler_test', 'hook', [FALSE]), 'Installed module runs hook.');
@@ -315,7 +315,7 @@ class ModuleHandlerTest extends UnitTestCase {
* @covers ::hasImplementations
* @covers ::loadAllIncludes
*/
- public function testImplementsHookModuleEnabled() {
+ public function testImplementsHookModuleEnabled(): void {
$module_handler = $this->getModuleHandler();
$this->assertTrue($module_handler->hasImplementations('hook', 'module_handler_test'), 'Installed module implementation found.');
@@ -331,7 +331,7 @@ class ModuleHandlerTest extends UnitTestCase {
*
* @covers ::hasImplementations
*/
- public function testHasImplementations() {
+ public function testHasImplementations(): void {
$module_handler = $this->getMockBuilder(ModuleHandler::class)
->setConstructorArgs([$this->root, [], $this->cacheBackend])
->onlyMethods(['buildImplementationInfo'])
@@ -359,7 +359,7 @@ class ModuleHandlerTest extends UnitTestCase {
*
* @covers ::invokeAllWith
*/
- public function testCachedGetImplementations() {
+ public function testCachedGetImplementations(): void {
$this->cacheBackend->expects($this->exactly(1))
->method('get')
->willReturn((object) ['data' => ['hook' => ['module_handler_test' => 'test']]]);
@@ -396,7 +396,7 @@ class ModuleHandlerTest extends UnitTestCase {
*
* @covers ::invokeAllWith
*/
- public function testCachedGetImplementationsMissingMethod() {
+ public function testCachedGetImplementationsMissingMethod(): void {
$this->cacheBackend->expects($this->exactly(1))
->method('get')
->willReturn((object) [
@@ -439,7 +439,7 @@ class ModuleHandlerTest extends UnitTestCase {
*
* @covers ::invokeAll
*/
- public function testInvokeAll() {
+ public function testInvokeAll(): void {
$module_handler = $this->getModuleHandler();
$module_handler->addModule('module_handler_test_all1', 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all1');
$module_handler->addModule('module_handler_test_all2', 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all2');
@@ -451,7 +451,7 @@ class ModuleHandlerTest extends UnitTestCase {
*
* @covers ::writeCache
*/
- public function testWriteCache() {
+ public function testWriteCache(): void {
$module_handler = $this->getModuleHandler();
$this->cacheBackend
->expects($this->exactly(2))
@@ -471,7 +471,7 @@ class ModuleHandlerTest extends UnitTestCase {
* @covers ::getHookInfo
* @covers ::buildHookInfo
*/
- public function testGetHookInfo() {
+ public function testGetHookInfo(): void {
$module_handler = $this->getModuleHandler();
// Set up some synthetic results.
$this->cacheBackend
@@ -499,7 +499,7 @@ class ModuleHandlerTest extends UnitTestCase {
*
* @covers ::resetImplementations
*/
- public function testResetImplementations() {
+ public function testResetImplementations(): void {
$module_handler = $this->getModuleHandler();
// Prime caches
$module_handler->invokeAllWith('hook', function (callable $hook, string $module) {});
@@ -530,7 +530,7 @@ class ModuleHandlerTest extends UnitTestCase {
/**
* @covers ::getModuleDirectories
*/
- public function testGetModuleDirectories() {
+ public function testGetModuleDirectories(): void {
$module_handler = $this->getModuleHandler();
$module_handler->setModuleList([]);
$module_handler->addModule('node', 'core/modules/node');
diff --git a/core/tests/Drupal/Tests/Core/Extension/ModuleInfoTest.php b/core/tests/Drupal/Tests/Core/Extension/ModuleInfoTest.php
index af1c33a56d7..1b13648aa14 100644
--- a/core/tests/Drupal/Tests/Core/Extension/ModuleInfoTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/ModuleInfoTest.php
@@ -22,7 +22,7 @@ class ModuleInfoTest extends UnitTestCase {
*
* @dataProvider coreModuleListDataProvider
*/
- public function testModuleInfo($module) {
+ public function testModuleInfo($module): void {
$module_directory = __DIR__ . '/../../../../../modules/' . $module;
$info = Yaml::decode(file_get_contents($module_directory . '/' . $module . '.info.yml'));
$this->assertArrayHasKey('version', $info);
diff --git a/core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php b/core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php
index d1900369c26..438fc0d759a 100644
--- a/core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/ModuleRequiredByThemesUninstallValidatorTest.php
@@ -49,7 +49,7 @@ class ModuleRequiredByThemesUninstallValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidateNoThemeDependency() {
+ public function testValidateNoThemeDependency(): void {
$this->themeExtensionList->getAllInstalledInfo()->willReturn([
'stable9' => [
'name' => 'Stable 9',
@@ -70,7 +70,7 @@ class ModuleRequiredByThemesUninstallValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidateOneThemeDependency() {
+ public function testValidateOneThemeDependency(): void {
$module = 'single_module';
$module_name = 'Single Module';
$theme = 'one_theme';
@@ -109,7 +109,7 @@ class ModuleRequiredByThemesUninstallValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidateTwoThemeDependencies() {
+ public function testValidateTwoThemeDependencies(): void {
$module = 'popular_module';
$module_name = 'Popular Module';
$theme1 = 'first_theme';
diff --git a/core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php b/core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php
index 2e00d9e7481..93ac524faca 100644
--- a/core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/RequiredModuleUninstallValidatorTest.php
@@ -32,7 +32,7 @@ class RequiredModuleUninstallValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidateNoModule() {
+ public function testValidateNoModule(): void {
$this->uninstallValidator->expects($this->once())
->method('getModuleInfoByModule')
->willReturn([]);
@@ -46,7 +46,7 @@ class RequiredModuleUninstallValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidateNotRequired() {
+ public function testValidateNotRequired(): void {
$module = $this->randomMachineName();
$this->uninstallValidator->expects($this->once())
@@ -61,7 +61,7 @@ class RequiredModuleUninstallValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testValidateRequired() {
+ public function testValidateRequired(): void {
$module = $this->randomMachineName();
$this->uninstallValidator->expects($this->once())
diff --git a/core/tests/Drupal/Tests/Core/Extension/ThemeExtensionListTest.php b/core/tests/Drupal/Tests/Core/Extension/ThemeExtensionListTest.php
index 0dc1de5b8b6..37cfa0f62c1 100644
--- a/core/tests/Drupal/Tests/Core/Extension/ThemeExtensionListTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/ThemeExtensionListTest.php
@@ -27,7 +27,7 @@ class ThemeExtensionListTest extends UnitTestCase {
/**
* Tests rebuild the theme data with theme parents.
*/
- public function testRebuildThemeDataWithThemeParents() {
+ public function testRebuildThemeDataWithThemeParents(): void {
$extension_discovery = $this->prophesize(ExtensionDiscovery::class);
$extension_discovery
->scan('theme')
@@ -121,7 +121,7 @@ class ThemeExtensionListTest extends UnitTestCase {
*
* @group legacy
*/
- public function testGetBaseThemes(array $themes, $theme, array $expected) {
+ public function testGetBaseThemes(array $themes, $theme, array $expected): void {
// Mocks and stubs.
$module_handler = $this->prophesize(ModuleHandlerInterface::class);
$state = new State(new KeyValueMemoryFactory(), new NullBackend('bin'), new NullLockBackend());
diff --git a/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php b/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
index b8c71ba4d77..576815f249b 100644
--- a/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
@@ -71,7 +71,7 @@ class ThemeHandlerTest extends UnitTestCase {
* @see \Drupal\Core\Extension\ThemeHandler::rebuildThemeData()
* @group legacy
*/
- public function testRebuildThemeData() {
+ public function testRebuildThemeData(): void {
$this->expectDeprecation("\Drupal\Core\Extension\ThemeHandlerInterface::rebuildThemeData() is deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. Use \Drupal::service('extension.list.theme')->reset()->getList() instead. See https://www.drupal.org/node/3413196");
$this->themeList->expects($this->once())
->method('reset')
@@ -97,7 +97,7 @@ class ThemeHandlerTest extends UnitTestCase {
/**
* Tests empty libraries in theme.info.yml file.
*/
- public function testThemeLibrariesEmpty() {
+ public function testThemeLibrariesEmpty(): void {
$theme = new Extension($this->root, 'theme', 'core/modules/system/tests/themes/test_theme_libraries_empty', 'test_theme_libraries_empty.info.yml');
try {
$this->themeHandler->addTheme($theme);
diff --git a/core/tests/Drupal/Tests/Core/Field/FieldDefinitionListenerTest.php b/core/tests/Drupal/Tests/Core/Field/FieldDefinitionListenerTest.php
index 61496932428..7486fb1c3b8 100644
--- a/core/tests/Drupal/Tests/Core/Field/FieldDefinitionListenerTest.php
+++ b/core/tests/Drupal/Tests/Core/Field/FieldDefinitionListenerTest.php
@@ -108,7 +108,7 @@ class FieldDefinitionListenerTest extends UnitTestCase {
/**
* @covers ::onFieldDefinitionCreate
*/
- public function testOnFieldDefinitionCreateNewField() {
+ public function testOnFieldDefinitionCreateNewField(): void {
$field_definition = $this->prophesize(FieldDefinitionInterface::class);
$field_definition->getTargetEntityTypeId()->willReturn('test_entity_type');
$field_definition->getTargetBundle()->willReturn('test_bundle');
@@ -139,7 +139,7 @@ class FieldDefinitionListenerTest extends UnitTestCase {
/**
* @covers ::onFieldDefinitionCreate
*/
- public function testOnFieldDefinitionCreateExistingField() {
+ public function testOnFieldDefinitionCreateExistingField(): void {
$field_definition = $this->prophesize(FieldDefinitionInterface::class);
$field_definition->getTargetEntityTypeId()->willReturn('test_entity_type');
$field_definition->getTargetBundle()->willReturn('test_bundle');
@@ -175,7 +175,7 @@ class FieldDefinitionListenerTest extends UnitTestCase {
/**
* @covers ::onFieldDefinitionUpdate
*/
- public function testOnFieldDefinitionUpdate() {
+ public function testOnFieldDefinitionUpdate(): void {
$field_definition = $this->prophesize(FieldDefinitionInterface::class);
$field_definition->getTargetEntityTypeId()->willReturn('test_entity_type');
@@ -192,7 +192,7 @@ class FieldDefinitionListenerTest extends UnitTestCase {
/**
* @covers ::onFieldDefinitionDelete
*/
- public function testOnFieldDefinitionDeleteMultipleBundles() {
+ public function testOnFieldDefinitionDeleteMultipleBundles(): void {
$field_definition = $this->prophesize(FieldDefinitionInterface::class);
$field_definition->getTargetEntityTypeId()->willReturn('test_entity_type');
$field_definition->getTargetBundle()->willReturn('test_bundle');
@@ -232,7 +232,7 @@ class FieldDefinitionListenerTest extends UnitTestCase {
/**
* @covers ::onFieldDefinitionDelete
*/
- public function testOnFieldDefinitionDeleteSingleBundles() {
+ public function testOnFieldDefinitionDeleteSingleBundles(): void {
$field_definition = $this->prophesize(FieldDefinitionInterface::class);
$field_definition->getTargetEntityTypeId()->willReturn('test_entity_type');
$field_definition->getTargetBundle()->willReturn('test_bundle');
diff --git a/core/tests/Drupal/Tests/Core/Field/FieldFilteredMarkupTest.php b/core/tests/Drupal/Tests/Core/Field/FieldFilteredMarkupTest.php
index 645c67f5fbc..d82fda322d3 100644
--- a/core/tests/Drupal/Tests/Core/Field/FieldFilteredMarkupTest.php
+++ b/core/tests/Drupal/Tests/Core/Field/FieldFilteredMarkupTest.php
@@ -19,7 +19,7 @@ class FieldFilteredMarkupTest extends UnitTestCase {
* @covers ::create
* @dataProvider providerTestCreate
*/
- public function testCreate($string, $expected, $instance_of_check) {
+ public function testCreate($string, $expected, $instance_of_check): void {
$filtered_string = FieldFilteredMarkup::create($string);
if ($instance_of_check) {
@@ -52,7 +52,7 @@ class FieldFilteredMarkupTest extends UnitTestCase {
/**
* @covers ::displayAllowedTags
*/
- public function testDisplayAllowedTags() {
+ public function testDisplayAllowedTags(): void {
$expected = '<a> <b> <big> <code> <del> <em> <i> <ins> <pre> <q> <small> <span> <strong> <sub> <sup> <tt> <ol> <ul> <li> <p> <br> <img>';
$this->assertSame($expected, FieldFilteredMarkup::displayAllowedTags());
diff --git a/core/tests/Drupal/Tests/Core/Field/FieldInputValueNormalizerTraitTest.php b/core/tests/Drupal/Tests/Core/Field/FieldInputValueNormalizerTraitTest.php
index b846f9686c9..631e31374c4 100644
--- a/core/tests/Drupal/Tests/Core/Field/FieldInputValueNormalizerTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Field/FieldInputValueNormalizerTraitTest.php
@@ -19,7 +19,7 @@ class FieldInputValueNormalizerTraitTest extends UnitTestCase {
* @dataProvider keyValueByDeltaTestCases
* @covers ::normalizeValue
*/
- public function testKeyValueByDelta($input_value, $expected_value, $main_property_name = 'value') {
+ public function testKeyValueByDelta($input_value, $expected_value, $main_property_name = 'value'): void {
$this->assertEquals($expected_value, $this->normalizeValue($input_value, $main_property_name));
}
@@ -85,7 +85,7 @@ class FieldInputValueNormalizerTraitTest extends UnitTestCase {
/**
* @covers ::normalizeValue
*/
- public function testScalarWithNoMainProperty() {
+ public function testScalarWithNoMainProperty(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('A main property is required when normalizing scalar field values.');
$value = 'foo';
@@ -95,7 +95,7 @@ class FieldInputValueNormalizerTraitTest extends UnitTestCase {
/**
* @covers ::normalizeValue
*/
- public function testKeyValueByDeltaUndefinedVariables() {
+ public function testKeyValueByDeltaUndefinedVariables(): void {
$this->assertEquals([], $this->normalizeValue($undefined_variable, 'value'));
$this->assertEquals([], $this->normalizeValue($undefined_variable['undefined_key'], 'value'));
}
diff --git a/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php b/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php
index 629ebc8dc2e..5662ea0f3be 100644
--- a/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php
+++ b/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php
@@ -25,7 +25,7 @@ class FieldItemListTest extends UnitTestCase {
*
* @dataProvider providerTestEquals
*/
- public function testEquals($expected, ?FieldItemInterface $first_field_item = NULL, ?FieldItemInterface $second_field_item = NULL) {
+ public function testEquals($expected, ?FieldItemInterface $first_field_item = NULL, ?FieldItemInterface $second_field_item = NULL): void {
// Mock the field type manager and place it in the container.
$field_type_manager = $this->createMock('Drupal\Core\Field\FieldTypePluginManagerInterface');
@@ -167,7 +167,7 @@ class FieldItemListTest extends UnitTestCase {
*
* @dataProvider providerTestEquals
*/
- public function testHasAffectingChanges($expected, ?FieldItemInterface $first_field_item = NULL, ?FieldItemInterface $second_field_item = NULL) {
+ public function testHasAffectingChanges($expected, ?FieldItemInterface $first_field_item = NULL, ?FieldItemInterface $second_field_item = NULL): void {
// Mock the field type manager and place it in the container.
$field_type_manager = $this->createMock(FieldTypePluginManagerInterface::class);
$container = new ContainerBuilder();
@@ -228,7 +228,7 @@ class FieldItemListTest extends UnitTestCase {
/**
* @covers ::equals
*/
- public function testEqualsEmptyItems() {
+ public function testEqualsEmptyItems(): void {
/** @var \Drupal\Core\Field\FieldItemBase $fv */
$first_field_item = new FieldItemTestClass();
$first_field_item->setValue(['0' => 1, '1' => 2]);
@@ -292,7 +292,7 @@ class FieldItemListTest extends UnitTestCase {
/**
* @covers ::defaultValuesForm
*/
- public function testDefaultValuesForm() {
+ public function testDefaultValuesForm(): void {
$field_definition = $this->createMock(FieldDefinitionInterface::class);
$field_definition->expects($this->any())
->method('getType')
@@ -316,7 +316,7 @@ class FieldItemListTest extends UnitTestCase {
/**
* @covers ::defaultValuesFormValidate
*/
- public function testDefaultValuesFormValidate() {
+ public function testDefaultValuesFormValidate(): void {
$field_definition = $this->createMock(FieldDefinitionInterface::class);
/** @var \Drupal\Core\Field\FieldItemList|\PHPUnit\Framework\MockObject\MockObject $field_list */
$field_list = $this->getMockBuilder(FieldItemList::class)
@@ -337,7 +337,7 @@ class FieldItemListTest extends UnitTestCase {
/**
* @covers ::defaultValuesFormSubmit
*/
- public function testDefaultValuesFormSubmit() {
+ public function testDefaultValuesFormSubmit(): void {
$field_definition = $this->createMock(FieldDefinitionInterface::class);
/** @var \Drupal\Core\Field\FieldItemList|\PHPUnit\Framework\MockObject\MockObject $field_list */
$field_list = $this->getMockBuilder(FieldItemList::class)
diff --git a/core/tests/Drupal/Tests/Core/Field/FieldTypePluginManagerTest.php b/core/tests/Drupal/Tests/Core/Field/FieldTypePluginManagerTest.php
index 5e8aef87c08..38513190d11 100644
--- a/core/tests/Drupal/Tests/Core/Field/FieldTypePluginManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Field/FieldTypePluginManagerTest.php
@@ -79,7 +79,7 @@ class FieldTypePluginManagerTest extends UnitTestCase {
/**
* @covers ::getGroupedDefinitions
*/
- public function testGetGroupedDefinitions() {
+ public function testGetGroupedDefinitions(): void {
$this->discovery->getDefinitions()->willReturn([
'telephone' => [
'category' => 'general',
@@ -132,7 +132,7 @@ class FieldTypePluginManagerTest extends UnitTestCase {
/**
* @covers ::getGroupedDefinitions
*/
- public function testGetGroupedDefinitionsInvalid() {
+ public function testGetGroupedDefinitionsInvalid(): void {
$this->discovery->getDefinitions()->willReturn([
'string' => [
'category' => 'text',
@@ -172,7 +172,7 @@ class FieldTypePluginManagerTest extends UnitTestCase {
/**
* @covers ::getGroupedDefinitions
*/
- public function testGetGroupedDefinitionsEmpty() {
+ public function testGetGroupedDefinitionsEmpty(): void {
$this->fieldTypeCategoryManager->getDefinitions()->willReturn([]);
$this->assertEquals([], $this->fieldTypeManager->getGroupedDefinitions([]));
}
diff --git a/core/tests/Drupal/Tests/Core/Field/PluginSettingsBaseTest.php b/core/tests/Drupal/Tests/Core/Field/PluginSettingsBaseTest.php
index b743c692b0f..0d3fc0aeeea 100644
--- a/core/tests/Drupal/Tests/Core/Field/PluginSettingsBaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Field/PluginSettingsBaseTest.php
@@ -16,7 +16,7 @@ class PluginSettingsBaseTest extends UnitTestCase {
/**
* @covers ::getThirdPartySettings
*/
- public function testGetThirdPartySettings() {
+ public function testGetThirdPartySettings(): void {
$plugin_settings = new TestPluginSettingsBase();
$this->assertSame([], $plugin_settings->getThirdPartySettings());
$this->assertSame([], $plugin_settings->getThirdPartySettings('test'));
diff --git a/core/tests/Drupal/Tests/Core/File/FileSystemTest.php b/core/tests/Drupal/Tests/Core/File/FileSystemTest.php
index 12b049d9c70..7d159125731 100644
--- a/core/tests/Drupal/Tests/Core/File/FileSystemTest.php
+++ b/core/tests/Drupal/Tests/Core/File/FileSystemTest.php
@@ -51,7 +51,7 @@ class FileSystemTest extends UnitTestCase {
/**
* @covers ::chmod
*/
- public function testChmodFile() {
+ public function testChmodFile(): void {
vfsStream::setup('dir');
vfsStream::create(['test.txt' => 'asdf']);
$uri = 'vfs://dir/test.txt';
@@ -65,7 +65,7 @@ class FileSystemTest extends UnitTestCase {
/**
* @covers ::chmod
*/
- public function testChmodDir() {
+ public function testChmodDir(): void {
vfsStream::setup('dir');
vfsStream::create(['nested_dir' => []]);
$uri = 'vfs://dir/nested_dir';
@@ -79,7 +79,7 @@ class FileSystemTest extends UnitTestCase {
/**
* @covers ::chmod
*/
- public function testChmodUnsuccessful() {
+ public function testChmodUnsuccessful(): void {
vfsStream::setup('dir');
$this->assertFalse($this->fileSystem->chmod('vfs://dir/test.txt'));
}
@@ -87,7 +87,7 @@ class FileSystemTest extends UnitTestCase {
/**
* @covers ::unlink
*/
- public function testUnlink() {
+ public function testUnlink(): void {
vfsStream::setup('dir');
vfsStream::create(['test.txt' => 'asdf']);
$uri = 'vfs://dir/test.txt';
@@ -106,7 +106,7 @@ class FileSystemTest extends UnitTestCase {
*
* @dataProvider providerTestBasename
*/
- public function testBasename($uri, $expected, $suffix = NULL) {
+ public function testBasename($uri, $expected, $suffix = NULL): void {
$this->assertSame($expected, $this->fileSystem->basename($uri, $suffix));
}
@@ -151,7 +151,7 @@ class FileSystemTest extends UnitTestCase {
*
* @covers ::createFilename
*/
- public function testInvalidUTF8() {
+ public function testInvalidUTF8(): void {
vfsStream::setup('dir');
// cspell:disable-next-line
$filename = "a\xFFsdf\x80€" . '.txt';
diff --git a/core/tests/Drupal/Tests/Core/File/FileUploadSanitizeNameEventTest.php b/core/tests/Drupal/Tests/Core/File/FileUploadSanitizeNameEventTest.php
index 17e7bbe1f5b..7f69faabf68 100644
--- a/core/tests/Drupal/Tests/Core/File/FileUploadSanitizeNameEventTest.php
+++ b/core/tests/Drupal/Tests/Core/File/FileUploadSanitizeNameEventTest.php
@@ -21,7 +21,7 @@ class FileUploadSanitizeNameEventTest extends UnitTestCase {
* @covers ::setFilename
* @covers ::getFilename
*/
- public function testSetFilename() {
+ public function testSetFilename(): void {
$event = new FileUploadSanitizeNameEvent('foo.txt', '');
$this->assertSame('foo.txt', $event->getFilename());
$event->setFilename('foo.html');
@@ -31,7 +31,7 @@ class FileUploadSanitizeNameEventTest extends UnitTestCase {
/**
* @covers ::setFilename
*/
- public function testSetFilenameException() {
+ public function testSetFilenameException(): void {
$event = new FileUploadSanitizeNameEvent('foo.txt', '');
$this->assertSame('foo.txt', $event->getFilename());
$this->expectException(\InvalidArgumentException::class);
@@ -43,7 +43,7 @@ class FileUploadSanitizeNameEventTest extends UnitTestCase {
* @covers ::__construct
* @covers ::setFilename
*/
- public function testConstructorException() {
+ public function testConstructorException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('$filename must be a filename with no path information, "bar/foo.txt" provided');
new FileUploadSanitizeNameEvent('bar/foo.txt', '');
@@ -52,7 +52,7 @@ class FileUploadSanitizeNameEventTest extends UnitTestCase {
/**
* @covers ::getAllowedExtensions
*/
- public function testAllowedExtensions() {
+ public function testAllowedExtensions(): void {
$event = new FileUploadSanitizeNameEvent('foo.txt', '');
$this->assertSame([], $event->getAllowedExtensions());
@@ -70,7 +70,7 @@ class FileUploadSanitizeNameEventTest extends UnitTestCase {
* @param string $filename
* The filename to test
*/
- public function testEventFilenameFunctions(string $filename) {
+ public function testEventFilenameFunctions(string $filename): void {
$event = new FileUploadSanitizeNameEvent($filename, '');
$this->assertSame($filename, $event->getFilename());
}
@@ -104,7 +104,7 @@ class FileUploadSanitizeNameEventTest extends UnitTestCase {
/**
* @covers ::stopPropagation
*/
- public function testStopPropagation() {
+ public function testStopPropagation(): void {
$this->expectException(\RuntimeException::class);
$event = new FileUploadSanitizeNameEvent('test.txt', '');
$event->stopPropagation();
diff --git a/core/tests/Drupal/Tests/Core/Flood/MemoryBackendTest.php b/core/tests/Drupal/Tests/Core/Flood/MemoryBackendTest.php
index 74d9fe20ddf..1f078f2618a 100644
--- a/core/tests/Drupal/Tests/Core/Flood/MemoryBackendTest.php
+++ b/core/tests/Drupal/Tests/Core/Flood/MemoryBackendTest.php
@@ -38,7 +38,7 @@ class MemoryBackendTest extends UnitTestCase {
/**
* Tests an allowed flood event.
*/
- public function testAllowedProceeding() {
+ public function testAllowedProceeding(): void {
$threshold = 2;
$window_expired = -1;
@@ -49,7 +49,7 @@ class MemoryBackendTest extends UnitTestCase {
/**
* Tests a flood event with more than the allowed calls.
*/
- public function testNotAllowedProceeding() {
+ public function testNotAllowedProceeding(): void {
$threshold = 1;
$window_expired = -1;
@@ -65,7 +65,7 @@ class MemoryBackendTest extends UnitTestCase {
*
* @medium
*/
- public function testExpiring() {
+ public function testExpiring(): void {
$threshold = 1;
$window_expired = -1;
@@ -83,7 +83,7 @@ class MemoryBackendTest extends UnitTestCase {
/**
* Tests a flood event with no expiring, so cron will not allow to proceed.
*/
- public function testNotExpiring() {
+ public function testNotExpiring(): void {
$threshold = 2;
$this->flood->register('test_event', 1);
@@ -100,7 +100,7 @@ class MemoryBackendTest extends UnitTestCase {
/**
* Tests memory backend records events to the nearest microsecond.
*/
- public function testMemoryBackendThreshold() {
+ public function testMemoryBackendThreshold(): void {
$this->flood->register('new event');
$this->assertTrue($this->flood->isAllowed('new event', '2'));
$this->flood->register('new event');
diff --git a/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php b/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php
index 0604fda0b4b..318127b121b 100644
--- a/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php
@@ -16,7 +16,7 @@ class ConfigFormBaseTraitTest extends UnitTestCase {
/**
* @covers ::config
*/
- public function testConfig() {
+ public function testConfig(): void {
$trait = $this->createPartialMock(ConfiguredTrait::class, ['getEditableConfigNames']);
// Set up some configuration in a mocked config factory.
@@ -44,7 +44,7 @@ class ConfigFormBaseTraitTest extends UnitTestCase {
/**
* @covers ::config
*/
- public function testConfigFactoryException() {
+ public function testConfigFactoryException(): void {
$testObject = new ConfiguredTrait();
// There is no config factory available this should result in an exception.
@@ -57,7 +57,7 @@ class ConfigFormBaseTraitTest extends UnitTestCase {
/**
* @covers ::config
*/
- public function testConfigFactoryExceptionInvalidProperty() {
+ public function testConfigFactoryExceptionInvalidProperty(): void {
$testObject = new ConfiguredTrait();
// There is no config factory available this should result in an exception.
diff --git a/core/tests/Drupal/Tests/Core/Form/ConfigTargetTest.php b/core/tests/Drupal/Tests/Core/Form/ConfigTargetTest.php
index ba24a851541..a2588857886 100644
--- a/core/tests/Drupal/Tests/Core/Form/ConfigTargetTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/ConfigTargetTest.php
@@ -114,7 +114,7 @@ class ConfigTargetTest extends UnitTestCase {
* @covers ::fromForm
* @covers ::fromString
*/
- public function testFromFormString() {
+ public function testFromFormString(): void {
$form = [
'group' => [
'#type' => 'details',
@@ -136,7 +136,7 @@ class ConfigTargetTest extends UnitTestCase {
/**
* @covers ::fromForm
*/
- public function testFromFormConfigTarget() {
+ public function testFromFormConfigTarget(): void {
$form = [
'test' => [
'#type' => 'text',
@@ -158,7 +158,7 @@ class ConfigTargetTest extends UnitTestCase {
* @covers ::fromForm
* @dataProvider providerTestFromFormException
*/
- public function testFromFormException(array $form, array $array_parents, string $exception_message) {
+ public function testFromFormException(array $form, array $array_parents, string $exception_message): void {
$this->expectException(\LogicException::class);
$this->expectExceptionMessage($exception_message);
ConfigTarget::fromForm($array_parents, $form);
diff --git a/core/tests/Drupal/Tests/Core/Form/ConfirmFormHelperTest.php b/core/tests/Drupal/Tests/Core/Form/ConfirmFormHelperTest.php
index aa597ec73bd..449964fd573 100644
--- a/core/tests/Drupal/Tests/Core/Form/ConfirmFormHelperTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/ConfirmFormHelperTest.php
@@ -21,7 +21,7 @@ class ConfirmFormHelperTest extends UnitTestCase {
*
* @covers ::buildCancelLink
*/
- public function testCancelLinkTitle() {
+ public function testCancelLinkTitle(): void {
$cancel_text = 'Cancel text';
$form = $this->createMock('Drupal\Core\Form\ConfirmFormInterface');
$form->expects($this->any())
@@ -38,7 +38,7 @@ class ConfirmFormHelperTest extends UnitTestCase {
*
* @covers ::buildCancelLink
*/
- public function testCancelLinkRoute() {
+ public function testCancelLinkRoute(): void {
$route_name = 'foo_bar';
$cancel_route = new Url($route_name);
$form = $this->createMock('Drupal\Core\Form\ConfirmFormInterface');
@@ -55,7 +55,7 @@ class ConfirmFormHelperTest extends UnitTestCase {
*
* @covers ::buildCancelLink
*/
- public function testCancelLinkRouteWithParams() {
+ public function testCancelLinkRouteWithParams(): void {
$expected = Url::fromRoute('foo_bar.baz', ['baz' => 'banana'], ['absolute' => TRUE]);
$form = $this->createMock('Drupal\Core\Form\ConfirmFormInterface');
$form->expects($this->any())
@@ -71,7 +71,7 @@ class ConfirmFormHelperTest extends UnitTestCase {
*
* @covers ::buildCancelLink
*/
- public function testCancelLinkRouteWithUrl() {
+ public function testCancelLinkRouteWithUrl(): void {
$cancel_route = new Url(
'foo_bar.baz', [
'baz' => 'banana',
@@ -95,7 +95,7 @@ class ConfirmFormHelperTest extends UnitTestCase {
* @covers ::buildCancelLink
* @dataProvider providerTestCancelLinkDestination
*/
- public function testCancelLinkDestination($destination) {
+ public function testCancelLinkDestination($destination): void {
$query = ['destination' => $destination];
$form = $this->createMock('Drupal\Core\Form\ConfirmFormInterface');
diff --git a/core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php b/core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php
index 32b928b1896..4aea9f25bed 100644
--- a/core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/EventSubscriber/FormAjaxSubscriberTest.php
@@ -76,7 +76,7 @@ class FormAjaxSubscriberTest extends UnitTestCase {
/**
* @covers ::onException
*/
- public function testOnException() {
+ public function testOnException(): void {
$form = ['#type' => 'form', '#build_id' => 'the_build_id'];
$expected_form = $form + [
'#build_id_old' => 'the_build_id',
@@ -101,7 +101,7 @@ class FormAjaxSubscriberTest extends UnitTestCase {
/**
* @covers ::onException
*/
- public function testOnExceptionNewBuildId() {
+ public function testOnExceptionNewBuildId(): void {
$form = ['#type' => 'form', '#build_id' => 'the_build_id'];
$expected_form = $form + [
'#build_id_old' => 'a_new_build_id',
@@ -126,7 +126,7 @@ class FormAjaxSubscriberTest extends UnitTestCase {
/**
* @covers ::onException
*/
- public function testOnExceptionOtherClass() {
+ public function testOnExceptionOtherClass(): void {
$request = new Request();
$exception = new \Exception();
@@ -139,7 +139,7 @@ class FormAjaxSubscriberTest extends UnitTestCase {
/**
* @covers ::onException
*/
- public function testOnExceptionResponseBuilderException() {
+ public function testOnExceptionResponseBuilderException(): void {
$form = ['#type' => 'form', '#build_id' => 'the_build_id'];
$expected_form = $form + [
'#build_id_old' => 'the_build_id',
@@ -162,7 +162,7 @@ class FormAjaxSubscriberTest extends UnitTestCase {
/**
* @covers ::onException
*/
- public function testOnExceptionBrokenPostRequest() {
+ public function testOnExceptionBrokenPostRequest(): void {
$this->formAjaxResponseBuilder->expects($this->never())
->method('buildResponse');
@@ -209,7 +209,7 @@ class FormAjaxSubscriberTest extends UnitTestCase {
* @covers ::onException
* @covers ::getFormAjaxException
*/
- public function testOnExceptionNestedException() {
+ public function testOnExceptionNestedException(): void {
$form = ['#type' => 'form', '#build_id' => 'the_build_id'];
$expected_form = $form + [
'#build_id_old' => 'the_build_id',
@@ -233,7 +233,7 @@ class FormAjaxSubscriberTest extends UnitTestCase {
/**
* @covers ::getFormAjaxException
*/
- public function testOnExceptionNestedWrongException() {
+ public function testOnExceptionNestedWrongException(): void {
$nested_exception = new \Exception();
$exception = new \Exception('', 0, $nested_exception);
$request = new Request();
diff --git a/core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php b/core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php
index 67ea2418447..92b91a582d6 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php
@@ -47,7 +47,7 @@ class FormAjaxResponseBuilderTest extends UnitTestCase {
/**
* @covers ::buildResponse
*/
- public function testBuildResponseNoTriggeringElement() {
+ public function testBuildResponseNoTriggeringElement(): void {
$this->renderer->expects($this->never())
->method('renderResponse');
@@ -63,7 +63,7 @@ class FormAjaxResponseBuilderTest extends UnitTestCase {
/**
* @covers ::buildResponse
*/
- public function testBuildResponseNoCallable() {
+ public function testBuildResponseNoCallable(): void {
$this->renderer->expects($this->never())
->method('renderResponse');
@@ -81,7 +81,7 @@ class FormAjaxResponseBuilderTest extends UnitTestCase {
/**
* @covers ::buildResponse
*/
- public function testBuildResponseRenderArray() {
+ public function testBuildResponseRenderArray(): void {
$triggering_element = [
'#ajax' => [
'callback' => function (array $form, FormStateInterface $form_state) {
@@ -112,7 +112,7 @@ class FormAjaxResponseBuilderTest extends UnitTestCase {
/**
* @covers ::buildResponse
*/
- public function testBuildResponseResponse() {
+ public function testBuildResponseResponse(): void {
$triggering_element = [
'#ajax' => [
'callback' => function (array $form, FormStateInterface $form_state) {
@@ -137,7 +137,7 @@ class FormAjaxResponseBuilderTest extends UnitTestCase {
/**
* @covers ::buildResponse
*/
- public function testBuildResponseWithCommands() {
+ public function testBuildResponseWithCommands(): void {
$triggering_element = [
'#ajax' => [
'callback' => function (array $form, FormStateInterface $form_state) {
@@ -170,7 +170,7 @@ class FormAjaxResponseBuilderTest extends UnitTestCase {
/**
* @covers ::buildResponse
*/
- public function testBuildResponseWithUpdateCommand() {
+ public function testBuildResponseWithUpdateCommand(): void {
$triggering_element = [
'#ajax' => [
'callback' => function (array $form, FormStateInterface $form_state) {
diff --git a/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php b/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
index 7e6590b797d..3137681d18e 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
@@ -55,7 +55,7 @@ class FormBuilderTest extends FormTestBase {
*
* @covers ::getFormId
*/
- public function testGetFormIdWithString() {
+ public function testGetFormIdWithString(): void {
$form_arg = 'foo';
$form_state = new FormState();
$this->expectException(\InvalidArgumentException::class);
@@ -66,7 +66,7 @@ class FormBuilderTest extends FormTestBase {
/**
* @covers ::getFormId
*/
- public function testGetFormIdWithNonFormClass() {
+ public function testGetFormIdWithNonFormClass(): void {
$form_arg = \stdClass::class;
$form_state = new FormState();
$this->expectException(\InvalidArgumentException::class);
@@ -77,7 +77,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests the getFormId() method with a class name form ID.
*/
- public function testGetFormIdWithClassName() {
+ public function testGetFormIdWithClassName(): void {
$form_arg = 'Drupal\Tests\Core\Form\TestForm';
$form_state = new FormState();
@@ -90,7 +90,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests the getFormId() method with an injected class name form ID.
*/
- public function testGetFormIdWithInjectedClassName() {
+ public function testGetFormIdWithInjectedClassName(): void {
$container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface');
\Drupal::setContainer($container);
@@ -106,7 +106,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests the getFormId() method with a form object.
*/
- public function testGetFormIdWithObject() {
+ public function testGetFormIdWithObject(): void {
$expected_form_id = 'my_module_form_id';
$form_arg = $this->getMockForm($expected_form_id);
@@ -121,7 +121,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests the getFormId() method with a base form object.
*/
- public function testGetFormIdWithBaseForm() {
+ public function testGetFormIdWithBaseForm(): void {
$expected_form_id = 'my_module_form_id';
$base_form_id = 'my_module';
@@ -146,7 +146,7 @@ class FormBuilderTest extends FormTestBase {
*
* @dataProvider formStateResponseProvider
*/
- public function testHandleFormStateResponse($class, $form_state_key) {
+ public function testHandleFormStateResponse($class, $form_state_key): void {
$form_id = 'test_form_id';
$expected_form = $form_id();
@@ -187,7 +187,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests the handling of a redirect when FormStateInterface::$response exists.
*/
- public function testHandleRedirectWithResponse() {
+ public function testHandleRedirectWithResponse(): void {
$form_id = 'test_form_id';
$expected_form = $form_id();
@@ -226,7 +226,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests the getForm() method with a string based form ID.
*/
- public function testGetFormWithString() {
+ public function testGetFormWithString(): void {
$form_id = 'test_form_id';
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('The form class test_form_id could not be found or loaded.');
@@ -236,7 +236,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests the getForm() method with a form object.
*/
- public function testGetFormWithObject() {
+ public function testGetFormWithObject(): void {
$form_id = 'test_form_id';
$expected_form = $form_id();
@@ -250,7 +250,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests the getForm() method with a class name based form ID.
*/
- public function testGetFormWithClassString() {
+ public function testGetFormWithClassString(): void {
$form_id = '\Drupal\Tests\Core\Form\TestForm';
$object = new TestForm();
$form = [];
@@ -265,7 +265,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests the buildForm() method with a string based form ID.
*/
- public function testBuildFormWithString() {
+ public function testBuildFormWithString(): void {
$form_id = 'test_form_id';
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('The form class test_form_id could not be found or loaded.');
@@ -275,7 +275,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests the buildForm() method with a class name based form ID.
*/
- public function testBuildFormWithClassString() {
+ public function testBuildFormWithClassString(): void {
$form_id = '\Drupal\Tests\Core\Form\TestForm';
$object = new TestForm();
$form = [];
@@ -290,7 +290,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests the buildForm() method with a form object.
*/
- public function testBuildFormWithObject() {
+ public function testBuildFormWithObject(): void {
$form_id = 'test_form_id';
$expected_form = $form_id();
@@ -315,7 +315,7 @@ class FormBuilderTest extends FormTestBase {
*
* @dataProvider providerTestBuildFormWithTriggeringElement
*/
- public function testBuildFormWithTriggeringElement($element_value, $input_value) {
+ public function testBuildFormWithTriggeringElement($element_value, $input_value): void {
$form_id = 'test_form_id';
$expected_form = $form_id();
@@ -353,7 +353,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests the rebuildForm() method for a POST submission.
*/
- public function testRebuildForm() {
+ public function testRebuildForm(): void {
$form_id = 'test_form_id';
$expected_form = $form_id();
@@ -393,7 +393,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests the rebuildForm() method for a GET submission.
*/
- public function testRebuildFormOnGetRequest() {
+ public function testRebuildFormOnGetRequest(): void {
$form_id = 'test_form_id';
$expected_form = $form_id();
@@ -431,7 +431,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests the getCache() method.
*/
- public function testGetCache() {
+ public function testGetCache(): void {
$form_id = 'test_form_id';
$expected_form = $form_id();
$expected_form['#token'] = FALSE;
@@ -474,7 +474,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests that HTML IDs are unique when rebuilding a form with errors.
*/
- public function testUniqueHtmlId() {
+ public function testUniqueHtmlId(): void {
$form_id = 'test_form_id';
$expected_form = $form_id();
$expected_form['test']['#required'] = TRUE;
@@ -500,7 +500,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests that HTML IDs are unique between 2 forms with the same element names.
*/
- public function testUniqueElementHtmlId() {
+ public function testUniqueElementHtmlId(): void {
$form_id_1 = 'test_form_id';
$form_id_2 = 'test_form_id_2';
$expected_form = $form_id_1();
@@ -530,7 +530,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests that a cached form is deleted after submit.
*/
- public function testFormCacheDeletionCached() {
+ public function testFormCacheDeletionCached(): void {
$form_id = 'test_form_id';
$form_build_id = $this->randomMachineName();
@@ -557,7 +557,7 @@ class FormBuilderTest extends FormTestBase {
/**
* Tests that an uncached form does not trigger cache set or delete.
*/
- public function testFormCacheDeletionUncached() {
+ public function testFormCacheDeletionUncached(): void {
$form_id = 'test_form_id';
$form_build_id = $this->randomMachineName();
@@ -575,7 +575,7 @@ class FormBuilderTest extends FormTestBase {
/**
* @covers ::buildForm
*/
- public function testExceededFileSize() {
+ public function testExceededFileSize(): void {
$request = new Request([FormBuilderInterface::AJAX_FORM_REQUEST => TRUE]);
$request->setSession(new Session(new MockArraySessionStorage()));
$request_stack = new RequestStack();
@@ -649,7 +649,7 @@ class FormBuilderTest extends FormTestBase {
*
* @dataProvider providerTestChildAccessInheritance
*/
- public function testChildAccessInheritance($element, $access_checks) {
+ public function testChildAccessInheritance($element, $access_checks): void {
$form_arg = new TestFormWithPredefinedForm();
$form_arg->setForm($element);
@@ -812,7 +812,7 @@ class FormBuilderTest extends FormTestBase {
*
* @dataProvider providerTestValueCallableIsSafe
*/
- public function testValueCallableIsSafe($callback, $expected) {
+ public function testValueCallableIsSafe($callback, $expected): void {
$method = new \ReflectionMethod(FormBuilder::class, 'valueCallableIsSafe');
$is_safe = $method->invoke($this->formBuilder, $callback);
$this->assertSame($expected, $is_safe);
@@ -848,7 +848,7 @@ class FormBuilderTest extends FormTestBase {
*
* @dataProvider providerTestInvalidToken
*/
- public function testInvalidToken($expected, $valid_token, $user_is_authenticated) {
+ public function testInvalidToken($expected, $valid_token, $user_is_authenticated): void {
$form_token = 'the_form_token';
$form_id = 'test_form_id';
@@ -909,7 +909,7 @@ class FormBuilderTest extends FormTestBase {
*
* @dataProvider providerTestFormTokenCacheability
*/
- public function testFormTokenCacheability($token, $is_authenticated, $expected_form_cacheability, $expected_token_cacheability, $method) {
+ public function testFormTokenCacheability($token, $is_authenticated, $expected_form_cacheability, $expected_token_cacheability, $method): void {
$user = $this->prophesize(AccountProxyInterface::class);
$user->isAuthenticated()
->willReturn($is_authenticated);
diff --git a/core/tests/Drupal/Tests/Core/Form/FormCacheTest.php b/core/tests/Drupal/Tests/Core/Form/FormCacheTest.php
index e83d5705c44..b59fb9ce55e 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormCacheTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormCacheTest.php
@@ -117,7 +117,7 @@ class FormCacheTest extends UnitTestCase {
/**
* @covers ::getCache
*/
- public function testGetCacheValidToken() {
+ public function testGetCacheValidToken(): void {
$form_build_id = 'the_form_build_id';
$form_state = new FormState();
$cache_token = 'the_cache_token';
@@ -141,7 +141,7 @@ class FormCacheTest extends UnitTestCase {
/**
* @covers ::getCache
*/
- public function testGetCacheInvalidToken() {
+ public function testGetCacheInvalidToken(): void {
$form_build_id = 'the_form_build_id';
$form_state = new FormState();
$cache_token = 'the_cache_token';
@@ -165,7 +165,7 @@ class FormCacheTest extends UnitTestCase {
/**
* @covers ::getCache
*/
- public function testGetCacheAnonUser() {
+ public function testGetCacheAnonUser(): void {
$form_build_id = 'the_form_build_id';
$form_state = new FormState();
$cached_form = ['#cache_token' => NULL];
@@ -187,7 +187,7 @@ class FormCacheTest extends UnitTestCase {
/**
* @covers ::getCache
*/
- public function testGetCacheAuthUser() {
+ public function testGetCacheAuthUser(): void {
$form_build_id = 'the_form_build_id';
$form_state = new FormState();
$cached_form = ['#cache_token' => NULL];
@@ -207,7 +207,7 @@ class FormCacheTest extends UnitTestCase {
/**
* @covers ::getCache
*/
- public function testGetCacheNoForm() {
+ public function testGetCacheNoForm(): void {
$form_build_id = 'the_form_build_id';
$form_state = new FormState();
$cached_form = NULL;
@@ -226,7 +226,7 @@ class FormCacheTest extends UnitTestCase {
/**
* @covers ::getCache
*/
- public function testGetCacheImmutableForm() {
+ public function testGetCacheImmutableForm(): void {
$form_build_id = 'the_form_build_id';
$form_state = (new FormState())
->addBuildInfo('immutable', TRUE);
@@ -252,7 +252,7 @@ class FormCacheTest extends UnitTestCase {
/**
* @covers ::loadCachedFormState
*/
- public function testLoadCachedFormState() {
+ public function testLoadCachedFormState(): void {
$form_build_id = 'the_form_build_id';
$form_state = new FormState();
$cached_form = ['#cache_token' => NULL];
@@ -278,7 +278,7 @@ class FormCacheTest extends UnitTestCase {
/**
* @covers ::loadCachedFormState
*/
- public function testLoadCachedFormStateWithFiles() {
+ public function testLoadCachedFormStateWithFiles(): void {
$form_build_id = 'the_form_build_id';
$form_state = new FormState();
$cached_form = ['#cache_token' => NULL];
@@ -318,7 +318,7 @@ class FormCacheTest extends UnitTestCase {
/**
* @covers ::setCache
*/
- public function testSetCacheWithForm() {
+ public function testSetCacheWithForm(): void {
$form_build_id = 'the_form_build_id';
$form = [
'#form_id' => 'the_form_id',
@@ -340,7 +340,7 @@ class FormCacheTest extends UnitTestCase {
/**
* @covers ::setCache
*/
- public function testSetCacheWithoutForm() {
+ public function testSetCacheWithoutForm(): void {
$form_build_id = 'the_form_build_id';
$form = NULL;
$form_state = new FormState();
@@ -359,7 +359,7 @@ class FormCacheTest extends UnitTestCase {
/**
* @covers ::setCache
*/
- public function testSetCacheAuthUser() {
+ public function testSetCacheAuthUser(): void {
$form_build_id = 'the_form_build_id';
$form = [];
$form_state = new FormState();
@@ -389,7 +389,7 @@ class FormCacheTest extends UnitTestCase {
/**
* @covers ::setCache
*/
- public function testSetCacheBuildIdMismatch() {
+ public function testSetCacheBuildIdMismatch(): void {
$form_build_id = 'the_form_build_id';
$form = [
'#form_id' => 'the_form_id',
@@ -410,7 +410,7 @@ class FormCacheTest extends UnitTestCase {
/**
* @covers ::deleteCache
*/
- public function testDeleteCache() {
+ public function testDeleteCache(): void {
$form_build_id = 'the_form_build_id';
$this->formCacheStore->expects($this->once())
diff --git a/core/tests/Drupal/Tests/Core/Form/FormElementHelperTest.php b/core/tests/Drupal/Tests/Core/Form/FormElementHelperTest.php
index 7eedb6d440b..535623e1f60 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormElementHelperTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormElementHelperTest.php
@@ -24,7 +24,7 @@ class FormElementHelperTest extends UnitTestCase {
*
* @dataProvider getElementByNameProvider
*/
- public function testGetElementByName($name, $form, $expected) {
+ public function testGetElementByName($name, $form, $expected): void {
$this->assertSame($expected, FormElementHelper::getElementByName($name, $form));
}
@@ -109,7 +109,7 @@ class FormElementHelperTest extends UnitTestCase {
*
* @dataProvider getElementTitleProvider
*/
- public function testGetElementTitle($name, $form, $expected) {
+ public function testGetElementTitle($name, $form, $expected): void {
$element = FormElementHelper::getElementByName($name, $form);
$this->assertSame($expected, FormElementHelper::getElementTitle($element));
}
diff --git a/core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php b/core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php
index f60ab6d0dff..e319d52b117 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormErrorHandlerTest.php
@@ -49,7 +49,7 @@ class FormErrorHandlerTest extends UnitTestCase {
* @covers ::handleFormErrors
* @covers ::displayErrorMessages
*/
- public function testDisplayErrorMessages() {
+ public function testDisplayErrorMessages(): void {
$messages = [
'invalid',
'invalid',
@@ -125,7 +125,7 @@ class FormErrorHandlerTest extends UnitTestCase {
* @covers ::handleFormErrors
* @covers ::setElementErrorsFromFormState
*/
- public function testSetElementErrorsFromFormState() {
+ public function testSetElementErrorsFromFormState(): void {
$form = [
'#parents' => [],
'#array_parents' => [],
diff --git a/core/tests/Drupal/Tests/Core/Form/FormHelperTest.php b/core/tests/Drupal/Tests/Core/Form/FormHelperTest.php
index e39c3973a32..2da73b861e1 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormHelperTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormHelperTest.php
@@ -19,7 +19,7 @@ class FormHelperTest extends UnitTestCase {
*
* @covers ::rewriteStatesSelector
*/
- public function testRewriteStatesSelector() {
+ public function testRewriteStatesSelector(): void {
// Simple selectors.
$value = ['value' => 'medium'];
@@ -89,7 +89,7 @@ class FormHelperTest extends UnitTestCase {
* @covers ::processStates
* @dataProvider providerElements
*/
- public function testProcessStates($elements, $key) {
+ public function testProcessStates($elements, $key): void {
$json = Json::encode($elements['#states']);
FormHelper::processStates($elements);
$this->assertEquals(['core/drupal.states'], $elements['#attached']['library']);
diff --git a/core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php b/core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php
index 3924855fd97..0594c733b15 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php
@@ -58,7 +58,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setFormState
*/
- public function testSetFormState() {
+ public function testSetFormState(): void {
$form_state_additions = [
'foo' => 'bar',
];
@@ -74,7 +74,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testSetAlwaysProcess($always_process) {
+ public function testSetAlwaysProcess($always_process): void {
$this->decoratedFormState->setAlwaysProcess($always_process)
->shouldBeCalled();
@@ -86,7 +86,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testGetAlwaysProcess($always_process) {
+ public function testGetAlwaysProcess($always_process): void {
$this->decoratedFormState->getAlwaysProcess()
->willReturn($always_process)
->shouldBeCalled();
@@ -97,7 +97,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setButtons
*/
- public function testSetButtons() {
+ public function testSetButtons(): void {
$buttons = [
'FOO' => 'BAR',
];
@@ -111,7 +111,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getButtons
*/
- public function testGetButtons() {
+ public function testGetButtons(): void {
$buttons = [
'FOO' => 'BAR',
];
@@ -128,7 +128,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testSetCached($cache) {
+ public function testSetCached($cache): void {
$this->decoratedFormState->setCached($cache)
->shouldBeCalled();
@@ -140,7 +140,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testIsCached($cache) {
+ public function testIsCached($cache): void {
$this->decoratedFormState->isCached()
->willReturn($cache)
->shouldBeCalled();
@@ -152,7 +152,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testSetCachedWithLogicException($cache) {
+ public function testSetCachedWithLogicException($cache): void {
$this->decoratedFormState->setCached($cache)
->willThrow(\LogicException::class);
$this->expectException(\LogicException::class);
@@ -162,7 +162,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::disableCache
*/
- public function testDisableCache() {
+ public function testDisableCache(): void {
$this->decoratedFormState->disableCache()
->shouldBeCalled();
@@ -172,7 +172,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setExecuted
*/
- public function testSetExecuted() {
+ public function testSetExecuted(): void {
$this->decoratedFormState->setExecuted()
->shouldBeCalled();
@@ -188,7 +188,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
* Any valid value for \Drupal\Core\Form\FormStateInterface::isExecuted()'s
* return value.
*/
- public function testIsExecuted($executed) {
+ public function testIsExecuted($executed): void {
$this->decoratedFormState->isExecuted()
->willReturn($executed)
->shouldBeCalled();
@@ -199,7 +199,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setGroups
*/
- public function testSetGroups() {
+ public function testSetGroups(): void {
$groups = [
'FOO' => 'BAR',
];
@@ -213,7 +213,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getGroups
*/
- public function testGetGroups() {
+ public function testGetGroups(): void {
$groups = [
'FOO' => 'BAR',
];
@@ -235,7 +235,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testSetHasFileElement($has_file_element) {
+ public function testSetHasFileElement($has_file_element): void {
$this->decoratedFormState->setHasFileElement($has_file_element)
->shouldBeCalled();
@@ -247,7 +247,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testHasFileElement($has_file_element) {
+ public function testHasFileElement($has_file_element): void {
$this->decoratedFormState->hasFileElement()
->willReturn($has_file_element)
->shouldBeCalled();
@@ -260,7 +260,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerLimitValidationErrors
*/
- public function testSetLimitValidationErrors($limit_validation_errors) {
+ public function testSetLimitValidationErrors($limit_validation_errors): void {
$this->decoratedFormState->setLimitValidationErrors($limit_validation_errors)
->shouldBeCalled();
@@ -272,7 +272,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerLimitValidationErrors
*/
- public function testGetLimitValidationErrors($limit_validation_errors) {
+ public function testGetLimitValidationErrors($limit_validation_errors): void {
$this->decoratedFormState->getLimitValidationErrors()
->willReturn($limit_validation_errors)
->shouldBeCalled();
@@ -299,7 +299,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testSetMethod($method) {
+ public function testSetMethod($method): void {
$this->decoratedFormState->setMethod($method)
->shouldBeCalled();
@@ -311,7 +311,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerIsMethodType
*/
- public function testIsMethodType($expected_return_value, $method_type) {
+ public function testIsMethodType($expected_return_value, $method_type): void {
$this->decoratedFormState->isMethodType($method_type)
->willReturn($expected_return_value)
->shouldBeCalled();
@@ -336,7 +336,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSetRequestMethod
*/
- public function testSetRequestMethod($method) {
+ public function testSetRequestMethod($method): void {
$this->decoratedFormState->setRequestMethod($method)
->shouldBeCalled();
@@ -358,7 +358,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testSetValidationEnforced($must_validate) {
+ public function testSetValidationEnforced($must_validate): void {
$this->decoratedFormState->setValidationEnforced($must_validate)
->shouldBeCalled();
@@ -370,7 +370,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testIsValidationEnforced($must_validate) {
+ public function testIsValidationEnforced($must_validate): void {
$this->decoratedFormState->isValidationEnforced()
->willReturn($must_validate)
->shouldBeCalled();
@@ -383,7 +383,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testDisableRedirect($no_redirect) {
+ public function testDisableRedirect($no_redirect): void {
$this->decoratedFormState->disableRedirect($no_redirect)
->shouldBeCalled();
@@ -395,7 +395,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testIsRedirectDisabled($no_redirect) {
+ public function testIsRedirectDisabled($no_redirect): void {
$this->decoratedFormState->isRedirectDisabled()
->willReturn($no_redirect)
->shouldBeCalled();
@@ -408,7 +408,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testSetProcessInput($process_input) {
+ public function testSetProcessInput($process_input): void {
$this->decoratedFormState->setProcessInput($process_input)
->shouldBeCalled();
@@ -420,7 +420,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testIsProcessingInput($process_input) {
+ public function testIsProcessingInput($process_input): void {
$this->decoratedFormState->isProcessingInput()
->willReturn($process_input)
->shouldBeCalled();
@@ -433,7 +433,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testSetProgrammed($programmed) {
+ public function testSetProgrammed($programmed): void {
$this->decoratedFormState->setProgrammed($programmed)
->shouldBeCalled();
@@ -445,7 +445,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testIsProgrammed($programmed) {
+ public function testIsProgrammed($programmed): void {
$this->decoratedFormState->isProgrammed()
->willReturn($programmed)
->shouldBeCalled();
@@ -458,7 +458,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testSetProgrammedBypassAccessCheck($programmed_bypass_access_check) {
+ public function testSetProgrammedBypassAccessCheck($programmed_bypass_access_check): void {
$this->decoratedFormState->setProgrammedBypassAccessCheck($programmed_bypass_access_check)
->shouldBeCalled();
@@ -470,7 +470,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testIsBypassingProgrammedAccessChecks($programmed_bypass_access_check) {
+ public function testIsBypassingProgrammedAccessChecks($programmed_bypass_access_check): void {
$this->decoratedFormState->isBypassingProgrammedAccessChecks()
->willReturn($programmed_bypass_access_check)
->shouldBeCalled();
@@ -481,7 +481,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setRebuildInfo
*/
- public function testSetRebuildInfo() {
+ public function testSetRebuildInfo(): void {
$rebuild_info = [
'FOO' => 'BAR',
];
@@ -495,7 +495,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getRebuildInfo
*/
- public function testGetRebuildInfo() {
+ public function testGetRebuildInfo(): void {
$rebuild_info = [
'FOO' => 'BAR',
];
@@ -510,7 +510,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::addRebuildInfo
*/
- public function testAddRebuildInfo() {
+ public function testAddRebuildInfo(): void {
$property = 'FOO';
$value = 'BAR';
@@ -522,7 +522,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setStorage
*/
- public function testSetStorage() {
+ public function testSetStorage(): void {
$storage = [
'FOO' => 'BAR',
];
@@ -536,7 +536,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getStorage
*/
- public function testGetStorage() {
+ public function testGetStorage(): void {
$storage = [
'FOO' => 'BAR',
];
@@ -556,7 +556,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setSubmitHandlers
*/
- public function testSetSubmitHandlers() {
+ public function testSetSubmitHandlers(): void {
$submit_handlers = [
'FOO' => 'BAR',
];
@@ -570,7 +570,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getSubmitHandlers
*/
- public function testGetSubmitHandlers() {
+ public function testGetSubmitHandlers(): void {
$submit_handlers = [
'FOO' => 'BAR',
];
@@ -585,7 +585,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setSubmitted
*/
- public function testSetSubmitted() {
+ public function testSetSubmitted(): void {
$this->decoratedFormState->setSubmitted()
->shouldBeCalled();
@@ -602,7 +602,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
* \Drupal\Core\Form\FormStateInterface::isSubmitted()'s return
* value.
*/
- public function testIsSubmitted($submitted) {
+ public function testIsSubmitted($submitted): void {
$this->decoratedFormState->isSubmitted()
->willReturn($submitted);
@@ -612,7 +612,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setTemporary
*/
- public function testSetTemporary() {
+ public function testSetTemporary(): void {
$temporary = [
'FOO' => 'BAR',
];
@@ -626,7 +626,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getTemporary
*/
- public function testGetTemporary() {
+ public function testGetTemporary(): void {
$temporary = [
'FOO' => 'BAR',
];
@@ -652,7 +652,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
* \Drupal\Core\Form\FormStateInterface::setTemporaryValue()'s $value
* argument.
*/
- public function testSetTemporaryValue($key, $value) {
+ public function testSetTemporaryValue($key, $value): void {
$this->decoratedFormState->setTemporaryValue($key, $value)
->shouldBeCalled();
@@ -683,7 +683,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
* \Drupal\Core\Form\FormStateInterface::getTemporaryValue()'s return
* value.
*/
- public function testGetTemporaryValue($key, $value = NULL) {
+ public function testGetTemporaryValue($key, $value = NULL): void {
// Use PHPUnit for mocking, because Prophecy cannot mock methods that return
// by reference. See \Prophecy\Doubler\Generator\Node::getCode().
$decorated_form_state = $this->createMock(FormStateInterface::class);
@@ -721,7 +721,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
* \Drupal\Core\Form\FormStateInterface::hasTemporaryValue()'s $key
* argument.
*/
- public function testHasTemporaryValue($exists, $key) {
+ public function testHasTemporaryValue($exists, $key): void {
$this->decoratedFormState->hasTemporaryValue($key)
->willReturn($exists)
->shouldBeCalled();
@@ -742,7 +742,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setTriggeringElement
*/
- public function testSetTriggeringElement() {
+ public function testSetTriggeringElement(): void {
$triggering_element = [
'FOO' => 'BAR',
];
@@ -756,7 +756,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getTriggeringElement
*/
- public function testGetTriggeringElement() {
+ public function testGetTriggeringElement(): void {
$triggering_element = [
'FOO' => 'BAR',
];
@@ -776,7 +776,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setValidateHandlers
*/
- public function testSetValidateHandlers() {
+ public function testSetValidateHandlers(): void {
$validate_handlers = [
'FOO' => 'BAR',
];
@@ -790,7 +790,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getValidateHandlers
*/
- public function testGetValidateHandlers() {
+ public function testGetValidateHandlers(): void {
$validate_handlers = [
'FOO' => 'BAR',
];
@@ -812,7 +812,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
* \Drupal\Core\Form\FormStateInterface::setValidationComplete()'s $complete
* argument.
*/
- public function testSetValidationComplete($complete) {
+ public function testSetValidationComplete($complete): void {
$this->decoratedFormState->setValidationComplete($complete)
->shouldBeCalled();
@@ -829,7 +829,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
* \Drupal\Core\Form\FormStateInterface::isValidationComplete()'s return
* value.
*/
- public function testIsValidationComplete($complete) {
+ public function testIsValidationComplete($complete): void {
$this->decoratedFormState->isValidationComplete()
->willReturn($complete)
->shouldBeCalled();
@@ -855,7 +855,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
* Any valid value for \Drupal\Core\Form\FormStateInterface::loadInclude()'s
* $name argument.
*/
- public function testLoadInclude($expected, $module, $type, $name) {
+ public function testLoadInclude($expected, $module, $type, $name): void {
$this->decoratedFormState->loadInclude($module, $type, $name)
->willReturn($expected)
->shouldBeCalled();
@@ -881,7 +881,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getCacheableArray
*/
- public function testGetCacheableArray() {
+ public function testGetCacheableArray(): void {
$cacheable_array = [
'foo' => 'bar',
];
@@ -896,7 +896,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setCompleteForm
*/
- public function testSetCompleteForm() {
+ public function testSetCompleteForm(): void {
$complete_form = [
'FOO' => 'BAR',
];
@@ -910,7 +910,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getCompleteForm
*/
- public function testGetCompleteForm() {
+ public function testGetCompleteForm(): void {
$complete_form = [
'FOO' => 'BAR',
];
@@ -940,7 +940,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
* Any valid value for \Drupal\Core\Form\FormStateInterface::set()'s $value
* argument.
*/
- public function testSet($key, $value) {
+ public function testSet($key, $value): void {
$this->decoratedFormState->set($key, $value)
->shouldBeCalled();
@@ -969,7 +969,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
* (optional) Any valid value for
* \Drupal\Core\Form\FormStateInterface::get()'s return value.
*/
- public function testGet($key, $value = NULL) {
+ public function testGet($key, $value = NULL): void {
// Use PHPUnit for mocking, because Prophecy cannot mock methods that return
// by reference. See \Prophecy\Doubler\Generator\Node::getCode().
@@ -1006,7 +1006,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
* Any valid value for \Drupal\Core\Form\FormStateInterface::has()'s $key
* argument.
*/
- public function testHas($exists, $key) {
+ public function testHas($exists, $key): void {
$this->decoratedFormState->has($key)
->willReturn($exists)
->shouldBeCalled();
@@ -1027,7 +1027,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setBuildInfo
*/
- public function testSetBuildInfo() {
+ public function testSetBuildInfo(): void {
$build_info = [
'FOO' => 'BAR',
];
@@ -1041,7 +1041,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getBuildInfo
*/
- public function testGetBuildInfo() {
+ public function testGetBuildInfo(): void {
$build_info = [
'FOO' => 'BAR',
];
@@ -1056,7 +1056,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::addBuildInfo
*/
- public function testAddBuildInfo() {
+ public function testAddBuildInfo(): void {
$property = 'FOO';
$value = 'BAR';
@@ -1069,7 +1069,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setUserInput
*/
- public function testSetUserInput() {
+ public function testSetUserInput(): void {
$user_input = [
'FOO' => 'BAR',
];
@@ -1083,7 +1083,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getUserInput
*/
- public function testGetUserInput() {
+ public function testGetUserInput(): void {
$user_input = [
'FOO' => 'BAR',
];
@@ -1103,7 +1103,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getValues
*/
- public function testGetValues() {
+ public function testGetValues(): void {
$values = [
'FOO' => 'BAR',
];
@@ -1123,7 +1123,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getValue
*/
- public function testGetValue() {
+ public function testGetValue(): void {
$key = 'FOO';
$value = 'BAR';
@@ -1143,7 +1143,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setValues
*/
- public function testSetValues() {
+ public function testSetValues(): void {
$values = [
'foo' => 'Foo',
'bar' => ['Bar'],
@@ -1158,7 +1158,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setValue
*/
- public function testSetValue() {
+ public function testSetValue(): void {
$key = 'FOO';
$value = 'BAR';
@@ -1171,7 +1171,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::unsetValue
*/
- public function testUnsetValue() {
+ public function testUnsetValue(): void {
$key = 'FOO';
$this->decoratedFormState->unsetValue($key)
@@ -1183,7 +1183,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::hasValue
*/
- public function testHasValue() {
+ public function testHasValue(): void {
$key = ['foo', 'bar'];
$has = TRUE;
@@ -1197,7 +1197,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::isValueEmpty
*/
- public function testIsValueEmpty() {
+ public function testIsValueEmpty(): void {
$key = ['foo', 'bar'];
$is_empty = TRUE;
@@ -1211,7 +1211,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setValueForElement
*/
- public function testSetValueForElement() {
+ public function testSetValueForElement(): void {
$element = [
'#type' => 'foo',
];
@@ -1226,7 +1226,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setResponse
*/
- public function testSetResponse() {
+ public function testSetResponse(): void {
$response = $this->createMock(Response::class);
$this->decoratedFormState->setResponse($response)
@@ -1238,7 +1238,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getResponse
*/
- public function testGetResponse() {
+ public function testGetResponse(): void {
$response = $this->createMock(Response::class);
$this->decoratedFormState->getResponse()
@@ -1251,7 +1251,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setRedirect
*/
- public function testSetRedirect() {
+ public function testSetRedirect(): void {
$route_name = 'foo';
$route_parameters = [
'bar' => 'baz',
@@ -1269,7 +1269,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setRedirectUrl
*/
- public function testSetRedirectUrl() {
+ public function testSetRedirectUrl(): void {
$url = new Url('foo');
$this->decoratedFormState->setRedirectUrl($url)
@@ -1287,7 +1287,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
* Any valid value for \Drupal\Core\Form\FormStateInterface::getRedirect()'s
* return value.
*/
- public function testGetRedirect($expected) {
+ public function testGetRedirect($expected): void {
$this->decoratedFormState->getRedirect()
->willReturn($expected)
->shouldBeCalled();
@@ -1310,7 +1310,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setErrorByName
*/
- public function testSetErrorByName() {
+ public function testSetErrorByName(): void {
$name = 'foo';
$message = 'bar';
@@ -1323,7 +1323,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setError
*/
- public function testSetError() {
+ public function testSetError(): void {
$element = [
'#foo' => 'bar',
];
@@ -1338,7 +1338,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::clearErrors
*/
- public function testClearErrors() {
+ public function testClearErrors(): void {
$this->decoratedFormState->clearErrors()
->shouldBeCalled();
@@ -1348,7 +1348,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getError
*/
- public function testGetError() {
+ public function testGetError(): void {
$element = [
'#foo' => 'bar',
];
@@ -1364,7 +1364,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getErrors
*/
- public function testGetErrors() {
+ public function testGetErrors(): void {
$errors = [
'foo' => 'bar',
];
@@ -1384,7 +1384,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
* Any valid value for \Drupal\Core\Form\FormStateInterface::setRebuild()'s
* $rebuild argument.
*/
- public function testSetRebuild($rebuild) {
+ public function testSetRebuild($rebuild): void {
$this->decoratedFormState->setRebuild($rebuild)
->shouldBeCalled();
@@ -1396,7 +1396,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testIsRebuilding($rebuild) {
+ public function testIsRebuilding($rebuild): void {
$this->decoratedFormState->isRebuilding()
->willReturn($rebuild)
->shouldBeCalled();
@@ -1409,7 +1409,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testSetInvalidToken($expected) {
+ public function testSetInvalidToken($expected): void {
$this->decoratedFormState->setInvalidToken($expected)
->shouldBeCalled();
@@ -1421,7 +1421,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerSingleBooleanArgument
*/
- public function testHasInvalidToken($expected) {
+ public function testHasInvalidToken($expected): void {
$this->decoratedFormState->hasInvalidToken()
->willReturn($expected)
->shouldBeCalled();
@@ -1434,7 +1434,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
*
* @dataProvider providerPrepareCallback
*/
- public function testPrepareCallback($unprepared_callback, callable $prepared_callback) {
+ public function testPrepareCallback($unprepared_callback, callable $prepared_callback): void {
$this->decoratedFormState->prepareCallback(Argument::is($unprepared_callback))
->willReturn($prepared_callback)
->shouldBeCalled();
@@ -1468,7 +1468,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setFormObject
*/
- public function testSetFormObject() {
+ public function testSetFormObject(): void {
$form = $this->createMock(FormInterface::class);
$this->decoratedFormState->setFormObject($form)
@@ -1480,7 +1480,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getFormObject
*/
- public function testGetFormObject() {
+ public function testGetFormObject(): void {
$form = $this->createMock(FormInterface::class);
$this->decoratedFormState->getFormObject()
@@ -1493,7 +1493,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::setCleanValueKeys
*/
- public function testSetCleanValueKeys() {
+ public function testSetCleanValueKeys(): void {
$keys = ['BAR'];
$this->decoratedFormState->setCleanValueKeys($keys)
@@ -1505,7 +1505,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::getCleanValueKeys
*/
- public function testGetCleanValueKeys() {
+ public function testGetCleanValueKeys(): void {
$keys = ['BAR'];
$this->decoratedFormState->getCleanValueKeys()
@@ -1518,7 +1518,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::addCleanValueKey
*/
- public function testAddCleanValueKey() {
+ public function testAddCleanValueKey(): void {
$key = 'BAR';
$this->decoratedFormState->addCleanValueKey($key)
@@ -1530,7 +1530,7 @@ class FormStateDecoratorBaseTest extends UnitTestCase {
/**
* @covers ::cleanValues
*/
- public function testCleanValues() {
+ public function testCleanValues(): void {
$this->decoratedFormState->cleanValues()
->shouldBeCalled();
diff --git a/core/tests/Drupal/Tests/Core/Form/FormStateTest.php b/core/tests/Drupal/Tests/Core/Form/FormStateTest.php
index 3aadbc411d4..708e2b32b8d 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormStateTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormStateTest.php
@@ -25,7 +25,7 @@ class FormStateTest extends UnitTestCase {
*
* @dataProvider providerTestGetRedirect
*/
- public function testGetRedirect($form_state_additions, $expected) {
+ public function testGetRedirect($form_state_additions, $expected): void {
$form_state = (new FormState())->setFormState($form_state_additions);
$redirect = $form_state->getRedirect();
$this->assertEquals($expected, $redirect);
@@ -58,7 +58,7 @@ class FormStateTest extends UnitTestCase {
*
* @covers ::setError
*/
- public function testSetError() {
+ public function testSetError(): void {
$form_state = new FormState();
$element['#parents'] = ['foo', 'bar'];
$form_state->setError($element, 'Fail');
@@ -72,7 +72,7 @@ class FormStateTest extends UnitTestCase {
*
* @dataProvider providerTestGetError
*/
- public function testGetError($errors, $parents, $error = NULL) {
+ public function testGetError($errors, $parents, $error = NULL): void {
$element['#parents'] = $parents;
$form_state = (new FormState())->setFormState([
'errors' => $errors,
@@ -100,7 +100,7 @@ class FormStateTest extends UnitTestCase {
*
* @dataProvider providerTestSetErrorByName
*/
- public function testSetErrorByName($limit_validation_errors, $expected_errors) {
+ public function testSetErrorByName($limit_validation_errors, $expected_errors): void {
$form_state = new FormState();
$form_state->setLimitValidationErrors($limit_validation_errors);
$form_state->clearErrors();
@@ -130,7 +130,7 @@ class FormStateTest extends UnitTestCase {
*
* @covers ::setErrorByName
*/
- public function testFormErrorsDuringSubmission() {
+ public function testFormErrorsDuringSubmission(): void {
$form_state = new FormState();
$form_state->setValidationComplete();
$this->expectException(\LogicException::class);
@@ -141,7 +141,7 @@ class FormStateTest extends UnitTestCase {
/**
* @covers ::prepareCallback
*/
- public function testPrepareCallbackValidMethod() {
+ public function testPrepareCallbackValidMethod(): void {
$form_state = new FormState();
$form_state->setFormObject(new PrepareCallbackTestForm());
$processed_callback = $form_state->prepareCallback('::buildForm');
@@ -151,7 +151,7 @@ class FormStateTest extends UnitTestCase {
/**
* @covers ::prepareCallback
*/
- public function testPrepareCallbackInValidMethod() {
+ public function testPrepareCallbackInValidMethod(): void {
$form_state = new FormState();
$form_state->setFormObject(new PrepareCallbackTestForm());
$processed_callback = $form_state->prepareCallback('not_a_method');
@@ -162,7 +162,7 @@ class FormStateTest extends UnitTestCase {
/**
* @covers ::prepareCallback
*/
- public function testPrepareCallbackArray() {
+ public function testPrepareCallbackArray(): void {
$form_state = new FormState();
$form_state->setFormObject(new PrepareCallbackTestForm());
$callback = [$form_state->getFormObject(), 'buildForm'];
@@ -173,7 +173,7 @@ class FormStateTest extends UnitTestCase {
/**
* @covers ::loadInclude
*/
- public function testLoadInclude() {
+ public function testLoadInclude(): void {
$type = 'some_type';
$module = 'some_module';
$name = 'some_name';
@@ -190,7 +190,7 @@ class FormStateTest extends UnitTestCase {
/**
* @covers ::loadInclude
*/
- public function testLoadIncludeNoName() {
+ public function testLoadIncludeNoName(): void {
$type = 'some_type';
$module = 'some_module';
$form_state = $this->getMockBuilder('Drupal\Core\Form\FormState')
@@ -206,7 +206,7 @@ class FormStateTest extends UnitTestCase {
/**
* @covers ::loadInclude
*/
- public function testLoadIncludeNotFound() {
+ public function testLoadIncludeNotFound(): void {
$type = 'some_type';
$module = 'some_module';
$form_state = $this->getMockBuilder('Drupal\Core\Form\FormState')
@@ -222,7 +222,7 @@ class FormStateTest extends UnitTestCase {
/**
* @covers ::loadInclude
*/
- public function testLoadIncludeAlreadyLoaded() {
+ public function testLoadIncludeAlreadyLoaded(): void {
$type = 'some_type';
$module = 'some_module';
$name = 'some_name';
@@ -248,7 +248,7 @@ class FormStateTest extends UnitTestCase {
*
* @dataProvider providerTestIsCached
*/
- public function testIsCached($cache_key, $no_cache_key, $expected) {
+ public function testIsCached($cache_key, $no_cache_key, $expected): void {
$form_state = (new FormState())->setFormState([
'cache' => $cache_key,
'no_cache' => $no_cache_key,
@@ -302,7 +302,7 @@ class FormStateTest extends UnitTestCase {
/**
* @covers ::setCached
*/
- public function testSetCachedPost() {
+ public function testSetCachedPost(): void {
$form_state = new FormState();
$form_state->setRequestMethod('POST');
$form_state->setCached();
@@ -312,7 +312,7 @@ class FormStateTest extends UnitTestCase {
/**
* @covers ::setCached
*/
- public function testSetCachedGet() {
+ public function testSetCachedGet(): void {
$form_state = new FormState();
$form_state->setRequestMethod('GET');
$this->expectException(\LogicException::class);
@@ -326,7 +326,7 @@ class FormStateTest extends UnitTestCase {
*
* @dataProvider providerTestIsMethodType
*/
- public function testIsMethodType($set_method_type, $input, $expected) {
+ public function testIsMethodType($set_method_type, $input, $expected): void {
$form_state = (new FormState())
->setMethod($set_method_type);
$this->assertSame($expected, $form_state->isMethodType($input));
@@ -365,7 +365,7 @@ class FormStateTest extends UnitTestCase {
* @covers ::hasTemporaryValue
* @covers ::setTemporaryValue
*/
- public function testTemporaryValue() {
+ public function testTemporaryValue(): void {
$form_state = new FormState();
$this->assertFalse($form_state->hasTemporaryValue('rainbow_sparkles'));
$form_state->setTemporaryValue('rainbow_sparkles', 'yes');
@@ -379,7 +379,7 @@ class FormStateTest extends UnitTestCase {
/**
* @covers ::getCleanValueKeys
*/
- public function testGetCleanValueKeys() {
+ public function testGetCleanValueKeys(): void {
$form_state = new FormState();
$this->assertSame($form_state->getCleanValueKeys(), ['form_id', 'form_token', 'form_build_id', 'op']);
}
@@ -387,7 +387,7 @@ class FormStateTest extends UnitTestCase {
/**
* @covers ::setCleanValueKeys
*/
- public function testSetCleanValueKeys() {
+ public function testSetCleanValueKeys(): void {
$form_state = new FormState();
$form_state->setCleanValueKeys(['key1', 'key2']);
$this->assertSame($form_state->getCleanValueKeys(), ['key1', 'key2']);
@@ -409,7 +409,7 @@ class FormStateTest extends UnitTestCase {
*
* @covers ::cleanValues
*/
- public function testCleanValues($form_state) {
+ public function testCleanValues($form_state): void {
$form_state->setValue('value_to_keep', 'magic_ponies');
$this->assertSame($form_state->cleanValues()->getValues(), ['value_to_keep' => 'magic_ponies']);
}
@@ -418,7 +418,7 @@ class FormStateTest extends UnitTestCase {
* @covers ::setValues
* @covers ::getValues
*/
- public function testGetValues() {
+ public function testGetValues(): void {
$values = [
'foo' => 'bar',
];
diff --git a/core/tests/Drupal/Tests/Core/Form/FormStateValuesTraitTest.php b/core/tests/Drupal/Tests/Core/Form/FormStateValuesTraitTest.php
index 1b931f3027d..d99a939d42a 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormStateValuesTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormStateValuesTraitTest.php
@@ -19,7 +19,7 @@ class FormStateValuesTraitTest extends UnitTestCase {
*
* @covers ::setValueForElement
*/
- public function testSetValueForElement() {
+ public function testSetValueForElement(): void {
$element = [
'#parents' => [
'foo',
@@ -43,7 +43,7 @@ class FormStateValuesTraitTest extends UnitTestCase {
*
* @dataProvider providerGetValue
*/
- public function testGetValue($key, $expected, $default = NULL) {
+ public function testGetValue($key, $expected, $default = NULL): void {
$form_state = (new FormStateValuesTraitStub())->setValues([
'foo' => 'one',
'bar' => [
@@ -91,7 +91,7 @@ class FormStateValuesTraitTest extends UnitTestCase {
/**
* @covers ::getValue
*/
- public function testGetValueModifyReturn() {
+ public function testGetValueModifyReturn(): void {
$initial_values = $values = [
'foo' => 'one',
'bar' => [
@@ -113,7 +113,7 @@ class FormStateValuesTraitTest extends UnitTestCase {
*
* @dataProvider providerSetValue
*/
- public function testSetValue($key, $value, $expected) {
+ public function testSetValue($key, $value, $expected): void {
$form_state = (new FormStateValuesTraitStub())->setValues([
'bar' => 'wrong',
]);
@@ -149,7 +149,7 @@ class FormStateValuesTraitTest extends UnitTestCase {
*
* @dataProvider providerHasValue
*/
- public function testHasValue($key, $expected) {
+ public function testHasValue($key, $expected): void {
$form_state = (new FormStateValuesTraitStub())->setValues([
'foo' => 'one',
'bar' => [
@@ -198,7 +198,7 @@ class FormStateValuesTraitTest extends UnitTestCase {
*
* @dataProvider providerIsValueEmpty
*/
- public function testIsValueEmpty($key, $expected) {
+ public function testIsValueEmpty($key, $expected): void {
$form_state = (new FormStateValuesTraitStub())->setValues([
'foo' => 'one',
'bar' => [
diff --git a/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php b/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php
index 83dbfec7378..ebeffbc8f17 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php
@@ -56,7 +56,7 @@ class FormSubmitterTest extends UnitTestCase {
/**
* @covers ::doSubmitForm
*/
- public function testHandleFormSubmissionNotSubmitted() {
+ public function testHandleFormSubmissionNotSubmitted(): void {
$form_submitter = $this->getFormSubmitter();
$form = [];
$form_state = new FormState();
@@ -69,7 +69,7 @@ class FormSubmitterTest extends UnitTestCase {
/**
* @covers ::doSubmitForm
*/
- public function testHandleFormSubmissionNoRedirect() {
+ public function testHandleFormSubmissionNoRedirect(): void {
$form_submitter = $this->getFormSubmitter();
$form = [];
$form_state = (new FormState())
@@ -86,7 +86,7 @@ class FormSubmitterTest extends UnitTestCase {
*
* @dataProvider providerTestHandleFormSubmissionWithResponses
*/
- public function testHandleFormSubmissionWithResponses($class, $form_state_key) {
+ public function testHandleFormSubmissionWithResponses($class, $form_state_key): void {
$response = $this->getMockBuilder($class)
->disableOriginalConstructor()
->getMock();
@@ -117,7 +117,7 @@ class FormSubmitterTest extends UnitTestCase {
*
* @covers ::redirectForm
*/
- public function testRedirectWithNull() {
+ public function testRedirectWithNull(): void {
$form_submitter = $this->getFormSubmitter();
$form_state = $this->createMock('Drupal\Core\Form\FormStateInterface');
@@ -143,7 +143,7 @@ class FormSubmitterTest extends UnitTestCase {
*
* @dataProvider providerTestRedirectWithUrl
*/
- public function testRedirectWithUrl(Url $redirect_value, $result, $status = 303) {
+ public function testRedirectWithUrl(Url $redirect_value, $result, $status = 303): void {
$container = new ContainerBuilder();
$container->set('url_generator', $this->urlGenerator);
\Drupal::setContainer($container);
@@ -190,7 +190,7 @@ class FormSubmitterTest extends UnitTestCase {
*
* @covers ::redirectForm
*/
- public function testRedirectWithResponseObject() {
+ public function testRedirectWithResponseObject(): void {
$form_submitter = $this->getFormSubmitter();
$redirect = new RedirectResponse('/example');
$form_state = $this->createMock('Drupal\Core\Form\FormStateInterface');
@@ -208,7 +208,7 @@ class FormSubmitterTest extends UnitTestCase {
*
* @covers ::redirectForm
*/
- public function testRedirectWithoutResult() {
+ public function testRedirectWithoutResult(): void {
$form_submitter = $this->getFormSubmitter();
$this->urlGenerator->expects($this->never())
->method('generateFromRoute');
@@ -229,7 +229,7 @@ class FormSubmitterTest extends UnitTestCase {
/**
* @covers ::executeSubmitHandlers
*/
- public function testExecuteSubmitHandlers() {
+ public function testExecuteSubmitHandlers(): void {
$form_submitter = $this->getFormSubmitter();
$mock = $this->prophesize(MockFormBase::class);
$mock
diff --git a/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php b/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php
index b80768cf531..18952cecd8c 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php
@@ -56,7 +56,7 @@ class FormValidatorTest extends UnitTestCase {
* @covers ::validateForm
* @covers ::finalizeValidation
*/
- public function testValidationComplete() {
+ public function testValidationComplete(): void {
$form_validator = new FormValidator(new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler);
$form = [];
@@ -71,7 +71,7 @@ class FormValidatorTest extends UnitTestCase {
*
* @covers ::validateForm
*/
- public function testPreventDuplicateValidation() {
+ public function testPreventDuplicateValidation(): void {
$form_validator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
->setConstructorArgs([new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler])
->onlyMethods(['doValidateForm'])
@@ -91,7 +91,7 @@ class FormValidatorTest extends UnitTestCase {
*
* @covers ::validateForm
*/
- public function testMustValidate() {
+ public function testMustValidate(): void {
$form_validator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
->setConstructorArgs([new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler])
->onlyMethods(['doValidateForm'])
@@ -111,7 +111,7 @@ class FormValidatorTest extends UnitTestCase {
/**
* @covers ::validateForm
*/
- public function testValidateInvalidFormToken() {
+ public function testValidateInvalidFormToken(): void {
$request_stack = new RequestStack();
$request = new Request([], [], [], [], [], ['REQUEST_URI' => '/test/example?foo=bar']);
$request_stack->push($request);
@@ -141,7 +141,7 @@ class FormValidatorTest extends UnitTestCase {
/**
* @covers ::validateForm
*/
- public function testValidateValidFormToken() {
+ public function testValidateValidFormToken(): void {
$request_stack = new RequestStack();
$this->csrfToken->expects($this->once())
->method('validate')
@@ -170,7 +170,7 @@ class FormValidatorTest extends UnitTestCase {
*
* @dataProvider providerTestHandleErrorsWithLimitedValidation
*/
- public function testHandleErrorsWithLimitedValidation($sections, $triggering_element, $values, $expected) {
+ public function testHandleErrorsWithLimitedValidation($sections, $triggering_element, $values, $expected): void {
$form_validator = new FormValidator(new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler);
$triggering_element['#limit_validation_errors'] = $sections;
@@ -263,7 +263,7 @@ class FormValidatorTest extends UnitTestCase {
/**
* @covers ::executeValidateHandlers
*/
- public function testExecuteValidateHandlers() {
+ public function testExecuteValidateHandlers(): void {
$form_validator = new FormValidator(new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler);
$mock = $this->getMockBuilder(FormValidatorTestMockInterface::class)
@@ -294,7 +294,7 @@ class FormValidatorTest extends UnitTestCase {
*
* @dataProvider providerTestRequiredErrorMessage
*/
- public function testRequiredErrorMessage($element, $expected_message) {
+ public function testRequiredErrorMessage($element, $expected_message): void {
$form_validator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
->setConstructorArgs([new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler])
->onlyMethods(['executeValidateHandlers'])
@@ -342,7 +342,7 @@ class FormValidatorTest extends UnitTestCase {
/**
* @covers ::doValidateForm
*/
- public function testElementValidate() {
+ public function testElementValidate(): void {
$form_validator = $this->getMockBuilder('Drupal\Core\Form\FormValidator')
->setConstructorArgs([new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler])
->onlyMethods(['executeValidateHandlers'])
@@ -372,7 +372,7 @@ class FormValidatorTest extends UnitTestCase {
*
* @dataProvider providerTestPerformRequiredValidation
*/
- public function testPerformRequiredValidation($element, $expected_message, $call_watchdog) {
+ public function testPerformRequiredValidation($element, $expected_message, $call_watchdog): void {
$form_validator = new FormValidator(new RequestStack(), $this->getStringTranslationStub(), $this->csrfToken, $this->logger, $this->formErrorHandler);
if ($call_watchdog) {
diff --git a/core/tests/Drupal/Tests/Core/Form/OptGroupTest.php b/core/tests/Drupal/Tests/Core/Form/OptGroupTest.php
index 25f6bf5668a..bdba83a6891 100644
--- a/core/tests/Drupal/Tests/Core/Form/OptGroupTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/OptGroupTest.php
@@ -18,7 +18,7 @@ class OptGroupTest extends UnitTestCase {
*
* @dataProvider providerTestFlattenOptions
*/
- public function testFlattenOptions($options) {
+ public function testFlattenOptions($options): void {
$this->assertSame(['foo' => 'foo'], OptGroup::flattenOptions($options));
}
diff --git a/core/tests/Drupal/Tests/Core/Form/SubformStateTest.php b/core/tests/Drupal/Tests/Core/Form/SubformStateTest.php
index 6bd6bab57e3..b0efd7279a6 100644
--- a/core/tests/Drupal/Tests/Core/Form/SubformStateTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/SubformStateTest.php
@@ -68,7 +68,7 @@ class SubformStateTest extends UnitTestCase {
* @param string $expected
* The expected state values.
*/
- public function testGetValues(array $parents, $expected) {
+ public function testGetValues(array $parents, $expected): void {
$parent_form_state = new FormState();
$parent_form_state->setValues(static::$formStateValues);
@@ -107,7 +107,7 @@ class SubformStateTest extends UnitTestCase {
* @param string $expected
* The expected state values.
*/
- public function testGetValuesBroken(array $parents, $expected) {
+ public function testGetValuesBroken(array $parents, $expected): void {
$this->expectException(\UnexpectedValueException::class);
$this->testGetValues($parents, $expected);
}
@@ -134,7 +134,7 @@ class SubformStateTest extends UnitTestCase {
*
* @dataProvider providerTestGetValue
*/
- public function testGetValue($parents, $key, $expected, $default = NULL) {
+ public function testGetValue($parents, $key, $expected, $default = NULL): void {
$parent_form_state = new FormState();
$parent_form_state->setValues(static::$formStateValues);
@@ -168,7 +168,7 @@ class SubformStateTest extends UnitTestCase {
*
* @dataProvider providerTestGetValueBroken
*/
- public function testGetValueBroken(array $parents, $key, $expected, $default = NULL) {
+ public function testGetValueBroken(array $parents, $key, $expected, $default = NULL): void {
$this->expectException(\UnexpectedValueException::class);
$this->testGetValue($parents, $key, $expected, $default);
}
@@ -192,7 +192,7 @@ class SubformStateTest extends UnitTestCase {
*
* @dataProvider providerTestSetValues
*/
- public function testSetValues($parents, $new_values, $expected) {
+ public function testSetValues($parents, $new_values, $expected): void {
$parent_form_state = new FormState();
$parent_form_state->setValues(static::$formStateValues);
@@ -223,7 +223,7 @@ class SubformStateTest extends UnitTestCase {
*
* @dataProvider providerTestSetValuesBroken
*/
- public function testSetValuesBroken($parents, $new_values, $expected) {
+ public function testSetValuesBroken($parents, $new_values, $expected): void {
$this->expectException(\UnexpectedValueException::class);
$this->testSetValues($parents, $new_values, $expected);
}
@@ -247,7 +247,7 @@ class SubformStateTest extends UnitTestCase {
/**
* @covers ::getCompleteFormState
*/
- public function testGetCompleteFormStateWithParentCompleteForm() {
+ public function testGetCompleteFormStateWithParentCompleteForm(): void {
$parent_form_state = $this->prophesize(FormStateInterface::class);
$subform_state = SubformState::createForSubform($this->parentForm['dog'], $this->parentForm, $parent_form_state->reveal());
$this->assertSame($parent_form_state->reveal(), $subform_state->getCompleteFormState());
@@ -256,7 +256,7 @@ class SubformStateTest extends UnitTestCase {
/**
* @covers ::getCompleteFormState
*/
- public function testGetCompleteFormStateWithParentSubform() {
+ public function testGetCompleteFormStateWithParentSubform(): void {
$complete_form_state = $this->prophesize(FormStateInterface::class);
$parent_form_state = $this->prophesize(SubformStateInterface::class);
$parent_form_state->getCompleteFormState()
@@ -269,7 +269,7 @@ class SubformStateTest extends UnitTestCase {
/**
* @covers ::setLimitValidationErrors
*/
- public function testSetLimitValidationErrors() {
+ public function testSetLimitValidationErrors(): void {
$parent_limit_validation_errors = ['dog', 'name'];
$limit_validation_errors = ['name'];
@@ -284,7 +284,7 @@ class SubformStateTest extends UnitTestCase {
/**
* @covers ::getLimitValidationErrors
*/
- public function testGetLimitValidationErrors() {
+ public function testGetLimitValidationErrors(): void {
$parent_limit_validation_errors = ['dog', 'name'];
$limit_validation_errors = ['name'];
@@ -300,7 +300,7 @@ class SubformStateTest extends UnitTestCase {
/**
* @covers ::setErrorByName
*/
- public function testSetErrorByName() {
+ public function testSetErrorByName(): void {
$parent_form_error_name = 'dog][name';
$subform_error_name = 'name';
// cSpell:disable-next-line
@@ -317,7 +317,7 @@ class SubformStateTest extends UnitTestCase {
/**
* @covers ::getFormObject
*/
- public function testFormObject() {
+ public function testFormObject(): void {
$parent_form_state = $this->prophesize(FormStateInterface::class);
$parent_form_object = $this->prophesize(FormInterface::class)->reveal();
$parent_form_state->getFormObject()->willReturn($parent_form_object)->shouldBeCalledOnce();
diff --git a/core/tests/Drupal/Tests/Core/Http/CacheableExceptionTest.php b/core/tests/Drupal/Tests/Core/Http/CacheableExceptionTest.php
index edd771a7408..91587fd5203 100644
--- a/core/tests/Drupal/Tests/Core/Http/CacheableExceptionTest.php
+++ b/core/tests/Drupal/Tests/Core/Http/CacheableExceptionTest.php
@@ -31,7 +31,7 @@ class CacheableExceptionTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Http\Exception\CacheableHttpException
*/
- public function testCacheableHttpException() {
+ public function testCacheableHttpException(): void {
$exception = new CacheableHttpException((new CacheableMetadata())->setCacheContexts(['route']), 500, 'test message', NULL, ['X-Drupal-Exception' => 'Test'], 123);
$this->assertSame(['route'], $exception->getCacheContexts());
$this->assertSame(500, $exception->getStatusCode());
@@ -43,7 +43,7 @@ class CacheableExceptionTest extends UnitTestCase {
/**
* @dataProvider providerTestExceptions
*/
- public function testExceptions($status_code, $class, $argument = NULL, $expected_headers = []) {
+ public function testExceptions($status_code, $class, $argument = NULL, $expected_headers = []): void {
$cacheable_metadata = (new CacheableMetadata())->setCacheContexts(['route']);
$message = "$class test message";
if ($argument) {
diff --git a/core/tests/Drupal/Tests/Core/Http/ClientFactoryTest.php b/core/tests/Drupal/Tests/Core/Http/ClientFactoryTest.php
index d880ee1d645..527258fc75b 100644
--- a/core/tests/Drupal/Tests/Core/Http/ClientFactoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Http/ClientFactoryTest.php
@@ -44,7 +44,7 @@ class ClientFactoryTest extends UnitTestCase {
* @param array $expected_config_keys
* The expected config keys.
*/
- public function testCreateFromOptions($settings_config, $parameter_config, $expected_config_keys) {
+ public function testCreateFromOptions($settings_config, $parameter_config, $expected_config_keys): void {
if ($settings_config) {
new Settings(['http_client_config' => $settings_config]);
}
diff --git a/core/tests/Drupal/Tests/Core/Http/TrustedHostsRequestFactoryTest.php b/core/tests/Drupal/Tests/Core/Http/TrustedHostsRequestFactoryTest.php
index 57530376ee2..1bc4abd3c66 100644
--- a/core/tests/Drupal/Tests/Core/Http/TrustedHostsRequestFactoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Http/TrustedHostsRequestFactoryTest.php
@@ -29,7 +29,7 @@ class TrustedHostsRequestFactoryTest extends UnitTestCase {
* @covers ::createRequest
* @dataProvider providerTestCreateRequest
*/
- public function testCreateRequest($host, $server, $expected) {
+ public function testCreateRequest($host, $server, $expected): void {
$request_factory = new TrustedHostsRequestFactory($host);
$request = $request_factory->createRequest([], [], [], [], [], $server, []);
$this->assertEquals($expected, $request->getHost());
diff --git a/core/tests/Drupal/Tests/Core/Image/ImageTest.php b/core/tests/Drupal/Tests/Core/Image/ImageTest.php
index 57ac5de1064..673aeb534eb 100644
--- a/core/tests/Drupal/Tests/Core/Image/ImageTest.php
+++ b/core/tests/Drupal/Tests/Core/Image/ImageTest.php
@@ -153,7 +153,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::getHeight().
*/
- public function testGetHeight() {
+ public function testGetHeight(): void {
$this->getTestImage(FALSE);
$this->assertEquals(100, $this->image->getHeight());
}
@@ -161,7 +161,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::getWidth().
*/
- public function testGetWidth() {
+ public function testGetWidth(): void {
$this->getTestImage(FALSE);
$this->assertEquals(88, $this->image->getWidth());
}
@@ -169,7 +169,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::getFileSize.
*/
- public function testGetFileSize() {
+ public function testGetFileSize(): void {
$this->getTestImage(FALSE);
$this->assertEquals(3905, $this->image->getFileSize());
}
@@ -177,7 +177,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::getToolkit()->getType().
*/
- public function testGetType() {
+ public function testGetType(): void {
$this->getTestImage(FALSE);
$this->assertEquals(IMAGETYPE_PNG, $this->image->getToolkit()->getType());
}
@@ -185,7 +185,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::getMimeType().
*/
- public function testGetMimeType() {
+ public function testGetMimeType(): void {
$this->getTestImage(FALSE);
$this->assertEquals('image/png', $this->image->getMimeType());
}
@@ -193,7 +193,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::isValid().
*/
- public function testIsValid() {
+ public function testIsValid(): void {
$this->getTestImage(FALSE);
$this->assertTrue($this->image->isValid());
$this->assertFileIsReadable($this->image->getSource());
@@ -202,7 +202,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::getToolkitId().
*/
- public function testGetToolkitId() {
+ public function testGetToolkitId(): void {
$this->getTestImage(FALSE);
$this->assertEquals('gd', $this->image->getToolkitId());
}
@@ -210,7 +210,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::save().
*/
- public function testSave() {
+ public function testSave(): void {
$this->getTestImage();
// This will fail if save() method isn't called on the toolkit.
$toolkit = $this->getToolkitMock();
@@ -239,7 +239,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::save().
*/
- public function testSaveFails() {
+ public function testSaveFails(): void {
$this->getTestImage();
// This will fail if save() method isn't called on the toolkit.
$this->toolkit->expects($this->once())
@@ -252,7 +252,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::save().
*/
- public function testChmodFails() {
+ public function testChmodFails(): void {
$this->getTestImage();
// This will fail if save() method isn't called on the toolkit.
$toolkit = $this->getToolkitMock();
@@ -281,7 +281,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::parseFile().
*/
- public function testParseFileFails() {
+ public function testParseFileFails(): void {
$toolkit = $this->getToolkitMock();
$image = new Image($toolkit, 'magic-foobar.png');
@@ -292,7 +292,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::scale().
*/
- public function testScaleWidth() {
+ public function testScaleWidth(): void {
$this->getTestImageForOperation('Scale');
$this->toolkitOperation->expects($this->once())
->method('execute')
@@ -305,7 +305,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::scale().
*/
- public function testScaleHeight() {
+ public function testScaleHeight(): void {
$this->getTestImageForOperation('Scale');
$this->toolkitOperation->expects($this->once())
->method('execute')
@@ -318,7 +318,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::scale().
*/
- public function testScaleSame() {
+ public function testScaleSame(): void {
$this->getTestImageForOperation('Scale');
// Dimensions are the same, resize should not be called.
$this->toolkitOperation->expects($this->once())
@@ -333,7 +333,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::scaleAndCrop().
*/
- public function testScaleAndCropWidth() {
+ public function testScaleAndCropWidth(): void {
$this->getTestImageForOperation('ScaleAndCrop');
$this->toolkitOperation->expects($this->once())
->method('execute')
@@ -346,7 +346,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::scaleAndCrop().
*/
- public function testScaleAndCropHeight() {
+ public function testScaleAndCropHeight(): void {
$this->getTestImageForOperation('ScaleAndCrop');
$this->toolkitOperation->expects($this->once())
->method('execute')
@@ -359,7 +359,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::scaleAndCrop().
*/
- public function testScaleAndCropFails() {
+ public function testScaleAndCropFails(): void {
$this->getTestImageForOperation('ScaleAndCrop');
$this->toolkitOperation->expects($this->once())
->method('execute')
@@ -375,7 +375,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::crop().
*/
- public function testCropWidth() {
+ public function testCropWidth(): void {
$this->getTestImageForOperation('Crop');
$this->toolkitOperation->expects($this->once())
->method('execute')
@@ -389,7 +389,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::crop().
*/
- public function testCropHeight() {
+ public function testCropHeight(): void {
$this->getTestImageForOperation('Crop');
$this->toolkitOperation->expects($this->once())
->method('execute')
@@ -403,7 +403,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::crop().
*/
- public function testCrop() {
+ public function testCrop(): void {
$this->getTestImageForOperation('Crop');
$this->toolkitOperation->expects($this->once())
->method('execute')
@@ -416,7 +416,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::convert().
*/
- public function testConvert() {
+ public function testConvert(): void {
$this->getTestImageForOperation('Convert');
$this->toolkitOperation->expects($this->once())
->method('execute')
@@ -429,7 +429,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::resize().
*/
- public function testResize() {
+ public function testResize(): void {
$this->getTestImageForOperation('Resize');
$this->toolkitOperation->expects($this->once())
->method('execute')
@@ -444,7 +444,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::resize().
*/
- public function testFloatResize() {
+ public function testFloatResize(): void {
$this->getTestImageForOperation('Resize');
$this->toolkitOperation->expects($this->once())
->method('execute')
@@ -459,7 +459,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::desaturate().
*/
- public function testDesaturate() {
+ public function testDesaturate(): void {
$this->getTestImageForOperation('Desaturate');
$this->toolkitOperation->expects($this->once())
->method('execute')
@@ -471,7 +471,7 @@ class ImageTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Image\Image::rotate().
*/
- public function testRotate() {
+ public function testRotate(): void {
$this->getTestImageForOperation('Rotate');
$this->toolkitOperation->expects($this->once())
->method('execute')
diff --git a/core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php b/core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php
index e347ed5fe25..a3692788c17 100644
--- a/core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Language/LanguageUnitTest.php
@@ -17,7 +17,7 @@ class LanguageUnitTest extends UnitTestCase {
/**
* @covers ::__construct
*/
- public function testConstruct() {
+ public function testConstruct(): void {
$name = $this->randomMachineName();
$language_code = $this->randomMachineName(2);
$uuid = $this->randomMachineName();
@@ -31,7 +31,7 @@ class LanguageUnitTest extends UnitTestCase {
/**
* @covers ::getName
*/
- public function testGetName() {
+ public function testGetName(): void {
$name = $this->randomMachineName();
$language_code = $this->randomMachineName(2);
$language = new Language(['id' => $language_code, 'name' => $name]);
@@ -41,7 +41,7 @@ class LanguageUnitTest extends UnitTestCase {
/**
* @covers ::getId
*/
- public function testGetLangcode() {
+ public function testGetLangcode(): void {
$language_code = $this->randomMachineName(2);
$language = new Language(['id' => $language_code]);
$this->assertSame($language_code, $language->getId());
@@ -50,7 +50,7 @@ class LanguageUnitTest extends UnitTestCase {
/**
* @covers ::getDirection
*/
- public function testGetDirection() {
+ public function testGetDirection(): void {
$language_code = $this->randomMachineName(2);
$language = new Language(['id' => $language_code, 'direction' => LanguageInterface::DIRECTION_RTL]);
$this->assertSame(LanguageInterface::DIRECTION_RTL, $language->getDirection());
@@ -59,7 +59,7 @@ class LanguageUnitTest extends UnitTestCase {
/**
* @covers ::isDefault
*/
- public function testIsDefault() {
+ public function testIsDefault(): void {
$language_default = $this->getMockBuilder('Drupal\Core\Language\LanguageDefault')->disableOriginalConstructor()->getMock();
$container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface');
$container->expects($this->any())
@@ -94,7 +94,7 @@ class LanguageUnitTest extends UnitTestCase {
* @param array $expected
* The expected array of keys.
*/
- public function testSortArrayOfLanguages(array $languages, array $expected) {
+ public function testSortArrayOfLanguages(array $languages, array $expected): void {
Language::sort($languages);
$this->assertSame($expected, array_keys($languages));
}
diff --git a/core/tests/Drupal/Tests/Core/Layout/LayoutDefaultTest.php b/core/tests/Drupal/Tests/Core/Layout/LayoutDefaultTest.php
index 9bb982c9f12..7ab62f52c14 100644
--- a/core/tests/Drupal/Tests/Core/Layout/LayoutDefaultTest.php
+++ b/core/tests/Drupal/Tests/Core/Layout/LayoutDefaultTest.php
@@ -18,7 +18,7 @@ class LayoutDefaultTest extends UnitTestCase {
* @covers ::build
* @dataProvider providerTestBuild
*/
- public function testBuild($regions, $expected) {
+ public function testBuild($regions, $expected): void {
$definition = new LayoutDefinition([
'theme_hook' => 'layout',
'library' => 'core/drupal',
diff --git a/core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php b/core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php
index 7610bf16bf5..62547d63c97 100644
--- a/core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php
@@ -104,7 +104,7 @@ class LayoutPluginManagerTest extends UnitTestCase {
* @covers ::getDefinitions
* @covers ::providerExists
*/
- public function testGetDefinitions() {
+ public function testGetDefinitions(): void {
$expected = [
'module_a_provided_layout',
'theme_a_provided_layout',
@@ -121,7 +121,7 @@ class LayoutPluginManagerTest extends UnitTestCase {
* @covers ::getDefinition
* @covers ::processDefinition
*/
- public function testGetDefinition() {
+ public function testGetDefinition(): void {
$layout_definition = $this->layoutPluginManager->getDefinition('theme_a_provided_layout');
$this->assertSame('theme_a_provided_layout', $layout_definition->id());
$this->assertSame('2 column layout', (string) $layout_definition->getLabel());
@@ -243,7 +243,7 @@ class LayoutPluginManagerTest extends UnitTestCase {
/**
* @covers ::processDefinition
*/
- public function testProcessDefinition() {
+ public function testProcessDefinition(): void {
$this->moduleHandler->alter('layout', Argument::type('array'))->shouldNotBeCalled();
$this->expectException(InvalidPluginDefinitionException::class);
$this->expectExceptionMessage('The "module_a_derived_layout:array_based" layout definition must extend ' . LayoutDefinition::class);
@@ -265,7 +265,7 @@ EOS;
/**
* @covers ::getThemeImplementations
*/
- public function testGetThemeImplementations() {
+ public function testGetThemeImplementations(): void {
$core_path = '/core/lib/Drupal/Core';
$expected = [
'layout' => [
@@ -297,7 +297,7 @@ EOS;
/**
* @covers ::getCategories
*/
- public function testGetCategories() {
+ public function testGetCategories(): void {
$expected = [
'Columns: 1',
'Columns: 2',
@@ -309,7 +309,7 @@ EOS;
/**
* @covers ::getSortedDefinitions
*/
- public function testGetSortedDefinitions() {
+ public function testGetSortedDefinitions(): void {
// Sorted by category first, then label.
$expected = [
'module_a_provided_layout',
@@ -326,7 +326,7 @@ EOS;
/**
* @covers ::getGroupedDefinitions
*/
- public function testGetGroupedDefinitions() {
+ public function testGetGroupedDefinitions(): void {
$category_expected = [
'Columns: 1' => [
'module_a_provided_layout',
diff --git a/core/tests/Drupal/Tests/Core/Listeners/DrupalStandardsListenerDeprecationTest.php b/core/tests/Drupal/Tests/Core/Listeners/DrupalStandardsListenerDeprecationTest.php
index 6c54105dc26..634a9c23a23 100644
--- a/core/tests/Drupal/Tests/Core/Listeners/DrupalStandardsListenerDeprecationTest.php
+++ b/core/tests/Drupal/Tests/Core/Listeners/DrupalStandardsListenerDeprecationTest.php
@@ -33,7 +33,7 @@ class DrupalStandardsListenerDeprecationTest extends UnitTestCase {
*
* @covers ::testFunction
*/
- public function testDeprecation() {
+ public function testDeprecation(): void {
// Meaningless assertion so this test is not risky.
$this->assertTrue(TRUE);
}
diff --git a/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php b/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php
index 0fcefcd0a8b..8796ed8b6a1 100644
--- a/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php
+++ b/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php
@@ -31,7 +31,7 @@ class LockBackendAbstractTest extends UnitTestCase {
/**
* Tests the wait() method when lockMayBeAvailable() returns TRUE.
*/
- public function testWaitFalse() {
+ public function testWaitFalse(): void {
$this->lock->expects($this->any())
->method('lockMayBeAvailable')
->with($this->equalTo('test_name'))
@@ -46,7 +46,7 @@ class LockBackendAbstractTest extends UnitTestCase {
* Waiting could take 1 second so we need to extend the possible runtime.
* @medium
*/
- public function testWaitTrue() {
+ public function testWaitTrue(): void {
$this->lock->expects($this->any())
->method('lockMayBeAvailable')
->with($this->equalTo('test_name'))
@@ -58,7 +58,7 @@ class LockBackendAbstractTest extends UnitTestCase {
/**
* Tests the getLockId() method.
*/
- public function testGetLockId() {
+ public function testGetLockId(): void {
$lock_id = $this->lock->getLockId();
$this->assertIsString($lock_id);
// Example lock ID would be '7213141505232b6ee2cb967.27683891'.
diff --git a/core/tests/Drupal/Tests/Core/Logger/LogMessageParserTest.php b/core/tests/Drupal/Tests/Core/Logger/LogMessageParserTest.php
index 5e88cd9be7c..0b63b0fadac 100644
--- a/core/tests/Drupal/Tests/Core/Logger/LogMessageParserTest.php
+++ b/core/tests/Drupal/Tests/Core/Logger/LogMessageParserTest.php
@@ -29,7 +29,7 @@ class LogMessageParserTest extends UnitTestCase {
* @dataProvider providerTestParseMessagePlaceholders
* @covers ::parseMessagePlaceholders
*/
- public function testParseMessagePlaceholders(array $value, array $expected) {
+ public function testParseMessagePlaceholders(array $value, array $expected): void {
$parser = new LogMessageParser();
$message_placeholders = $parser->parseMessagePlaceholders($value['message'], $value['context']);
$this->assertEquals($expected['message'], $value['message']);
diff --git a/core/tests/Drupal/Tests/Core/Logger/LoggerChannelFactoryTest.php b/core/tests/Drupal/Tests/Core/Logger/LoggerChannelFactoryTest.php
index 6ff5700fe95..1d0cc3e8428 100644
--- a/core/tests/Drupal/Tests/Core/Logger/LoggerChannelFactoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Logger/LoggerChannelFactoryTest.php
@@ -20,7 +20,7 @@ class LoggerChannelFactoryTest extends UnitTestCase {
*
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
$factory = new LoggerChannelFactory(
$this->createMock(RequestStack::class),
$this->createMock(AccountInterface::class),
diff --git a/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php b/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php
index 2028dcff1ee..718fa92f3ed 100644
--- a/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php
+++ b/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php
@@ -35,7 +35,7 @@ class LoggerChannelTest extends UnitTestCase {
* @covers ::setCurrentUser
* @covers ::setRequestStack
*/
- public function testLog(callable $expected, bool $request = FALSE, bool $account = FALSE) {
+ public function testLog(callable $expected, bool $request = FALSE, bool $account = FALSE): void {
$channel = new LoggerChannel('test');
$message = $this->randomMachineName();
$logger = $this->createMock('Psr\Log\LoggerInterface');
@@ -72,7 +72,7 @@ class LoggerChannelTest extends UnitTestCase {
*
* @covers ::log
*/
- public function testLogRecursionProtection() {
+ public function testLogRecursionProtection(): void {
$channel = new LoggerChannel('test');
$logger = $this->createMock('Psr\Log\LoggerInterface');
$logger->expects($this->exactly(LoggerChannel::MAX_CALL_DEPTH))
@@ -88,7 +88,7 @@ class LoggerChannelTest extends UnitTestCase {
* @covers ::addLogger
* @covers ::sortLoggers
*/
- public function testSortLoggers() {
+ public function testSortLoggers(): void {
$channel = new LoggerChannel($this->randomMachineName());
$index_order = '';
for ($i = 0; $i < 4; $i++) {
diff --git a/core/tests/Drupal/Tests/Core/Mail/MailFormatHelperTest.php b/core/tests/Drupal/Tests/Core/Mail/MailFormatHelperTest.php
index f0cac252767..4dc84914763 100644
--- a/core/tests/Drupal/Tests/Core/Mail/MailFormatHelperTest.php
+++ b/core/tests/Drupal/Tests/Core/Mail/MailFormatHelperTest.php
@@ -18,7 +18,7 @@ class MailFormatHelperTest extends UnitTestCase {
/**
* @covers ::wrapMail
*/
- public function testWrapMail() {
+ public function testWrapMail(): void {
$delimiter = "End of header\n";
$long_file_name = $this->randomMachineName(64) . '.docx';
$headers_in_body = 'Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document; name="' . $long_file_name . "\"\n";
diff --git a/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php b/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php
index c4640b90ae5..bbb7efb1206 100644
--- a/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php
@@ -154,7 +154,7 @@ class MailManagerTest extends UnitTestCase {
*
* @covers ::getInstance
*/
- public function testGetInstance() {
+ public function testGetInstance(): void {
$interface = [
'default' => 'php_mail',
'example_testkey' => 'test_mail_collector',
@@ -177,7 +177,7 @@ class MailManagerTest extends UnitTestCase {
*
* @covers ::mail
*/
- public function testMailInRenderContext() {
+ public function testMailInRenderContext(): void {
$interface = [
'default' => 'php_mail',
'example_testkey' => 'test_mail_collector',
diff --git a/core/tests/Drupal/Tests/Core/Mail/Plugin/Mail/PhpMailTest.php b/core/tests/Drupal/Tests/Core/Mail/Plugin/Mail/PhpMailTest.php
index 35d783e7725..760e2a0199d 100644
--- a/core/tests/Drupal/Tests/Core/Mail/Plugin/Mail/PhpMailTest.php
+++ b/core/tests/Drupal/Tests/Core/Mail/Plugin/Mail/PhpMailTest.php
@@ -109,7 +109,7 @@ class PhpMailTest extends UnitTestCase {
*
* @covers ::mail
*/
- public function testMail() {
+ public function testMail(): void {
// Setup a mail message.
$message = [
'id' => 'example_key',
diff --git a/core/tests/Drupal/Tests/Core/Mail/Plugin/Mail/SymfonyMailerTest.php b/core/tests/Drupal/Tests/Core/Mail/Plugin/Mail/SymfonyMailerTest.php
index 40fa0911daa..169d6cc2853 100644
--- a/core/tests/Drupal/Tests/Core/Mail/Plugin/Mail/SymfonyMailerTest.php
+++ b/core/tests/Drupal/Tests/Core/Mail/Plugin/Mail/SymfonyMailerTest.php
@@ -23,7 +23,7 @@ class SymfonyMailerTest extends UnitTestCase {
*
* @covers ::format
*/
- public function testFormatResemblesHtml() {
+ public function testFormatResemblesHtml(): void {
// Populate global $base_path to avoid notices generated by
// MailFormatHelper::htmlToMailUrls()
global $base_path;
@@ -67,7 +67,7 @@ class SymfonyMailerTest extends UnitTestCase {
*
* @covers ::mail
*/
- public function testMail() {
+ public function testMail(): void {
// Setup a mail message.
$message = [
'id' => 'example_key',
diff --git a/core/tests/Drupal/Tests/Core/Menu/ContextualLinkDefaultTest.php b/core/tests/Drupal/Tests/Core/Menu/ContextualLinkDefaultTest.php
index ccba55d707e..00663971b36 100644
--- a/core/tests/Drupal/Tests/Core/Menu/ContextualLinkDefaultTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/ContextualLinkDefaultTest.php
@@ -68,7 +68,7 @@ class ContextualLinkDefaultTest extends UnitTestCase {
/**
* @covers ::getTitle
*/
- public function testGetTitle() {
+ public function testGetTitle(): void {
$title = 'Example';
$this->pluginDefinition['title'] = (new TranslatableMarkup($title, [], [], $this->stringTranslation));
$this->stringTranslation->expects($this->once())
@@ -83,7 +83,7 @@ class ContextualLinkDefaultTest extends UnitTestCase {
/**
* @covers ::getTitle
*/
- public function testGetTitleWithContext() {
+ public function testGetTitleWithContext(): void {
$title = 'Example';
$this->pluginDefinition['title'] = (new TranslatableMarkup($title, [], ['context' => 'context'], $this->stringTranslation));
$this->stringTranslation->expects($this->once())
@@ -98,7 +98,7 @@ class ContextualLinkDefaultTest extends UnitTestCase {
/**
* @covers ::getTitle
*/
- public function testGetTitleWithTitleArguments() {
+ public function testGetTitleWithTitleArguments(): void {
$title = 'Example @test';
$this->pluginDefinition['title'] = (new TranslatableMarkup($title, ['@test' => 'value'], [], $this->stringTranslation));
$this->stringTranslation->expects($this->once())
@@ -114,7 +114,7 @@ class ContextualLinkDefaultTest extends UnitTestCase {
/**
* @covers ::getRouteName
*/
- public function testGetRouteName($route_name = 'test_route_name') {
+ public function testGetRouteName($route_name = 'test_route_name'): void {
$this->pluginDefinition['route_name'] = $route_name;
$this->setupContextualLinkDefault();
@@ -124,7 +124,7 @@ class ContextualLinkDefaultTest extends UnitTestCase {
/**
* @covers ::getGroup
*/
- public function testGetGroup($group_name = 'test_group') {
+ public function testGetGroup($group_name = 'test_group'): void {
$this->pluginDefinition['group'] = $group_name;
$this->setupContextualLinkDefault();
@@ -134,7 +134,7 @@ class ContextualLinkDefaultTest extends UnitTestCase {
/**
* @covers ::getOptions
*/
- public function testGetOptions($options = ['key' => 'value']) {
+ public function testGetOptions($options = ['key' => 'value']): void {
$this->pluginDefinition['options'] = $options;
$this->setupContextualLinkDefault();
@@ -144,7 +144,7 @@ class ContextualLinkDefaultTest extends UnitTestCase {
/**
* @covers ::getWeight
*/
- public function testGetWeight($weight = 5) {
+ public function testGetWeight($weight = 5): void {
$this->pluginDefinition['weight'] = $weight;
$this->setupContextualLinkDefault();
diff --git a/core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php b/core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php
index 4d235bec59b..0780db15ee2 100644
--- a/core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php
@@ -100,7 +100,7 @@ class ContextualLinkManagerTest extends UnitTestCase {
*
* @see \Drupal\Core\Menu\ContextualLinkManager::getContextualLinkPluginsByGroup()
*/
- public function testGetContextualLinkPluginsByGroup() {
+ public function testGetContextualLinkPluginsByGroup(): void {
$definitions = [
'test_plugin1' => [
'id' => 'test_plugin1',
@@ -139,7 +139,7 @@ class ContextualLinkManagerTest extends UnitTestCase {
/**
* Tests the getContextualLinkPluginsByGroup method with a prefilled cache.
*/
- public function testGetContextualLinkPluginsByGroupWithCache() {
+ public function testGetContextualLinkPluginsByGroupWithCache(): void {
$definitions = [
'test_plugin1' => [
'id' => 'test_plugin1',
@@ -174,7 +174,7 @@ class ContextualLinkManagerTest extends UnitTestCase {
*
* @see \Drupal\Core\Menu\ContextualLinkManager::processDefinition()
*/
- public function testProcessDefinitionWithoutRoute() {
+ public function testProcessDefinitionWithoutRoute(): void {
$definition = [
'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
'group' => 'example',
@@ -189,7 +189,7 @@ class ContextualLinkManagerTest extends UnitTestCase {
*
* @see \Drupal\Core\Menu\ContextualLinkManager::processDefinition()
*/
- public function testProcessDefinitionWithoutGroup() {
+ public function testProcessDefinitionWithoutGroup(): void {
$definition = [
'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
'route_name' => 'example',
@@ -204,7 +204,7 @@ class ContextualLinkManagerTest extends UnitTestCase {
*
* @see \Drupal\Core\Menu\ContextualLinkManager::getContextualLinksArrayByGroup()
*/
- public function testGetContextualLinksArrayByGroup() {
+ public function testGetContextualLinksArrayByGroup(): void {
$definitions = [
'test_plugin1' => [
'id' => 'test_plugin1',
@@ -264,7 +264,7 @@ class ContextualLinkManagerTest extends UnitTestCase {
*
* @see \Drupal\Core\Menu\ContextualLinkManager::getContextualLinksArrayByGroup()
*/
- public function testGetContextualLinksArrayByGroupAccessCheck() {
+ public function testGetContextualLinksArrayByGroupAccessCheck(): void {
$definitions = [
'test_plugin1' => [
'id' => 'test_plugin1',
@@ -307,7 +307,7 @@ class ContextualLinkManagerTest extends UnitTestCase {
/**
* Tests the plugins alter hook.
*/
- public function testPluginDefinitionAlter() {
+ public function testPluginDefinitionAlter(): void {
$definitions['test_plugin'] = [
'id' => 'test_plugin',
'class' => ContextualLinkDefault::class,
diff --git a/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php b/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php
index 8d0eba684e6..367d08d5d8d 100644
--- a/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php
@@ -150,7 +150,7 @@ class DefaultMenuLinkTreeManipulatorsTest extends UnitTestCase {
*
* @covers ::generateIndexAndSort
*/
- public function testGenerateIndexAndSort() {
+ public function testGenerateIndexAndSort(): void {
$this->mockTree();
$tree = $this->originalTree;
$tree = $this->defaultMenuTreeManipulators->generateIndexAndSort($tree);
@@ -174,7 +174,7 @@ class DefaultMenuLinkTreeManipulatorsTest extends UnitTestCase {
* @covers ::checkAccess
* @covers ::menuLinkCheckAccess
*/
- public function testCheckAccess() {
+ public function testCheckAccess(): void {
// Those menu links that are non-external will have their access checks
// performed. 9 routes, but 1 is external, 2 already have their 'access'
// property set, and 1 is a child if an inaccessible menu link, so only 5
@@ -282,7 +282,7 @@ class DefaultMenuLinkTreeManipulatorsTest extends UnitTestCase {
*
* @covers ::flatten
*/
- public function testFlatten() {
+ public function testFlatten(): void {
$this->mockTree();
$tree = $this->defaultMenuTreeManipulators->flatten($this->originalTree);
$this->assertEquals([1, 2, 5, 6, 8, 9], array_keys($this->originalTree));
@@ -296,7 +296,7 @@ class DefaultMenuLinkTreeManipulatorsTest extends UnitTestCase {
* @covers ::collectNodeLinks
* @covers ::checkAccess
*/
- public function testCheckNodeAccess() {
+ public function testCheckNodeAccess(): void {
$links = [
1 => MenuLinkMock::create(['id' => 'node.1', 'route_name' => 'entity.node.canonical', 'title' => 'foo', 'parent' => '', 'route_parameters' => ['node' => 1]]),
2 => MenuLinkMock::create(['id' => 'node.2', 'route_name' => 'entity.node.canonical', 'title' => 'bar', 'parent' => '', 'route_parameters' => ['node' => 2]]),
diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalActionDefaultTest.php b/core/tests/Drupal/Tests/Core/Menu/LocalActionDefaultTest.php
index 09bf2b601e1..85d1c6989da 100644
--- a/core/tests/Drupal/Tests/Core/Menu/LocalActionDefaultTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/LocalActionDefaultTest.php
@@ -81,7 +81,7 @@ class LocalActionDefaultTest extends UnitTestCase {
*
* @see \Drupal\Core\Menu\LocalTaskDefault::getTitle()
*/
- public function testGetTitle() {
+ public function testGetTitle(): void {
$this->pluginDefinition['title'] = (new TranslatableMarkup('Example', [], [], $this->stringTranslation));
$this->stringTranslation->expects($this->once())
->method('translateString')
@@ -97,7 +97,7 @@ class LocalActionDefaultTest extends UnitTestCase {
*
* @see \Drupal\Core\Menu\LocalTaskDefault::getTitle()
*/
- public function testGetTitleWithContext() {
+ public function testGetTitleWithContext(): void {
$this->pluginDefinition['title'] = (new TranslatableMarkup('Example', [], ['context' => 'context'], $this->stringTranslation));
$this->stringTranslation->expects($this->once())
->method('translateString')
@@ -111,7 +111,7 @@ class LocalActionDefaultTest extends UnitTestCase {
/**
* Tests the getTitle method with title arguments.
*/
- public function testGetTitleWithTitleArguments() {
+ public function testGetTitleWithTitleArguments(): void {
$this->pluginDefinition['title'] = (new TranslatableMarkup('Example @test', ['@test' => 'value'], [], $this->stringTranslation));
$this->stringTranslation->expects($this->once())
->method('translateString')
diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php b/core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php
index b2ab4446e9b..d3198aa3101 100644
--- a/core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php
@@ -137,7 +137,7 @@ class LocalActionManagerTest extends UnitTestCase {
/**
* @covers ::getTitle
*/
- public function testGetTitle() {
+ public function testGetTitle(): void {
$local_action = $this->createMock('Drupal\Core\Menu\LocalActionInterface');
$local_action->expects($this->once())
->method('getTitle')
@@ -156,7 +156,7 @@ class LocalActionManagerTest extends UnitTestCase {
*
* @dataProvider getActionsForRouteProvider
*/
- public function testGetActionsForRoute($route_appears, array $plugin_definitions, array $expected_actions) {
+ public function testGetActionsForRoute($route_appears, array $plugin_definitions, array $expected_actions): void {
$this->discovery->expects($this->any())
->method('getDefinitions')
->willReturn($plugin_definitions);
diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php b/core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php
index 223fb5a6d6c..8548e3cee16 100644
--- a/core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskDefaultTest.php
@@ -83,7 +83,7 @@ class LocalTaskDefaultTest extends UnitTestCase {
/**
* @covers ::getRouteParameters
*/
- public function testGetRouteParametersForStaticRoute() {
+ public function testGetRouteParametersForStaticRoute(): void {
$this->pluginDefinition = [
'route_name' => 'test_route',
];
@@ -102,7 +102,7 @@ class LocalTaskDefaultTest extends UnitTestCase {
/**
* @covers ::getRouteParameters
*/
- public function testGetRouteParametersInPluginDefinitions() {
+ public function testGetRouteParametersInPluginDefinitions(): void {
$this->pluginDefinition = [
'route_name' => 'test_route',
'route_parameters' => ['parameter' => 'example'],
@@ -122,7 +122,7 @@ class LocalTaskDefaultTest extends UnitTestCase {
/**
* @covers ::getRouteParameters
*/
- public function testGetRouteParametersForDynamicRouteWithNonUpcastedParameters() {
+ public function testGetRouteParametersForDynamicRouteWithNonUpcastedParameters(): void {
$this->pluginDefinition = [
'route_name' => 'test_route',
];
@@ -145,7 +145,7 @@ class LocalTaskDefaultTest extends UnitTestCase {
*
* @covers ::getRouteParameters
*/
- public function testGetRouteParametersForDynamicRouteWithUpcastedParameters() {
+ public function testGetRouteParametersForDynamicRouteWithUpcastedParameters(): void {
$this->pluginDefinition = [
'route_name' => 'test_route',
];
@@ -167,7 +167,7 @@ class LocalTaskDefaultTest extends UnitTestCase {
*
* @covers ::getRouteParameters
*/
- public function testGetRouteParametersForDynamicRouteWithUpcastedParametersEmptyRawParameters() {
+ public function testGetRouteParametersForDynamicRouteWithUpcastedParametersEmptyRawParameters(): void {
$this->pluginDefinition = [
'route_name' => 'test_route',
];
@@ -231,7 +231,7 @@ class LocalTaskDefaultTest extends UnitTestCase {
* @dataProvider providerTestGetWeight
* @covers ::getWeight
*/
- public function testGetWeight($plugin_definition, $plugin_id, $expected_weight) {
+ public function testGetWeight($plugin_definition, $plugin_id, $expected_weight): void {
$this->pluginDefinition = $plugin_definition;
$this->pluginId = $plugin_id;
$this->setupLocalTaskDefault();
@@ -243,7 +243,7 @@ class LocalTaskDefaultTest extends UnitTestCase {
* @covers ::getActive
* @covers ::setActive
*/
- public function testActive() {
+ public function testActive(): void {
$this->setupLocalTaskDefault();
$this->assertFalse($this->localTaskBase->getActive());
@@ -254,7 +254,7 @@ class LocalTaskDefaultTest extends UnitTestCase {
/**
* @covers ::getTitle
*/
- public function testGetTitle() {
+ public function testGetTitle(): void {
$this->pluginDefinition['title'] = (new TranslatableMarkup('Example', [], [], $this->stringTranslation));
$this->stringTranslation->expects($this->once())
->method('translateString')
@@ -268,7 +268,7 @@ class LocalTaskDefaultTest extends UnitTestCase {
/**
* @covers ::getTitle
*/
- public function testGetTitleWithContext() {
+ public function testGetTitleWithContext(): void {
$title = 'Example';
$this->pluginDefinition['title'] = (new TranslatableMarkup($title, [], ['context' => 'context'], $this->stringTranslation));
$this->stringTranslation->expects($this->once())
@@ -283,7 +283,7 @@ class LocalTaskDefaultTest extends UnitTestCase {
/**
* @covers ::getTitle
*/
- public function testGetTitleWithTitleArguments() {
+ public function testGetTitleWithTitleArguments(): void {
$this->pluginDefinition['title'] = (new TranslatableMarkup('Example @test', ['@test' => 'value'], [], $this->stringTranslation));
$this->stringTranslation->expects($this->once())
->method('translateString')
@@ -297,7 +297,7 @@ class LocalTaskDefaultTest extends UnitTestCase {
/**
* @covers ::getOptions
*/
- public function testGetOptions() {
+ public function testGetOptions(): void {
$this->pluginDefinition['options'] = [
'attributes' => ['class' => ['example']],
];
@@ -324,7 +324,7 @@ class LocalTaskDefaultTest extends UnitTestCase {
* @covers ::getCacheTags
* @covers ::getCacheMaxAge
*/
- public function testCacheabilityMetadata() {
+ public function testCacheabilityMetadata(): void {
$this->pluginDefinition['cache_contexts'] = ['route'];
$this->pluginDefinition['cache_tags'] = ['kitten'];
$this->pluginDefinition['cache_max_age'] = 3600;
diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php b/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
index 5ee43089ad2..582faf10d55 100644
--- a/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
@@ -120,7 +120,7 @@ class LocalTaskManagerTest extends UnitTestCase {
*
* @see \Drupal\system\Plugin\Type\MenuLocalTaskManager::getLocalTasksForRoute()
*/
- public function testGetLocalTasksForRouteSingleLevelTitle() {
+ public function testGetLocalTasksForRouteSingleLevelTitle(): void {
$definitions = $this->getLocalTaskFixtures();
$this->pluginDiscovery->expects($this->once())
@@ -144,7 +144,7 @@ class LocalTaskManagerTest extends UnitTestCase {
*
* @see \Drupal\system\Plugin\Type\MenuLocalTaskManager::getLocalTasksForRoute()
*/
- public function testGetLocalTasksForRouteForChild() {
+ public function testGetLocalTasksForRouteForChild(): void {
$definitions = $this->getLocalTaskFixtures();
$this->pluginDiscovery->expects($this->once())
@@ -166,7 +166,7 @@ class LocalTaskManagerTest extends UnitTestCase {
/**
* Tests the cache of the local task manager with an empty initial cache.
*/
- public function testGetLocalTaskForRouteWithEmptyCache() {
+ public function testGetLocalTaskForRouteWithEmptyCache(): void {
$definitions = $this->getLocalTaskFixtures();
$this->pluginDiscovery->expects($this->once())
@@ -197,7 +197,7 @@ class LocalTaskManagerTest extends UnitTestCase {
/**
* Tests the cache of the local task manager with a filled initial cache.
*/
- public function testGetLocalTaskForRouteWithFilledCache() {
+ public function testGetLocalTaskForRouteWithFilledCache(): void {
$this->pluginDiscovery->expects($this->never())
->method('getDefinitions');
@@ -224,7 +224,7 @@ class LocalTaskManagerTest extends UnitTestCase {
*
* @see \Drupal\system\Plugin\Type\MenuLocalTaskManager::getTitle()
*/
- public function testGetTitle() {
+ public function testGetTitle(): void {
$menu_local_task = $this->createMock('Drupal\Core\Menu\LocalTaskInterface');
$menu_local_task->expects($this->once())
->method('getTitle');
@@ -396,7 +396,7 @@ class LocalTaskManagerTest extends UnitTestCase {
/**
* @covers ::getTasksBuild
*/
- public function testGetTasksBuildWithCacheabilityMetadata() {
+ public function testGetTasksBuildWithCacheabilityMetadata(): void {
$definitions = $this->getLocalTaskFixtures();
$this->pluginDiscovery->expects($this->once())
diff --git a/core/tests/Drupal/Tests/Core/Menu/MenuActiveTrailTest.php b/core/tests/Drupal/Tests/Core/Menu/MenuActiveTrailTest.php
index 54c2d22eb6b..75727693a80 100644
--- a/core/tests/Drupal/Tests/Core/Menu/MenuActiveTrailTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/MenuActiveTrailTest.php
@@ -142,7 +142,7 @@ class MenuActiveTrailTest extends UnitTestCase {
* @covers ::getActiveLink
* @dataProvider provider
*/
- public function testGetActiveLink(Request $request, $links, $menu_name, $expected_link) {
+ public function testGetActiveLink(Request $request, $links, $menu_name, $expected_link): void {
$this->requestStack->push($request);
if ($links !== FALSE) {
$this->menuLinkManager->expects($this->exactly(2))
@@ -162,7 +162,7 @@ class MenuActiveTrailTest extends UnitTestCase {
* @covers ::getActiveTrailIds
* @dataProvider provider
*/
- public function testGetActiveTrailIds(Request $request, $links, $menu_name, $expected_link, $expected_trail) {
+ public function testGetActiveTrailIds(Request $request, $links, $menu_name, $expected_link, $expected_trail): void {
$expected_trail_ids = array_combine($expected_trail, $expected_trail);
$this->requestStack->push($request);
@@ -195,7 +195,7 @@ class MenuActiveTrailTest extends UnitTestCase {
*
* @covers ::getCid
*/
- public function testGetCid() {
+ public function testGetCid(): void {
$data = $this->provider()[1];
/** @var \Symfony\Component\HttpFoundation\Request $request */
$request = $data[0];
diff --git a/core/tests/Drupal/Tests/Core/Menu/MenuLinkDefaultFormTest.php b/core/tests/Drupal/Tests/Core/Menu/MenuLinkDefaultFormTest.php
index f1ab40a3bfe..c7aa7448369 100644
--- a/core/tests/Drupal/Tests/Core/Menu/MenuLinkDefaultFormTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/MenuLinkDefaultFormTest.php
@@ -24,7 +24,7 @@ class MenuLinkDefaultFormTest extends UnitTestCase {
/**
* @covers ::extractFormValues
*/
- public function testExtractFormValues() {
+ public function testExtractFormValues(): void {
$menu_link_manager = $this->prophesize(MenuLinkManagerInterface::class);
$menu_parent_form_selector = $this->prophesize(MenuParentFormSelectorInterface::class);
$module_handler = $this->prophesize(ModuleHandlerInterface::class);
diff --git a/core/tests/Drupal/Tests/Core/Menu/MenuLinkDefaultTest.php b/core/tests/Drupal/Tests/Core/Menu/MenuLinkDefaultTest.php
index 2e300cfffad..11519f5a6f0 100644
--- a/core/tests/Drupal/Tests/Core/Menu/MenuLinkDefaultTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/MenuLinkDefaultTest.php
@@ -17,7 +17,7 @@ class MenuLinkDefaultTest extends UnitTestCase {
/**
* @covers ::updateLink
*/
- public function testUpdateLink() {
+ public function testUpdateLink(): void {
$plugin_definition = [
'title' => 'Hey jude',
'enabled' => 1,
@@ -41,7 +41,7 @@ class MenuLinkDefaultTest extends UnitTestCase {
/**
* @covers ::updateLink
*/
- public function testUpdateLinkWithoutPersist() {
+ public function testUpdateLinkWithoutPersist(): void {
$plugin_definition = [
'title' => 'Hey jude',
'enabled' => 1,
diff --git a/core/tests/Drupal/Tests/Core/Menu/MenuLinkTreeElementTest.php b/core/tests/Drupal/Tests/Core/Menu/MenuLinkTreeElementTest.php
index 720b0da0381..c378ea39951 100644
--- a/core/tests/Drupal/Tests/Core/Menu/MenuLinkTreeElementTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/MenuLinkTreeElementTest.php
@@ -21,7 +21,7 @@ class MenuLinkTreeElementTest extends UnitTestCase {
*
* @covers ::__construct
*/
- public function testConstruction() {
+ public function testConstruction(): void {
$link = MenuLinkMock::create(['id' => 'test']);
$item = new MenuLinkTreeElement($link, FALSE, 3, FALSE, []);
$this->assertSame($link, $item->link);
@@ -36,7 +36,7 @@ class MenuLinkTreeElementTest extends UnitTestCase {
*
* @covers ::count
*/
- public function testCount() {
+ public function testCount(): void {
$link_1 = MenuLinkMock::create(['id' => 'test_1']);
$link_2 = MenuLinkMock::create(['id' => 'test_2']);
$child_item = new MenuLinkTreeElement($link_2, FALSE, 2, FALSE, []);
diff --git a/core/tests/Drupal/Tests/Core/Menu/MenuTreeParametersTest.php b/core/tests/Drupal/Tests/Core/Menu/MenuTreeParametersTest.php
index bc63907c88e..cd467b61f62 100644
--- a/core/tests/Drupal/Tests/Core/Menu/MenuTreeParametersTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/MenuTreeParametersTest.php
@@ -46,7 +46,7 @@ class MenuTreeParametersTest extends UnitTestCase {
* @covers ::setMinDepth
* @dataProvider providerTestSetMinDepth
*/
- public function testSetMinDepth($min_depth, $expected) {
+ public function testSetMinDepth($min_depth, $expected): void {
$parameters = new MenuTreeParameters();
$parameters->setMinDepth($min_depth);
$this->assertEquals($expected, $parameters->minDepth);
@@ -57,7 +57,7 @@ class MenuTreeParametersTest extends UnitTestCase {
*
* @covers ::addExpandedParents
*/
- public function testAddExpanded() {
+ public function testAddExpanded(): void {
$parameters = new MenuTreeParameters();
// Verify default value.
@@ -83,7 +83,7 @@ class MenuTreeParametersTest extends UnitTestCase {
*
* @covers ::addCondition
*/
- public function testAddCondition() {
+ public function testAddCondition(): void {
$parameters = new MenuTreeParameters();
// Verify default value.
@@ -116,7 +116,7 @@ class MenuTreeParametersTest extends UnitTestCase {
*
* @covers ::onlyEnabledLinks
*/
- public function testOnlyEnabledLinks() {
+ public function testOnlyEnabledLinks(): void {
$parameters = new MenuTreeParameters();
$parameters->onlyEnabledLinks();
$this->assertEquals(1, $parameters->conditions['enabled']);
@@ -127,7 +127,7 @@ class MenuTreeParametersTest extends UnitTestCase {
*
* @covers ::setTopLevelOnly
*/
- public function testSetTopLevelOnly() {
+ public function testSetTopLevelOnly(): void {
$parameters = new MenuTreeParameters();
$parameters->setTopLevelOnly();
$this->assertEquals(1, $parameters->maxDepth);
@@ -138,7 +138,7 @@ class MenuTreeParametersTest extends UnitTestCase {
*
* @covers ::excludeRoot
*/
- public function testExcludeRoot() {
+ public function testExcludeRoot(): void {
$parameters = new MenuTreeParameters();
$parameters->excludeRoot();
$this->assertEquals(1, $parameters->minDepth);
@@ -148,7 +148,7 @@ class MenuTreeParametersTest extends UnitTestCase {
* @covers ::serialize
* @covers ::unserialize
*/
- public function testSerialize() {
+ public function testSerialize(): void {
$parameters = new MenuTreeParameters();
$parameters->setRoot(1);
$parameters->setMinDepth('2');
diff --git a/core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php b/core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php
index 7e5acedecc6..f934071037c 100644
--- a/core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php
@@ -18,7 +18,7 @@ class StaticMenuLinkOverridesTest extends UnitTestCase {
*
* @covers ::reload
*/
- public function testReload() {
+ public function testReload(): void {
$config_factory = $this->createMock('Drupal\Core\Config\ConfigFactoryInterface');
$config_factory->expects($this->once())
->method('reset')
@@ -37,7 +37,7 @@ class StaticMenuLinkOverridesTest extends UnitTestCase {
* @covers ::loadOverride
* @covers ::getConfig
*/
- public function testLoadOverride($overrides, $id, $expected) {
+ public function testLoadOverride($overrides, $id, $expected): void {
$config_factory = $this->getConfigFactoryStub(['core.menu.static_menu_link_overrides' => ['definitions' => $overrides]]);
$static_override = new StaticMenuLinkOverrides($config_factory);
@@ -65,7 +65,7 @@ class StaticMenuLinkOverridesTest extends UnitTestCase {
* @covers ::loadMultipleOverrides
* @covers ::getConfig
*/
- public function testLoadMultipleOverrides() {
+ public function testLoadMultipleOverrides(): void {
$overrides = [];
$overrides['test1'] = ['parent' => 'test0'];
$overrides['test2'] = ['parent' => 'test1'];
@@ -84,7 +84,7 @@ class StaticMenuLinkOverridesTest extends UnitTestCase {
* @covers ::loadOverride
* @covers ::getConfig
*/
- public function testSaveOverride() {
+ public function testSaveOverride(): void {
$config = $this->getMockBuilder('Drupal\Core\Config\Config')
->disableOriginalConstructor()
->getMock();
@@ -146,7 +146,7 @@ class StaticMenuLinkOverridesTest extends UnitTestCase {
*
* @dataProvider providerTestDeleteOverrides
*/
- public function testDeleteOverrides($ids, array $old_definitions, array $new_definitions) {
+ public function testDeleteOverrides($ids, array $old_definitions, array $new_definitions): void {
$config = $this->getMockBuilder('Drupal\Core\Config\Config')
->disableOriginalConstructor()
->getMock();
diff --git a/core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php b/core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php
index 227cfc83533..2b143781956 100644
--- a/core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php
+++ b/core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php
@@ -44,7 +44,7 @@ class ChainRequestPolicyTest extends UnitTestCase {
*
* @covers ::check
*/
- public function testEmptyChain() {
+ public function testEmptyChain(): void {
$result = $this->policy->check($this->request);
$this->assertNull($result);
}
@@ -54,7 +54,7 @@ class ChainRequestPolicyTest extends UnitTestCase {
*
* @covers ::check
*/
- public function testNullRuleChain() {
+ public function testNullRuleChain(): void {
$rule = $this->createMock('Drupal\Core\PageCache\RequestPolicyInterface');
$rule->expects($this->once())
->method('check')
@@ -73,7 +73,7 @@ class ChainRequestPolicyTest extends UnitTestCase {
* @dataProvider providerChainExceptionOnInvalidReturnValue
* @covers ::check
*/
- public function testChainExceptionOnInvalidReturnValue($return_value) {
+ public function testChainExceptionOnInvalidReturnValue($return_value): void {
$rule = $this->createMock('Drupal\Core\PageCache\RequestPolicyInterface');
$rule->expects($this->once())
->method('check')
@@ -109,7 +109,7 @@ class ChainRequestPolicyTest extends UnitTestCase {
* @dataProvider providerAllowIfAnyRuleReturnedAllow
* @covers ::check
*/
- public function testAllowIfAnyRuleReturnedAllow($return_values) {
+ public function testAllowIfAnyRuleReturnedAllow($return_values): void {
foreach ($return_values as $return_value) {
$rule = $this->createMock('Drupal\Core\PageCache\RequestPolicyInterface');
$rule->expects($this->once())
@@ -140,7 +140,7 @@ class ChainRequestPolicyTest extends UnitTestCase {
/**
* Asserts that check() returns immediately when a rule returned DENY.
*/
- public function testStopChainOnFirstDeny() {
+ public function testStopChainOnFirstDeny(): void {
$rule1 = $this->createMock('Drupal\Core\PageCache\RequestPolicyInterface');
$rule1->expects($this->once())
->method('check')
diff --git a/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php b/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php
index 377d5a16d5f..9b4d77d7859 100644
--- a/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php
+++ b/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php
@@ -53,7 +53,7 @@ class ChainResponsePolicyTest extends UnitTestCase {
*
* @covers ::check
*/
- public function testEmptyChain() {
+ public function testEmptyChain(): void {
$result = $this->policy->check($this->response, $this->request);
$this->assertNull($result);
}
@@ -63,7 +63,7 @@ class ChainResponsePolicyTest extends UnitTestCase {
*
* @covers ::check
*/
- public function testNullRuleChain() {
+ public function testNullRuleChain(): void {
$rule = $this->createMock('Drupal\Core\PageCache\ResponsePolicyInterface');
$rule->expects($this->once())
->method('check')
@@ -82,7 +82,7 @@ class ChainResponsePolicyTest extends UnitTestCase {
* @dataProvider providerChainExceptionOnInvalidReturnValue
* @covers ::check
*/
- public function testChainExceptionOnInvalidReturnValue($return_value) {
+ public function testChainExceptionOnInvalidReturnValue($return_value): void {
$rule = $this->createMock('Drupal\Core\PageCache\ResponsePolicyInterface');
$rule->expects($this->once())
->method('check')
@@ -115,7 +115,7 @@ class ChainResponsePolicyTest extends UnitTestCase {
/**
* Asserts that check() returns immediately when a rule returned DENY.
*/
- public function testStopChainOnFirstDeny() {
+ public function testStopChainOnFirstDeny(): void {
$rule1 = $this->createMock('Drupal\Core\PageCache\ResponsePolicyInterface');
$rule1->expects($this->once())
->method('check')
diff --git a/core/tests/Drupal/Tests/Core/PageCache/CommandLineOrUnsafeMethodTest.php b/core/tests/Drupal/Tests/Core/PageCache/CommandLineOrUnsafeMethodTest.php
index 99eb53cd733..ca09b31d162 100644
--- a/core/tests/Drupal/Tests/Core/PageCache/CommandLineOrUnsafeMethodTest.php
+++ b/core/tests/Drupal/Tests/Core/PageCache/CommandLineOrUnsafeMethodTest.php
@@ -40,7 +40,7 @@ class CommandLineOrUnsafeMethodTest extends UnitTestCase {
* @dataProvider providerTestHttpMethod
* @covers ::check
*/
- public function testHttpMethod($expected_result, $method) {
+ public function testHttpMethod($expected_result, $method): void {
$this->policy->expects($this->once())
->method('isCli')
->willReturn(FALSE);
@@ -74,7 +74,7 @@ class CommandLineOrUnsafeMethodTest extends UnitTestCase {
*
* @covers ::check
*/
- public function testIsCli() {
+ public function testIsCli(): void {
$this->policy->expects($this->once())
->method('isCli')
->willReturn(TRUE);
diff --git a/core/tests/Drupal/Tests/Core/PageCache/NoSessionOpenTest.php b/core/tests/Drupal/Tests/Core/PageCache/NoSessionOpenTest.php
index 026705cc986..2cff1b71984 100644
--- a/core/tests/Drupal/Tests/Core/PageCache/NoSessionOpenTest.php
+++ b/core/tests/Drupal/Tests/Core/PageCache/NoSessionOpenTest.php
@@ -44,7 +44,7 @@ class NoSessionOpenTest extends UnitTestCase {
*
* @covers ::check
*/
- public function testNoAllowUnlessSessionCookiePresent() {
+ public function testNoAllowUnlessSessionCookiePresent(): void {
$request_without_session = new Request();
$request_with_session = Request::create('/', 'GET', [], ['some-session-name' => 'some-session-id']);
diff --git a/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php b/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php
index c5717ffa231..e0043a8467d 100644
--- a/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php
+++ b/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php
@@ -148,7 +148,7 @@ class EntityConverterTest extends UnitTestCase {
*
* @covers ::applies
*/
- public function testApplies(array $definition, $name, Route $route, $applies) {
+ public function testApplies(array $definition, $name, Route $route, $applies): void {
$this->entityTypeManager->expects($this->any())
->method('hasDefinition')
->willReturnCallback(function ($entity_type) {
@@ -179,7 +179,7 @@ class EntityConverterTest extends UnitTestCase {
*
* @covers ::convert
*/
- public function testConvert($value, array $definition, array $defaults, $expected_result) {
+ public function testConvert($value, array $definition, array $defaults, $expected_result): void {
$this->setUpMocks();
$this->entityRepository->expects($this->any())
@@ -209,7 +209,7 @@ class EntityConverterTest extends UnitTestCase {
/**
* Tests the convert() method with an invalid entity type.
*/
- public function testConvertWithInvalidEntityType() {
+ public function testConvertWithInvalidEntityType(): void {
$this->setUpMocks();
$plugin_id = 'invalid_id';
@@ -227,7 +227,7 @@ class EntityConverterTest extends UnitTestCase {
/**
* Tests the convert() method with an invalid dynamic entity type.
*/
- public function testConvertWithInvalidDynamicEntityType() {
+ public function testConvertWithInvalidDynamicEntityType(): void {
$this->expectException(ParamNotConvertedException::class);
$this->expectExceptionMessage('The "foo" parameter was not converted because the "invalid_id" parameter is missing.');
$this->entityConverter->convert('id', ['type' => 'entity:{invalid_id}'], 'foo', ['foo' => 'id']);
diff --git a/core/tests/Drupal/Tests/Core/ParamConverter/EntityRevisionParamConverterTest.php b/core/tests/Drupal/Tests/Core/ParamConverter/EntityRevisionParamConverterTest.php
index 37101bcdcc1..1b712bd7ebb 100644
--- a/core/tests/Drupal/Tests/Core/ParamConverter/EntityRevisionParamConverterTest.php
+++ b/core/tests/Drupal/Tests/Core/ParamConverter/EntityRevisionParamConverterTest.php
@@ -51,7 +51,7 @@ class EntityRevisionParamConverterTest extends UnitTestCase {
/**
* @covers ::applies
*/
- public function testNonApplyingRoute() {
+ public function testNonApplyingRoute(): void {
$route = new Route('/test');
$this->assertFalse($this->converter->applies([], 'test_revision', $route));
}
@@ -59,7 +59,7 @@ class EntityRevisionParamConverterTest extends UnitTestCase {
/**
* @covers ::applies
*/
- public function testApplyingRoute() {
+ public function testApplyingRoute(): void {
$route = $this->getTestRoute();
$this->assertTrue($this->converter->applies($route->getOption('parameters')['test_revision'], 'test_revision', $route));
}
@@ -71,7 +71,7 @@ class EntityRevisionParamConverterTest extends UnitTestCase {
*
* @covers ::convert
*/
- public function testConvert($value, array $definition, array $defaults, $expected_result) {
+ public function testConvert($value, array $definition, array $defaults, $expected_result): void {
$storage = $this->prophesize(RevisionableStorageInterface::class);
$storage->loadRevision('valid_id')->willReturn((object) ['revision_id' => 'valid_id']);
$storage->loadRevision('invalid_id')->willReturn(NULL);
@@ -105,7 +105,7 @@ class EntityRevisionParamConverterTest extends UnitTestCase {
*
* @covers ::convert
*/
- public function testConvertWithInvalidEntityType() {
+ public function testConvertWithInvalidEntityType(): void {
$entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class);
$entity_type_manager->getStorage('invalid_entity_type_id')->willThrow(new InvalidPluginDefinitionException('invalid_entity_type_id'));
$entity_repository = $this->prophesize(EntityRepositoryInterface::class);
@@ -120,7 +120,7 @@ class EntityRevisionParamConverterTest extends UnitTestCase {
*
* @covers ::convert
*/
- public function testConvertWithInvalidType() {
+ public function testConvertWithInvalidType(): void {
$this->expectException(ParamNotConvertedException::class);
$this->expectExceptionMessage('The type definition "entity_revision_{entity_type_id}" is invalid. The expected format is "entity_revision:<entity_type_id>".');
$this->converter->convert('valid_id', ['type' => 'entity_revision_{entity_type_id}'], 'foo', ['foo' => 'valid_id']);
@@ -131,7 +131,7 @@ class EntityRevisionParamConverterTest extends UnitTestCase {
*
* @covers ::convert
*/
- public function testConvertWithInvalidDynamicEntityType() {
+ public function testConvertWithInvalidDynamicEntityType(): void {
$this->expectException(ParamNotConvertedException::class);
$this->expectExceptionMessage('The "foo" parameter was not converted because the "invalid_entity_type_id" parameter is missing.');
$this->converter->convert('valid_id', ['type' => 'entity_revision:{invalid_entity_type_id}'], 'foo', ['foo' => 'valid_id']);
diff --git a/core/tests/Drupal/Tests/Core/ParamConverter/ParamConverterManagerTest.php b/core/tests/Drupal/Tests/Core/ParamConverter/ParamConverterManagerTest.php
index e518f99e6ef..f48e26295e1 100644
--- a/core/tests/Drupal/Tests/Core/ParamConverter/ParamConverterManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/ParamConverter/ParamConverterManagerTest.php
@@ -38,7 +38,7 @@ class ParamConverterManagerTest extends UnitTestCase {
*
* @covers ::getConverter
*/
- public function testGetConverter($name, $class) {
+ public function testGetConverter($name, $class): void {
$converter = $this->getMockBuilder('Drupal\Core\ParamConverter\ParamConverterInterface')
->setMockClassName($class)
->getMock();
@@ -55,7 +55,7 @@ class ParamConverterManagerTest extends UnitTestCase {
*
* @covers ::getConverter
*/
- public function testGetConverterException() {
+ public function testGetConverterException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->manager->getConverter('undefined.converter');
}
@@ -129,7 +129,7 @@ class ParamConverterManagerTest extends UnitTestCase {
*
* @dataProvider providerTestSetRouteParameterConverters
*/
- public function testSetRouteParameterConverters($path, $parameters = NULL, $expected = NULL) {
+ public function testSetRouteParameterConverters($path, $parameters = NULL, $expected = NULL): void {
$converter = $this->createMock('Drupal\Core\ParamConverter\ParamConverterInterface');
$converter->expects($this->any())
->method('applies')
@@ -170,7 +170,7 @@ class ParamConverterManagerTest extends UnitTestCase {
/**
* @covers ::convert
*/
- public function testConvert() {
+ public function testConvert(): void {
$route = new Route('/test/{id}/{literal}/{null}');
$parameters = [
'id' => [
@@ -207,7 +207,7 @@ class ParamConverterManagerTest extends UnitTestCase {
/**
* @covers ::convert
*/
- public function testConvertNoConverting() {
+ public function testConvertNoConverting(): void {
$route = new Route('/test');
$defaults = [
RouteObjectInterface::ROUTE_OBJECT => $route,
@@ -223,7 +223,7 @@ class ParamConverterManagerTest extends UnitTestCase {
/**
* @covers ::convert
*/
- public function testConvertMissingParam() {
+ public function testConvertMissingParam(): void {
$route = new Route('/test/{id}');
$parameters = [
'id' => [
diff --git a/core/tests/Drupal/Tests/Core/Password/DefaultPasswordGeneratorTest.php b/core/tests/Drupal/Tests/Core/Password/DefaultPasswordGeneratorTest.php
index aa8db53413e..43659958e1d 100644
--- a/core/tests/Drupal/Tests/Core/Password/DefaultPasswordGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Password/DefaultPasswordGeneratorTest.php
@@ -18,7 +18,7 @@ class DefaultPasswordGeneratorTest extends UnitTestCase {
/**
* @covers ::generate
*/
- public function testGenerate() {
+ public function testGenerate(): void {
$generator = new DefaultPasswordGenerator();
$password = $generator->generate();
$this->assertEquals(10, strlen($password));
diff --git a/core/tests/Drupal/Tests/Core/Password/PhpPasswordTest.php b/core/tests/Drupal/Tests/Core/Password/PhpPasswordTest.php
index ec62177e967..1cbfc0c7d60 100644
--- a/core/tests/Drupal/Tests/Core/Password/PhpPasswordTest.php
+++ b/core/tests/Drupal/Tests/Core/Password/PhpPasswordTest.php
@@ -47,7 +47,7 @@ class PhpPasswordTest extends UnitTestCase {
* @covers ::hash
* @covers ::needsRehash
*/
- public function testPasswordNeedsUpdate() {
+ public function testPasswordNeedsUpdate(): void {
$weakHash = (new PhpPassword(PASSWORD_BCRYPT, ['cost' => 4]))->hash($this->password);
$this->assertTrue($this->passwordHasher->needsRehash($weakHash), 'Password hash with weak cost settings needs a new hash.');
}
@@ -58,7 +58,7 @@ class PhpPasswordTest extends UnitTestCase {
* @covers ::check
* @covers ::needsRehash
*/
- public function testPasswordChecking() {
+ public function testPasswordChecking(): void {
$this->assertTrue($this->passwordHasher->check($this->password, $this->passwordHash), 'Password check succeeds.');
$this->assertFalse($this->passwordHasher->needsRehash($this->passwordHash), 'Does not need a new hash.');
}
@@ -70,7 +70,7 @@ class PhpPasswordTest extends UnitTestCase {
* @covers ::check
* @covers ::needsRehash
*/
- public function testPasswordRehashing() {
+ public function testPasswordRehashing(): void {
// Increment the cost by one.
$strongHasher = new PhpPassword(PASSWORD_BCRYPT, ['cost' => 6]);
$this->assertTrue($strongHasher->needsRehash($this->passwordHash), 'Needs a new hash after incrementing the cost option.');
@@ -91,7 +91,7 @@ class PhpPasswordTest extends UnitTestCase {
*
* @dataProvider providerLongPasswords
*/
- public function testLongPassword($password, $allowed) {
+ public function testLongPassword($password, $allowed): void {
$passwordHash = $this->passwordHasher->hash($password);
diff --git a/core/tests/Drupal/Tests/Core/Path/PathMatcherTest.php b/core/tests/Drupal/Tests/Core/Path/PathMatcherTest.php
index 1213e9e3509..13ab4f0b2c9 100644
--- a/core/tests/Drupal/Tests/Core/Path/PathMatcherTest.php
+++ b/core/tests/Drupal/Tests/Core/Path/PathMatcherTest.php
@@ -44,7 +44,7 @@ class PathMatcherTest extends UnitTestCase {
*
* @dataProvider getMatchPathData
*/
- public function testMatchPath($patterns, $paths) {
+ public function testMatchPath($patterns, $paths): void {
foreach ($paths as $path => $expected_result) {
$actual_result = $this->pathMatcher->matchPath($path, $patterns);
$this->assertEquals($actual_result, $expected_result, "Tried matching the path '$path' to the pattern '$patterns'.");
diff --git a/core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php b/core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
index 3391aeb9424..b7b25b5f85d 100644
--- a/core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php
@@ -71,7 +71,7 @@ class PathValidatorTest extends UnitTestCase {
*
* @covers ::isValid
*/
- public function testIsValidWithFrontpage() {
+ public function testIsValidWithFrontpage(): void {
$this->accessAwareRouter->expects($this->never())
->method('match');
@@ -83,7 +83,7 @@ class PathValidatorTest extends UnitTestCase {
*
* @covers ::isValid
*/
- public function testIsValidWithNone() {
+ public function testIsValidWithNone(): void {
$this->accessAwareRouter->expects($this->never())
->method('match');
@@ -95,7 +95,7 @@ class PathValidatorTest extends UnitTestCase {
*
* @covers ::isValid
*/
- public function testIsValidWithExternalUrl() {
+ public function testIsValidWithExternalUrl(): void {
$this->accessAwareRouter->expects($this->never())
->method('match');
@@ -107,7 +107,7 @@ class PathValidatorTest extends UnitTestCase {
*
* @covers ::isValid
*/
- public function testIsValidWithInvalidExternalUrl() {
+ public function testIsValidWithInvalidExternalUrl(): void {
$this->accessAwareRouter->expects($this->never())
->method('match');
@@ -120,7 +120,7 @@ class PathValidatorTest extends UnitTestCase {
* @covers ::isValid
* @covers ::getPathAttributes
*/
- public function testIsValidWithLinkToAnyPageAccount() {
+ public function testIsValidWithLinkToAnyPageAccount(): void {
$this->account->expects($this->once())
->method('hasPermission')
->with('link to any page')
@@ -143,7 +143,7 @@ class PathValidatorTest extends UnitTestCase {
*
* @covers ::isValid
*/
- public function testIsValidWithoutLinkToAnyPageAccount() {
+ public function testIsValidWithoutLinkToAnyPageAccount(): void {
$this->account->expects($this->once())
->method('hasPermission')
->with('link to any page')
@@ -166,7 +166,7 @@ class PathValidatorTest extends UnitTestCase {
*
* @covers ::isValid
*/
- public function testIsValidWithPathAlias() {
+ public function testIsValidWithPathAlias(): void {
$this->account->expects($this->once())
->method('hasPermission')
->with('link to any page')
@@ -191,7 +191,7 @@ class PathValidatorTest extends UnitTestCase {
* @covers ::isValid
* @covers ::getPathAttributes
*/
- public function testIsValidWithAccessDenied() {
+ public function testIsValidWithAccessDenied(): void {
$this->account->expects($this->once())
->method('hasPermission')
->with('link to any page')
@@ -213,7 +213,7 @@ class PathValidatorTest extends UnitTestCase {
* @covers ::isValid
* @covers ::getPathAttributes
*/
- public function testIsValidWithResourceNotFound() {
+ public function testIsValidWithResourceNotFound(): void {
$this->account->expects($this->once())
->method('hasPermission')
->with('link to any page')
@@ -235,7 +235,7 @@ class PathValidatorTest extends UnitTestCase {
* @covers ::isValid
* @covers ::getPathAttributes
*/
- public function testIsValidWithParamNotConverted() {
+ public function testIsValidWithParamNotConverted(): void {
$this->account->expects($this->once())
->method('hasPermission')
->with('link to any page')
@@ -257,7 +257,7 @@ class PathValidatorTest extends UnitTestCase {
* @covers ::isValid
* @covers ::getPathAttributes
*/
- public function testIsValidWithMethodNotAllowed() {
+ public function testIsValidWithMethodNotAllowed(): void {
$this->account->expects($this->once())
->method('hasPermission')
->with('link to any page')
@@ -280,7 +280,7 @@ class PathValidatorTest extends UnitTestCase {
*
* @covers ::isValid
*/
- public function testIsValidWithFailingParameterConverting() {
+ public function testIsValidWithFailingParameterConverting(): void {
$this->account->expects($this->once())
->method('hasPermission')
->with('link to any page')
@@ -303,7 +303,7 @@ class PathValidatorTest extends UnitTestCase {
*
* @covers ::isValid
*/
- public function testIsValidWithNotExistingPath() {
+ public function testIsValidWithNotExistingPath(): void {
$this->account->expects($this->once())
->method('hasPermission')
->with('link to any page')
@@ -327,7 +327,7 @@ class PathValidatorTest extends UnitTestCase {
* @covers ::getUrlIfValid
* @covers ::getPathAttributes
*/
- public function testGetUrlIfValidWithAccess() {
+ public function testGetUrlIfValidWithAccess(): void {
$this->account->expects($this->exactly(2))
->method('hasPermission')
->with('link to any page')
@@ -360,7 +360,7 @@ class PathValidatorTest extends UnitTestCase {
*
* @covers ::getUrlIfValid
*/
- public function testGetUrlIfValidWithQuery() {
+ public function testGetUrlIfValidWithQuery(): void {
$this->account->expects($this->once())
->method('hasPermission')
->with('link to any page')
@@ -386,7 +386,7 @@ class PathValidatorTest extends UnitTestCase {
*
* @covers ::getUrlIfValid
*/
- public function testGetUrlIfValidWithoutAccess() {
+ public function testGetUrlIfValidWithoutAccess(): void {
$this->account->expects($this->once())
->method('hasPermission')
->with('link to any page')
@@ -410,7 +410,7 @@ class PathValidatorTest extends UnitTestCase {
*
* @covers ::getUrlIfValid
*/
- public function testGetUrlIfValidWithFrontPageAndQueryAndFragments() {
+ public function testGetUrlIfValidWithFrontPageAndQueryAndFragments(): void {
$url = $this->pathValidator->getUrlIfValid('<front>?hei=sen#berg');
$this->assertEquals('<front>', $url->getRouteName());
$this->assertEquals(['hei' => 'sen'], $url->getOptions()['query']);
@@ -423,7 +423,7 @@ class PathValidatorTest extends UnitTestCase {
* @covers ::getUrlIfValidWithoutAccessCheck
* @covers ::getPathAttributes
*/
- public function testGetUrlIfValidWithoutAccessCheck() {
+ public function testGetUrlIfValidWithoutAccessCheck(): void {
$this->account->expects($this->never())
->method('hasPermission')
->with('link to any page');
diff --git a/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php b/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php
index 9cdd35e54e9..9fbee0465dc 100644
--- a/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php
+++ b/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php
@@ -25,7 +25,7 @@ class PathProcessorFrontTest extends UnitTestCase {
* @covers ::processInbound
* @dataProvider providerProcessInbound
*/
- public function testProcessInbound($frontpage_path, $path, $expected, array $expected_query = []) {
+ public function testProcessInbound($frontpage_path, $path, $expected, array $expected_query = []): void {
$config_factory = $this->prophesize(ConfigFactoryInterface::class);
$config = $this->prophesize(ImmutableConfig::class);
$config_factory->get('system.site')
@@ -58,7 +58,7 @@ class PathProcessorFrontTest extends UnitTestCase {
*
* @covers ::processInbound
*/
- public function testProcessInboundBadConfig() {
+ public function testProcessInboundBadConfig(): void {
$config_factory = $this->prophesize(ConfigFactoryInterface::class);
$config = $this->prophesize(ImmutableConfig::class);
$config_factory->get('system.site')
diff --git a/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php b/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php
index a7018c32b52..b5b80a1bf0e 100644
--- a/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php
+++ b/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php
@@ -78,7 +78,7 @@ class PathProcessorTest extends UnitTestCase {
/**
* Tests resolving the inbound path to the system path.
*/
- public function testProcessInbound() {
+ public function testProcessInbound(): void {
// Create an alias manager stub.
$alias_manager = $this->getMockBuilder(AliasManager::class)
diff --git a/core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php b/core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php
index 6ea9efd4ea2..a7de9884d9c 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php
@@ -52,7 +52,7 @@ class CategorizingPluginManagerTraitTest extends UnitTestCase {
/**
* @covers ::getCategories
*/
- public function testGetCategories() {
+ public function testGetCategories(): void {
$this->assertSame([
'fruits',
'vegetables',
@@ -62,7 +62,7 @@ class CategorizingPluginManagerTraitTest extends UnitTestCase {
/**
* @covers ::getSortedDefinitions
*/
- public function testGetSortedDefinitions() {
+ public function testGetSortedDefinitions(): void {
$sorted = $this->pluginManager->getSortedDefinitions();
$this->assertSame(['apple', 'mango', 'cucumber'], array_keys($sorted));
}
@@ -70,7 +70,7 @@ class CategorizingPluginManagerTraitTest extends UnitTestCase {
/**
* @covers ::getGroupedDefinitions
*/
- public function testGetGroupedDefinitions() {
+ public function testGetGroupedDefinitions(): void {
$grouped = $this->pluginManager->getGroupedDefinitions();
$this->assertSame(['fruits', 'vegetables'], array_keys($grouped));
$this->assertSame(['apple', 'mango'], array_keys($grouped['fruits']));
@@ -80,7 +80,7 @@ class CategorizingPluginManagerTraitTest extends UnitTestCase {
/**
* @covers ::processDefinitionCategory
*/
- public function testProcessDefinitionCategory() {
+ public function testProcessDefinitionCategory(): void {
// Existing category.
$definition = [
'label' => 'some',
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionIsSatisfiedTest.php b/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionIsSatisfiedTest.php
index 1fd6da4f1ac..abb88f01604 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionIsSatisfiedTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionIsSatisfiedTest.php
@@ -74,7 +74,7 @@ class ContextDefinitionIsSatisfiedTest extends UnitTestCase {
*
* @dataProvider providerTestIsSatisfiedBy
*/
- public function testIsSatisfiedBy($expected, ContextDefinition $requirement, ContextDefinition $definition, $value = NULL) {
+ public function testIsSatisfiedBy($expected, ContextDefinition $requirement, ContextDefinition $definition, $value = NULL): void {
$context = new Context($definition, $value);
$this->assertSame($expected, $requirement->isSatisfiedBy($context));
}
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php b/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php
index 9758a52f958..588124f8403 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php
@@ -33,7 +33,7 @@ class ContextDefinitionTest extends UnitTestCase {
* @covers ::getDataDefinition
* @uses \Drupal
*/
- public function testGetDataDefinition($is_multiple) {
+ public function testGetDataDefinition($is_multiple): void {
$data_type = 'valid';
$mock_data_definition = $this->createMock(ContextDefinitionInterface::class);
$mock_data_definition->expects($this->once())
@@ -106,7 +106,7 @@ class ContextDefinitionTest extends UnitTestCase {
* @covers ::getDataDefinition
* @uses \Drupal
*/
- public function testGetDataDefinitionInvalidType($is_multiple) {
+ public function testGetDataDefinitionInvalidType($is_multiple): void {
// Since we're trying to make getDataDefinition() throw an exception in
// isolation, we use a data type which is not valid.
$data_type = 'not_valid';
@@ -172,7 +172,7 @@ class ContextDefinitionTest extends UnitTestCase {
* @covers ::getConstraint
* @uses \Drupal
*/
- public function testGetConstraint($expected, $constraint_array, $constraint) {
+ public function testGetConstraint($expected, $constraint_array, $constraint): void {
$mock_context_definition = $this->getMockBuilder('Drupal\Core\Plugin\Context\ContextDefinition')
->disableOriginalConstructor()
->onlyMethods([
@@ -190,7 +190,7 @@ class ContextDefinitionTest extends UnitTestCase {
* @covers ::getDefaultValue
* @covers ::setDefaultValue
*/
- public function testDefaultValue() {
+ public function testDefaultValue(): void {
$context_definition = new ContextDefinition();
$this->assertNull($context_definition->getDefaultValue());
$context_definition->setDefaultValue('test');
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php b/core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php
index ba24da9008c..fef689c098c 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Context/ContextTest.php
@@ -50,7 +50,7 @@ class ContextTest extends UnitTestCase {
/**
* @covers ::getContextValue
*/
- public function testDefaultValue() {
+ public function testDefaultValue(): void {
$this->setUpDefaultValue('test');
$context = new Context($this->contextDefinition);
@@ -61,7 +61,7 @@ class ContextTest extends UnitTestCase {
/**
* @covers ::getContextData
*/
- public function testDefaultDataValue() {
+ public function testDefaultDataValue(): void {
$this->setUpDefaultValue('test');
$context = new Context($this->contextDefinition);
@@ -72,7 +72,7 @@ class ContextTest extends UnitTestCase {
/**
* @covers ::getContextData
*/
- public function testNullDataValue() {
+ public function testNullDataValue(): void {
$this->setUpDefaultValue(NULL);
$context = new Context($this->contextDefinition);
@@ -83,7 +83,7 @@ class ContextTest extends UnitTestCase {
/**
* @covers ::setContextValue
*/
- public function testSetContextValueTypedData() {
+ public function testSetContextValueTypedData(): void {
$this->contextDefinition = $this->createMock('Drupal\Core\Plugin\Context\ContextDefinitionInterface');
@@ -95,7 +95,7 @@ class ContextTest extends UnitTestCase {
/**
* @covers ::setContextValue
*/
- public function testSetContextValueCacheableDependency() {
+ public function testSetContextValueCacheableDependency(): void {
$container = new Container();
$cache_context_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
->disableOriginalConstructor()
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php b/core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php
index c1f253096a1..6a1a14e4946 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php
@@ -108,7 +108,7 @@ class EntityContextDefinitionIsSatisfiedTest extends UnitTestCase {
*
* @dataProvider providerTestIsSatisfiedBy
*/
- public function testIsSatisfiedBy($expected, ContextDefinition $requirement, ContextDefinition $definition, $value = NULL) {
+ public function testIsSatisfiedBy($expected, ContextDefinition $requirement, ContextDefinition $definition, $value = NULL): void {
$entity_storage = $this->prophesize(EntityStorageInterface::class);
$content_entity_storage = $this->prophesize(ContentEntityStorageInterface::class);
$this->entityTypeManager->getStorage('test_config')->willReturn($entity_storage->reveal());
@@ -192,7 +192,7 @@ class EntityContextDefinitionIsSatisfiedTest extends UnitTestCase {
*
* @dataProvider providerTestIsSatisfiedByGenerateBundledEntity
*/
- public function testIsSatisfiedByGenerateBundledEntity($expected, array $requirement_bundles, array $candidate_bundles, ?array $bundles_to_instantiate = NULL) {
+ public function testIsSatisfiedByGenerateBundledEntity($expected, array $requirement_bundles, array $candidate_bundles, ?array $bundles_to_instantiate = NULL): void {
// If no bundles are explicitly specified, instantiate all bundles.
if (!$bundles_to_instantiate) {
$bundles_to_instantiate = $candidate_bundles;
@@ -289,7 +289,7 @@ class EntityContextDefinitionIsSatisfiedTest extends UnitTestCase {
*
* @dataProvider providerTestIsSatisfiedByPassBundledEntity
*/
- public function testIsSatisfiedByPassBundledEntity($expected, $requirement_constraint) {
+ public function testIsSatisfiedByPassBundledEntity($expected, $requirement_constraint): void {
$entity_type = new EntityType(['id' => 'test_content']);
$this->entityTypeManager->getDefinitions()->willReturn([
'test_content' => $entity_type,
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Context/LazyContextRepositoryTest.php b/core/tests/Drupal/Tests/Core/Plugin/Context/LazyContextRepositoryTest.php
index 82240491a19..da4130d7611 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Context/LazyContextRepositoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Context/LazyContextRepositoryTest.php
@@ -35,7 +35,7 @@ class LazyContextRepositoryTest extends UnitTestCase {
/**
* @covers ::getRuntimeContexts
*/
- public function testGetRuntimeContextsSingle() {
+ public function testGetRuntimeContextsSingle(): void {
$contexts = $this->setupContextAndProvider('test_provider', ['test_context']);
$lazy_context_repository = new LazyContextRepository($this->container, ['test_provider']);
@@ -46,7 +46,7 @@ class LazyContextRepositoryTest extends UnitTestCase {
/**
* @covers ::getRuntimeContexts
*/
- public function testGetRuntimeMultipleContextsPerService() {
+ public function testGetRuntimeMultipleContextsPerService(): void {
$contexts = $this->setupContextAndProvider('test_provider', ['test_context0', 'test_context1']);
$lazy_context_repository = new LazyContextRepository($this->container, ['test_provider']);
@@ -57,7 +57,7 @@ class LazyContextRepositoryTest extends UnitTestCase {
/**
* @covers ::getRuntimeContexts
*/
- public function testGetRuntimeMultipleContextProviders() {
+ public function testGetRuntimeMultipleContextProviders(): void {
$contexts0 = $this->setupContextAndProvider('test_provider', ['test_context0', 'test_context1'], ['test_context0']);
$contexts1 = $this->setupContextAndProvider('test_provider2', ['test1_context0', 'test1_context1'], ['test1_context0']);
@@ -69,7 +69,7 @@ class LazyContextRepositoryTest extends UnitTestCase {
/**
* @covers ::getRuntimeContexts
*/
- public function testInvalidContextId() {
+ public function testInvalidContextId(): void {
$lazy_context_repository = new LazyContextRepository($this->container, ['test_provider']);
$this->expectException(\AssertionError::class);
$this->expectExceptionMessage('You must provide the context IDs in the @{service_id}:{unqualified_context_id} format.');
@@ -79,7 +79,7 @@ class LazyContextRepositoryTest extends UnitTestCase {
/**
* @covers ::getRuntimeContexts
*/
- public function testGetRuntimeStaticCache() {
+ public function testGetRuntimeStaticCache(): void {
$context0 = new Context(new ContextDefinition('example'));
$context1 = new Context(new ContextDefinition('example'));
@@ -98,7 +98,7 @@ class LazyContextRepositoryTest extends UnitTestCase {
/**
* @covers ::getAvailableContexts
*/
- public function testGetAvailableContexts() {
+ public function testGetAvailableContexts(): void {
$contexts0 = $this->setupContextAndProvider('test_provider0', ['test0_context0', 'test0_context1']);
$contexts1 = $this->setupContextAndProvider('test_provider1', ['test1_context0', 'test1_context1']);
diff --git a/core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php b/core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php
index cff3e9bc65e..221293855b9 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php
@@ -70,7 +70,7 @@ class ContextHandlerTest extends UnitTestCase {
*
* @dataProvider providerTestCheckRequirements
*/
- public function testCheckRequirements($contexts, $requirements, $expected) {
+ public function testCheckRequirements($contexts, $requirements, $expected): void {
$contexts = array_map(function ($context) {
$mock = $this->createMock('Drupal\Core\Plugin\Context\ContextInterface');
$mock->expects($this->atLeastOnce())
@@ -121,7 +121,7 @@ class ContextHandlerTest extends UnitTestCase {
*
* @dataProvider providerTestGetMatchingContexts
*/
- public function testGetMatchingContexts($contexts, $requirement, $expected = NULL) {
+ public function testGetMatchingContexts($contexts, $requirement, $expected = NULL): void {
$contexts = array_map(function ($context) {
$mock = $this->createMock('Drupal\Core\Plugin\Context\ContextInterface');
$mock->expects($this->atLeastOnce())
@@ -172,7 +172,7 @@ class ContextHandlerTest extends UnitTestCase {
*
* @dataProvider providerTestFilterPluginDefinitionsByContexts
*/
- public function testFilterPluginDefinitionsByContexts($has_context, $definitions, $expected) {
+ public function testFilterPluginDefinitionsByContexts($has_context, $definitions, $expected): void {
if ($has_context) {
$context = $this->createMock('Drupal\Core\Plugin\Context\ContextInterface');
$expected_context_definition = (new ContextDefinition('string'))->setConstraints(['Blank' => []]);
@@ -299,7 +299,7 @@ class ContextHandlerTest extends UnitTestCase {
/**
* @covers ::applyContextMapping
*/
- public function testApplyContextMapping() {
+ public function testApplyContextMapping(): void {
$context_hit = $this->createMock('Drupal\Core\Plugin\Context\ContextInterface');
$context_hit->expects($this->atLeastOnce())
->method('hasContextValue')
@@ -340,7 +340,7 @@ class ContextHandlerTest extends UnitTestCase {
/**
* @covers ::applyContextMapping
*/
- public function testApplyContextMappingMissingRequired() {
+ public function testApplyContextMappingMissingRequired(): void {
$context = $this->createMock('Drupal\Core\Plugin\Context\ContextInterface');
$context->expects($this->never())
->method('getContextValue');
@@ -377,7 +377,7 @@ class ContextHandlerTest extends UnitTestCase {
/**
* @covers ::applyContextMapping
*/
- public function testApplyContextMappingMissingNotRequired() {
+ public function testApplyContextMappingMissingNotRequired(): void {
$context = $this->createMock('Drupal\Core\Plugin\Context\ContextInterface');
$context->expects($this->never())
->method('getContextValue');
@@ -412,7 +412,7 @@ class ContextHandlerTest extends UnitTestCase {
/**
* @covers ::applyContextMapping
*/
- public function testApplyContextMappingNoValueRequired() {
+ public function testApplyContextMappingNoValueRequired(): void {
$context = $this->createMock('Drupal\Core\Plugin\Context\ContextInterface');
$context->expects($this->never())
->method('getContextValue');
@@ -447,7 +447,7 @@ class ContextHandlerTest extends UnitTestCase {
/**
* @covers ::applyContextMapping
*/
- public function testApplyContextMappingNoValueNonRequired() {
+ public function testApplyContextMappingNoValueNonRequired(): void {
$context = $this->createMock('Drupal\Core\Plugin\Context\ContextInterface');
$context->expects($this->never())
->method('getContextValue');
@@ -480,7 +480,7 @@ class ContextHandlerTest extends UnitTestCase {
/**
* @covers ::applyContextMapping
*/
- public function testApplyContextMappingConfigurableAssigned() {
+ public function testApplyContextMappingConfigurableAssigned(): void {
$context = $this->createMock('Drupal\Core\Plugin\Context\ContextInterface');
$context->expects($this->atLeastOnce())
->method('hasContextValue')
@@ -519,7 +519,7 @@ class ContextHandlerTest extends UnitTestCase {
/**
* @covers ::applyContextMapping
*/
- public function testApplyContextMappingConfigurableAssignedMiss() {
+ public function testApplyContextMappingConfigurableAssignedMiss(): void {
$context = $this->createMock('Drupal\Core\Plugin\Context\ContextInterface');
$context->expects($this->never())
->method('getContextValue');
diff --git a/core/tests/Drupal/Tests/Core/Plugin/DefaultLazyPluginCollectionTest.php b/core/tests/Drupal/Tests/Core/Plugin/DefaultLazyPluginCollectionTest.php
index a4b9e379caa..f957384a702 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/DefaultLazyPluginCollectionTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/DefaultLazyPluginCollectionTest.php
@@ -27,7 +27,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
/**
* @covers ::has
*/
- public function testHas() {
+ public function testHas(): void {
$this->setupPluginCollection();
$definitions = $this->getPluginDefinitions();
@@ -41,7 +41,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
/**
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
$this->setupPluginCollection($this->once());
$apple = $this->pluginInstances['apple'];
@@ -51,7 +51,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
/**
* @covers ::get
*/
- public function testGetNotExistingPlugin() {
+ public function testGetNotExistingPlugin(): void {
$this->setupPluginCollection();
$this->expectException(PluginNotFoundException::class);
$this->expectExceptionMessage("Plugin ID 'pear' was not found.");
@@ -84,7 +84,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
* @covers ::sortHelper
* @dataProvider providerTestSortHelper
*/
- public function testSortHelper($plugin_id_1, $plugin_id_2, $expected) {
+ public function testSortHelper($plugin_id_1, $plugin_id_2, $expected): void {
$this->setupPluginCollection($this->any());
if ($expected != 0) {
$expected = $expected > 0 ? 1 : -1;
@@ -95,7 +95,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
/**
* @covers ::getConfiguration
*/
- public function testGetConfiguration() {
+ public function testGetConfiguration(): void {
$this->setupPluginCollection($this->exactly(3));
// The expected order matches $this->config.
$expected = ['banana', 'cherry', 'apple'];
@@ -118,7 +118,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
/**
* @covers ::addInstanceId
*/
- public function testAddInstanceId() {
+ public function testAddInstanceId(): void {
$this->setupPluginCollection($this->exactly(4));
$expected = [
'banana' => 'banana',
@@ -146,7 +146,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
/**
* @covers ::removeInstanceId
*/
- public function testRemoveInstanceId() {
+ public function testRemoveInstanceId(): void {
$this->setupPluginCollection($this->exactly(2));
$this->defaultPluginCollection->removeInstanceId('cherry');
$config = $this->defaultPluginCollection->getConfiguration();
@@ -156,7 +156,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
/**
* @covers ::setInstanceConfiguration
*/
- public function testSetInstanceConfiguration() {
+ public function testSetInstanceConfiguration(): void {
$this->setupPluginCollection($this->exactly(3));
$expected = [
'id' => 'cherry',
@@ -173,7 +173,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
*
* @covers ::setInstanceConfiguration
*/
- public function testSetInstanceConfigurationPluginChange() {
+ public function testSetInstanceConfigurationPluginChange(): void {
$configurable_plugin = $this->prophesize(ConfigurableInterface::class);
$configurable_config = ['id' => 'configurable', 'foo' => 'bar'];
$configurable_plugin->getConfiguration()->willReturn($configurable_config);
@@ -202,7 +202,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
/**
* @covers ::count
*/
- public function testCount() {
+ public function testCount(): void {
$this->setupPluginCollection();
$this->assertCount(3, $this->defaultPluginCollection);
}
@@ -210,7 +210,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
/**
* @covers ::clear
*/
- public function testClear() {
+ public function testClear(): void {
$this->setupPluginCollection($this->exactly(6));
$this->defaultPluginCollection->getConfiguration();
$this->defaultPluginCollection->getConfiguration();
@@ -221,7 +221,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
/**
* @covers ::set
*/
- public function testSet() {
+ public function testSet(): void {
$this->setupPluginCollection($this->exactly(4));
$instance = $this->pluginManager->createInstance('cherry', $this->config['cherry']);
$this->defaultPluginCollection->set('cherry2', $instance);
@@ -247,7 +247,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
/**
* @covers ::getConfiguration
*/
- public function testConfigurableGetConfiguration() {
+ public function testConfigurableGetConfiguration(): void {
$this->setupPluginCollection($this->exactly(3));
$config = $this->defaultPluginCollection->getConfiguration();
$this->assertSame($this->config, $config);
@@ -256,7 +256,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
/**
* @covers ::setConfiguration
*/
- public function testConfigurableSetConfiguration() {
+ public function testConfigurableSetConfiguration(): void {
$this->setupPluginCollection($this->exactly(2));
$this->defaultPluginCollection->setConfiguration(['apple' => ['value' => 'pineapple', 'id' => 'apple']]);
@@ -279,7 +279,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
*
* @covers ::getConfiguration
*/
- public function testConfigurableInterface() {
+ public function testConfigurableInterface(): void {
$configurable_plugin = $this->prophesize(ConfigurableInterface::class);
$configurable_config = ['id' => 'configurable', 'foo' => 'bar'];
$configurable_plugin->getConfiguration()->willReturn($configurable_config);
diff --git a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php
index 5a03eb56c9c..0a7f41cc03a 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php
@@ -70,7 +70,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
/**
* Tests the plugin manager with a plugin that extends a non-installed class.
*/
- public function testDefaultPluginManagerWithPluginExtendingNonInstalledClass() {
+ public function testDefaultPluginManagerWithPluginExtendingNonInstalledClass(): void {
$definitions = [];
$definitions['extending_non_installed_class'] = [
'id' => 'extending_non_installed_class',
@@ -89,7 +89,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
/**
* Tests the plugin manager with a disabled module.
*/
- public function testDefaultPluginManagerWithDisabledModule() {
+ public function testDefaultPluginManagerWithDisabledModule(): void {
$definitions = $this->expectedDefinitions;
$definitions['cherry'] = [
'id' => 'cherry',
@@ -114,7 +114,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
/**
* Tests the plugin manager and object plugin definitions.
*/
- public function testDefaultPluginManagerWithObjects() {
+ public function testDefaultPluginManagerWithObjects(): void {
$definitions = $this->expectedDefinitions;
$definitions['cherry'] = (object) [
'id' => 'cherry',
@@ -139,7 +139,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
/**
* Tests the plugin manager behavior for a missing plugin ID.
*/
- public function testGetDefinitionPluginNotFoundException() {
+ public function testGetDefinitionPluginNotFoundException(): void {
$plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions);
$this->expectException(PluginNotFoundException::class);
@@ -150,7 +150,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
/**
* Tests the plugin manager with no cache and altering.
*/
- public function testDefaultPluginManager() {
+ public function testDefaultPluginManager(): void {
$plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions, NULL, NULL, '\Drupal\plugin_test\Plugin\plugin_test\fruit\FruitInterface');
$this->assertEquals($this->expectedDefinitions, $plugin_manager->getDefinitions());
$this->assertEquals($this->expectedDefinitions['banana'], $plugin_manager->getDefinition('banana'));
@@ -159,7 +159,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
/**
* Tests the plugin manager with no cache and altering.
*/
- public function testDefaultPluginManagerWithAlter() {
+ public function testDefaultPluginManagerWithAlter(): void {
$module_handler = $this->getMockBuilder('Drupal\Core\Extension\ModuleHandler')
->disableOriginalConstructor()
->getMock();
@@ -179,7 +179,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
/**
* Tests the plugin manager with caching and altering.
*/
- public function testDefaultPluginManagerWithEmptyCache() {
+ public function testDefaultPluginManagerWithEmptyCache(): void {
$cid = $this->randomMachineName();
$cache_backend = $this->getMockBuilder('Drupal\Core\Cache\MemoryBackend')
->disableOriginalConstructor()
@@ -204,7 +204,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
/**
* Tests the plugin manager with caching and altering.
*/
- public function testDefaultPluginManagerWithFilledCache() {
+ public function testDefaultPluginManagerWithFilledCache(): void {
$cid = $this->randomMachineName();
$cache_backend = $this->getMockBuilder('Drupal\Core\Cache\MemoryBackend')
->disableOriginalConstructor()
@@ -227,7 +227,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
/**
* Tests the plugin manager with caching disabled.
*/
- public function testDefaultPluginManagerNoCache() {
+ public function testDefaultPluginManagerNoCache(): void {
$plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions, NULL, NULL, '\Drupal\plugin_test\Plugin\plugin_test\fruit\FruitInterface');
$cid = $this->randomMachineName();
@@ -251,7 +251,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
/**
* Tests the plugin manager cache clear with tags.
*/
- public function testCacheClearWithTags() {
+ public function testCacheClearWithTags(): void {
$cid = $this->randomMachineName();
$cache_backend = $this->createMock('Drupal\Core\Cache\CacheBackendInterface');
$cache_tags_invalidator = $this->createMock('Drupal\Core\Cache\CacheTagsInvalidatorInterface');
@@ -276,7 +276,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
*
* @covers ::createInstance
*/
- public function testCreateInstanceWithJustValidInterfaces() {
+ public function testCreateInstanceWithJustValidInterfaces(): void {
$plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions, NULL, NULL, '\Drupal\plugin_test\Plugin\plugin_test\fruit\FruitInterface');
foreach ($this->expectedDefinitions as $plugin_id => $definition) {
@@ -289,7 +289,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
*
* @covers ::createInstance
*/
- public function testCreateInstanceWithInvalidInterfaces() {
+ public function testCreateInstanceWithInvalidInterfaces(): void {
$module_handler = $this->createMock('Drupal\Core\Extension\ModuleHandlerInterface');
$module_handler->expects($this->any())
@@ -318,7 +318,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
*
* @covers ::getDefinitions
*/
- public function testGetDefinitionsWithoutRequiredInterface() {
+ public function testGetDefinitionsWithoutRequiredInterface(): void {
$module_handler = $this->createMock('Drupal\Core\Extension\ModuleHandlerInterface');
$module_handler->expects($this->any())
@@ -343,7 +343,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
/**
* @covers ::getCacheContexts
*/
- public function testGetCacheContexts() {
+ public function testGetCacheContexts(): void {
$module_handler = $this->prophesize(ModuleHandlerInterface::class);
$plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions, $module_handler->reveal(), NULL);
$cache_contexts = $plugin_manager->getCacheContexts();
@@ -356,7 +356,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
/**
* @covers ::getCacheTags
*/
- public function testGetCacheTags() {
+ public function testGetCacheTags(): void {
$module_handler = $this->prophesize(ModuleHandlerInterface::class);
$plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions, $module_handler->reveal(), NULL);
$cache_tags = $plugin_manager->getCacheTags();
@@ -369,7 +369,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
/**
* @covers ::getCacheMaxAge
*/
- public function testGetCacheMaxAge() {
+ public function testGetCacheMaxAge(): void {
$module_handler = $this->prophesize(ModuleHandlerInterface::class);
$plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions, $module_handler->reveal(), NULL);
$cache_max_age = $plugin_manager->getCacheMaxAge();
@@ -380,7 +380,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
* @covers ::findDefinitions
* @covers ::extractProviderFromDefinition
*/
- public function testProviderExists() {
+ public function testProviderExists(): void {
$definitions = [];
$definitions['array_based_found'] = ['provider' => 'module_found'];
$definitions['array_based_missing'] = ['provider' => 'module_missing'];
@@ -406,7 +406,7 @@ class DefaultPluginManagerTest extends UnitTestCase {
* @covers ::processDefinition
* @dataProvider providerTestProcessDefinition
*/
- public function testProcessDefinition($definition, $expected) {
+ public function testProcessDefinition($definition, $expected): void {
$module_handler = $this->prophesize(ModuleHandlerInterface::class);
$plugin_manager = new TestPluginManagerWithDefaults($this->namespaces, $this->expectedDefinitions, $module_handler->reveal(), NULL);
diff --git a/core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php b/core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php
index 43ccb8fd864..c428a9c78db 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php
@@ -36,7 +36,7 @@ class DefaultSingleLazyPluginCollectionTest extends LazyPluginCollectionTestBase
/**
* Tests the get() method.
*/
- public function testGet() {
+ public function testGet(): void {
$this->setupPluginCollection($this->once());
$apple = $this->pluginInstances['apple'];
@@ -48,7 +48,7 @@ class DefaultSingleLazyPluginCollectionTest extends LazyPluginCollectionTestBase
* @covers ::getConfiguration
* @covers ::setConfiguration
*/
- public function testAddInstanceId() {
+ public function testAddInstanceId(): void {
$this->setupPluginCollection($this->any());
$this->assertEquals(['id' => 'apple', 'key' => 'value'], $this->defaultPluginCollection->get('apple')->getConfiguration());
@@ -64,7 +64,7 @@ class DefaultSingleLazyPluginCollectionTest extends LazyPluginCollectionTestBase
/**
* @covers ::getInstanceIds
*/
- public function testGetInstanceIds() {
+ public function testGetInstanceIds(): void {
$this->setupPluginCollection($this->any());
$this->assertEquals(['apple' => 'apple'], $this->defaultPluginCollection->getInstanceIds());
@@ -75,7 +75,7 @@ class DefaultSingleLazyPluginCollectionTest extends LazyPluginCollectionTestBase
/**
* @covers ::setConfiguration
*/
- public function testConfigurableSetConfiguration() {
+ public function testConfigurableSetConfiguration(): void {
$this->setupPluginCollection($this->any());
$this->defaultPluginCollection->setConfiguration(['apple' => ['value' => 'pineapple', 'id' => 'apple']]);
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecoratorTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecoratorTest.php
index b1bebdd43ad..14c56887280 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecoratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecoratorTest.php
@@ -16,7 +16,7 @@ class ContainerDerivativeDiscoveryDecoratorTest extends UnitTestCase {
/**
* @covers ::getDefinitions
*/
- public function testGetDefinitions() {
+ public function testGetDefinitions(): void {
$example_service = $this->createMock('Symfony\Contracts\EventDispatcher\EventDispatcherInterface');
$example_container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')
->onlyMethods(['get'])
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php
index 2e3fd33f05a..e82f496b3ac 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php
@@ -39,7 +39,7 @@ class DerivativeDiscoveryDecoratorTest extends UnitTestCase {
*
* @see \Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator::getDerivativeFetcher()
*/
- public function testGetDerivativeFetcher() {
+ public function testGetDerivativeFetcher(): void {
$definitions = [];
$definitions['non_container_aware_discovery'] = [
'id' => 'non_container_aware_discovery',
@@ -65,7 +65,7 @@ class DerivativeDiscoveryDecoratorTest extends UnitTestCase {
/**
* Tests the getDerivativeFetcher method with objects instead of arrays.
*/
- public function testGetDerivativeFetcherWithAnnotationObjects() {
+ public function testGetDerivativeFetcherWithAnnotationObjects(): void {
$definitions = [];
$definitions['non_container_aware_discovery'] = (object) [
'id' => 'non_container_aware_discovery',
@@ -95,7 +95,7 @@ class DerivativeDiscoveryDecoratorTest extends UnitTestCase {
*
* @covers ::getDeriverClass
*/
- public function testGetDeriverClassWithClassedDefinitions() {
+ public function testGetDeriverClassWithClassedDefinitions(): void {
$definitions = [];
$definition = $this->prophesize(DerivablePluginDefinitionInterface::class);
$definition->id()->willReturn('non_container_aware_discovery');
@@ -117,7 +117,7 @@ class DerivativeDiscoveryDecoratorTest extends UnitTestCase {
/**
* @covers ::getDeriverClass
*/
- public function testGetDeriverClassWithInvalidClassedDefinitions() {
+ public function testGetDeriverClassWithInvalidClassedDefinitions(): void {
$definition = $this->prophesize(DerivablePluginDefinitionInterface::class);
$definition->id()->willReturn('non_existent_discovery');
$definition->getDeriver()->willReturn('\Drupal\system\Tests\Plugin\NonExistentDeriver');
@@ -140,7 +140,7 @@ class DerivativeDiscoveryDecoratorTest extends UnitTestCase {
*
* @see \Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator::getDeriver().\
*/
- public function testNonExistentDerivativeFetcher() {
+ public function testNonExistentDerivativeFetcher(): void {
$definitions = [];
// Do this with a class that doesn't exist.
$definitions['non_existent_discovery'] = [
@@ -162,7 +162,7 @@ class DerivativeDiscoveryDecoratorTest extends UnitTestCase {
*
* @see \Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator::getDeriver().\
*/
- public function testInvalidDerivativeFetcher() {
+ public function testInvalidDerivativeFetcher(): void {
$definitions = [];
// Do this with a class that doesn't implement the interface.
$definitions['invalid_discovery'] = [
@@ -182,7 +182,7 @@ class DerivativeDiscoveryDecoratorTest extends UnitTestCase {
/**
* Tests derivative definitions when a definition already exists.
*/
- public function testExistingDerivative() {
+ public function testExistingDerivative(): void {
$definitions = [];
$definitions['non_container_aware_discovery'] = [
'id' => 'non_container_aware_discovery',
@@ -222,7 +222,7 @@ class DerivativeDiscoveryDecoratorTest extends UnitTestCase {
/**
* Tests a single definition when a derivative already exists.
*/
- public function testSingleExistingDerivative() {
+ public function testSingleExistingDerivative(): void {
$base_definition = [
'id' => 'non_container_aware_discovery',
'deriver' => '\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery',
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/HookDiscoveryTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/HookDiscoveryTest.php
index f5020d85706..8b60c5215a5 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/HookDiscoveryTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/HookDiscoveryTest.php
@@ -43,7 +43,7 @@ class HookDiscoveryTest extends UnitTestCase {
*
* @see \Drupal\Core\Plugin\Discovery::getDefinitions()
*/
- public function testGetDefinitionsWithoutPlugins() {
+ public function testGetDefinitionsWithoutPlugins(): void {
$this->assertCount(0, $this->hookDiscovery->getDefinitions());
}
@@ -52,7 +52,7 @@ class HookDiscoveryTest extends UnitTestCase {
*
* @see \Drupal\Core\Plugin\Discovery::getDefinitions()
*/
- public function testGetDefinitions() {
+ public function testGetDefinitions(): void {
$this->moduleHandler->expects($this->atLeastOnce())
->method('invokeAllWith')
->with('test_plugin')
@@ -81,7 +81,7 @@ class HookDiscoveryTest extends UnitTestCase {
*
* @see \Drupal\Core\Plugin\Discovery::getDefinition()
*/
- public function testGetDefinition() {
+ public function testGetDefinition(): void {
$this->moduleHandler->expects($this->exactly(4))
->method('invokeAllWith')
->with('test_plugin')
@@ -110,7 +110,7 @@ class HookDiscoveryTest extends UnitTestCase {
*
* @see \Drupal\Core\Plugin\Discovery::getDefinition()
*/
- public function testGetDefinitionWithUnknownID() {
+ public function testGetDefinitionWithUnknownID(): void {
$this->expectException(PluginNotFoundException::class);
$this->hookDiscovery->getDefinition('test_non_existent', TRUE);
}
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDirectoryDiscoveryTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDirectoryDiscoveryTest.php
index 8f5d9dad20a..8b8b1c7c919 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDirectoryDiscoveryTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDirectoryDiscoveryTest.php
@@ -20,7 +20,7 @@ class YamlDirectoryDiscoveryTest extends UnitTestCase {
/**
* @covers ::getDefinitions
*/
- public function testGetDefinitions() {
+ public function testGetDefinitions(): void {
vfsStream::setup('modules', NULL, [
'module_a' => [
'subdir1' => [
@@ -68,7 +68,7 @@ class YamlDirectoryDiscoveryTest extends UnitTestCase {
/**
* @covers ::getDefinitions
*/
- public function testGetDefinitionsWithTranslatableDefinitions() {
+ public function testGetDefinitionsWithTranslatableDefinitions(): void {
vfsStream::setup('modules', NULL, [
'module_a' => [
'subdir1' => [
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php
index 634979c8d51..cac65e81d82 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php
@@ -72,7 +72,7 @@ class YamlDiscoveryDecoratorTest extends UnitTestCase {
/**
* Tests the getDefinitions() method.
*/
- public function testGetDefinitions() {
+ public function testGetDefinitions(): void {
$definitions = $this->discoveryDecorator->getDefinitions();
$this->assertIsArray($definitions);
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryTest.php
index fe41eb82a23..6ed2aca673b 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryTest.php
@@ -53,7 +53,7 @@ class YamlDiscoveryTest extends UnitTestCase {
/**
* Tests the getDefinitions() method.
*/
- public function testGetDefinitions() {
+ public function testGetDefinitions(): void {
$definitions = $this->discovery->getDefinitions();
$this->assertIsArray($definitions);
@@ -75,7 +75,7 @@ class YamlDiscoveryTest extends UnitTestCase {
/**
* @covers ::getDefinitions
*/
- public function testGetDefinitionsWithTranslatableDefinitions() {
+ public function testGetDefinitionsWithTranslatableDefinitions(): void {
vfsStream::setup('root');
$file_1 = <<<'EOS'
@@ -113,7 +113,7 @@ EOS;
/**
* Tests the getDefinition() method.
*/
- public function testGetDefinition() {
+ public function testGetDefinition(): void {
$definitions = $this->discovery->getDefinitions();
// Test the getDefinition() method.
foreach ($this->expectedKeys as $expected_key) {
diff --git a/core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php b/core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php
index 15896ffb7ca..93a4e1942e8 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php
@@ -22,7 +22,7 @@ class FilteredPluginManagerTraitTest extends UnitTestCase {
* @covers ::getFilteredDefinitions
* @dataProvider providerTestGetFilteredDefinitions
*/
- public function testGetFilteredDefinitions($contexts, $expected) {
+ public function testGetFilteredDefinitions($contexts, $expected): void {
// Start with two plugins.
$definitions = [];
$definitions['plugin1'] = ['id' => 'plugin1'];
diff --git a/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php b/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php
index 0befb6181f4..ac07454f576 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php
@@ -26,7 +26,7 @@ class PluginDependencyTraitTest extends UnitTestCase {
*
* @dataProvider providerTestPluginDependencies
*/
- public function testGetPluginDependencies(ProphecyInterface $plugin, $definition, array $expected) {
+ public function testGetPluginDependencies(ProphecyInterface $plugin, $definition, array $expected): void {
$test_class = new TestPluginDependency();
$module_handler = $this->prophesize(ModuleHandlerInterface::class);
@@ -58,7 +58,7 @@ class PluginDependencyTraitTest extends UnitTestCase {
* @param array $expected
* The expected dependencies.
*/
- public function testCalculatePluginDependencies(ProphecyInterface $plugin, $definition, array $expected) {
+ public function testCalculatePluginDependencies(ProphecyInterface $plugin, $definition, array $expected): void {
$test_class = new TestPluginDependency();
$module_handler = $this->prophesize(ModuleHandlerInterface::class);
diff --git a/core/tests/Drupal/Tests/Core/Plugin/PluginFormFactoryTest.php b/core/tests/Drupal/Tests/Core/Plugin/PluginFormFactoryTest.php
index cc1da0d5809..b987a2bdafb 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/PluginFormFactoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/PluginFormFactoryTest.php
@@ -46,7 +46,7 @@ class PluginFormFactoryTest extends UnitTestCase {
/**
* @covers ::createInstance
*/
- public function testCreateInstance() {
+ public function testCreateInstance(): void {
$plugin_form = $this->prophesize(PluginFormInterface::class);
$expected = $plugin_form->reveal();
@@ -63,7 +63,7 @@ class PluginFormFactoryTest extends UnitTestCase {
/**
* @covers ::createInstance
*/
- public function testCreateInstanceUsingPlugin() {
+ public function testCreateInstanceUsingPlugin(): void {
$this->classResolver->getInstanceFromDefinition(Argument::cetera())->shouldNotBeCalled();
$plugin = $this->prophesize(PluginWithFormsInterface::class)->willImplement(PluginFormInterface::class);
@@ -77,7 +77,7 @@ class PluginFormFactoryTest extends UnitTestCase {
/**
* @covers ::createInstance
*/
- public function testCreateInstanceUsingPluginWithSlashes() {
+ public function testCreateInstanceUsingPluginWithSlashes(): void {
$this->classResolver->getInstanceFromDefinition(Argument::cetera())->shouldNotBeCalled();
$plugin = $this->prophesize(PluginWithFormsInterface::class)->willImplement(PluginFormInterface::class);
@@ -91,7 +91,7 @@ class PluginFormFactoryTest extends UnitTestCase {
/**
* @covers ::createInstance
*/
- public function testCreateInstanceDefaultFallback() {
+ public function testCreateInstanceDefaultFallback(): void {
$this->classResolver->getInstanceFromDefinition(Argument::cetera())->shouldNotBeCalled();
$plugin = $this->prophesize(PluginWithFormsInterface::class)->willImplement(PluginFormInterface::class);
@@ -106,7 +106,7 @@ class PluginFormFactoryTest extends UnitTestCase {
/**
* @covers ::createInstance
*/
- public function testCreateInstancePluginAware() {
+ public function testCreateInstancePluginAware(): void {
$plugin_form = $this->prophesize(PluginFormInterface::class)->willImplement(PluginAwareInterface::class);
$expected = $plugin_form->reveal();
@@ -126,7 +126,7 @@ class PluginFormFactoryTest extends UnitTestCase {
/**
* @covers ::createInstance
*/
- public function testCreateInstanceDefinitionException() {
+ public function testCreateInstanceDefinitionException(): void {
$this->expectException(InvalidPluginDefinitionException::class);
$this->expectExceptionMessage('The "the_plugin_id" plugin did not specify a "anything" form class');
@@ -141,7 +141,7 @@ class PluginFormFactoryTest extends UnitTestCase {
/**
* @covers ::createInstance
*/
- public function testCreateInstanceInvalidException() {
+ public function testCreateInstanceInvalidException(): void {
$this->expectException(InvalidPluginDefinitionException::class);
$this->expectExceptionMessage('The "the_plugin_id" plugin did not specify a valid "invalid" form class, must implement \Drupal\Core\Plugin\PluginFormInterface');
diff --git a/core/tests/Drupal/Tests/Core/Plugin/PluginWithFormsTraitTest.php b/core/tests/Drupal/Tests/Core/Plugin/PluginWithFormsTraitTest.php
index 46ede2cb185..459d26de709 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/PluginWithFormsTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/PluginWithFormsTraitTest.php
@@ -22,7 +22,7 @@ class PluginWithFormsTraitTest extends UnitTestCase {
* @covers ::hasFormClass
* @dataProvider providerGetFormClass
*/
- public function testGetFormClass(PluginWithFormsInterface $block_plugin, $operation, $expected_class) {
+ public function testGetFormClass(PluginWithFormsInterface $block_plugin, $operation, $expected_class): void {
$this->assertSame($expected_class, $block_plugin->getFormClass($operation));
$this->assertSame($expected_class !== NULL, $block_plugin->hasFormClass($operation));
}
diff --git a/core/tests/Drupal/Tests/Core/PrivateKeyTest.php b/core/tests/Drupal/Tests/Core/PrivateKeyTest.php
index 7a0c86f02e4..c78304372c6 100644
--- a/core/tests/Drupal/Tests/Core/PrivateKeyTest.php
+++ b/core/tests/Drupal/Tests/Core/PrivateKeyTest.php
@@ -51,7 +51,7 @@ class PrivateKeyTest extends UnitTestCase {
/**
* Tests PrivateKey::get().
*/
- public function testGet() {
+ public function testGet(): void {
$this->state->expects($this->once())
->method('get')
->with('system.private_key')
@@ -63,14 +63,14 @@ class PrivateKeyTest extends UnitTestCase {
/**
* Tests PrivateKey::get() with no private key from state.
*/
- public function testGetNoState() {
+ public function testGetNoState(): void {
$this->assertIsString($this->privateKey->get());
}
/**
* Tests PrivateKey::setPrivateKey().
*/
- public function testSet() {
+ public function testSet(): void {
$random_name = $this->randomMachineName();
$this->state->expects($this->once())
diff --git a/core/tests/Drupal/Tests/Core/ProxyBuilder/ProxyBuilderTest.php b/core/tests/Drupal/Tests/Core/ProxyBuilder/ProxyBuilderTest.php
index 8f2c03d76d7..b3d291118b2 100644
--- a/core/tests/Drupal/Tests/Core/ProxyBuilder/ProxyBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/ProxyBuilder/ProxyBuilderTest.php
@@ -34,7 +34,7 @@ class ProxyBuilderTest extends UnitTestCase {
* @covers ::buildParameter
* @covers ::buildMethodBody
*/
- public function testBuildComplexMethod() {
+ public function testBuildComplexMethod(): void {
$class = 'Drupal\Tests\Core\ProxyBuilder\TestServiceComplexMethod';
$result = $this->proxyBuilder->build($class);
diff --git a/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php b/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php
index 2e25d3e54ca..2307b355e7b 100644
--- a/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php
@@ -35,7 +35,7 @@ class BubbleableMetadataTest extends UnitTestCase {
* @covers ::merge
* @dataProvider providerTestMerge
*/
- public function testMerge(BubbleableMetadata $a, CacheableMetadata $b, BubbleableMetadata $expected) {
+ public function testMerge(BubbleableMetadata $a, CacheableMetadata $b, BubbleableMetadata $expected): void {
// Verify that if the second operand is a CacheableMetadata object, not a
// BubbleableMetadata object, that BubbleableMetadata::merge() doesn't
// attempt to merge assets.
@@ -113,7 +113,7 @@ class BubbleableMetadataTest extends UnitTestCase {
* @covers ::setAttachments
* @dataProvider providerTestAddAttachments
*/
- public function testAddAttachments(BubbleableMetadata $initial, $attachments, BubbleableMetadata $expected) {
+ public function testAddAttachments(BubbleableMetadata $initial, $attachments, BubbleableMetadata $expected): void {
$test = $initial;
$test->addAttachments($attachments);
$this->assertEquals($expected, $test);
@@ -134,7 +134,7 @@ class BubbleableMetadataTest extends UnitTestCase {
* @covers ::applyTo
* @dataProvider providerTestApplyTo
*/
- public function testApplyTo(BubbleableMetadata $metadata, array $render_array, array $expected) {
+ public function testApplyTo(BubbleableMetadata $metadata, array $render_array, array $expected): void {
$this->assertNull($metadata->applyTo($render_array));
$this->assertEquals($expected, $render_array);
}
@@ -199,7 +199,7 @@ class BubbleableMetadataTest extends UnitTestCase {
* @covers ::createFromRenderArray
* @dataProvider providerTestCreateFromRenderArray
*/
- public function testCreateFromRenderArray(array $render_array, BubbleableMetadata $expected) {
+ public function testCreateFromRenderArray(array $render_array, BubbleableMetadata $expected): void {
$this->assertEquals($expected, BubbleableMetadata::createFromRenderArray($render_array));
}
@@ -242,7 +242,7 @@ class BubbleableMetadataTest extends UnitTestCase {
*
* @covers ::mergeAttachments
*/
- public function testMergeAttachmentsLibraryMerging() {
+ public function testMergeAttachmentsLibraryMerging(): void {
$a['#attached'] = [
'library' => [
'core/drupal',
@@ -393,7 +393,7 @@ class BubbleableMetadataTest extends UnitTestCase {
*
* @dataProvider providerTestMergeAttachmentsHtmlHeadMerging
*/
- public function testMergeAttachmentsHtmlHeadMerging($a, $b, $expected) {
+ public function testMergeAttachmentsHtmlHeadMerging($a, $b, $expected): void {
$this->assertSame($expected, BubbleableMetadata::mergeAttachments($a, $b));
}
@@ -466,7 +466,7 @@ class BubbleableMetadataTest extends UnitTestCase {
*
* @dataProvider providerTestMergeAttachmentsHtmlHeadLinkMerging
*/
- public function testMergeAttachmentsHtmlHeadLinkMerging($a, $b, $expected) {
+ public function testMergeAttachmentsHtmlHeadLinkMerging($a, $b, $expected): void {
$this->assertSame($expected, BubbleableMetadata::mergeAttachments($a, $b));
}
@@ -532,7 +532,7 @@ class BubbleableMetadataTest extends UnitTestCase {
*
* @dataProvider providerTestMergeAttachmentsHttpHeaderMerging
*/
- public function testMergeAttachmentsHttpHeaderMerging($a, $b, $expected) {
+ public function testMergeAttachmentsHttpHeaderMerging($a, $b, $expected): void {
$this->assertSame($expected, BubbleableMetadata::mergeAttachments($a, $b));
}
@@ -598,7 +598,7 @@ class BubbleableMetadataTest extends UnitTestCase {
* @covers ::addCacheableDependency
* @dataProvider providerTestMerge
*/
- public function testAddCacheableDependency(BubbleableMetadata $a, $b, BubbleableMetadata $expected) {
+ public function testAddCacheableDependency(BubbleableMetadata $a, $b, BubbleableMetadata $expected): void {
$cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
->disableOriginalConstructor()
->getMock();
diff --git a/core/tests/Drupal/Tests/Core/Render/Element/HtmlTagTest.php b/core/tests/Drupal/Tests/Core/Render/Element/HtmlTagTest.php
index 104f0fec140..d0c09e97fc5 100644
--- a/core/tests/Drupal/Tests/Core/Render/Element/HtmlTagTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/Element/HtmlTagTest.php
@@ -17,7 +17,7 @@ class HtmlTagTest extends RendererTestBase {
/**
* @covers ::getInfo
*/
- public function testGetInfo() {
+ public function testGetInfo(): void {
$htmlTag = new HtmlTag([], 'test', 'test');
$info = $htmlTag->getInfo();
$this->assertArrayHasKey('#pre_render', $info);
@@ -29,7 +29,7 @@ class HtmlTagTest extends RendererTestBase {
* @covers ::preRenderHtmlTag
* @dataProvider providerPreRenderHtmlTag
*/
- public function testPreRenderHtmlTag($element, $expected) {
+ public function testPreRenderHtmlTag($element, $expected): void {
$result = HtmlTag::preRenderHtmlTag($element);
foreach ($result as &$child) {
if (is_array($child) && isset($child['#tag'])) {
diff --git a/core/tests/Drupal/Tests/Core/Render/Element/MachineNameTest.php b/core/tests/Drupal/Tests/Core/Render/Element/MachineNameTest.php
index 1361a55ee1d..32acfc71540 100644
--- a/core/tests/Drupal/Tests/Core/Render/Element/MachineNameTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/Element/MachineNameTest.php
@@ -25,7 +25,7 @@ class MachineNameTest extends UnitTestCase {
*
* @dataProvider providerTestValueCallback
*/
- public function testValueCallback($expected, $input) {
+ public function testValueCallback($expected, $input): void {
$element = [];
$form_state = $this->prophesize(FormStateInterface::class)->reveal();
$this->assertSame($expected, MachineName::valueCallback($element, $input, $form_state));
@@ -48,7 +48,7 @@ class MachineNameTest extends UnitTestCase {
/**
* @covers ::processMachineName
*/
- public function testProcessMachineName() {
+ public function testProcessMachineName(): void {
$form_state = new FormState();
$element = [
diff --git a/core/tests/Drupal/Tests/Core/Render/Element/PasswordConfirmTest.php b/core/tests/Drupal/Tests/Core/Render/Element/PasswordConfirmTest.php
index 1862a3a343e..d1e20b098f7 100644
--- a/core/tests/Drupal/Tests/Core/Render/Element/PasswordConfirmTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/Element/PasswordConfirmTest.php
@@ -19,7 +19,7 @@ class PasswordConfirmTest extends UnitTestCase {
*
* @dataProvider providerTestValueCallback
*/
- public function testValueCallback($expected, $element, $input) {
+ public function testValueCallback($expected, $element, $input): void {
$form_state = $this->prophesize(FormStateInterface::class)->reveal();
$this->assertSame($expected, PasswordConfirm::valueCallback($element, $input, $form_state));
}
diff --git a/core/tests/Drupal/Tests/Core/Render/Element/PasswordTest.php b/core/tests/Drupal/Tests/Core/Render/Element/PasswordTest.php
index 9085722c3ec..32bd56d52d1 100644
--- a/core/tests/Drupal/Tests/Core/Render/Element/PasswordTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/Element/PasswordTest.php
@@ -19,7 +19,7 @@ class PasswordTest extends UnitTestCase {
*
* @dataProvider providerTestValueCallback
*/
- public function testValueCallback($expected, $input) {
+ public function testValueCallback($expected, $input): void {
$element = [];
$form_state = $this->prophesize(FormStateInterface::class)->reveal();
$this->assertSame($expected, Password::valueCallback($element, $input, $form_state));
diff --git a/core/tests/Drupal/Tests/Core/Render/Element/RenderElementTest.php b/core/tests/Drupal/Tests/Core/Render/Element/RenderElementTest.php
index 4e9a0667398..7c078c61d5a 100644
--- a/core/tests/Drupal/Tests/Core/Render/Element/RenderElementTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/Element/RenderElementTest.php
@@ -47,7 +47,7 @@ class RenderElementTest extends UnitTestCase {
/**
* @covers ::preRenderAjaxForm
*/
- public function testPreRenderAjaxForm() {
+ public function testPreRenderAjaxForm(): void {
$request = Request::create('/test');
$request->query->set('foo', 'bar');
$this->requestStack->push($request);
@@ -78,7 +78,7 @@ class RenderElementTest extends UnitTestCase {
/**
* @covers ::preRenderAjaxForm
*/
- public function testPreRenderAjaxFormWithQueryOptions() {
+ public function testPreRenderAjaxFormWithQueryOptions(): void {
$request = Request::create('/test');
$request->query->set('foo', 'bar');
$this->requestStack->push($request);
diff --git a/core/tests/Drupal/Tests/Core/Render/Element/TableSelectTest.php b/core/tests/Drupal/Tests/Core/Render/Element/TableSelectTest.php
index 95d7bcb952c..fc58c1db4ef 100644
--- a/core/tests/Drupal/Tests/Core/Render/Element/TableSelectTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/Element/TableSelectTest.php
@@ -20,7 +20,7 @@ class TableSelectTest extends UnitTestCase {
/**
* @covers ::processTableselect
*/
- public function testProcessTableselectWithLinkTitle() {
+ public function testProcessTableselectWithLinkTitle(): void {
$element = [];
$form_state = new FormState();
$complete_form = [];
@@ -45,7 +45,7 @@ class TableSelectTest extends UnitTestCase {
/**
* @covers ::processTableselect
*/
- public function testProcessTableselectWithStringTitle() {
+ public function testProcessTableselectWithStringTitle(): void {
$element = [];
$form_state = new FormState();
$complete_form = [];
diff --git a/core/tests/Drupal/Tests/Core/Render/Element/TextareaTest.php b/core/tests/Drupal/Tests/Core/Render/Element/TextareaTest.php
index e66a2819a40..f2b971eab60 100644
--- a/core/tests/Drupal/Tests/Core/Render/Element/TextareaTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/Element/TextareaTest.php
@@ -19,7 +19,7 @@ class TextareaTest extends UnitTestCase {
*
* @dataProvider providerTestValueCallback
*/
- public function testValueCallback($expected, $input) {
+ public function testValueCallback($expected, $input): void {
$element = [];
$form_state = $this->prophesize(FormStateInterface::class)->reveal();
$this->assertSame($expected, Textarea::valueCallback($element, $input, $form_state));
diff --git a/core/tests/Drupal/Tests/Core/Render/Element/TextfieldTest.php b/core/tests/Drupal/Tests/Core/Render/Element/TextfieldTest.php
index 5ec874b2d92..2459a87092c 100644
--- a/core/tests/Drupal/Tests/Core/Render/Element/TextfieldTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/Element/TextfieldTest.php
@@ -19,7 +19,7 @@ class TextfieldTest extends UnitTestCase {
*
* @dataProvider providerTestValueCallback
*/
- public function testValueCallback($expected, $input) {
+ public function testValueCallback($expected, $input): void {
$element = [];
$form_state = $this->prophesize(FormStateInterface::class)->reveal();
$this->assertSame($expected, Textfield::valueCallback($element, $input, $form_state));
diff --git a/core/tests/Drupal/Tests/Core/Render/Element/TokenTest.php b/core/tests/Drupal/Tests/Core/Render/Element/TokenTest.php
index 40f1bea21ab..25dc5263160 100644
--- a/core/tests/Drupal/Tests/Core/Render/Element/TokenTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/Element/TokenTest.php
@@ -19,7 +19,7 @@ class TokenTest extends UnitTestCase {
*
* @dataProvider providerTestValueCallback
*/
- public function testValueCallback($expected, $input) {
+ public function testValueCallback($expected, $input): void {
$element = [];
$form_state = $this->prophesize(FormStateInterface::class)->reveal();
$this->assertSame($expected, Token::valueCallback($element, $input, $form_state));
diff --git a/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php b/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php
index 601b2a43bc9..a9ede9f13c8 100644
--- a/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php
@@ -74,7 +74,7 @@ class ElementInfoManagerTest extends UnitTestCase {
*
* @dataProvider providerTestGetInfoElementPlugin
*/
- public function testGetInfoElementPlugin($plugin_class, $expected_info) {
+ public function testGetInfoElementPlugin($plugin_class, $expected_info): void {
$this->moduleHandler->expects($this->once())
->method('alter')
->with('element_info', $this->anything())
@@ -141,7 +141,7 @@ class ElementInfoManagerTest extends UnitTestCase {
/**
* @covers ::getInfoProperty
*/
- public function testGetInfoProperty() {
+ public function testGetInfoProperty(): void {
$this->themeManager
->method('getActiveTheme')
->willReturn(new ActiveTheme(['name' => 'test']));
diff --git a/core/tests/Drupal/Tests/Core/Render/ElementTest.php b/core/tests/Drupal/Tests/Core/Render/ElementTest.php
index 709793dff07..fd71a85a59d 100644
--- a/core/tests/Drupal/Tests/Core/Render/ElementTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/ElementTest.php
@@ -17,7 +17,7 @@ class ElementTest extends UnitTestCase {
/**
* Tests the property() method.
*/
- public function testProperty() {
+ public function testProperty(): void {
$this->assertTrue(Element::property('#property'));
$this->assertFalse(Element::property('property'));
$this->assertFalse(Element::property('property#'));
@@ -27,7 +27,7 @@ class ElementTest extends UnitTestCase {
/**
* Tests the properties() method.
*/
- public function testProperties() {
+ public function testProperties(): void {
$element = [
'#property1' => 'property1',
'#property2' => 'property2',
@@ -43,7 +43,7 @@ class ElementTest extends UnitTestCase {
/**
* Tests the child() method.
*/
- public function testChild() {
+ public function testChild(): void {
$this->assertFalse(Element::child('#property'));
$this->assertTrue(Element::child('property'));
$this->assertTrue(Element::child('property#'));
@@ -52,7 +52,7 @@ class ElementTest extends UnitTestCase {
/**
* Tests the children() method.
*/
- public function testChildren() {
+ public function testChildren(): void {
$element = [
'child2' => ['#weight' => 10],
'child1' => ['#weight' => 0],
@@ -104,7 +104,7 @@ class ElementTest extends UnitTestCase {
/**
* Tests the children() method with an invalid key.
*/
- public function testInvalidChildren() {
+ public function testInvalidChildren(): void {
$element = [
'foo' => 'bar',
];
@@ -116,7 +116,7 @@ class ElementTest extends UnitTestCase {
/**
* Tests the children() method with an ignored key/value pair.
*/
- public function testIgnoredChildren() {
+ public function testIgnoredChildren(): void {
$element = [
'foo' => NULL,
];
@@ -133,7 +133,7 @@ class ElementTest extends UnitTestCase {
*
* @dataProvider providerVisibleChildren
*/
- public function testVisibleChildren(array $element, array $expected_keys) {
+ public function testVisibleChildren(array $element, array $expected_keys): void {
$this->assertSame($expected_keys, Element::getVisibleChildren($element));
}
@@ -161,7 +161,7 @@ class ElementTest extends UnitTestCase {
*
* @dataProvider providerTestSetAttributes
*/
- public function testSetAttributes($element, $map, $expected_element) {
+ public function testSetAttributes($element, $map, $expected_element): void {
Element::setAttributes($element, $map);
$this->assertSame($expected_element, $element);
}
@@ -183,7 +183,7 @@ class ElementTest extends UnitTestCase {
*
* @dataProvider providerTestIsEmpty
*/
- public function testIsEmpty(array $element, $expected) {
+ public function testIsEmpty(array $element, $expected): void {
$this->assertSame(Element::isEmpty($element), $expected);
}
@@ -229,7 +229,7 @@ class ElementTest extends UnitTestCase {
* @covers ::isRenderArray
* @dataProvider dataProviderIsRenderArray
*/
- public function testIsRenderArray($build, $expected) {
+ public function testIsRenderArray($build, $expected): void {
$this->assertSame(
$expected,
Element::isRenderArray($build)
diff --git a/core/tests/Drupal/Tests/Core/Render/MetadataBubblingUrlGeneratorTest.php b/core/tests/Drupal/Tests/Core/Render/MetadataBubblingUrlGeneratorTest.php
index 2c54d6146bc..64e0d242318 100644
--- a/core/tests/Drupal/Tests/Core/Render/MetadataBubblingUrlGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/MetadataBubblingUrlGeneratorTest.php
@@ -52,7 +52,7 @@ class MetadataBubblingUrlGeneratorTest extends UrlGeneratorTest {
*
* @dataProvider providerUrlBubbleableMetadataBubbling
*/
- public function testUrlBubbleableMetadataBubbling($collect_bubbleable_metadata, $invocations, array $options) {
+ public function testUrlBubbleableMetadataBubbling($collect_bubbleable_metadata, $invocations, array $options): void {
$self = $this;
$this->renderer->expects($this->exactly($invocations))
diff --git a/core/tests/Drupal/Tests/Core/Render/Placeholder/ChainedPlaceholderStrategyTest.php b/core/tests/Drupal/Tests/Core/Render/Placeholder/ChainedPlaceholderStrategyTest.php
index 3d9282d60e6..34e2f44b88d 100644
--- a/core/tests/Drupal/Tests/Core/Render/Placeholder/ChainedPlaceholderStrategyTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/Placeholder/ChainedPlaceholderStrategyTest.php
@@ -20,7 +20,7 @@ class ChainedPlaceholderStrategyTest extends UnitTestCase {
*
* @dataProvider providerProcessPlaceholders
*/
- public function testProcessPlaceholders($strategies, $placeholders, $result) {
+ public function testProcessPlaceholders($strategies, $placeholders, $result): void {
$chained_placeholder_strategy = new ChainedPlaceholderStrategy();
foreach ($strategies as $strategy) {
@@ -125,7 +125,7 @@ class ChainedPlaceholderStrategyTest extends UnitTestCase {
/**
* @covers ::processPlaceholders
*/
- public function testProcessPlaceholdersNoStrategies() {
+ public function testProcessPlaceholdersNoStrategies(): void {
// Placeholders but no strategies defined.
$placeholders = [
'assert-me' => ['#markup' => 'I-am-a-llama-that-will-lead-to-an-assertion-by-the-chained-placeholder-strategy.'],
@@ -140,7 +140,7 @@ class ChainedPlaceholderStrategyTest extends UnitTestCase {
/**
* @covers ::processPlaceholders
*/
- public function testProcessPlaceholdersWithRoguePlaceholderStrategy() {
+ public function testProcessPlaceholdersWithRoguePlaceholderStrategy(): void {
// Placeholders but no strategies defined.
$placeholders = [
'assert-me' => ['#markup' => 'llama'],
diff --git a/core/tests/Drupal/Tests/Core/Render/PlaceholderGeneratorTest.php b/core/tests/Drupal/Tests/Core/Render/PlaceholderGeneratorTest.php
index def952bb9de..065cdc6d15a 100644
--- a/core/tests/Drupal/Tests/Core/Render/PlaceholderGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/PlaceholderGeneratorTest.php
@@ -32,7 +32,7 @@ class PlaceholderGeneratorTest extends RendererTestBase {
* @covers ::createPlaceholder
* @dataProvider providerCreatePlaceholderGeneratesValidHtmlMarkup
*/
- public function testCreatePlaceholderGeneratesValidHtmlMarkup(array $element) {
+ public function testCreatePlaceholderGeneratesValidHtmlMarkup(array $element): void {
$build = $this->placeholderGenerator->createPlaceholder($element);
$original_placeholder_markup = (string) $build['#markup'];
@@ -49,7 +49,7 @@ class PlaceholderGeneratorTest extends RendererTestBase {
*
* @covers ::createPlaceholder
*/
- public function testRenderPlaceholdersDifferentSortedContextsTags() {
+ public function testRenderPlaceholdersDifferentSortedContextsTags(): void {
$contexts_1 = ['user', 'foo'];
$contexts_2 = ['foo', 'user'];
$tags_1 = ['current-temperature', 'foo'];
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
index cc4088d3da2..52944069309 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
@@ -35,7 +35,7 @@ class RendererBubblingTest extends RendererTestBase {
/**
* Tests bubbling of assets when NOT using #pre_render callbacks.
*/
- public function testBubblingWithoutPreRender() {
+ public function testBubblingWithoutPreRender(): void {
$this->setUpRequest();
$this->setUpMemoryCache();
@@ -79,7 +79,7 @@ class RendererBubblingTest extends RendererTestBase {
/**
* Tests cache context bubbling with a custom cache bin.
*/
- public function testContextBubblingCustomCacheBin() {
+ public function testContextBubblingCustomCacheBin(): void {
$bin = $this->randomMachineName();
$this->setUpRequest();
@@ -135,7 +135,7 @@ class RendererBubblingTest extends RendererTestBase {
*
* @dataProvider providerTestContextBubblingEdgeCases
*/
- public function testContextBubblingEdgeCases(array $element, array $expected_top_level_contexts, $expected_cache_item) {
+ public function testContextBubblingEdgeCases(array $element, array $expected_top_level_contexts, $expected_cache_item): void {
$this->setUpRequest();
$this->setUpMemoryCache();
$this->cacheContextsManager->expects($this->any())
@@ -314,7 +314,7 @@ class RendererBubblingTest extends RendererTestBase {
* @todo Revisit now that we have self-healing tests for VariationCache. This
* is essentially a clone of the other bubbling tests now.
*/
- public function testConditionalCacheContextBubblingSelfHealing() {
+ public function testConditionalCacheContextBubblingSelfHealing(): void {
$current_user_role = &$this->currentUserRole;
$this->setUpRequest();
@@ -445,7 +445,7 @@ class RendererBubblingTest extends RendererTestBase {
*
* @dataProvider providerTestBubblingWithPrerender
*/
- public function testBubblingWithPrerender($test_element) {
+ public function testBubblingWithPrerender($test_element): void {
$this->setUpRequest();
$this->setUpMemoryCache();
@@ -529,7 +529,7 @@ class RendererBubblingTest extends RendererTestBase {
/**
* Tests that an element's cache keys cannot be changed during its rendering.
*/
- public function testOverWriteCacheKeys() {
+ public function testOverWriteCacheKeys(): void {
$this->setUpRequest();
$this->setUpMemoryCache();
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererDebugTest.php b/core/tests/Drupal/Tests/Core/Render/RendererDebugTest.php
index f8c506ac8bd..d365bae0d5e 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererDebugTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererDebugTest.php
@@ -24,7 +24,7 @@ class RendererDebugTest extends RendererTestBase {
/**
* Test render debug output.
*/
- public function testDebugOutput() {
+ public function testDebugOutput(): void {
$this->setUpRequest();
$this->setUpMemoryCache();
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php b/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
index 4d8c52d82e6..874ae1350db 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
@@ -803,7 +803,7 @@ class RendererPlaceholdersTest extends RendererTestBase {
* @covers ::doRender
* @covers ::replacePlaceholders
*/
- public function testRecursivePlaceholder() {
+ public function testRecursivePlaceholder(): void {
$args = [static::randomContextValue()];
$element = [];
$element['#create_placeholder'] = TRUE;
@@ -822,7 +822,7 @@ class RendererPlaceholdersTest extends RendererTestBase {
* @covers ::render
* @covers ::doRender
*/
- public function testInvalidLazyBuilder() {
+ public function testInvalidLazyBuilder(): void {
$element = [];
$element['#lazy_builder'] = '\Drupal\Tests\Core\Render\PlaceholdersTest::callback';
@@ -835,7 +835,7 @@ class RendererPlaceholdersTest extends RendererTestBase {
* @covers ::render
* @covers ::doRender
*/
- public function testInvalidLazyBuilderArguments() {
+ public function testInvalidLazyBuilderArguments(): void {
$element = [];
$element['#lazy_builder'] = ['\Drupal\Tests\Core\Render\PlaceholdersTest::callback', 'arg1', 'arg2'];
@@ -850,7 +850,7 @@ class RendererPlaceholdersTest extends RendererTestBase {
*
* @see testNonScalarLazyBuilderCallbackContext
*/
- public function testScalarLazyBuilderCallbackContext() {
+ public function testScalarLazyBuilderCallbackContext(): void {
$element = [];
$element['#lazy_builder'] = [
'\Drupal\Tests\Core\Render\PlaceholdersTest::callback',
@@ -872,7 +872,7 @@ class RendererPlaceholdersTest extends RendererTestBase {
* @covers ::render
* @covers ::doRender
*/
- public function testNonScalarLazyBuilderCallbackContext() {
+ public function testNonScalarLazyBuilderCallbackContext(): void {
$element = [];
$element['#lazy_builder'] = [
'\Drupal\Tests\Core\Render\PlaceholdersTest::callback',
@@ -896,7 +896,7 @@ class RendererPlaceholdersTest extends RendererTestBase {
* @covers ::render
* @covers ::doRender
*/
- public function testChildrenPlusBuilder() {
+ public function testChildrenPlusBuilder(): void {
$element = [];
$element['#lazy_builder'] = ['Drupal\Tests\Core\Render\RecursivePlaceholdersTest::callback', []];
$element['child_a']['#markup'] = 'Oh hai!';
@@ -911,7 +911,7 @@ class RendererPlaceholdersTest extends RendererTestBase {
* @covers ::render
* @covers ::doRender
*/
- public function testPropertiesPlusBuilder() {
+ public function testPropertiesPlusBuilder(): void {
$element = [];
$element['#lazy_builder'] = ['Drupal\Tests\Core\Render\RecursivePlaceholdersTest::callback', []];
$element['#llama'] = '#awesome';
@@ -926,7 +926,7 @@ class RendererPlaceholdersTest extends RendererTestBase {
* @covers ::render
* @covers ::doRender
*/
- public function testCreatePlaceholderPropertyWithoutLazyBuilder() {
+ public function testCreatePlaceholderPropertyWithoutLazyBuilder(): void {
$element = [];
$element['#create_placeholder'] = TRUE;
@@ -958,7 +958,7 @@ class RendererPlaceholdersTest extends RendererTestBase {
* @covers \Drupal\Core\Render\RenderCache::get
* @covers ::replacePlaceholders
*/
- public function testRenderChildrenPlaceholdersDifferentArguments() {
+ public function testRenderChildrenPlaceholdersDifferentArguments(): void {
$this->setUpRequest();
$this->setupMemoryCache();
$this->cacheContextsManager->expects($this->any())
@@ -1057,7 +1057,7 @@ HTML;
* @covers \Drupal\Core\Render\RenderCache::get
* @covers ::replacePlaceholders
*/
- public function testRenderLazyBuilderPreview() {
+ public function testRenderLazyBuilderPreview(): void {
$this->setUpRequest();
$this->setupMemoryCache();
$this->renderCache = new TestPlaceholderingRenderCache($this->requestStack, $this->cacheFactory, $this->cacheContextsManager, $this->placeholderGenerator);
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php b/core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php
index ba74ff893f3..98afe1484c8 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php
@@ -34,7 +34,7 @@ class RendererRecursionTest extends RendererTestBase {
* @covers ::render
* @covers ::doRender
*/
- public function testRenderRecursionWithNestedRenderRoot() {
+ public function testRenderRecursionWithNestedRenderRoot(): void {
[$complex_child_markup, $parent_markup, $complex_child_template] = $this->setUpRenderRecursionComplexElements();
$renderer = $this->renderer;
$this->setUpRequest();
@@ -66,7 +66,7 @@ class RendererRecursionTest extends RendererTestBase {
* @covers ::render
* @covers ::doRender
*/
- public function testRenderRecursionWithNestedRender() {
+ public function testRenderRecursionWithNestedRender(): void {
[$complex_child_markup, $parent_markup, $complex_child_template] = $this->setUpRenderRecursionComplexElements();
$renderer = $this->renderer;
$this->setUpRequest();
@@ -100,7 +100,7 @@ class RendererRecursionTest extends RendererTestBase {
* @covers ::renderRoot
* @covers ::renderInIsolation
*/
- public function testRenderRecursionWithNestedRenderInIsolation() {
+ public function testRenderRecursionWithNestedRenderInIsolation(): void {
[$complex_child_markup, $parent_markup, $complex_child_template] = $this->setUpRenderRecursionComplexElements();
$renderer = $this->renderer;
$this->setUpRequest();
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererTest.php b/core/tests/Drupal/Tests/Core/Render/RendererTest.php
index d14a083c177..bdbc2fa87d9 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererTest.php
@@ -41,7 +41,7 @@ class RendererTest extends RendererTestBase {
*
* @dataProvider providerTestRenderBasic
*/
- public function testRenderBasic($build, $expected, ?callable $setup_code = NULL) {
+ public function testRenderBasic($build, $expected, ?callable $setup_code = NULL): void {
if (isset($setup_code)) {
$setup_code = $setup_code->bindTo($this);
$setup_code($this->themeManager);
@@ -487,7 +487,7 @@ class RendererTest extends RendererTestBase {
* @covers ::render
* @covers ::doRender
*/
- public function testRenderSorting() {
+ public function testRenderSorting(): void {
$first = $this->randomMachineName();
$second = $this->randomMachineName();
// Build an array with '#weight' set for each element.
@@ -522,7 +522,7 @@ class RendererTest extends RendererTestBase {
* @covers ::render
* @covers ::doRender
*/
- public function testRenderSortingWithSetHashSorted() {
+ public function testRenderSortingWithSetHashSorted(): void {
$first = $this->randomMachineName();
$second = $this->randomMachineName();
// The same array structure again, but with #sorted set to TRUE.
@@ -549,7 +549,7 @@ class RendererTest extends RendererTestBase {
*
* @dataProvider providerAccessValues
*/
- public function testRenderWithPresetAccess($access) {
+ public function testRenderWithPresetAccess($access): void {
$build = [
'#access' => $access,
];
@@ -563,7 +563,7 @@ class RendererTest extends RendererTestBase {
*
* @dataProvider providerAccessValues
*/
- public function testRenderWithAccessCallbackCallable($access) {
+ public function testRenderWithAccessCallbackCallable($access): void {
$build = [
'#access_callback' => function () use ($access) {
return $access;
@@ -581,7 +581,7 @@ class RendererTest extends RendererTestBase {
*
* @dataProvider providerAccessValues
*/
- public function testRenderWithAccessPropertyAndCallback($access) {
+ public function testRenderWithAccessPropertyAndCallback($access): void {
$build = [
'#access' => $access,
'#access_callback' => function () {
@@ -598,7 +598,7 @@ class RendererTest extends RendererTestBase {
*
* @dataProvider providerAccessValues
*/
- public function testRenderWithAccessControllerResolved($access) {
+ public function testRenderWithAccessControllerResolved($access): void {
switch ($access) {
case AccessResult::allowed():
@@ -629,7 +629,7 @@ class RendererTest extends RendererTestBase {
* @covers ::render
* @covers ::doRender
*/
- public function testRenderAccessCacheabilityDependencyInheritance() {
+ public function testRenderAccessCacheabilityDependencyInheritance(): void {
$build = [
'#access' => AccessResult::allowed()->addCacheContexts(['user']),
];
@@ -651,7 +651,7 @@ class RendererTest extends RendererTestBase {
*
* @dataProvider providerRenderTwice
*/
- public function testRenderTwice($build) {
+ public function testRenderTwice($build): void {
$this->assertEquals('kittens', $this->renderer->renderRoot($build));
$this->assertEquals('kittens', $build['#markup']);
$this->assertEquals(['kittens-147'], $build['#cache']['tags']);
@@ -703,7 +703,7 @@ class RendererTest extends RendererTestBase {
/**
* Ensures that #access is taken in account when rendering #render_children.
*/
- public function testRenderChildrenAccess() {
+ public function testRenderChildrenAccess(): void {
$build = [
'#access' => FALSE,
'#render_children' => TRUE,
@@ -754,7 +754,7 @@ class RendererTest extends RendererTestBase {
* @covers ::render
* @covers ::doRender
*/
- public function testRenderWithoutThemeArguments() {
+ public function testRenderWithoutThemeArguments(): void {
$element = [
'#theme' => 'common_test_foo',
];
@@ -772,7 +772,7 @@ class RendererTest extends RendererTestBase {
* @covers ::render
* @covers ::doRender
*/
- public function testRenderWithThemeArguments() {
+ public function testRenderWithThemeArguments(): void {
$element = [
'#theme' => 'common_test_foo',
'#foo' => $this->randomMachineName(),
@@ -830,7 +830,7 @@ class RendererTest extends RendererTestBase {
*
* @dataProvider providerRenderCache
*/
- public function testRenderCache($child_access, $expected_tags) {
+ public function testRenderCache($child_access, $expected_tags): void {
$this->setUpRequest();
$this->setUpMemoryCache();
@@ -880,7 +880,7 @@ class RendererTest extends RendererTestBase {
*
* @dataProvider providerTestRenderCacheMaxAge
*/
- public function testRenderCacheMaxAge($max_age, $is_render_cached, $render_cache_item_expire) {
+ public function testRenderCacheMaxAge($max_age, $is_render_cached, $render_cache_item_expire): void {
$this->setUpRequest();
$this->setUpMemoryCache();
@@ -925,7 +925,7 @@ class RendererTest extends RendererTestBase {
*
* @dataProvider providerTestRenderCacheProperties
*/
- public function testRenderCacheProperties(array $expected_results) {
+ public function testRenderCacheProperties(array $expected_results): void {
$this->setUpRequest();
$this->setUpMemoryCache();
@@ -993,7 +993,7 @@ class RendererTest extends RendererTestBase {
*
* @dataProvider providerTestAddCacheableDependency
*/
- public function testAddCacheableDependency(array $build, $object, array $expected) {
+ public function testAddCacheableDependency(array $build, $object, array $expected): void {
$this->renderer->addCacheableDependency($build, $object);
$this->assertEquals($build, $expected);
}
diff --git a/core/tests/Drupal/Tests/Core/Route/RoleAccessCheckTest.php b/core/tests/Drupal/Tests/Core/Route/RoleAccessCheckTest.php
index 647a1819ef0..451fdad716a 100644
--- a/core/tests/Drupal/Tests/Core/Route/RoleAccessCheckTest.php
+++ b/core/tests/Drupal/Tests/Core/Route/RoleAccessCheckTest.php
@@ -141,7 +141,7 @@ class RoleAccessCheckTest extends UnitTestCase {
*
* @dataProvider roleAccessProvider
*/
- public function testRoleAccess($path, $grant_accounts, $deny_accounts) {
+ public function testRoleAccess($path, $grant_accounts, $deny_accounts): void {
$cache_contexts_manager = $this->prophesize(CacheContextsManager::class);
$cache_contexts_manager->assertValidTokens()->willReturn(TRUE);
$cache_contexts_manager->reveal();
diff --git a/core/tests/Drupal/Tests/Core/RouteProcessor/RouteProcessorManagerTest.php b/core/tests/Drupal/Tests/Core/RouteProcessor/RouteProcessorManagerTest.php
index 7541dbd687e..625814a39c9 100644
--- a/core/tests/Drupal/Tests/Core/RouteProcessor/RouteProcessorManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/RouteProcessor/RouteProcessorManagerTest.php
@@ -35,7 +35,7 @@ class RouteProcessorManagerTest extends UnitTestCase {
/**
* Tests the Route process manager functionality.
*/
- public function testRouteProcessorManager() {
+ public function testRouteProcessorManager(): void {
$route = new Route('');
$parameters = ['test' => 'test'];
$route_name = 'test_name';
diff --git a/core/tests/Drupal/Tests/Core/Routing/AcceptHeaderMatcherTest.php b/core/tests/Drupal/Tests/Core/Routing/AcceptHeaderMatcherTest.php
index 3b62244155c..af5f10d6f3a 100644
--- a/core/tests/Drupal/Tests/Core/Routing/AcceptHeaderMatcherTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/AcceptHeaderMatcherTest.php
@@ -70,7 +70,7 @@ class AcceptHeaderMatcherTest extends UnitTestCase {
*
* @dataProvider acceptFilterProvider
*/
- public function testAcceptFiltering($accept_header, $format, $included_route, $excluded_route) {
+ public function testAcceptFiltering($accept_header, $format, $included_route, $excluded_route): void {
$collection = $this->fixtures->sampleRouteCollection();
$request = Request::create('path/two', 'GET');
@@ -89,7 +89,7 @@ class AcceptHeaderMatcherTest extends UnitTestCase {
/**
* Confirms that the AcceptHeaderMatcher throws an exception for no-route.
*/
- public function testNoRouteFound() {
+ public function testNoRouteFound(): void {
// Remove the sample routes that would match any method.
$routes = $this->fixtures->sampleRouteCollection();
$routes->remove('route_a');
diff --git a/core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php b/core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php
index 95e0bb96a8f..1b7aaa74881 100644
--- a/core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php
@@ -77,7 +77,7 @@ class AccessAwareRouterTest extends UnitTestCase {
/**
* Tests the matchRequest() function for access allowed.
*/
- public function testMatchRequestAllowed() {
+ public function testMatchRequestAllowed(): void {
$this->setupRouter();
$request = new Request();
$access_result = AccessResult::allowed();
@@ -97,7 +97,7 @@ class AccessAwareRouterTest extends UnitTestCase {
/**
* Tests the matchRequest() function for access denied.
*/
- public function testMatchRequestDenied() {
+ public function testMatchRequestDenied(): void {
$this->setupRouter();
$request = new Request();
$access_result = AccessResult::forbidden();
@@ -112,7 +112,7 @@ class AccessAwareRouterTest extends UnitTestCase {
/**
* Tests the matchRequest() function for access denied with reason message.
*/
- public function testCheckAccessResultWithReason() {
+ public function testCheckAccessResultWithReason(): void {
$this->setupRouter();
$request = new Request();
$reason = $this->getRandomGenerator()->string();
@@ -131,7 +131,7 @@ class AccessAwareRouterTest extends UnitTestCase {
*
* @covers ::__call
*/
- public function testCall() {
+ public function testCall(): void {
$mock_router = $this->createMock(RouterInterface::class);
$this->router = $this->getMockBuilder(MockRouterInterface::class)
diff --git a/core/tests/Drupal/Tests/Core/Routing/ContentTypeHeaderMatcherTest.php b/core/tests/Drupal/Tests/Core/Routing/ContentTypeHeaderMatcherTest.php
index e22aeebf65c..c04de331560 100644
--- a/core/tests/Drupal/Tests/Core/Routing/ContentTypeHeaderMatcherTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/ContentTypeHeaderMatcherTest.php
@@ -48,7 +48,7 @@ class ContentTypeHeaderMatcherTest extends UnitTestCase {
*
* @dataProvider providerTestSafeRequestFilter
*/
- public function testSafeRequestFilter($method) {
+ public function testSafeRequestFilter($method): void {
$collection = $this->fixtures->sampleRouteCollection();
$collection->addCollection($this->fixtures->contentRouteCollection());
@@ -70,7 +70,7 @@ class ContentTypeHeaderMatcherTest extends UnitTestCase {
/**
* Tests that XML-restricted routes get filtered out on JSON requests.
*/
- public function testJsonRequest() {
+ public function testJsonRequest(): void {
$collection = $this->fixtures->sampleRouteCollection();
$collection->addCollection($this->fixtures->contentRouteCollection());
@@ -89,7 +89,7 @@ class ContentTypeHeaderMatcherTest extends UnitTestCase {
/**
* Tests route filtering on POST form submission requests.
*/
- public function testPostForm() {
+ public function testPostForm(): void {
$collection = $this->fixtures->sampleRouteCollection();
$collection->addCollection($this->fixtures->contentRouteCollection());
@@ -108,7 +108,7 @@ class ContentTypeHeaderMatcherTest extends UnitTestCase {
*
* @covers ::filter
*/
- public function testNoRouteFound() {
+ public function testNoRouteFound(): void {
$matcher = new ContentTypeHeaderMatcher();
$routes = $this->fixtures->contentRouteCollection();
@@ -124,7 +124,7 @@ class ContentTypeHeaderMatcherTest extends UnitTestCase {
*
* @covers ::filter
*/
- public function testContentTypeRequestHeaderMissing() {
+ public function testContentTypeRequestHeaderMissing(): void {
$matcher = new ContentTypeHeaderMatcher();
$routes = $this->fixtures->contentRouteCollection();
diff --git a/core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php b/core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php
index 92e5b705e55..5ec49e52926 100644
--- a/core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php
@@ -41,7 +41,7 @@ class CurrentRouteMatchTest extends RouteMatchTestBase {
* @covers ::getCurrentRouteMatch
* @covers ::getRouteMatch
*/
- public function testGetCurrentRouteObject() {
+ public function testGetCurrentRouteObject(): void {
$request_stack = new RequestStack();
$request = new Request();
@@ -78,7 +78,7 @@ class CurrentRouteMatchTest extends RouteMatchTestBase {
/**
* @covers ::getRouteMatchFromRequest
*/
- public function testGetRouteMatchFromRequestWithRouting() {
+ public function testGetRouteMatchFromRequestWithRouting(): void {
$request_stack = new RequestStack();
$request = new Request();
$request_stack->push($request);
@@ -93,7 +93,7 @@ class CurrentRouteMatchTest extends RouteMatchTestBase {
/**
* @covers ::getRouteMatchFromRequest
*/
- public function testGetRouteMatchFromRequest() {
+ public function testGetRouteMatchFromRequest(): void {
$request_stack = new RequestStack();
$request = new Request();
$request_stack->push($request);
@@ -112,7 +112,7 @@ class CurrentRouteMatchTest extends RouteMatchTestBase {
/**
* @covers ::resetRouteMatch
*/
- public function testResetRouteMatch() {
+ public function testResetRouteMatch(): void {
$route = new Route('/test-route/{foo}');
$request = new Request();
$request->attributes->set(RouteObjectInterface::ROUTE_NAME, 'test_route');
diff --git a/core/tests/Drupal/Tests/Core/Routing/LazyRouteCollectionTest.php b/core/tests/Drupal/Tests/Core/Routing/LazyRouteCollectionTest.php
index 54df9e2b819..c34e9afde60 100644
--- a/core/tests/Drupal/Tests/Core/Routing/LazyRouteCollectionTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/LazyRouteCollectionTest.php
@@ -47,7 +47,7 @@ class LazyRouteCollectionTest extends UnitTestCase {
* @covers ::getIterator
* @covers ::all
*/
- public function testGetIterator() {
+ public function testGetIterator(): void {
$this->routeProvider->expects($this->exactly(2))
->method('getRoutesByNames')
->with(NULL)
@@ -60,7 +60,7 @@ class LazyRouteCollectionTest extends UnitTestCase {
/**
* @covers ::count
*/
- public function testCount() {
+ public function testCount(): void {
$this->routeProvider
->method('getRoutesByNames')
->with(NULL)
@@ -74,7 +74,7 @@ class LazyRouteCollectionTest extends UnitTestCase {
*
* @covers ::get
*/
- public function testGetName() {
+ public function testGetName(): void {
// Hit.
$this->routeProvider
->method('getRouteByName')
diff --git a/core/tests/Drupal/Tests/Core/Routing/MethodFilterTest.php b/core/tests/Drupal/Tests/Core/Routing/MethodFilterTest.php
index 31ac253a4df..0f6bf9fb226 100644
--- a/core/tests/Drupal/Tests/Core/Routing/MethodFilterTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/MethodFilterTest.php
@@ -20,7 +20,7 @@ class MethodFilterTest extends UnitTestCase {
/**
* @covers ::filter
*/
- public function testWithAllowedMethod() {
+ public function testWithAllowedMethod(): void {
$request = Request::create('/test', 'GET');
$collection = new RouteCollection();
$collection->add('test_route.get', new Route('/test', [], [], [], '', [], ['GET']));
@@ -35,7 +35,7 @@ class MethodFilterTest extends UnitTestCase {
/**
* @covers ::filter
*/
- public function testWithAllowedMethodAndMultipleMatchingRoutes() {
+ public function testWithAllowedMethodAndMultipleMatchingRoutes(): void {
$request = Request::create('/test', 'GET');
$collection = new RouteCollection();
$collection->add('test_route.get', new Route('/test', [], [], [], '', [], ['GET']));
@@ -53,7 +53,7 @@ class MethodFilterTest extends UnitTestCase {
/**
* @covers ::filter
*/
- public function testMethodNotAllowedException() {
+ public function testMethodNotAllowedException(): void {
$request = Request::create('/test', 'PATCH');
$collection = new RouteCollection();
$collection->add('test_route.get', new Route('/test', [], [], [], '', [], ['GET']));
@@ -67,7 +67,7 @@ class MethodFilterTest extends UnitTestCase {
/**
* @covers ::filter
*/
- public function testMethodNotAllowedExceptionWithMultipleRoutes() {
+ public function testMethodNotAllowedExceptionWithMultipleRoutes(): void {
$request = Request::create('/test', 'PATCH');
$collection = new RouteCollection();
$collection->add('test_route.get', new Route('/test', [], [], [], '', [], ['GET']));
@@ -83,7 +83,7 @@ class MethodFilterTest extends UnitTestCase {
/**
* @covers ::filter
*/
- public function testFilteredMethods() {
+ public function testFilteredMethods(): void {
$request = Request::create('/test', 'PATCH');
$collection = new RouteCollection();
$collection->add('test_route.get', new Route('/test', [], [], [], '', [], ['GET']));
@@ -104,7 +104,7 @@ class MethodFilterTest extends UnitTestCase {
*
* @covers ::filter
*/
- public function testCollectionOrder() {
+ public function testCollectionOrder(): void {
$request = Request::create('/test', 'GET');
$collection = new RouteCollection();
diff --git a/core/tests/Drupal/Tests/Core/Routing/PathChangedHelperTest.php b/core/tests/Drupal/Tests/Core/Routing/PathChangedHelperTest.php
index ce07c2fc931..9018d058fa1 100644
--- a/core/tests/Drupal/Tests/Core/Routing/PathChangedHelperTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/PathChangedHelperTest.php
@@ -20,7 +20,7 @@ class PathChangedHelperTest extends UnitTestCase {
*
* @covers ::__construct
*/
- public function testPathChangedHelperException() {
+ public function testPathChangedHelperException(): void {
$route_match = $this->prophesize(RouteMatchInterface::class);
$route_match->getRouteName()->willReturn('path.changed.not-bc');
diff --git a/core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php b/core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php
index 2bf84130126..199262f3f3f 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php
@@ -73,7 +73,7 @@ class RedirectDestinationTest extends UnitTestCase {
*
* @covers ::get
*/
- public function testGet(Request $request, $expected_destination) {
+ public function testGet(Request $request, $expected_destination): void {
$this->requestStack->push($request);
$this->setupUrlGenerator();
@@ -87,7 +87,7 @@ class RedirectDestinationTest extends UnitTestCase {
*
* @covers ::getAsArray
*/
- public function testGetAsArray(Request $request, $expected_destination) {
+ public function testGetAsArray(Request $request, $expected_destination): void {
$this->requestStack->push($request);
$this->setupUrlGenerator();
@@ -125,7 +125,7 @@ class RedirectDestinationTest extends UnitTestCase {
* @covers ::set
* @covers ::get
*/
- public function testSetBeforeGetCall() {
+ public function testSetBeforeGetCall(): void {
$this->redirectDestination->set('/example');
$this->assertEquals('/example', $this->redirectDestination->get());
}
@@ -134,7 +134,7 @@ class RedirectDestinationTest extends UnitTestCase {
* @covers ::set
* @covers ::get
*/
- public function testSetAfterGetCall() {
+ public function testSetAfterGetCall(): void {
$request = Request::create('/');
$request->query->set('destination', '/other-example');
$this->requestStack->push($request);
diff --git a/core/tests/Drupal/Tests/Core/Routing/RequestFormatRouteFilterTest.php b/core/tests/Drupal/Tests/Core/Routing/RequestFormatRouteFilterTest.php
index af9c6199a8c..fb0157a58c6 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RequestFormatRouteFilterTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RequestFormatRouteFilterTest.php
@@ -24,7 +24,7 @@ class RequestFormatRouteFilterTest extends UnitTestCase {
* @covers ::filter
* @dataProvider filterProvider
*/
- public function testFilter(RouteCollection $collection, $request_format, array $expected_filtered_collection) {
+ public function testFilter(RouteCollection $collection, $request_format, array $expected_filtered_collection): void {
$route_filter = new RequestFormatRouteFilter();
$request = new Request();
@@ -63,7 +63,7 @@ class RequestFormatRouteFilterTest extends UnitTestCase {
/**
* @covers ::filter
*/
- public function testNoRouteFound() {
+ public function testNoRouteFound(): void {
$url = $this->prophesize(GeneratedUrl::class);
$url_assembler = $this->prophesize(UnroutedUrlAssemblerInterface::class);
$url_assembler->assemble('http://localhost/test?_format=xml', ['query' => ['_format' => 'json'], 'external' => TRUE], TRUE)
@@ -89,7 +89,7 @@ class RequestFormatRouteFilterTest extends UnitTestCase {
/**
* @covers ::filter
*/
- public function testNoRouteFoundWhenNoRequestFormatAndSingleRouteWithMultipleFormats() {
+ public function testNoRouteFoundWhenNoRequestFormatAndSingleRouteWithMultipleFormats(): void {
$this->expectException(NotAcceptableHttpException::class);
$this->expectExceptionMessage('No route found for the specified format html.');
diff --git a/core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php b/core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php
index bf108cd2c42..325a0319b48 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php
@@ -99,7 +99,7 @@ class RouteBuilderTest extends UnitTestCase {
/**
* Tests that the route rebuilding both locks and unlocks.
*/
- public function testRebuildLockingUnlocking() {
+ public function testRebuildLockingUnlocking(): void {
$this->lock->expects($this->once())
->method('acquire')
->with('router_rebuild')
@@ -119,7 +119,7 @@ class RouteBuilderTest extends UnitTestCase {
/**
* Tests route rebuilding with a blocking lock.
*/
- public function testRebuildBlockingLock() {
+ public function testRebuildBlockingLock(): void {
$this->lock->expects($this->once())
->method('acquire')
->with('router_rebuild')
@@ -143,7 +143,7 @@ class RouteBuilderTest extends UnitTestCase {
*
* @see \Drupal\Core\Routing\RouteBuilder::rebuild()
*/
- public function testRebuildWithStaticModuleRoutes() {
+ public function testRebuildWithStaticModuleRoutes(): void {
$this->lock->expects($this->once())
->method('acquire')
->with('router_rebuild')
@@ -189,7 +189,7 @@ class RouteBuilderTest extends UnitTestCase {
*
* @see \Drupal\Core\Routing\RouteBuilder::rebuild()
*/
- public function testRebuildWithProviderBasedRoutes() {
+ public function testRebuildWithProviderBasedRoutes(): void {
$this->lock->expects($this->once())
->method('acquire')
->with('router_rebuild')
@@ -254,7 +254,7 @@ class RouteBuilderTest extends UnitTestCase {
/**
* Tests \Drupal\Core\Routing\RouteBuilder::rebuildIfNeeded() method.
*/
- public function testRebuildIfNeeded() {
+ public function testRebuildIfNeeded(): void {
$this->lock->expects($this->once())
->method('acquire')
->with('router_rebuild')
@@ -282,7 +282,7 @@ class RouteBuilderTest extends UnitTestCase {
*
* @see \Drupal\Core\Routing\RouteBuilder::rebuild()
*/
- public function testRebuildWithOverriddenRouteClass() {
+ public function testRebuildWithOverriddenRouteClass(): void {
$this->lock->expects($this->once())
->method('acquire')
->with('router_rebuild')
diff --git a/core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php b/core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php
index 9c282fac1ff..5b34e631958 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RouteCompilerTest.php
@@ -25,7 +25,7 @@ class RouteCompilerTest extends UnitTestCase {
*
* @dataProvider providerTestGetFit
*/
- public function testGetFit($path, $expected) {
+ public function testGetFit($path, $expected): void {
$route_compiler = new RouteCompiler();
$result = $route_compiler->getFit($path);
$this->assertSame($expected, $result);
@@ -54,7 +54,7 @@ class RouteCompilerTest extends UnitTestCase {
/**
* Confirms that a route compiles properly with the necessary data.
*/
- public function testCompilation() {
+ public function testCompilation(): void {
$route = new Route('/test/{something}/more');
$route->setOption('compiler_class', RouteCompiler::class);
$compiled = $route->compile();
@@ -66,7 +66,7 @@ class RouteCompilerTest extends UnitTestCase {
/**
* Confirms that a compiled route with default values has the correct outline.
*/
- public function testCompilationDefaultValue() {
+ public function testCompilationDefaultValue(): void {
// Because "here" has a default value, it should not factor into the outline
// or the fitness.
$route = new Route('/test/{something}/more/{here}', [
diff --git a/core/tests/Drupal/Tests/Core/Routing/RouteMatchTest.php b/core/tests/Drupal/Tests/Core/Routing/RouteMatchTest.php
index 47ebf10829e..85fa3e400fc 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RouteMatchTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RouteMatchTest.php
@@ -28,7 +28,7 @@ class RouteMatchTest extends RouteMatchTestBase {
* @covers ::createFromRequest
* @covers ::__construct
*/
- public function testRouteMatchFromRequest() {
+ public function testRouteMatchFromRequest(): void {
$request = new Request();
// A request that hasn't been routed yet.
diff --git a/core/tests/Drupal/Tests/Core/Routing/RoutePreloaderTest.php b/core/tests/Drupal/Tests/Core/Routing/RoutePreloaderTest.php
index a18b0a80af3..41e1eb9dc48 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RoutePreloaderTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RoutePreloaderTest.php
@@ -52,7 +52,7 @@ class RoutePreloaderTest extends UnitTestCase {
/**
* Tests onAlterRoutes with just admin routes.
*/
- public function testOnAlterRoutesWithAdminRoutes() {
+ public function testOnAlterRoutesWithAdminRoutes(): void {
$event = $this->getMockBuilder('Drupal\Core\Routing\RouteBuildEvent')
->disableOriginalConstructor()
->getMock();
@@ -73,7 +73,7 @@ class RoutePreloaderTest extends UnitTestCase {
/**
* Tests onAlterRoutes with "admin" appearing in the path.
*/
- public function testOnAlterRoutesWithAdminPathNoAdminRoute() {
+ public function testOnAlterRoutesWithAdminPathNoAdminRoute(): void {
$event = $this->getMockBuilder('Drupal\Core\Routing\RouteBuildEvent')
->disableOriginalConstructor()
->getMock();
@@ -96,7 +96,7 @@ class RoutePreloaderTest extends UnitTestCase {
/**
* Tests onAlterRoutes with admin routes and non admin routes.
*/
- public function testOnAlterRoutesWithNonAdminRoutes() {
+ public function testOnAlterRoutesWithNonAdminRoutes(): void {
$event = $this->getMockBuilder('Drupal\Core\Routing\RouteBuildEvent')
->disableOriginalConstructor()
->getMock();
@@ -134,7 +134,7 @@ class RoutePreloaderTest extends UnitTestCase {
/**
* Tests onRequest on a non html request.
*/
- public function testOnRequestNonHtml() {
+ public function testOnRequestNonHtml(): void {
$event = $this->getMockBuilder('\Symfony\Component\HttpKernel\Event\KernelEvent')
->disableOriginalConstructor()
->getMock();
@@ -155,7 +155,7 @@ class RoutePreloaderTest extends UnitTestCase {
/**
* Tests onRequest on a html request.
*/
- public function testOnRequestOnHtml() {
+ public function testOnRequestOnHtml(): void {
$event = $this->getMockBuilder('\Symfony\Component\HttpKernel\Event\KernelEvent')
->disableOriginalConstructor()
->getMock();
diff --git a/core/tests/Drupal/Tests/Core/Routing/RouterTest.php b/core/tests/Drupal/Tests/Core/Routing/RouterTest.php
index cdee3b81c35..254cf466931 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RouterTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RouterTest.php
@@ -24,7 +24,7 @@ class RouterTest extends UnitTestCase {
/**
* @covers ::applyFitOrder
*/
- public function testMatchesWithDifferentFitOrder() {
+ public function testMatchesWithDifferentFitOrder(): void {
$route_provider = $this->prophesize(RouteProviderInterface::class);
$route_collection = new RouteCollection();
diff --git a/core/tests/Drupal/Tests/Core/Routing/RouterUnsupportedTest.php b/core/tests/Drupal/Tests/Core/Routing/RouterUnsupportedTest.php
index cc306b0812e..4996d76988f 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RouterUnsupportedTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RouterUnsupportedTest.php
@@ -21,7 +21,7 @@ class RouterUnsupportedTest extends UnitTestCase {
/**
* @covers ::generate
*/
- public function testGenerateUnsupported() {
+ public function testGenerateUnsupported(): void {
$this->expectException(\BadMethodCallException::class);
$route_provider = $this->prophesize(RouteProviderInterface::class);
$current_path_stack = $this->prophesize(CurrentPathStack::class);
diff --git a/core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php b/core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php
index 440904c014b..fb6183466a5 100644
--- a/core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php
@@ -22,7 +22,7 @@ class TrustedRedirectResponseTest extends UnitTestCase {
/**
* @covers ::setTargetUrl
*/
- public function testSetTargetUrlWithInternalUrl() {
+ public function testSetTargetUrlWithInternalUrl(): void {
$redirect_response = new TrustedRedirectResponse('/example');
$redirect_response->setTargetUrl('/example2');
@@ -32,7 +32,7 @@ class TrustedRedirectResponseTest extends UnitTestCase {
/**
* @covers ::setTargetUrl
*/
- public function testSetTargetUrlWithUntrustedUrl() {
+ public function testSetTargetUrlWithUntrustedUrl(): void {
$request_context = new RequestContext();
$request_context->setCompleteBaseUrl('https://www.drupal.org');
$container = new ContainerBuilder();
@@ -48,7 +48,7 @@ class TrustedRedirectResponseTest extends UnitTestCase {
/**
* @covers ::setTargetUrl
*/
- public function testSetTargetUrlWithTrustedUrl() {
+ public function testSetTargetUrlWithTrustedUrl(): void {
$redirect_response = new TrustedRedirectResponse('/example');
$redirect_response->setTrustedTargetUrl('http://good-external-url.com/example');
@@ -59,7 +59,7 @@ class TrustedRedirectResponseTest extends UnitTestCase {
* @covers ::createFromRedirectResponse
* @dataProvider providerCreateFromRedirectResponse
*/
- public function testCreateFromRedirectResponse($redirect_response) {
+ public function testCreateFromRedirectResponse($redirect_response): void {
$trusted_redirect_response = TrustedRedirectResponse::createFromRedirectResponse($redirect_response);
// The trusted redirect response is always a CacheableResponseInterface instance.
diff --git a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
index 068f13f23b7..26c3b7663a5 100644
--- a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php
@@ -207,7 +207,7 @@ class UrlGeneratorTest extends UnitTestCase {
/**
* Confirms that generated routes will have aliased paths.
*/
- public function testAliasGeneration() {
+ public function testAliasGeneration(): void {
$url = $this->generator->generate('test_1');
$this->assertEquals('/hello/world', $url);
// No cacheability to test; UrlGenerator::generate() doesn't support
@@ -227,7 +227,7 @@ class UrlGeneratorTest extends UnitTestCase {
/**
* Confirms that generated routes will have aliased paths using interface constants.
*/
- public function testAliasGenerationUsingInterfaceConstants() {
+ public function testAliasGenerationUsingInterfaceConstants(): void {
$url = $this->generator->generate('test_1', [], UrlGenerator::ABSOLUTE_PATH);
$this->assertEquals('/hello/world', $url);
// No cacheability to test; UrlGenerator::generate() doesn't support
@@ -247,7 +247,7 @@ class UrlGeneratorTest extends UnitTestCase {
/**
* @covers ::generateFromRoute
*/
- public function testUrlGenerationWithDisabledPathProcessing() {
+ public function testUrlGenerationWithDisabledPathProcessing(): void {
$path_processor = $this->prophesize(OutboundPathProcessorInterface::class);
$path_processor->processOutbound(Argument::cetera())->shouldNotBeCalled();
@@ -261,7 +261,7 @@ class UrlGeneratorTest extends UnitTestCase {
/**
* @covers ::generateFromRoute
*/
- public function testUrlGenerationWithDisabledPathProcessingByRoute() {
+ public function testUrlGenerationWithDisabledPathProcessingByRoute(): void {
$path_processor = $this->prophesize(OutboundPathProcessorInterface::class);
$path_processor->processOutbound(Argument::cetera())->shouldNotBeCalled();
@@ -278,7 +278,7 @@ class UrlGeneratorTest extends UnitTestCase {
/**
* @covers ::generateFromRoute
*/
- public function testUrlGenerationWithDisabledPathProcessingByRouteAndOptedInPathProcessing() {
+ public function testUrlGenerationWithDisabledPathProcessingByRouteAndOptedInPathProcessing(): void {
$path_processor = $this->prophesize(OutboundPathProcessorInterface::class);
$path_processor->processOutbound('/test/one', Argument::cetera())->willReturn('/hello/world')->shouldBeCalled();
@@ -295,7 +295,7 @@ class UrlGeneratorTest extends UnitTestCase {
/**
* Tests URL generation in a subdirectory.
*/
- public function testGetPathFromRouteWithSubdirectory() {
+ public function testGetPathFromRouteWithSubdirectory(): void {
$this->routeProcessorManager->expects($this->once())
->method('processOutbound');
@@ -306,7 +306,7 @@ class UrlGeneratorTest extends UnitTestCase {
/**
* Confirms that generated routes will have aliased paths.
*/
- public function testAliasGenerationWithParameters() {
+ public function testAliasGenerationWithParameters(): void {
$url = $this->generator->generate('test_2', ['Lassie' => '5']);
$this->assertEquals('/goodbye/cruel/world', $url);
// No cacheability to test; UrlGenerator::generate() doesn't support
@@ -339,7 +339,7 @@ class UrlGeneratorTest extends UnitTestCase {
*
* @dataProvider providerTestAliasGenerationWithOptions
*/
- public function testAliasGenerationWithOptions($route_name, $route_parameters, $options, $expected) {
+ public function testAliasGenerationWithOptions($route_name, $route_parameters, $options, $expected): void {
$this->assertGenerateFromRoute($route_name, $route_parameters, $options, $expected, (new BubbleableMetadata())->setCacheMaxAge(Cache::PERMANENT));
}
@@ -388,7 +388,7 @@ class UrlGeneratorTest extends UnitTestCase {
/**
* Tests URL generation from route with trailing start and end slashes.
*/
- public function testGetPathFromRouteTrailing() {
+ public function testGetPathFromRouteTrailing(): void {
$this->routeProcessorManager->expects($this->once())
->method('processOutbound');
@@ -399,7 +399,7 @@ class UrlGeneratorTest extends UnitTestCase {
/**
* Confirms that absolute URLs work with generated routes.
*/
- public function testAbsoluteURLGeneration() {
+ public function testAbsoluteURLGeneration(): void {
$url = $this->generator->generate('test_1', [], TRUE);
$this->assertEquals('http://localhost/hello/world', $url);
// No cacheability to test; UrlGenerator::generate() doesn't support
@@ -417,7 +417,7 @@ class UrlGeneratorTest extends UnitTestCase {
/**
* Confirms that absolute URLs work with generated routes using interface constants.
*/
- public function testAbsoluteURLGenerationUsingInterfaceConstants() {
+ public function testAbsoluteURLGenerationUsingInterfaceConstants(): void {
$url = $this->generator->generate('test_1', [], UrlGenerator::ABSOLUTE_URL);
$this->assertEquals('http://localhost/hello/world', $url);
// No cacheability to test; UrlGenerator::generate() doesn't support
@@ -435,7 +435,7 @@ class UrlGeneratorTest extends UnitTestCase {
/**
* Confirms that explicitly setting the base_url works with generated routes.
*/
- public function testBaseURLGeneration() {
+ public function testBaseURLGeneration(): void {
$options = ['base_url' => 'http://www.example.com:8888'];
$this->assertGenerateFromRoute('test_1', [], $options, 'http://www.example.com:8888/hello/world', (new BubbleableMetadata())->setCacheMaxAge(Cache::PERMANENT));
@@ -457,7 +457,7 @@ class UrlGeneratorTest extends UnitTestCase {
/**
* Tests the 'scheme' route requirement during URL generation.
*/
- public function testUrlGenerationWithHttpsRequirement() {
+ public function testUrlGenerationWithHttpsRequirement(): void {
$url = $this->generator->generate('test_4', [], TRUE);
$this->assertEquals('https://localhost/test/four', $url);
// No cacheability to test; UrlGenerator::generate() doesn't support
@@ -483,7 +483,7 @@ class UrlGeneratorTest extends UnitTestCase {
*
* @dataProvider providerTestNoPath
*/
- public function testNoPath($options, $expected_url) {
+ public function testNoPath($options, $expected_url): void {
$url = $this->generator->generateFromRoute('<none>', [], $options);
$this->assertEquals($expected_url, $url);
}
@@ -511,7 +511,7 @@ class UrlGeneratorTest extends UnitTestCase {
/**
* @covers \Drupal\Core\Routing\UrlGenerator::generateFromRoute
*/
- public function testGenerateWithPathProcessorChangingOptions() {
+ public function testGenerateWithPathProcessorChangingOptions(): void {
$path_processor = $this->createMock(OutboundPathProcessorInterface::CLASS);
$path_processor->expects($this->atLeastOnce())
->method('processOutbound')
diff --git a/core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php b/core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php
index 60b454ac5ff..0b6e0c4d49b 100644
--- a/core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php
@@ -21,7 +21,7 @@ class DoTrustedCallbackTraitTest extends UnitTestCase {
* @covers ::doTrustedCallback
* @dataProvider providerTestTrustedCallbacks
*/
- public function testTrustedCallbacks(callable $callback, $extra_trusted_interface = NULL) {
+ public function testTrustedCallbacks(callable $callback, $extra_trusted_interface = NULL): void {
$return = $this->doTrustedCallback($callback, [], '%s is not trusted', TrustedCallbackInterface::THROW_EXCEPTION, $extra_trusted_interface);
$this->assertSame('test', $return);
}
@@ -50,7 +50,7 @@ class DoTrustedCallbackTraitTest extends UnitTestCase {
* @covers ::doTrustedCallback
* @dataProvider providerTestUntrustedCallbacks
*/
- public function testUntrustedCallbacks(callable $callback, $extra_trusted_interface = NULL) {
+ public function testUntrustedCallbacks(callable $callback, $extra_trusted_interface = NULL): void {
$this->expectException(UntrustedCallbackException::class);
$this->doTrustedCallback($callback, [], '%s is not trusted', TrustedCallbackInterface::THROW_EXCEPTION, $extra_trusted_interface);
}
@@ -72,7 +72,7 @@ class DoTrustedCallbackTraitTest extends UnitTestCase {
/**
* @dataProvider errorTypeProvider
*/
- public function testException($callback) {
+ public function testException($callback): void {
$this->expectException(UntrustedCallbackException::class);
$this->expectExceptionMessage('Drupal\Tests\Core\Security\UntrustedObject::callback is not trusted');
$this->doTrustedCallback($callback, [], '%s is not trusted');
@@ -82,7 +82,7 @@ class DoTrustedCallbackTraitTest extends UnitTestCase {
* @dataProvider errorTypeProvider
* @group legacy
*/
- public function testSilencedDeprecation($callback) {
+ public function testSilencedDeprecation($callback): void {
$this->expectDeprecation('Drupal\Tests\Core\Security\UntrustedObject::callback is not trusted');
$this->doTrustedCallback($callback, [], '%s is not trusted', TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION);
}
diff --git a/core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php b/core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php
index b7f55934346..ee3394b6391 100644
--- a/core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php
+++ b/core/tests/Drupal/Tests/Core/Security/RequestSanitizerTest.php
@@ -60,7 +60,7 @@ class RequestSanitizerTest extends UnitTestCase {
*
* @dataProvider providerTestRequestSanitization
*/
- public function testRequestSanitization(Request $request, array $expected = [], ?array $expected_errors = NULL, array $whitelist = []) {
+ public function testRequestSanitization(Request $request, array $expected = [], ?array $expected_errors = NULL, array $whitelist = []): void {
// Set up globals.
$_GET = $request->query->all();
$_POST = $request->request->all();
@@ -215,7 +215,7 @@ class RequestSanitizerTest extends UnitTestCase {
*
* @dataProvider providerTestAcceptableDestinations
*/
- public function testAcceptableDestinationGet($destination) {
+ public function testAcceptableDestinationGet($destination): void {
// Set up a GET request.
$request = $this->createRequestForTesting(['destination' => $destination]);
@@ -237,7 +237,7 @@ class RequestSanitizerTest extends UnitTestCase {
*
* @dataProvider providerTestSanitizedDestinations
*/
- public function testSanitizedDestinationGet($destination) {
+ public function testSanitizedDestinationGet($destination): void {
// Set up a GET request.
$request = $this->createRequestForTesting(['destination' => $destination]);
@@ -259,7 +259,7 @@ class RequestSanitizerTest extends UnitTestCase {
*
* @dataProvider providerTestAcceptableDestinations
*/
- public function testAcceptableDestinationPost($destination) {
+ public function testAcceptableDestinationPost($destination): void {
// Set up a POST request.
$request = $this->createRequestForTesting([], ['destination' => $destination]);
@@ -281,7 +281,7 @@ class RequestSanitizerTest extends UnitTestCase {
*
* @dataProvider providerTestSanitizedDestinations
*/
- public function testSanitizedDestinationPost($destination) {
+ public function testSanitizedDestinationPost($destination): void {
// Set up a POST request.
$request = $this->createRequestForTesting([], ['destination' => $destination]);
diff --git a/core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php b/core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php
index ebd6002999c..9f14175e85d 100644
--- a/core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php
@@ -48,7 +48,7 @@ class AccessPolicyProcessorTest extends UnitTestCase {
/**
* Tests that access policies are properly processed.
*/
- public function testCalculatePermissions() {
+ public function testCalculatePermissions(): void {
$account = $this->prophesize(AccountInterface::class)->reveal();
$access_policy = new BarAccessPolicy();
@@ -63,7 +63,7 @@ class AccessPolicyProcessorTest extends UnitTestCase {
/**
* Tests that access policies that do not apply are not processed.
*/
- public function testCalculatePermissionsNoApply() {
+ public function testCalculatePermissionsNoApply(): void {
$account = $this->prophesize(AccountInterface::class)->reveal();
$access_policy = new BarAccessPolicy();
@@ -79,7 +79,7 @@ class AccessPolicyProcessorTest extends UnitTestCase {
/**
* Tests that access policies can alter the final result.
*/
- public function testAlterPermissions() {
+ public function testAlterPermissions(): void {
$account = $this->prophesize(AccountInterface::class)->reveal();
$processor = $this->setUpAccessPolicyProcessor();
@@ -97,7 +97,7 @@ class AccessPolicyProcessorTest extends UnitTestCase {
/**
* Tests that alters that do not apply are not processed.
*/
- public function testAlterPermissionsNoApply() {
+ public function testAlterPermissionsNoApply(): void {
$account = $this->prophesize(AccountInterface::class)->reveal();
$processor = $this->setUpAccessPolicyProcessor();
@@ -112,7 +112,7 @@ class AccessPolicyProcessorTest extends UnitTestCase {
/**
* Tests that access policies which do nothing are properly processed.
*/
- public function testEmptyCalculator() {
+ public function testEmptyCalculator(): void {
$account = $this->prophesize(AccountInterface::class)->reveal();
$access_policy = new EmptyAccessPolicy();
@@ -128,7 +128,7 @@ class AccessPolicyProcessorTest extends UnitTestCase {
/**
* Tests that everything works if no access policies are present.
*/
- public function testNoCalculators() {
+ public function testNoCalculators(): void {
$account = $this->prophesize(AccountInterface::class)->reveal();
$processor = $this->setUpAccessPolicyProcessor();
@@ -141,7 +141,7 @@ class AccessPolicyProcessorTest extends UnitTestCase {
/**
* Tests the wrong scope exception.
*/
- public function testWrongScopeException() {
+ public function testWrongScopeException(): void {
$processor = $this->setUpAccessPolicyProcessor();
$processor->addAccessPolicy(new AlwaysAddsAccessPolicy());
@@ -153,7 +153,7 @@ class AccessPolicyProcessorTest extends UnitTestCase {
/**
* Tests the multiple scopes exception.
*/
- public function testMultipleScopeException() {
+ public function testMultipleScopeException(): void {
$processor = $this->setUpAccessPolicyProcessor();
$processor->addAccessPolicy(new FooAccessPolicy());
$processor->addAccessPolicy(new AlwaysAddsAccessPolicy());
@@ -166,7 +166,7 @@ class AccessPolicyProcessorTest extends UnitTestCase {
/**
* Tests the multiple scopes exception.
*/
- public function testMultipleScopeAlterException() {
+ public function testMultipleScopeAlterException(): void {
$processor = $this->setUpAccessPolicyProcessor();
$processor->addAccessPolicy(new FooAccessPolicy());
$processor->addAccessPolicy(new AlwaysAltersAccessPolicy());
@@ -188,7 +188,7 @@ class AccessPolicyProcessorTest extends UnitTestCase {
*
* @dataProvider accountSwitcherProvider
*/
- public function testAccountSwitcher(bool $has_user_context, bool $is_current_user, bool $should_call_switcher) {
+ public function testAccountSwitcher(bool $has_user_context, bool $is_current_user, bool $should_call_switcher): void {
$account = $this->prophesize(AccountInterface::class);
$account->id()->willReturn(2);
$account = $account->reveal();
@@ -253,7 +253,7 @@ class AccessPolicyProcessorTest extends UnitTestCase {
*
* @dataProvider cachingProvider
*/
- public function testCaching(bool $db_cache_hit, bool $static_cache_hit) {
+ public function testCaching(bool $db_cache_hit, bool $static_cache_hit): void {
if ($static_cache_hit) {
$this->assertFalse($db_cache_hit, 'DB cache should never be checked when there is a static hit.');
}
@@ -313,7 +313,7 @@ class AccessPolicyProcessorTest extends UnitTestCase {
/**
* Tests that only the cache contexts for policies that apply are added.
*/
- public function testCacheContexts() {
+ public function testCacheContexts(): void {
// BazAccessPolicy and BarAlterAccessPolicy shouldn't add any contexts.
$initial_cacheability = (new CacheableMetadata())->addCacheContexts(['foo', 'bar']);
$final_cacheability = (new CacheableMetadata())->addCacheContexts(['foo', 'bar'])->addCacheTags(['access_policies']);
@@ -336,7 +336,7 @@ class AccessPolicyProcessorTest extends UnitTestCase {
/**
* Tests that the persistent cache contexts are added properly.
*/
- public function testCacheContextCaching() {
+ public function testCacheContextCaching(): void {
$cache_entry = new \stdClass();
$cache_entry->data = ['baz'];
diff --git a/core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php b/core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php
index 770a732fceb..98a35b8fcf8 100644
--- a/core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php
@@ -23,7 +23,7 @@ class AccountProxyTest extends UnitTestCase {
* @covers ::id
* @covers ::setInitialAccountId
*/
- public function testId() {
+ public function testId(): void {
$dispatcher = $this->prophesize(EventDispatcherInterface::class);
$dispatcher->dispatch(Argument::any(), Argument::any())->willReturn(new Event());
$account_proxy = new AccountProxy($dispatcher->reveal());
@@ -43,7 +43,7 @@ class AccountProxyTest extends UnitTestCase {
/**
* @covers ::setInitialAccountId
*/
- public function testSetInitialAccountIdException() {
+ public function testSetInitialAccountIdException(): void {
$this->expectException(\LogicException::class);
$dispatcher = $this->prophesize(EventDispatcherInterface::class);
$dispatcher->dispatch(Argument::any(), Argument::any())->willReturn(new Event());
@@ -56,7 +56,7 @@ class AccountProxyTest extends UnitTestCase {
/**
* @covers ::hasRole
*/
- public function testHasRole() {
+ public function testHasRole(): void {
$dispatcher = $this->prophesize(EventDispatcherInterface::class);
$dispatcher->dispatch(Argument::any(), Argument::any())->willReturn(new Event());
$account_proxy = new AccountProxy($dispatcher->reveal());
diff --git a/core/tests/Drupal/Tests/Core/Session/AnonymousUserSessionTest.php b/core/tests/Drupal/Tests/Core/Session/AnonymousUserSessionTest.php
index 23631aa86dd..18783b85260 100644
--- a/core/tests/Drupal/Tests/Core/Session/AnonymousUserSessionTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/AnonymousUserSessionTest.php
@@ -20,7 +20,7 @@ class AnonymousUserSessionTest extends UnitTestCase {
* @covers ::getRoles
* @todo Move roles constants to a class/interface
*/
- public function testUserGetRoles() {
+ public function testUserGetRoles(): void {
$anonymous_user = new AnonymousUserSession();
$this->assertEquals([RoleInterface::ANONYMOUS_ID], $anonymous_user->getRoles());
$this->assertEquals([], $anonymous_user->getRoles(TRUE));
diff --git a/core/tests/Drupal/Tests/Core/Session/CalculatedPermissionsItemTest.php b/core/tests/Drupal/Tests/Core/Session/CalculatedPermissionsItemTest.php
index 85cd51e2de5..15a4a904208 100644
--- a/core/tests/Drupal/Tests/Core/Session/CalculatedPermissionsItemTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/CalculatedPermissionsItemTest.php
@@ -24,7 +24,7 @@ class CalculatedPermissionsItemTest extends UnitTestCase {
* @covers ::getPermissions
* @covers ::isAdmin
*/
- public function testConstructor() {
+ public function testConstructor(): void {
$scope = 'some_scope';
$item = new CalculatedPermissionsItem(['bar', 'baz', 'bar'], FALSE, $scope, 'foo');
@@ -44,7 +44,7 @@ class CalculatedPermissionsItemTest extends UnitTestCase {
* @covers ::hasPermission
* @depends testConstructor
*/
- public function testHasPermission() {
+ public function testHasPermission(): void {
$item = new CalculatedPermissionsItem(['bar'], FALSE, 'some_scope', 'foo');
$this->assertFalse($item->hasPermission('baz'), 'Missing permission was not found.');
$this->assertTrue($item->hasPermission('bar'), 'Existing permission was found.');
@@ -56,7 +56,7 @@ class CalculatedPermissionsItemTest extends UnitTestCase {
* @covers ::hasPermission
* @depends testConstructor
*/
- public function testHasPermissionWithAdminFlag() {
+ public function testHasPermissionWithAdminFlag(): void {
$item = new CalculatedPermissionsItem(['bar'], TRUE, 'some_scope', 'foo');
$this->assertTrue($item->hasPermission('baz'), 'Missing permission was found.');
$this->assertTrue($item->hasPermission('bar'), 'Existing permission was found.');
diff --git a/core/tests/Drupal/Tests/Core/Session/CalculatedPermissionsTest.php b/core/tests/Drupal/Tests/Core/Session/CalculatedPermissionsTest.php
index d24d3bfc539..fa5f4a62dff 100644
--- a/core/tests/Drupal/Tests/Core/Session/CalculatedPermissionsTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/CalculatedPermissionsTest.php
@@ -21,7 +21,7 @@ class CalculatedPermissionsTest extends UnitTestCase {
/**
* Tests that the object values were set in the constructor.
*/
- public function testConstructor() {
+ public function testConstructor(): void {
$item_a = new CalculatedPermissionsItem(['baz'], FALSE, 'scope_a', 'foo');
$item_b = new CalculatedPermissionsItem(['bob', 'charlie'], FALSE, 'scope_b', 1);
diff --git a/core/tests/Drupal/Tests/Core/Session/MetadataBagTest.php b/core/tests/Drupal/Tests/Core/Session/MetadataBagTest.php
index 379b434379d..f9a796ece37 100644
--- a/core/tests/Drupal/Tests/Core/Session/MetadataBagTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/MetadataBagTest.php
@@ -17,7 +17,7 @@ class MetadataBagTest extends UnitTestCase {
/**
* @covers ::stampNew
*/
- public function testStampNew() {
+ public function testStampNew(): void {
$metadata = new MetadataBag(new Settings([]));
$metadata->setCsrfTokenSeed('a_cryptographically_secure_long_random_string_should_used_here');
$metadata->stampNew();
diff --git a/core/tests/Drupal/Tests/Core/Session/PermissionsHashGeneratorTest.php b/core/tests/Drupal/Tests/Core/Session/PermissionsHashGeneratorTest.php
index 067472b3b05..3d905051695 100644
--- a/core/tests/Drupal/Tests/Core/Session/PermissionsHashGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/PermissionsHashGeneratorTest.php
@@ -96,7 +96,7 @@ class PermissionsHashGeneratorTest extends UnitTestCase {
*
* @covers ::generate
*/
- public function testGenerateRegular() {
+ public function testGenerateRegular(): void {
$permissions = new CalculatedPermissions(
(new RefinableCalculatedPermissions())->addItem(new CalculatedPermissionsItem([
'permission foo',
@@ -117,7 +117,7 @@ class PermissionsHashGeneratorTest extends UnitTestCase {
*
* @covers ::generate
*/
- public function testGenerateAdmin() {
+ public function testGenerateAdmin(): void {
$permissions = new CalculatedPermissions((new RefinableCalculatedPermissions())->addItem(new CalculatedPermissionsItem([], TRUE)));
$this->processor->processAccessPolicies($this->account1)->willReturn($permissions);
$this->processor->processAccessPolicies($this->account2)->willReturn($permissions);
@@ -136,7 +136,7 @@ class PermissionsHashGeneratorTest extends UnitTestCase {
*
* @covers ::generate
*/
- public function testGenerateNoAccessPolicies() {
+ public function testGenerateNoAccessPolicies(): void {
$permissions = new CalculatedPermissions(new RefinableCalculatedPermissions());
$this->processor->processAccessPolicies($this->account1)->willReturn($permissions);
$this->processor->processAccessPolicies($this->account2)->willReturn($permissions);
@@ -155,7 +155,7 @@ class PermissionsHashGeneratorTest extends UnitTestCase {
*
* @covers ::generate
*/
- public function testGenerateCache() {
+ public function testGenerateCache(): void {
$permissions = new CalculatedPermissions(new RefinableCalculatedPermissions());
$this->processor->processAccessPolicies($this->account1)->willReturn($permissions);
$this->processor->processAccessPolicies($this->account2)->willReturn($permissions);
diff --git a/core/tests/Drupal/Tests/Core/Session/RefinableCalculatedPermissionsTest.php b/core/tests/Drupal/Tests/Core/Session/RefinableCalculatedPermissionsTest.php
index 454a8674183..43b6d127094 100644
--- a/core/tests/Drupal/Tests/Core/Session/RefinableCalculatedPermissionsTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/RefinableCalculatedPermissionsTest.php
@@ -23,7 +23,7 @@ class RefinableCalculatedPermissionsTest extends UnitTestCase {
/**
* Tests the addition of a calculated permissions item.
*/
- public function testAddItem() {
+ public function testAddItem(): void {
$calculated_permissions = new RefinableCalculatedPermissions();
$scope = 'some_scope';
@@ -46,7 +46,7 @@ class RefinableCalculatedPermissionsTest extends UnitTestCase {
*
* @depends testAddItem
*/
- public function testAddItemOverwrite() {
+ public function testAddItemOverwrite(): void {
$calculated_permissions = new RefinableCalculatedPermissions();
$scope = 'some_scope';
@@ -63,7 +63,7 @@ class RefinableCalculatedPermissionsTest extends UnitTestCase {
*
* @depends testAddItem
*/
- public function testRemoveItem() {
+ public function testRemoveItem(): void {
$scope = 'some_scope';
$item = new CalculatedPermissionsItem(['bar'], FALSE, $scope, 'foo');
@@ -78,7 +78,7 @@ class RefinableCalculatedPermissionsTest extends UnitTestCase {
*
* @depends testAddItem
*/
- public function testRemoveItems() {
+ public function testRemoveItems(): void {
$scope = 'some_scope';
$item = new CalculatedPermissionsItem(['bar'], FALSE, $scope, 'foo');
@@ -94,7 +94,7 @@ class RefinableCalculatedPermissionsTest extends UnitTestCase {
*
* @depends testAddItem
*/
- public function testRemoveItemsByScope() {
+ public function testRemoveItemsByScope(): void {
$scope_a = 'cat';
$scope_b = 'dog';
@@ -115,7 +115,7 @@ class RefinableCalculatedPermissionsTest extends UnitTestCase {
*
* @depends testAddItem
*/
- public function testMerge() {
+ public function testMerge(): void {
$scope = 'some_scope';
$cache_context_manager = $this->prophesize(CacheContextsManager::class);
diff --git a/core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php b/core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php
index fd85368f4c4..aa03d6b5dc3 100644
--- a/core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php
@@ -32,7 +32,7 @@ class SessionConfigurationTest extends UnitTestCase {
*
* @dataProvider providerTestGeneratedCookieDomain
*/
- public function testGeneratedCookieDomain($uri, $expected_domain) {
+ public function testGeneratedCookieDomain($uri, $expected_domain): void {
$config = $this->createSessionConfiguration();
$request = Request::create($uri);
@@ -71,7 +71,7 @@ class SessionConfigurationTest extends UnitTestCase {
*
* @dataProvider providerTestEnforcedCookieDomain
*/
- public function testEnforcedCookieDomain($uri, $expected_domain) {
+ public function testEnforcedCookieDomain($uri, $expected_domain): void {
$config = $this->createSessionConfiguration(['cookie_domain' => '.example.com']);
$request = Request::create($uri);
@@ -109,7 +109,7 @@ class SessionConfigurationTest extends UnitTestCase {
*
* @dataProvider providerTestCookieSecure
*/
- public function testCookieSecure($uri, $expected_secure) {
+ public function testCookieSecure($uri, $expected_secure): void {
$config = $this->createSessionConfiguration();
$request = Request::create($uri);
@@ -121,7 +121,7 @@ class SessionConfigurationTest extends UnitTestCase {
/**
* Test that session.cookie_samesite is configured correctly.
*/
- public function testSameSiteCookie() {
+ public function testSameSiteCookie(): void {
$request = Request::create('https://example.com');
$config = $this->createSessionConfiguration(['cookie_samesite' => 'Strict']);
@@ -137,7 +137,7 @@ class SessionConfigurationTest extends UnitTestCase {
*
* @dataProvider providerTestCookieSecure
*/
- public function testCookieSecureNotOverridable($uri, $expected_secure) {
+ public function testCookieSecureNotOverridable($uri, $expected_secure): void {
$config = $this->createSessionConfiguration(['cookie_secure' => FALSE]);
$request = Request::create($uri);
@@ -170,7 +170,7 @@ class SessionConfigurationTest extends UnitTestCase {
*
* @dataProvider providerTestGeneratedSessionName
*/
- public function testGeneratedSessionName($uri, $expected_name) {
+ public function testGeneratedSessionName($uri, $expected_name): void {
$config = $this->createSessionConfiguration();
$request = Request::create($uri);
@@ -218,7 +218,7 @@ class SessionConfigurationTest extends UnitTestCase {
*
* @dataProvider providerTestEnforcedSessionName
*/
- public function testEnforcedSessionNameViaCookieDomain($uri, $expected_name) {
+ public function testEnforcedSessionNameViaCookieDomain($uri, $expected_name): void {
$config = $this->createSessionConfiguration(['cookie_domain' => '.example.com']);
$request = Request::create($uri);
@@ -266,7 +266,7 @@ class SessionConfigurationTest extends UnitTestCase {
*
* @dataProvider providerTestConstructorDefaultSettings
*/
- public function testConstructorDefaultSettings(array $options, int $expected_sid_length, int $expected_sid_bits_per_character, string $expected_name_suffix) {
+ public function testConstructorDefaultSettings(array $options, int $expected_sid_length, int $expected_sid_bits_per_character, string $expected_name_suffix): void {
$config = $this->createSessionConfiguration($options);
$options = $config->getOptions(Request::createFromGlobals());
$this->assertSame($expected_sid_length, $options['sid_length']);
diff --git a/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php b/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php
index 2957033911c..db79fca4b17 100644
--- a/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php
@@ -57,7 +57,7 @@ class UserSessionTest extends UnitTestCase {
* @covers ::getRoles
* @todo Move roles constants to a class/interface
*/
- public function testUserGetRoles() {
+ public function testUserGetRoles(): void {
$user = $this->createUserSession(['role_two'], TRUE);
$this->assertEquals([RoleInterface::AUTHENTICATED_ID, 'role_two'], $user->getRoles());
$this->assertEquals(['role_two'], $user->getRoles(TRUE));
@@ -68,7 +68,7 @@ class UserSessionTest extends UnitTestCase {
*
* @covers ::hasRole
*/
- public function testHasRole() {
+ public function testHasRole(): void {
$user1 = $this->createUserSession(['role_one']);
$user2 = $this->createUserSession(['role_one', 'role_two']);
$user3 = $this->createUserSession(['role_two'], TRUE);
diff --git a/core/tests/Drupal/Tests/Core/Session/WriteSafeSessionHandlerTest.php b/core/tests/Drupal/Tests/Core/Session/WriteSafeSessionHandlerTest.php
index 0f2c7498d75..27c3a0e0741 100644
--- a/core/tests/Drupal/Tests/Core/Session/WriteSafeSessionHandlerTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/WriteSafeSessionHandlerTest.php
@@ -46,7 +46,7 @@ class WriteSafeSessionHandlerTest extends UnitTestCase {
* @covers ::isSessionWritable
* @covers ::write
*/
- public function testConstructWriteSafeSessionHandlerDefaultArgs() {
+ public function testConstructWriteSafeSessionHandlerDefaultArgs(): void {
$session_id = 'some-id';
$session_data = 'serialized-session-data';
@@ -72,7 +72,7 @@ class WriteSafeSessionHandlerTest extends UnitTestCase {
* @covers ::isSessionWritable
* @covers ::write
*/
- public function testConstructWriteSafeSessionHandlerDisableWriting() {
+ public function testConstructWriteSafeSessionHandlerDisableWriting(): void {
$session_id = 'some-id';
$session_data = 'serialized-session-data';
@@ -91,7 +91,7 @@ class WriteSafeSessionHandlerTest extends UnitTestCase {
* @covers ::setSessionWritable
* @covers ::write
*/
- public function testSetSessionWritable() {
+ public function testSetSessionWritable(): void {
$session_id = 'some-id';
$session_data = 'serialized-session-data';
@@ -136,7 +136,7 @@ class WriteSafeSessionHandlerTest extends UnitTestCase {
* @covers ::gc
* @dataProvider providerTestOtherMethods
*/
- public function testOtherMethods($method, $expected_result, $args) {
+ public function testOtherMethods($method, $expected_result, $args): void {
$invocation = $this->wrappedSessionHandler->expects($this->exactly(2))
->method($method)
->willReturn($expected_result);
diff --git a/core/tests/Drupal/Tests/Core/Site/SettingsTest.php b/core/tests/Drupal/Tests/Core/Site/SettingsTest.php
index a2908c00e69..d378dcf983c 100644
--- a/core/tests/Drupal/Tests/Core/Site/SettingsTest.php
+++ b/core/tests/Drupal/Tests/Core/Site/SettingsTest.php
@@ -48,7 +48,7 @@ class SettingsTest extends UnitTestCase {
/**
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
// Test stored settings.
$this->assertEquals($this->config['one'], Settings::get('one'), 'The correct setting was not returned.');
$this->assertEquals($this->config['two'], Settings::get('two'), 'The correct setting was not returned.');
@@ -61,14 +61,14 @@ class SettingsTest extends UnitTestCase {
/**
* @covers ::getAll
*/
- public function testGetAll() {
+ public function testGetAll(): void {
$this->assertEquals($this->config, Settings::getAll());
}
/**
* @covers ::getInstance
*/
- public function testGetInstance() {
+ public function testGetInstance(): void {
$singleton = $this->settings->getInstance();
$this->assertEquals($singleton, $this->settings);
}
@@ -78,7 +78,7 @@ class SettingsTest extends UnitTestCase {
*
* @covers ::getHashSalt
*/
- public function testGetHashSalt() {
+ public function testGetHashSalt(): void {
$this->assertSame($this->config['hash_salt'], $this->settings->getHashSalt());
}
@@ -89,7 +89,7 @@ class SettingsTest extends UnitTestCase {
*
* @dataProvider providerTestGetHashSaltEmpty
*/
- public function testGetHashSaltEmpty(array $config) {
+ public function testGetHashSaltEmpty(array $config): void {
// Re-create settings with no 'hash_salt' key.
$settings = new Settings($config);
$this->expectException(\RuntimeException::class);
@@ -114,7 +114,7 @@ class SettingsTest extends UnitTestCase {
*
* @covers ::__sleep
*/
- public function testSerialize() {
+ public function testSerialize(): void {
$this->expectException(\LogicException::class);
serialize(new Settings([]));
}
@@ -124,7 +124,7 @@ class SettingsTest extends UnitTestCase {
*
* @covers ::getApcuPrefix
*/
- public function testGetApcuPrefix() {
+ public function testGetApcuPrefix(): void {
$settings = new Settings([
'hash_salt' => 123,
'apcu_ensure_unique_prefix' => TRUE,
@@ -143,7 +143,7 @@ class SettingsTest extends UnitTestCase {
*
* @covers ::getInstance
*/
- public function testGetInstanceReflection() {
+ public function testGetInstanceReflection(): void {
$settings = new Settings([]);
$class = new \ReflectionClass(Settings::class);
diff --git a/core/tests/Drupal/Tests/Core/StackMiddleware/ContentLengthTest.php b/core/tests/Drupal/Tests/Core/StackMiddleware/ContentLengthTest.php
index e406d11a02a..f88be207f40 100644
--- a/core/tests/Drupal/Tests/Core/StackMiddleware/ContentLengthTest.php
+++ b/core/tests/Drupal/Tests/Core/StackMiddleware/ContentLengthTest.php
@@ -21,7 +21,7 @@ class ContentLengthTest extends UnitTestCase {
* @covers ::handle
* @dataProvider providerTestSetContentLengthHeader
*/
- public function testHandle(false|int $expected_header, Response $response) {
+ public function testHandle(false|int $expected_header, Response $response): void {
$kernel = $this->prophesize(HttpKernelInterface::class);
$request = Request::create('/');
$kernel->handle($request, HttpKernelInterface::MAIN_REQUEST, TRUE)->willReturn($response);
diff --git a/core/tests/Drupal/Tests/Core/StackMiddleware/NegotiationMiddlewareTest.php b/core/tests/Drupal/Tests/Core/StackMiddleware/NegotiationMiddlewareTest.php
index 594d6075db0..b5d76f38d27 100644
--- a/core/tests/Drupal/Tests/Core/StackMiddleware/NegotiationMiddlewareTest.php
+++ b/core/tests/Drupal/Tests/Core/StackMiddleware/NegotiationMiddlewareTest.php
@@ -42,7 +42,7 @@ class NegotiationMiddlewareTest extends UnitTestCase {
*
* @covers ::getContentType
*/
- public function testAjaxIframeUpload() {
+ public function testAjaxIframeUpload(): void {
$request = new Request();
$request->request->set('ajax_iframe_upload', '1');
@@ -54,7 +54,7 @@ class NegotiationMiddlewareTest extends UnitTestCase {
*
* @covers ::getContentType
*/
- public function testFormatViaQueryParameter() {
+ public function testFormatViaQueryParameter(): void {
$request = new Request();
$request->query->set('_format', 'bob');
@@ -66,7 +66,7 @@ class NegotiationMiddlewareTest extends UnitTestCase {
*
* @covers ::getContentType
*/
- public function testUnknownContentTypeReturnsNull() {
+ public function testUnknownContentTypeReturnsNull(): void {
$request = new Request();
$this->assertNull($this->contentNegotiation->getContentType($request));
@@ -77,7 +77,7 @@ class NegotiationMiddlewareTest extends UnitTestCase {
*
* @covers ::getContentType
*/
- public function testUnknownContentTypeButAjaxRequest() {
+ public function testUnknownContentTypeButAjaxRequest(): void {
$request = new Request();
$request->headers->set('X-Requested-With', 'XMLHttpRequest');
@@ -89,7 +89,7 @@ class NegotiationMiddlewareTest extends UnitTestCase {
*
* @covers ::handle
*/
- public function testHandle() {
+ public function testHandle(): void {
$request = $this->prophesize(Request::class);
// Default empty format list should not set any formats.
@@ -122,7 +122,7 @@ class NegotiationMiddlewareTest extends UnitTestCase {
/**
* @covers ::registerFormat
*/
- public function testSetFormat() {
+ public function testSetFormat(): void {
$app = $this->createMock(HttpKernelInterface::class);
$app->expects($this->once())
->method('handle')
diff --git a/core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php b/core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php
index dbc4e54de26..84af0968d8e 100644
--- a/core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php
+++ b/core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php
@@ -38,7 +38,7 @@ class ReverseProxyMiddlewareTest extends UnitTestCase {
/**
* Tests that subscriber does not act when reverse proxy is not set.
*/
- public function testNoProxy() {
+ public function testNoProxy(): void {
$settings = new Settings([]);
$this->assertEquals(0, $settings->get('reverse_proxy'));
@@ -59,7 +59,7 @@ class ReverseProxyMiddlewareTest extends UnitTestCase {
*
* @dataProvider reverseProxyEnabledProvider
*/
- public function testReverseProxyEnabled($provided_settings, $expected_trusted_header_set) {
+ public function testReverseProxyEnabled($provided_settings, $expected_trusted_header_set): void {
// Enable reverse proxy and add test values.
$settings = new Settings(['reverse_proxy' => 1] + $provided_settings);
$this->trustedHeadersAreSet($settings, $expected_trusted_header_set);
diff --git a/core/tests/Drupal/Tests/Core/StringTranslation/ByteSizeMarkupTest.php b/core/tests/Drupal/Tests/Core/StringTranslation/ByteSizeMarkupTest.php
index a125ef27fb7..8f597af977f 100644
--- a/core/tests/Drupal/Tests/Core/StringTranslation/ByteSizeMarkupTest.php
+++ b/core/tests/Drupal/Tests/Core/StringTranslation/ByteSizeMarkupTest.php
@@ -20,7 +20,7 @@ class ByteSizeMarkupTest extends UnitTestCase {
* @covers ::create
* @dataProvider providerTestCommonFormatSize
*/
- public function testCommonFormatSize($expected, $input) {
+ public function testCommonFormatSize($expected, $input): void {
$size = ByteSizeMarkup::create($input, NULL, $this->getStringTranslationStub());
$this->assertInstanceOf(TranslatableMarkup::class, $size);
$this->assertEquals($expected, $size);
diff --git a/core/tests/Drupal/Tests/Core/StringTranslation/PluralTranslatableMarkupTest.php b/core/tests/Drupal/Tests/Core/StringTranslation/PluralTranslatableMarkupTest.php
index b1af945cad2..15833c74b5e 100644
--- a/core/tests/Drupal/Tests/Core/StringTranslation/PluralTranslatableMarkupTest.php
+++ b/core/tests/Drupal/Tests/Core/StringTranslation/PluralTranslatableMarkupTest.php
@@ -21,7 +21,7 @@ class PluralTranslatableMarkupTest extends UnitTestCase {
*
* @dataProvider providerPluralTranslatableMarkupSerialization
*/
- public function testPluralTranslatableMarkupSerialization($count, $expected_text) {
+ public function testPluralTranslatableMarkupSerialization($count, $expected_text): void {
// Add a mock string translation service to the container.
$container = new ContainerBuilder();
$container->set('string_translation', $this->getStringTranslationStub());
@@ -46,7 +46,7 @@ class PluralTranslatableMarkupTest extends UnitTestCase {
/**
* Tests when the plural translation is missing.
*/
- public function testMissingPluralTranslation() {
+ public function testMissingPluralTranslation(): void {
$markup = PluralTranslatableMarkup::createFromTranslatedString(2, 'There is no plural delimiter @count');
$this->assertEquals('There is no plural delimiter 2', $markup->render());
}
diff --git a/core/tests/Drupal/Tests/Core/StringTranslation/TranslatableMarkupTest.php b/core/tests/Drupal/Tests/Core/StringTranslation/TranslatableMarkupTest.php
index 338c21a5c77..f3aca4a2466 100644
--- a/core/tests/Drupal/Tests/Core/StringTranslation/TranslatableMarkupTest.php
+++ b/core/tests/Drupal/Tests/Core/StringTranslation/TranslatableMarkupTest.php
@@ -53,7 +53,7 @@ class TranslatableMarkupTest extends UnitTestCase {
*
* @covers ::__toString
*/
- public function testToString() {
+ public function testToString(): void {
$translation = $this->createMock(TranslationInterface::class);
$string = 'May I have an exception?';
@@ -86,7 +86,7 @@ class TranslatableMarkupTest extends UnitTestCase {
/**
* @covers ::__construct
*/
- public function testIsStringAssertion() {
+ public function testIsStringAssertion(): void {
$translation = $this->getStringTranslationStub();
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('$string ("foo") must be a string.');
@@ -96,7 +96,7 @@ class TranslatableMarkupTest extends UnitTestCase {
/**
* @covers ::__construct
*/
- public function testIsStringAssertionWithFormattableMarkup() {
+ public function testIsStringAssertionWithFormattableMarkup(): void {
$formattable_string = new FormattableMarkup('@bar', ['@bar' => 'foo']);
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('$string ("foo") must be a string.');
diff --git a/core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php b/core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php
index 5d8f7ca9bc8..70d0a96e7a3 100644
--- a/core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php
@@ -49,7 +49,7 @@ class TranslationManagerTest extends UnitTestCase {
/**
* @dataProvider providerTestFormatPlural
*/
- public function testFormatPlural($count, $singular, $plural, array $args, array $options, $expected) {
+ public function testFormatPlural($count, $singular, $plural, array $args, array $options, $expected): void {
$langcode = empty($options['langcode']) ? 'fr' : $options['langcode'];
$translator = $this->createMock('\Drupal\Core\StringTranslation\Translator\TranslatorInterface');
$translator->expects($this->once())
@@ -77,7 +77,7 @@ class TranslationManagerTest extends UnitTestCase {
*
* @dataProvider providerTestTranslatePlaceholder
*/
- public function testTranslatePlaceholder($string, array $args, $expected_string) {
+ public function testTranslatePlaceholder($string, array $args, $expected_string): void {
$actual = $this->translationManager->translate($string, $args);
$this->assertInstanceOf(MarkupInterface::class, $actual);
$this->assertEquals($expected_string, (string) $actual);
diff --git a/core/tests/Drupal/Tests/Core/StringTranslation/TranslationWrapperTest.php b/core/tests/Drupal/Tests/Core/StringTranslation/TranslationWrapperTest.php
index 14850309076..e013aaed8cd 100644
--- a/core/tests/Drupal/Tests/Core/StringTranslation/TranslationWrapperTest.php
+++ b/core/tests/Drupal/Tests/Core/StringTranslation/TranslationWrapperTest.php
@@ -19,7 +19,7 @@ class TranslationWrapperTest extends UnitTestCase {
/**
* @covers ::__construct
*/
- public function testTranslationWrapper() {
+ public function testTranslationWrapper(): void {
$object = new TranslationWrapper('Backward compatibility');
$this->assertInstanceOf(TranslatableMarkup::class, $object);
}
diff --git a/core/tests/Drupal/Tests/Core/TempStore/PrivateTempStoreTest.php b/core/tests/Drupal/Tests/Core/TempStore/PrivateTempStoreTest.php
index 1a022273390..5bf7cd35f3a 100644
--- a/core/tests/Drupal/Tests/Core/TempStore/PrivateTempStoreTest.php
+++ b/core/tests/Drupal/Tests/Core/TempStore/PrivateTempStoreTest.php
@@ -101,7 +101,7 @@ class PrivateTempStoreTest extends UnitTestCase {
*
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
$calls = ['1:test_2', '1:test', '1:test'];
$this->keyValue->expects($this->exactly(count($calls)))
->method('get')
@@ -124,7 +124,7 @@ class PrivateTempStoreTest extends UnitTestCase {
*
* @covers ::set
*/
- public function testSetWithNoLockAvailable() {
+ public function testSetWithNoLockAvailable(): void {
$this->lock->expects($this->exactly(2))
->method('acquire')
->with('1:test')
@@ -145,7 +145,7 @@ class PrivateTempStoreTest extends UnitTestCase {
*
* @covers ::set
*/
- public function testSet() {
+ public function testSet(): void {
$this->lock->expects($this->once())
->method('acquire')
->with('1:test')
@@ -168,7 +168,7 @@ class PrivateTempStoreTest extends UnitTestCase {
*
* @covers ::getMetadata
*/
- public function testGetMetadata() {
+ public function testGetMetadata(): void {
$this->keyValue->expects($this->exactly(2))
->method('get')
->with('1:test')
@@ -189,7 +189,7 @@ class PrivateTempStoreTest extends UnitTestCase {
*
* @covers ::delete
*/
- public function testDeleteLocking() {
+ public function testDeleteLocking(): void {
$this->keyValue->expects($this->once())
->method('get')
->with('1:test')
@@ -216,7 +216,7 @@ class PrivateTempStoreTest extends UnitTestCase {
*
* @covers ::delete
*/
- public function testDeleteWithNoLockAvailable() {
+ public function testDeleteWithNoLockAvailable(): void {
$this->keyValue->expects($this->once())
->method('get')
->with('1:test')
@@ -241,7 +241,7 @@ class PrivateTempStoreTest extends UnitTestCase {
*
* @covers ::delete
*/
- public function testDelete() {
+ public function testDelete(): void {
$this->lock->expects($this->once())
->method('acquire')
->with('1:test_2')
diff --git a/core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php b/core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php
index f0d474c534a..78b70369831 100644
--- a/core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php
+++ b/core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php
@@ -100,7 +100,7 @@ class SharedTempStoreTest extends UnitTestCase {
/**
* @covers ::get
*/
- public function testGet() {
+ public function testGet(): void {
$calls = ['test_2', 'test'];
$this->keyValue->expects($this->exactly(count($calls)))
->method('get')
@@ -121,7 +121,7 @@ class SharedTempStoreTest extends UnitTestCase {
*
* @covers ::getIfOwner
*/
- public function testGetIfOwner() {
+ public function testGetIfOwner(): void {
$calls = ['test_2', 'test', 'test'];
$this->keyValue->expects($this->exactly(count($calls)))
->method('get')
@@ -144,7 +144,7 @@ class SharedTempStoreTest extends UnitTestCase {
*
* @covers ::set
*/
- public function testSetWithNoLockAvailable() {
+ public function testSetWithNoLockAvailable(): void {
$this->lock->expects($this->exactly(2))
->method('acquire')
->with('test')
@@ -165,7 +165,7 @@ class SharedTempStoreTest extends UnitTestCase {
*
* @covers ::set
*/
- public function testSet() {
+ public function testSet(): void {
$this->lock->expects($this->once())
->method('acquire')
->with('test')
@@ -188,7 +188,7 @@ class SharedTempStoreTest extends UnitTestCase {
*
* @covers ::setIfNotExists
*/
- public function testSetIfNotExists() {
+ public function testSetIfNotExists(): void {
$this->keyValue->expects($this->once())
->method('setWithExpireIfNotExists')
->with('test', $this->ownObject, 604800)
@@ -202,7 +202,7 @@ class SharedTempStoreTest extends UnitTestCase {
*
* @covers ::setIfOwner
*/
- public function testSetIfOwnerWhenNotExists() {
+ public function testSetIfOwnerWhenNotExists(): void {
$this->keyValue->expects($this->once())
->method('setWithExpireIfNotExists')
->willReturn(TRUE);
@@ -215,7 +215,7 @@ class SharedTempStoreTest extends UnitTestCase {
*
* @covers ::setIfOwner
*/
- public function testSetIfOwnerNoObject() {
+ public function testSetIfOwnerNoObject(): void {
$this->keyValue->expects($this->once())
->method('setWithExpireIfNotExists')
->willReturn(FALSE);
@@ -233,7 +233,7 @@ class SharedTempStoreTest extends UnitTestCase {
*
* @covers ::setIfOwner
*/
- public function testSetIfOwner() {
+ public function testSetIfOwner(): void {
$this->lock->expects($this->once())
->method('acquire')
->with('test')
@@ -257,7 +257,7 @@ class SharedTempStoreTest extends UnitTestCase {
*
* @covers ::getMetadata
*/
- public function testGetMetadata() {
+ public function testGetMetadata(): void {
$this->keyValue->expects($this->exactly(2))
->method('get')
->with('test')
@@ -277,7 +277,7 @@ class SharedTempStoreTest extends UnitTestCase {
*
* @covers ::delete
*/
- public function testDelete() {
+ public function testDelete(): void {
$this->lock->expects($this->once())
->method('acquire')
->with('test')
@@ -300,7 +300,7 @@ class SharedTempStoreTest extends UnitTestCase {
*
* @covers ::delete
*/
- public function testDeleteWithNoLockAvailable() {
+ public function testDeleteWithNoLockAvailable(): void {
$this->lock->expects($this->exactly(2))
->method('acquire')
->with('test')
@@ -321,7 +321,7 @@ class SharedTempStoreTest extends UnitTestCase {
*
* @covers ::deleteIfOwner
*/
- public function testDeleteIfOwner() {
+ public function testDeleteIfOwner(): void {
$this->lock->expects($this->once())
->method('acquire')
->with('test_2')
@@ -350,7 +350,7 @@ class SharedTempStoreTest extends UnitTestCase {
/**
* Tests the serialization of a shared temp store.
*/
- public function testSerialization() {
+ public function testSerialization(): void {
// Add an unserializable request to the request stack. If the tempstore
// didn't use DependencySerializationTrait, an exception would be thrown
// when we try to serialize the tempstore.
diff --git a/core/tests/Drupal/Tests/Core/Template/AttributeHelperTest.php b/core/tests/Drupal/Tests/Core/Template/AttributeHelperTest.php
index 4590a145b44..6de70227fa5 100644
--- a/core/tests/Drupal/Tests/Core/Template/AttributeHelperTest.php
+++ b/core/tests/Drupal/Tests/Core/Template/AttributeHelperTest.php
@@ -35,7 +35,7 @@ class AttributeHelperTest extends UnitTestCase {
* @covers ::attributeExists
* @dataProvider providerTestAttributeExists
*/
- public function testAttributeExists(array $test_data, $test_attribute, $expected) {
+ public function testAttributeExists(array $test_data, $test_attribute, $expected): void {
$this->assertSame($expected, AttributeHelper::attributeExists($test_attribute, $test_data));
$attributes = new Attribute($test_data);
$this->assertSame($expected, AttributeHelper::attributeExists($test_attribute, $attributes));
@@ -63,7 +63,7 @@ class AttributeHelperTest extends UnitTestCase {
* @covers ::mergeCollections
* @dataProvider providerTestMergeCollections
*/
- public function testMergeCollections($original, $merge, $expected) {
+ public function testMergeCollections($original, $merge, $expected): void {
$this->assertEquals($expected, AttributeHelper::mergeCollections($original, $merge));
$this->assertEquals(new Attribute($expected), AttributeHelper::mergeCollections(new Attribute($original), $merge));
}
@@ -71,7 +71,7 @@ class AttributeHelperTest extends UnitTestCase {
/**
* @covers ::mergeCollections
*/
- public function testMergeCollectionsArgumentException() {
+ public function testMergeCollectionsArgumentException(): void {
$attributes = new Attribute(['class' => ['example-class']]);
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid collection argument');
diff --git a/core/tests/Drupal/Tests/Core/Template/AttributeTest.php b/core/tests/Drupal/Tests/Core/Template/AttributeTest.php
index 4b708c23948..f76bc92c757 100644
--- a/core/tests/Drupal/Tests/Core/Template/AttributeTest.php
+++ b/core/tests/Drupal/Tests/Core/Template/AttributeTest.php
@@ -23,7 +23,7 @@ class AttributeTest extends UnitTestCase {
/**
* Tests the constructor of the attribute class.
*/
- public function testConstructor() {
+ public function testConstructor(): void {
$attribute = new Attribute(['class' => ['example-class']]);
$this->assertTrue(isset($attribute['class']));
$this->assertEquals(new AttributeArray('class', ['example-class']), $attribute['class']);
@@ -49,7 +49,7 @@ class AttributeTest extends UnitTestCase {
/**
* Tests set of values.
*/
- public function testSet() {
+ public function testSet(): void {
$attribute = new Attribute();
$attribute['class'] = ['example-class'];
@@ -60,7 +60,7 @@ class AttributeTest extends UnitTestCase {
/**
* Tests adding new values to an existing part of the attribute.
*/
- public function testAdd() {
+ public function testAdd(): void {
$attribute = new Attribute(['class' => ['example-class']]);
$attribute['class'][] = 'other-class';
@@ -70,7 +70,7 @@ class AttributeTest extends UnitTestCase {
/**
* Tests removing of values.
*/
- public function testRemove() {
+ public function testRemove(): void {
$attribute = new Attribute(['class' => ['example-class']]);
unset($attribute['class']);
$this->assertFalse(isset($attribute['class']));
@@ -80,7 +80,7 @@ class AttributeTest extends UnitTestCase {
* Tests setting attributes.
* @covers ::setAttribute
*/
- public function testSetAttribute() {
+ public function testSetAttribute(): void {
$attribute = new Attribute();
// Test adding various attributes.
@@ -108,7 +108,7 @@ class AttributeTest extends UnitTestCase {
* Tests removing attributes.
* @covers ::removeAttribute
*/
- public function testRemoveAttribute() {
+ public function testRemoveAttribute(): void {
$attributes = [
'alt' => 'Alternative text',
'id' => 'bunny',
@@ -147,7 +147,7 @@ class AttributeTest extends UnitTestCase {
* Tests adding class attributes with the AttributeArray helper method.
* @covers ::addClass
*/
- public function testAddClasses() {
+ public function testAddClasses(): void {
// Add empty Attribute object with no classes.
$attribute = new Attribute();
@@ -199,7 +199,7 @@ class AttributeTest extends UnitTestCase {
* Tests removing class attributes with the AttributeArray helper method.
* @covers ::removeClass
*/
- public function testRemoveClasses() {
+ public function testRemoveClasses(): void {
// Add duplicate class to ensure that both duplicates are removed.
$classes = ['example-class', 'aa', 'xx', 'yy', 'red', 'green', 'blue', 'red'];
$attribute = new Attribute(['class' => $classes]);
@@ -230,7 +230,7 @@ class AttributeTest extends UnitTestCase {
* Tests checking for class names with the Attribute method.
* @covers ::hasClass
*/
- public function testHasClass() {
+ public function testHasClass(): void {
// Test an attribute without any classes.
$attribute = new Attribute();
$this->assertFalse($attribute->hasClass('a-class-nowhere-to-be-found'));
@@ -246,7 +246,7 @@ class AttributeTest extends UnitTestCase {
* @covers ::removeClass
* @covers ::addClass
*/
- public function testChainAddRemoveClasses() {
+ public function testChainAddRemoveClasses(): void {
$attribute = new Attribute(
['class' => ['example-class', 'red', 'green', 'blue']]
);
@@ -266,7 +266,7 @@ class AttributeTest extends UnitTestCase {
* @covers ::removeClass
* @covers ::addClass
*/
- public function testTwigAddRemoveClasses($template, $expected, $seed_attributes = []) {
+ public function testTwigAddRemoveClasses($template, $expected, $seed_attributes = []): void {
$loader = new StringLoader();
$twig = new Environment($loader);
$data = ['attributes' => new Attribute($seed_attributes)];
@@ -322,7 +322,7 @@ class AttributeTest extends UnitTestCase {
/**
* Tests iterating on the values of the attribute.
*/
- public function testIterate() {
+ public function testIterate(): void {
$attribute = new Attribute(['class' => ['example-class'], 'id' => 'example-id']);
$counter = 0;
@@ -342,7 +342,7 @@ class AttributeTest extends UnitTestCase {
/**
* Tests printing of an attribute.
*/
- public function testPrint() {
+ public function testPrint(): void {
$attribute = new Attribute(['class' => ['example-class'], 'id' => 'example-id', 'enabled' => TRUE]);
$content = $this->randomMachineName();
@@ -360,7 +360,7 @@ class AttributeTest extends UnitTestCase {
* @covers ::createAttributeValue
* @dataProvider providerTestAttributeValues
*/
- public function testAttributeValues(array $attributes, $expected) {
+ public function testAttributeValues(array $attributes, $expected): void {
$this->assertEquals($expected, (new Attribute($attributes))->__toString());
}
@@ -458,7 +458,7 @@ class AttributeTest extends UnitTestCase {
/**
* Tests the storage method.
*/
- public function testStorage() {
+ public function testStorage(): void {
$attribute = new Attribute(['class' => ['example-class']]);
$this->assertEquals(['class' => new AttributeArray('class', ['example-class'])], $attribute->storage());
@@ -485,7 +485,7 @@ class AttributeTest extends UnitTestCase {
* @covers ::hasAttribute
* @dataProvider providerTestHasAttribute
*/
- public function testHasAttribute(array $test_data, $test_attribute, $expected) {
+ public function testHasAttribute(array $test_data, $test_attribute, $expected): void {
$attributes = new Attribute($test_data);
$this->assertSame($expected, $attributes->hasAttribute($test_attribute));
}
@@ -509,14 +509,14 @@ class AttributeTest extends UnitTestCase {
* @covers ::merge
* @dataProvider providerTestMerge
*/
- public function testMerge($original, $merge, $expected) {
+ public function testMerge($original, $merge, $expected): void {
$this->assertEquals($expected, $original->merge($merge));
}
/**
* @covers ::merge
*/
- public function testMergeArgumentException() {
+ public function testMergeArgumentException(): void {
$attributes = new Attribute(['class' => ['example-class']]);
$this->expectException(\TypeError::class);
$attributes->merge('not an array');
diff --git a/core/tests/Drupal/Tests/Core/Template/Loader/ThemeRegistryLoaderTest.php b/core/tests/Drupal/Tests/Core/Template/Loader/ThemeRegistryLoaderTest.php
index 861d1d4c0fe..bd7cfe96638 100644
--- a/core/tests/Drupal/Tests/Core/Template/Loader/ThemeRegistryLoaderTest.php
+++ b/core/tests/Drupal/Tests/Core/Template/Loader/ThemeRegistryLoaderTest.php
@@ -16,7 +16,7 @@ class ThemeRegistryLoaderTest extends UnitTestCase {
/**
* @covers ::findTemplate
*/
- public function testLoaderReturnsFalseForExistsOnNonexistent() {
+ public function testLoaderReturnsFalseForExistsOnNonexistent(): void {
$registry = $this->prophesize('Drupal\Core\Theme\Registry');
$runtime = $this->prophesize('Drupal\Core\Utility\ThemeRegistry');
$runtime->has('foo')
diff --git a/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php b/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php
index cfa4c6ba001..e89c0c12fc7 100644
--- a/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php
+++ b/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php
@@ -96,7 +96,7 @@ class TwigExtensionTest extends UnitTestCase {
*
* @dataProvider providerTestEscaping
*/
- public function testEscaping($template, $expected) {
+ public function testEscaping($template, $expected): void {
$loader = new FilesystemLoader();
$twig = new Environment($loader, [
'debug' => TRUE,
@@ -148,7 +148,7 @@ class TwigExtensionTest extends UnitTestCase {
/**
* Tests the active_theme function.
*/
- public function testActiveTheme() {
+ public function testActiveTheme(): void {
$active_theme = $this->getMockBuilder('\Drupal\Core\Theme\ActiveTheme')
->disableOriginalConstructor()
->getMock();
@@ -169,7 +169,7 @@ class TwigExtensionTest extends UnitTestCase {
/**
* Tests the format_date filter.
*/
- public function testFormatDate() {
+ public function testFormatDate(): void {
$this->dateFormatter->expects($this->exactly(1))
->method('format')
->willReturnCallback(function ($timestamp) {
@@ -187,7 +187,7 @@ class TwigExtensionTest extends UnitTestCase {
/**
* Tests the file_url filter.
*/
- public function testFileUrl() {
+ public function testFileUrl(): void {
$this->fileUrlGenerator->expects($this->once())
->method('generateString')
->with('public://picture.jpg')
@@ -203,7 +203,7 @@ class TwigExtensionTest extends UnitTestCase {
/**
* Tests the active_theme_path function.
*/
- public function testActiveThemePath() {
+ public function testActiveThemePath(): void {
$active_theme = $this->getMockBuilder('\Drupal\Core\Theme\ActiveTheme')
->disableOriginalConstructor()
->getMock();
@@ -227,7 +227,7 @@ class TwigExtensionTest extends UnitTestCase {
*
* @covers ::escapeFilter
*/
- public function testSafeStringEscaping() {
+ public function testSafeStringEscaping(): void {
$loader = new FilesystemLoader();
$twig = new Environment($loader, [
'debug' => TRUE,
@@ -249,7 +249,7 @@ class TwigExtensionTest extends UnitTestCase {
/**
* @covers ::safeJoin
*/
- public function testSafeJoin() {
+ public function testSafeJoin(): void {
$this->renderer->expects($this->any())
->method('render')
->with(['#markup' => '<strong>will be rendered</strong>', '#printed' => FALSE])
@@ -288,7 +288,7 @@ class TwigExtensionTest extends UnitTestCase {
/**
* @dataProvider providerTestRenderVar
*/
- public function testRenderVar($result, $input) {
+ public function testRenderVar($result, $input): void {
$this->renderer->expects($this->any())
->method('render')
->with($result += ['#printed' => FALSE])
@@ -312,7 +312,7 @@ class TwigExtensionTest extends UnitTestCase {
* @covers ::escapeFilter
* @covers ::bubbleArgMetadata
*/
- public function testEscapeWithGeneratedLink() {
+ public function testEscapeWithGeneratedLink(): void {
$loader = new FilesystemLoader();
$twig = new Environment($loader, [
'debug' => TRUE,
@@ -345,7 +345,7 @@ class TwigExtensionTest extends UnitTestCase {
* @covers ::renderVar
* @covers ::bubbleArgMetadata
*/
- public function testRenderVarWithGeneratedLink() {
+ public function testRenderVarWithGeneratedLink(): void {
$link = new GeneratedLink();
$link->setGeneratedLink('<a href="http://example.com"></a>');
$link->addCacheTags(['foo']);
@@ -369,7 +369,7 @@ class TwigExtensionTest extends UnitTestCase {
* @covers ::renderVar
* @dataProvider providerTestRenderVarEarlyReturn
*/
- public function testRenderVarEarlyReturn($expected, $input) {
+ public function testRenderVarEarlyReturn($expected, $input): void {
$result = $this->systemUnderTest->renderVar($input);
$this->assertSame($expected, $result);
}
@@ -397,7 +397,7 @@ class TwigExtensionTest extends UnitTestCase {
*
* @covers ::createAttribute
*/
- public function testCreateAttribute() {
+ public function testCreateAttribute(): void {
$name = '__string_template_test_1__';
$loader = new ArrayLoader([$name => "{% for iteration in iterations %}<div{{ create_attribute(iteration) }}></div>{% endfor %}"]);
$twig = new Environment($loader);
@@ -425,7 +425,7 @@ class TwigExtensionTest extends UnitTestCase {
/**
* @covers ::getLink
*/
- public function testLinkWithOverriddenAttributes() {
+ public function testLinkWithOverriddenAttributes(): void {
$url = Url::fromRoute('<front>', [], ['attributes' => ['class' => ['foo']]]);
$build = $this->systemUnderTest->getLink('test', $url, ['class' => ['bar']]);
@@ -439,7 +439,7 @@ class TwigExtensionTest extends UnitTestCase {
* @covers ::suggestThemeHook
* @dataProvider providerTestTwigAddSuggestionFilter
*/
- public function testTwigAddSuggestionFilter($original_render_array, $suggestion, $expected_render_array) {
+ public function testTwigAddSuggestionFilter($original_render_array, $suggestion, $expected_render_array): void {
$processed_render_array = $this->systemUnderTest->suggestThemeHook($original_render_array, $suggestion);
$this->assertEquals($expected_render_array, $processed_render_array);
}
@@ -555,7 +555,7 @@ class TwigExtensionTest extends UnitTestCase {
* @covers ::addClass
* @dataProvider providerTestTwigAddClass
*/
- public function testTwigAddClass($element, $classes, $expected_result) {
+ public function testTwigAddClass($element, $classes, $expected_result): void {
$processed = $this->systemUnderTest->addClass($element, $classes);
$this->assertEquals($expected_result, $processed);
}
@@ -605,7 +605,7 @@ class TwigExtensionTest extends UnitTestCase {
* @covers ::setAttribute
* @dataProvider providerTestTwigSetAttribute
*/
- public function testTwigSetAttribute($element, $key, $value, $expected_result) {
+ public function testTwigSetAttribute($element, $key, $value, $expected_result): void {
$processed = $this->systemUnderTest->setAttribute($element, $key, $value);
$this->assertEquals($expected_result, $processed);
}
diff --git a/core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php b/core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php
index 82400aab7c5..9af863dcc85 100644
--- a/core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php
+++ b/core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php
@@ -47,7 +47,7 @@ class TwigSandboxTest extends UnitTestCase {
*
* @dataProvider getTwigEntityDangerousMethods
*/
- public function testEntityDangerousMethods($template) {
+ public function testEntityDangerousMethods($template): void {
$entity = $this->createMock('Drupal\Core\Entity\EntityInterface');
$this->expectException(SecurityError::class);
$this->twig->render($template, ['entity' => $entity]);
@@ -69,7 +69,7 @@ class TwigSandboxTest extends UnitTestCase {
/**
* Tests that white listed classes can be extended.
*/
- public function testExtendedClass() {
+ public function testExtendedClass(): void {
$this->assertEquals(' class=&quot;kitten&quot;', $this->twig->render('{{ attribute.addClass("kitten") }}', ['attribute' => new TestAttribute()]));
}
@@ -78,7 +78,7 @@ class TwigSandboxTest extends UnitTestCase {
*
* Currently "get", "has", and "is" are the only allowed prefixes.
*/
- public function testEntitySafePrefixes() {
+ public function testEntitySafePrefixes(): void {
$entity = $this->createMock('Drupal\Core\Entity\EntityInterface');
$entity->expects($this->atLeastOnce())
->method('hasLinkTemplate')
@@ -108,7 +108,7 @@ class TwigSandboxTest extends UnitTestCase {
* Currently the following methods are whitelisted: id, label, bundle, and
* get.
*/
- public function testEntitySafeMethods() {
+ public function testEntitySafeMethods(): void {
$entity = $this->getMockBuilder(ContentEntityBaseMockableClass::class)
->disableOriginalConstructor()
->getMock();
@@ -144,7 +144,7 @@ class TwigSandboxTest extends UnitTestCase {
/**
* Tests that safe methods inside Url objects can be called.
*/
- public function testUrlSafeMethods() {
+ public function testUrlSafeMethods(): void {
$url = $this->getMockBuilder('Drupal\Core\Url')
->disableOriginalConstructor()
->getMock();
diff --git a/core/tests/Drupal/Tests/Core/Test/AssertContentTraitTest.php b/core/tests/Drupal/Tests/Core/Test/AssertContentTraitTest.php
index 2b388facd23..9951d3970aa 100644
--- a/core/tests/Drupal/Tests/Core/Test/AssertContentTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/AssertContentTraitTest.php
@@ -18,7 +18,7 @@ class AssertContentTraitTest extends UnitTestCase {
/**
* @covers ::getTextContent
*/
- public function testGetTextContent() {
+ public function testGetTextContent(): void {
$raw_content = <<<EOT
diff --git a/core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php b/core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php
index ad8e2eeba54..43ff47406ec 100644
--- a/core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php
@@ -39,7 +39,7 @@ class BrowserTestBaseTest extends UnitTestCase {
/**
* @covers ::getHttpClient
*/
- public function testGetHttpClient() {
+ public function testGetHttpClient(): void {
// Our stand-in for the Guzzle client object.
$expected = new \stdClass();
@@ -62,7 +62,7 @@ class BrowserTestBaseTest extends UnitTestCase {
/**
* @covers ::getHttpClient
*/
- public function testGetHttpClientException() {
+ public function testGetHttpClientException(): void {
// A driver type that isn't BrowserKitDriver. This should cause a
// RuntimeException.
$btb = $this->mockBrowserTestBaseWithDriver(new \stdClass());
@@ -79,7 +79,7 @@ class BrowserTestBaseTest extends UnitTestCase {
*
* @covers ::tearDown
*/
- public function testTearDownWithoutSetUp() {
+ public function testTearDownWithoutSetUp(): void {
$method = 'cleanupEnvironment';
$this->assertTrue(method_exists(BrowserTestBase::class, $method));
$btb = $this->getMockBuilder(BrowserTestBaseMockableClass::class)
diff --git a/core/tests/Drupal/Tests/Core/Test/JUnitConverterTest.php b/core/tests/Drupal/Tests/Core/Test/JUnitConverterTest.php
index 2eaebb14c5b..49599b0e4ae 100644
--- a/core/tests/Drupal/Tests/Core/Test/JUnitConverterTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/JUnitConverterTest.php
@@ -27,7 +27,7 @@ class JUnitConverterTest extends UnitTestCase {
* Tests errors reported.
* @covers ::xmlToRows
*/
- public function testXmlToRowsWithErrors() {
+ public function testXmlToRowsWithErrors(): void {
$phpunit_error_xml = __DIR__ . '/fixtures/phpunit_error.xml';
$res = JUnitConverter::xmlToRows(1, $phpunit_error_xml);
@@ -48,7 +48,7 @@ class JUnitConverterTest extends UnitTestCase {
/**
* @covers ::xmlToRows
*/
- public function testXmlToRowsEmptyFile() {
+ public function testXmlToRowsEmptyFile(): void {
// File system with an empty XML file.
vfsStream::setup('junit_test', NULL, ['empty.xml' => '']);
$this->assertSame([], JUnitConverter::xmlToRows(23, vfsStream::url('junit_test/empty.xml')));
@@ -57,7 +57,7 @@ class JUnitConverterTest extends UnitTestCase {
/**
* @covers ::xmlElementToRows
*/
- public function testXmlElementToRows() {
+ public function testXmlElementToRows(): void {
$junit = <<<EOD
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
@@ -84,7 +84,7 @@ EOD;
/**
* @covers ::convertTestCaseToSimpletestRow
*/
- public function testConvertTestCaseToSimpletestRow() {
+ public function testConvertTestCaseToSimpletestRow(): void {
$junit = <<<EOD
<testcase name="testGetTestClasses" class="Drupal\Tests\simpletest\Unit\TestDiscoveryTest" classname="Drupal.Tests.simpletest.Unit.TestDiscoveryTest" file="/Users/paul/projects/drupal/core/modules/simpletest/tests/src/Unit/TestDiscoveryTest.php" line="108" assertions="2" time="0.100787"/>
EOD;
diff --git a/core/tests/Drupal/Tests/Core/Test/PhpUnitAutoloaderTest.php b/core/tests/Drupal/Tests/Core/Test/PhpUnitAutoloaderTest.php
index 1620a8970c0..98322cfcfb5 100644
--- a/core/tests/Drupal/Tests/Core/Test/PhpUnitAutoloaderTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/PhpUnitAutoloaderTest.php
@@ -16,7 +16,7 @@ class PhpUnitAutoloaderTest extends UnitTestCase {
/**
* Tests loading of classes provided by test sub modules.
*/
- public function testPhpUnitTestClassesLoading() {
+ public function testPhpUnitTestClassesLoading(): void {
$this->assertTrue(class_exists('\Drupal\phpunit_test\PhpUnitTestDummyClass'), 'Class provided by test module was not autoloaded.');
}
diff --git a/core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeIsolatedTest.php b/core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeIsolatedTest.php
index 92fa96d2a16..f62d39d185e 100644
--- a/core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeIsolatedTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeIsolatedTest.php
@@ -18,7 +18,7 @@ use Drupal\deprecation_test\Deprecation\FixtureDeprecatedClass;
*/
class PhpUnitBridgeIsolatedTest extends UnitTestCase {
- public function testDeprecatedClass() {
+ public function testDeprecatedClass(): void {
$this->expectDeprecation('Drupal\deprecation_test\Deprecation\FixtureDeprecatedClass is deprecated.');
$deprecated = new FixtureDeprecatedClass();
$this->assertEquals('test', $deprecated->testFunction());
diff --git a/core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeTest.php b/core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeTest.php
index 79420875f4e..d964a2f42be 100644
--- a/core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeTest.php
@@ -18,13 +18,13 @@ class PhpUnitBridgeTest extends UnitTestCase {
/**
* Tests class-level deprecation.
*/
- public function testDeprecatedClass() {
+ public function testDeprecatedClass(): void {
$this->expectDeprecation('Drupal\deprecation_test\Deprecation\FixtureDeprecatedClass is deprecated.');
$deprecated = new FixtureDeprecatedClass();
$this->assertEquals('test', $deprecated->testFunction());
}
- public function testDeprecatedFunction() {
+ public function testDeprecatedFunction(): void {
$this->markTestIncomplete('Modules are not loaded for unit tests, so deprecated_test_function() will not be available.');
$this->assertEquals('known_return_value', \deprecation_test_function());
}
diff --git a/core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php b/core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php
index 926a7cdedc5..5ec76e7820f 100644
--- a/core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php
@@ -22,7 +22,7 @@ class PhpUnitCliTest extends UnitTestCase {
* us from committing tests which don't break under run-tests.sh, but do
* break under the PHPUnit CLI test runner tool.
*/
- public function testPhpUnitListTests() {
+ public function testPhpUnitListTests(): void {
$command = [
'vendor/bin/phpunit',
'--configuration',
diff --git a/core/tests/Drupal/Tests/Core/Test/PhpUnitTestRunnerTest.php b/core/tests/Drupal/Tests/Core/Test/PhpUnitTestRunnerTest.php
index c8dc2cd27b6..8047ece4fc4 100644
--- a/core/tests/Drupal/Tests/Core/Test/PhpUnitTestRunnerTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/PhpUnitTestRunnerTest.php
@@ -23,7 +23,7 @@ class PhpUnitTestRunnerTest extends UnitTestCase {
*
* @covers ::execute
*/
- public function testRunTestsError() {
+ public function testRunTestsError(): void {
$test_id = 23;
$log_path = 'test_log_path';
@@ -86,7 +86,7 @@ class PhpUnitTestRunnerTest extends UnitTestCase {
/**
* @covers ::phpUnitCommand
*/
- public function testPhpUnitCommand() {
+ public function testPhpUnitCommand(): void {
$runner = new PhpUnitTestRunner($this->root, sys_get_temp_dir());
$this->assertMatchesRegularExpression('/phpunit/', $runner->phpUnitCommand());
}
@@ -94,7 +94,7 @@ class PhpUnitTestRunnerTest extends UnitTestCase {
/**
* @covers ::xmlLogFilePath
*/
- public function testXmlLogFilePath() {
+ public function testXmlLogFilePath(): void {
$runner = new PhpUnitTestRunner($this->root, sys_get_temp_dir());
$this->assertStringEndsWith('phpunit-23.xml', $runner->xmlLogFilePath(23));
}
@@ -144,7 +144,7 @@ class PhpUnitTestRunnerTest extends UnitTestCase {
* @dataProvider providerTestSummarizeResults
* @covers ::summarizeResults
*/
- public function testSummarizeResults($results, $has_status) {
+ public function testSummarizeResults($results, $has_status): void {
$runner = new PhpUnitTestRunner($this->root, sys_get_temp_dir());
$summary = $runner->summarizeResults($results);
diff --git a/core/tests/Drupal/Tests/Core/Test/RunTests/TestFileParserTest.php b/core/tests/Drupal/Tests/Core/Test/RunTests/TestFileParserTest.php
index dbcb853143d..957b2f61f97 100644
--- a/core/tests/Drupal/Tests/Core/Test/RunTests/TestFileParserTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/RunTests/TestFileParserTest.php
@@ -69,7 +69,7 @@ COMPOUND
* @covers ::parseContents
* @dataProvider provideTestFileContents
*/
- public function testParseContents($expected, $contents) {
+ public function testParseContents($expected, $contents): void {
$parser = new TestFileParser();
$ref_parse = new \ReflectionMethod($parser, 'parseContents');
@@ -80,7 +80,7 @@ COMPOUND
/**
* @covers ::getTestListFromFile
*/
- public function testGetTestListFromFile() {
+ public function testGetTestListFromFile(): void {
$parser = new TestFileParser();
$this->assertEquals(
['Drupal\Tests\Core\Test\RunTests\TestFileParserTest'],
diff --git a/core/tests/Drupal/Tests/Core/Test/TestDatabaseTest.php b/core/tests/Drupal/Tests/Core/Test/TestDatabaseTest.php
index a96d79e38a6..1660ac381ed 100644
--- a/core/tests/Drupal/Tests/Core/Test/TestDatabaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/TestDatabaseTest.php
@@ -19,7 +19,7 @@ class TestDatabaseTest extends UnitTestCase {
/**
* @covers ::__construct
*/
- public function testConstructorException() {
+ public function testConstructorException(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("Invalid database prefix: blah1253");
new TestDatabase('blah1253');
@@ -33,7 +33,7 @@ class TestDatabaseTest extends UnitTestCase {
*
* @dataProvider providerTestConstructor
*/
- public function testConstructor($db_prefix, $expected_db_prefix, $expected_site_path) {
+ public function testConstructor($db_prefix, $expected_db_prefix, $expected_site_path): void {
$test_db = new TestDatabase($db_prefix);
$this->assertEquals($expected_db_prefix, $test_db->getDatabasePrefix());
$this->assertEquals($expected_site_path, $test_db->getTestSitePath());
@@ -58,7 +58,7 @@ class TestDatabaseTest extends UnitTestCase {
* @covers ::getTestSitePath
* @covers ::getPhpErrorLogPath
*/
- public function testConstructorNullPrefix() {
+ public function testConstructorNullPrefix(): void {
// We use a stub class here because we can't mock getTestLock() so that it's
// available before the constructor is called.
$test_db = new TestTestDatabase(NULL);
diff --git a/core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php b/core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php
index 9b9053c3ba8..c747e896eee 100644
--- a/core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/TestDiscoveryTest.php
@@ -24,7 +24,7 @@ class TestDiscoveryTest extends UnitTestCase {
* @covers ::getTestInfo
* @dataProvider infoParserProvider
*/
- public function testTestInfoParser($expected, $classname, $doc_comment = NULL) {
+ public function testTestInfoParser($expected, $classname, $doc_comment = NULL): void {
$info = TestDiscovery::getTestInfo($classname, $doc_comment);
$this->assertEquals($expected, $info);
}
@@ -205,7 +205,7 @@ class TestDiscoveryTest extends UnitTestCase {
/**
* @covers ::getTestInfo
*/
- public function testTestInfoParserMissingGroup() {
+ public function testTestInfoParserMissingGroup(): void {
$classname = 'Drupal\KernelTests\field\BulkDeleteTest';
$doc_comment = <<<EOT
/**
@@ -220,7 +220,7 @@ EOT;
/**
* @covers ::getTestInfo
*/
- public function testTestInfoParserMissingSummary() {
+ public function testTestInfoParserMissingSummary(): void {
$classname = 'Drupal\KernelTests\field\BulkDeleteTest';
$doc_comment = <<<EOT
/**
@@ -299,7 +299,7 @@ EOF;
/**
* @covers ::getTestClasses
*/
- public function testGetTestClasses() {
+ public function testGetTestClasses(): void {
$this->setupVfsWithTestClasses();
$extensions = [
'test_module' => new Extension('vfs://drupal', 'module', 'modules/test_module/test_module.info.yml'),
@@ -368,7 +368,7 @@ EOF;
/**
* @covers ::getTestClasses
*/
- public function testGetTestClassesWithSelectedTypes() {
+ public function testGetTestClassesWithSelectedTypes(): void {
$this->setupVfsWithTestClasses();
$extensions = [
'test_module' => new Extension('vfs://drupal', 'module', 'modules/test_module/test_module.info.yml'),
@@ -413,7 +413,7 @@ EOF;
/**
* @covers ::getTestClasses
*/
- public function testGetTestsInProfiles() {
+ public function testGetTestsInProfiles(): void {
$this->setupVfsWithTestClasses();
$class_loader = $this->prophesize(ClassLoader::class);
@@ -443,7 +443,7 @@ EOF;
* @covers ::getPhpunitTestSuite
* @dataProvider providerTestGetPhpunitTestSuite
*/
- public function testGetPhpunitTestSuite($classname, $expected) {
+ public function testGetPhpunitTestSuite($classname, $expected): void {
$this->assertEquals($expected, TestDiscovery::getPhpunitTestSuite($classname));
}
@@ -470,7 +470,7 @@ EOF;
*
* @covers ::getTestInfo
*/
- public function testGetTestInfoEmptyDocblock() {
+ public function testGetTestInfoEmptyDocblock(): void {
// If getTestInfo() performed reflection, it won't be able to find the
// class we asked it to analyze, so it will throw a ReflectionException.
// We want to make sure it didn't do that, because we already did some
@@ -485,7 +485,7 @@ EOF;
*
* @covers ::scanDirectory
*/
- public function testScanDirectoryNoAbstract() {
+ public function testScanDirectoryNoAbstract(): void {
$this->setupVfsWithTestClasses();
$files = TestDiscovery::scanDirectory('Drupal\\Tests\\test_module\\Kernel\\', vfsStream::url('drupal/modules/test_module/tests/src/Kernel'));
$this->assertNotEmpty($files);
diff --git a/core/tests/Drupal/Tests/Core/Test/TestSetupTraitTest.php b/core/tests/Drupal/Tests/Core/Test/TestSetupTraitTest.php
index b6f74c017f4..ba1d28a50c6 100644
--- a/core/tests/Drupal/Tests/Core/Test/TestSetupTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/TestSetupTraitTest.php
@@ -26,7 +26,7 @@ class TestSetupTraitTest extends UnitTestCase {
*
* @covers ::changeDatabasePrefix
*/
- public function testChangeDatabasePrefix() {
+ public function testChangeDatabasePrefix(): void {
$root = dirname(__FILE__, 7);
putenv('SIMPLETEST_DB=pgsql://user:pass@127.0.0.1/db');
$connection_info = Database::convertDbUrlToConnectionInfo('mysql://user:pass@localhost/db', $root);
diff --git a/core/tests/Drupal/Tests/Core/Test/TestSuiteBaseTest.php b/core/tests/Drupal/Tests/Core/Test/TestSuiteBaseTest.php
index 13fdffbb790..db4ccefa9cb 100644
--- a/core/tests/Drupal/Tests/Core/Test/TestSuiteBaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/TestSuiteBaseTest.php
@@ -14,7 +14,7 @@ class TestSuiteBaseTest extends TestCase {
/**
* Tests the assumption that local time is in 'Australia/Sydney'.
*/
- public function testLocalTimeZone() {
+ public function testLocalTimeZone(): void {
// The 'Australia/Sydney' time zone is set in core/tests/bootstrap.php
$this->assertEquals('Australia/Sydney', date_default_timezone_get());
}
diff --git a/core/tests/Drupal/Tests/Core/Theme/AjaxBasePageNegotiatorTest.php b/core/tests/Drupal/Tests/Core/Theme/AjaxBasePageNegotiatorTest.php
index 612dbb10797..4d38efb908d 100644
--- a/core/tests/Drupal/Tests/Core/Theme/AjaxBasePageNegotiatorTest.php
+++ b/core/tests/Drupal/Tests/Core/Theme/AjaxBasePageNegotiatorTest.php
@@ -56,7 +56,7 @@ class AjaxBasePageNegotiatorTest extends UnitTestCase {
* @covers ::applies
* @dataProvider providerTestApplies
*/
- public function testApplies($request_data, $expected) {
+ public function testApplies($request_data, $expected): void {
$request = new Request();
foreach ($request_data as $key => $data) {
$request->query->set($key, $data);
@@ -80,7 +80,7 @@ class AjaxBasePageNegotiatorTest extends UnitTestCase {
/**
* @covers ::determineActiveTheme
*/
- public function testDetermineActiveThemeValidToken() {
+ public function testDetermineActiveThemeValidToken(): void {
$theme = 'claro';
$theme_token = 'valid_theme_token';
@@ -98,7 +98,7 @@ class AjaxBasePageNegotiatorTest extends UnitTestCase {
/**
* @covers ::determineActiveTheme
*/
- public function testDetermineActiveThemeInvalidToken() {
+ public function testDetermineActiveThemeInvalidToken(): void {
$theme = 'claro';
$theme_token = 'invalid_theme_token';
$request = new Request();
@@ -116,7 +116,7 @@ class AjaxBasePageNegotiatorTest extends UnitTestCase {
/**
* @covers ::determineActiveTheme
*/
- public function testDetermineActiveThemeDefaultTheme() {
+ public function testDetermineActiveThemeDefaultTheme(): void {
$theme = 'stark';
// When the theme is the system default, an empty string is provided as the
// theme token. See system_js_settings_alter().
diff --git a/core/tests/Drupal/Tests/Core/Theme/Component/ComponentMetadataTest.php b/core/tests/Drupal/Tests/Core/Theme/Component/ComponentMetadataTest.php
index 8eec15748d4..4e0555eb2ae 100644
--- a/core/tests/Drupal/Tests/Core/Theme/Component/ComponentMetadataTest.php
+++ b/core/tests/Drupal/Tests/Core/Theme/Component/ComponentMetadataTest.php
@@ -21,7 +21,7 @@ class ComponentMetadataTest extends UnitTestCaseTest {
*
* @dataProvider dataProviderMetadata
*/
- public function testMetadata(array $metadata_info, array $expectations) {
+ public function testMetadata(array $metadata_info, array $expectations): void {
$metadata = new ComponentMetadata($metadata_info, 'foo/', FALSE);
$this->assertSame($expectations['path'], $metadata->path);
$this->assertSame($expectations['status'], $metadata->status);
@@ -34,7 +34,7 @@ class ComponentMetadataTest extends UnitTestCaseTest {
*
* @dataProvider dataProviderMetadata
*/
- public function testMetadataEnforceSchema(array $metadata_info, array $expectations, bool $missing_schema) {
+ public function testMetadataEnforceSchema(array $metadata_info, array $expectations, bool $missing_schema): void {
if ($missing_schema) {
$this->expectException(InvalidComponentException::class);
$this->expectExceptionMessage('The component "' . $metadata_info['id'] . '" does not provide schema information. Schema definitions are mandatory for components declared in modules. For components declared in themes, schema definitions are only mandatory if the "enforce_prop_schemas" key is set to "true" in the theme info file.');
diff --git a/core/tests/Drupal/Tests/Core/Theme/Component/ComponentPluginManagerTest.php b/core/tests/Drupal/Tests/Core/Theme/Component/ComponentPluginManagerTest.php
index f962d50de02..b36717f3a24 100644
--- a/core/tests/Drupal/Tests/Core/Theme/Component/ComponentPluginManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Theme/Component/ComponentPluginManagerTest.php
@@ -44,7 +44,7 @@ class ComponentPluginManagerTest extends ComponentKernelTestBase {
*
* And not from the enclosing directory.
*/
- public function testMismatchingFolderName() {
+ public function testMismatchingFolderName(): void {
$this->expectException(ComponentNotFoundException::class);
$this->manager->find('sdc_theme_test:mismatching-folder-name');
}
diff --git a/core/tests/Drupal/Tests/Core/Theme/CoreThemesAutoloadedForTests.php b/core/tests/Drupal/Tests/Core/Theme/CoreThemesAutoloadedForTests.php
index dbd6ee68851..b00a01663b4 100644
--- a/core/tests/Drupal/Tests/Core/Theme/CoreThemesAutoloadedForTests.php
+++ b/core/tests/Drupal/Tests/Core/Theme/CoreThemesAutoloadedForTests.php
@@ -17,7 +17,7 @@ class CoreThemesAutoloadedForTests extends UnitTestCase {
/**
* Confirms that core/themes is autoloaded for tests.
*/
- public function testCoreThemesAutoloadedForTests() {
+ public function testCoreThemesAutoloadedForTests(): void {
$this->assertTrue(class_exists(ClaroPreRender::class), 'core/themes (ClaroPreRender) is registered with the tests autoloader');
}
diff --git a/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php b/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php
index 7f6a63ab81b..a7f14c67bb5 100644
--- a/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php
+++ b/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php
@@ -123,7 +123,7 @@ class RegistryTest extends UnitTestCase {
/**
* Tests getting the theme registry defined by a module.
*/
- public function testGetRegistryForModule() {
+ public function testGetRegistryForModule(): void {
$test_theme = new ActiveTheme([
'name' => 'test_theme',
'path' => 'core/modules/system/tests/themes/test_theme/test_theme.info.yml',
@@ -205,7 +205,7 @@ class RegistryTest extends UnitTestCase {
* @param array $expected
* The expected results.
*/
- public function testPostProcessExtension($defined_functions, $hooks, $expected) {
+ public function testPostProcessExtension($defined_functions, $hooks, $expected): void {
static::$functions['user'] = $defined_functions;
$theme = $this->prophesize(ActiveTheme::class);
diff --git a/core/tests/Drupal/Tests/Core/Theme/ThemeNegotiatorTest.php b/core/tests/Drupal/Tests/Core/Theme/ThemeNegotiatorTest.php
index bda597a2b05..62ebf8d1ccb 100644
--- a/core/tests/Drupal/Tests/Core/Theme/ThemeNegotiatorTest.php
+++ b/core/tests/Drupal/Tests/Core/Theme/ThemeNegotiatorTest.php
@@ -62,7 +62,7 @@ class ThemeNegotiatorTest extends UnitTestCase {
*
* @see \Drupal\Core\Theme\ThemeNegotiator::determineActiveTheme()
*/
- public function testDetermineActiveTheme() {
+ public function testDetermineActiveTheme(): void {
$negotiator = $this->createMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
$negotiator->expects($this->once())
->method('determineActiveTheme')
@@ -90,7 +90,7 @@ class ThemeNegotiatorTest extends UnitTestCase {
*
* @see \Drupal\Core\Theme\ThemeNegotiator::determineActiveTheme()
*/
- public function testDetermineActiveThemeWithPriority() {
+ public function testDetermineActiveThemeWithPriority(): void {
$negotiators = [];
$negotiator = $this->createMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
@@ -130,7 +130,7 @@ class ThemeNegotiatorTest extends UnitTestCase {
*
* @see \Drupal\Core\Theme\ThemeNegotiator::determineActiveTheme()
*/
- public function testDetermineActiveThemeWithAccessCheck() {
+ public function testDetermineActiveThemeWithAccessCheck(): void {
$negotiators = [];
$negotiator = $this->createMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
@@ -175,7 +175,7 @@ class ThemeNegotiatorTest extends UnitTestCase {
*
* @see \Drupal\Core\Theme\ThemeNegotiatorInterface
*/
- public function testDetermineActiveThemeWithNotApplyingNegotiator() {
+ public function testDetermineActiveThemeWithNotApplyingNegotiator(): void {
$negotiators = [];
$negotiator = $this->createMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
diff --git a/core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php b/core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php
index b395c49ed9f..088e70325f4 100644
--- a/core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php
+++ b/core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php
@@ -32,7 +32,7 @@ class PhpTransliterationTest extends UnitTestCase {
*
* @dataProvider providerTestPhpTransliterationWithAlter
*/
- public function testPhpTransliterationWithAlter($langcode, $original, $expected, $printable = NULL) {
+ public function testPhpTransliterationWithAlter($langcode, $original, $expected, $printable = NULL): void {
if ($printable === NULL) {
$printable = $original;
}
diff --git a/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php b/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php
index c1a04940801..f43d9bcd7dc 100644
--- a/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php
@@ -94,7 +94,7 @@ class RecursiveContextualValidatorTest extends UnitTestCase {
*
* @covers ::validate
*/
- public function testValidateWithGroups() {
+ public function testValidateWithGroups(): void {
$this->expectException(\LogicException::class);
$this->recursiveValidator->validate('test', NULL, 'test group');
}
@@ -104,7 +104,7 @@ class RecursiveContextualValidatorTest extends UnitTestCase {
*
* @covers ::validate
*/
- public function testValidateWithoutTypedData() {
+ public function testValidateWithoutTypedData(): void {
$this->expectException(\InvalidArgumentException::class);
$this->recursiveValidator->validate('test');
}
@@ -112,7 +112,7 @@ class RecursiveContextualValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testBasicValidateWithoutConstraints() {
+ public function testBasicValidateWithoutConstraints(): void {
$typed_data = $this->typedDataManager->create(DataDefinition::create('string'));
$violations = $this->recursiveValidator->validate($typed_data);
$this->assertCount(0, $violations);
@@ -121,7 +121,7 @@ class RecursiveContextualValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testBasicValidateWithConstraint() {
+ public function testBasicValidateWithConstraint(): void {
$typed_data = $this->typedDataManager->create(
DataDefinition::create('string')
->addConstraint('Callback', [
@@ -141,7 +141,7 @@ class RecursiveContextualValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testBasicValidateWithMultipleConstraints() {
+ public function testBasicValidateWithMultipleConstraints(): void {
$options = [
'callback' => function ($value, ExecutionContextInterface $context) {
$context->addViolation('test violation');
@@ -159,7 +159,7 @@ class RecursiveContextualValidatorTest extends UnitTestCase {
/**
* @covers ::validate
*/
- public function testPropertiesValidateWithMultipleLevels() {
+ public function testPropertiesValidateWithMultipleLevels(): void {
$typed_data = $this->buildExampleTypedDataWithProperties();
@@ -227,7 +227,7 @@ class RecursiveContextualValidatorTest extends UnitTestCase {
/**
* @covers ::validateProperty
*/
- public function testValidatePropertyWithCustomGroup() {
+ public function testValidatePropertyWithCustomGroup(): void {
$tree = [
'value' => [],
'properties' => [
@@ -244,7 +244,7 @@ class RecursiveContextualValidatorTest extends UnitTestCase {
*
* @dataProvider providerTestValidatePropertyWithInvalidObjects
*/
- public function testValidatePropertyWithInvalidObjects($object) {
+ public function testValidatePropertyWithInvalidObjects($object): void {
$this->expectException(\InvalidArgumentException::class);
$this->recursiveValidator->validateProperty($object, 'key1', NULL);
}
@@ -263,7 +263,7 @@ class RecursiveContextualValidatorTest extends UnitTestCase {
/**
* @covers ::validateProperty
*/
- public function testValidateProperty() {
+ public function testValidateProperty(): void {
$typed_data = $this->buildExampleTypedDataWithProperties();
$violations = $this->recursiveValidator->validateProperty($typed_data, 'key_with_properties');
@@ -283,7 +283,7 @@ class RecursiveContextualValidatorTest extends UnitTestCase {
*
* @dataProvider providerTestValidatePropertyWithInvalidObjects
*/
- public function testValidatePropertyValueWithInvalidObjects($object) {
+ public function testValidatePropertyValueWithInvalidObjects($object): void {
$this->expectException(\InvalidArgumentException::class);
$this->recursiveValidator->validatePropertyValue($object, 'key1', [], NULL);
}
@@ -291,7 +291,7 @@ class RecursiveContextualValidatorTest extends UnitTestCase {
/**
* @covers ::validatePropertyValue
*/
- public function testValidatePropertyValue() {
+ public function testValidatePropertyValue(): void {
$typed_data = $this->buildExampleTypedDataWithProperties(['subkey1' => 'subvalue11', 'subkey2' => 'subvalue22']);
$violations = $this->recursiveValidator->validatePropertyValue($typed_data, 'key_with_properties', $typed_data->get('key_with_properties'));
diff --git a/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php b/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php
index 801d52de5ba..46fb739c7e1 100644
--- a/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php
+++ b/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php
@@ -69,7 +69,7 @@ class UnroutedUrlTest extends UnitTestCase {
*
* @dataProvider providerFromUri
*/
- public function testFromUri($uri, $is_external) {
+ public function testFromUri($uri, $is_external): void {
$url = Url::fromUri($uri);
$this->assertInstanceOf('Drupal\Core\Url', $url);
@@ -104,7 +104,7 @@ class UnroutedUrlTest extends UnitTestCase {
* @covers ::fromUri
* @dataProvider providerFromInvalidUri
*/
- public function testFromInvalidUri($uri) {
+ public function testFromInvalidUri($uri): void {
$this->expectException(\InvalidArgumentException::class);
$url = Url::fromUri($uri);
}
@@ -134,7 +134,7 @@ class UnroutedUrlTest extends UnitTestCase {
*
* @covers ::createFromRequest
*/
- public function testCreateFromRequest() {
+ public function testCreateFromRequest(): void {
$request = Request::create('/test-path');
$this->router->expects($this->once())
@@ -154,7 +154,7 @@ class UnroutedUrlTest extends UnitTestCase {
*
* @covers ::isExternal
*/
- public function testIsExternal($uri, $is_external) {
+ public function testIsExternal($uri, $is_external): void {
$url = Url::fromUri($uri);
$this->assertSame($url->isExternal(), $is_external);
}
@@ -167,7 +167,7 @@ class UnroutedUrlTest extends UnitTestCase {
*
* @covers ::toString
*/
- public function testToString($uri) {
+ public function testToString($uri): void {
$url = Url::fromUri($uri);
$this->assertSame($uri, $url->toString());
}
@@ -180,7 +180,7 @@ class UnroutedUrlTest extends UnitTestCase {
*
* @covers ::getRouteName
*/
- public function testGetRouteName($uri) {
+ public function testGetRouteName($uri): void {
$url = Url::fromUri($uri);
$this->expectException(\UnexpectedValueException::class);
$url->getRouteName();
@@ -194,7 +194,7 @@ class UnroutedUrlTest extends UnitTestCase {
*
* @covers ::getRouteParameters
*/
- public function testGetRouteParameters($uri) {
+ public function testGetRouteParameters($uri): void {
$url = Url::fromUri($uri);
$this->expectException(\UnexpectedValueException::class);
$url->getRouteParameters();
@@ -208,7 +208,7 @@ class UnroutedUrlTest extends UnitTestCase {
*
* @covers ::getInternalPath
*/
- public function testGetInternalPath($uri) {
+ public function testGetInternalPath($uri): void {
$url = Url::fromUri($uri);
$this->expectException(\Exception::class);
$url->getInternalPath();
@@ -222,7 +222,7 @@ class UnroutedUrlTest extends UnitTestCase {
*
* @covers ::getUri
*/
- public function testGetUri($uri) {
+ public function testGetUri($uri): void {
$url = Url::fromUri($uri);
$this->assertNotNull($url->getUri());
}
@@ -235,7 +235,7 @@ class UnroutedUrlTest extends UnitTestCase {
*
* @covers ::getOptions
*/
- public function testGetOptions($uri) {
+ public function testGetOptions($uri): void {
$url = Url::fromUri($uri);
$this->assertIsArray($url->getOptions());
}
diff --git a/core/tests/Drupal/Tests/Core/Update/UpdateHookRegistryTest.php b/core/tests/Drupal/Tests/Core/Update/UpdateHookRegistryTest.php
index a39e9f66aea..9ee418937da 100644
--- a/core/tests/Drupal/Tests/Core/Update/UpdateHookRegistryTest.php
+++ b/core/tests/Drupal/Tests/Core/Update/UpdateHookRegistryTest.php
@@ -90,7 +90,7 @@ class UpdateHookRegistryTest extends UnitTestCase {
/**
* @covers ::getAvailableUpdates
*/
- public function testGetVersions() {
+ public function testGetVersions(): void {
$module_name = 'drupal\tests\core\update\under_test';
$update_registry = new UpdateHookRegistry([], $this->keyValueFactory);
@@ -108,7 +108,7 @@ class UpdateHookRegistryTest extends UnitTestCase {
* @covers ::setInstalledVersion
* @covers ::deleteInstalledVersion
*/
- public function testGetInstalledVersion() {
+ public function testGetInstalledVersion(): void {
$versions = [
'module1' => 1,
'module2' => 20,
diff --git a/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php b/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php
index 72d2ef35eab..d183cd752d1 100644
--- a/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php
+++ b/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php
@@ -183,7 +183,7 @@ EOS;
/**
* @covers ::getPendingUpdateFunctions
*/
- public function testGetPendingUpdateFunctionsNoExistingUpdates() {
+ public function testGetPendingUpdateFunctionsNoExistingUpdates(): void {
$this->setupBasicExtensions();
$key_value = $this->prophesize(KeyValueStoreInterface::class);
@@ -227,7 +227,7 @@ EOS;
/**
* @covers ::getPendingUpdateFunctions
*/
- public function testGetPendingUpdateFunctionsWithLoadedModulesButNotEnabled() {
+ public function testGetPendingUpdateFunctionsWithLoadedModulesButNotEnabled(): void {
$this->setupBasicExtensions();
$key_value = $this->prophesize(KeyValueStoreInterface::class);
@@ -262,7 +262,7 @@ EOS;
/**
* @covers ::getPendingUpdateFunctions
*/
- public function testGetPendingUpdateFunctionsExistingUpdates() {
+ public function testGetPendingUpdateFunctionsExistingUpdates(): void {
$this->setupBasicExtensions();
$key_value = $this->prophesize(KeyValueStoreInterface::class);
@@ -309,7 +309,7 @@ EOS;
/**
* @covers ::getPendingUpdateInformation
*/
- public function testGetPendingUpdateInformation() {
+ public function testGetPendingUpdateInformation(): void {
$this->setupBasicExtensions();
$key_value = $this->prophesize(KeyValueStoreInterface::class);
@@ -357,7 +357,7 @@ EOS;
/**
* @covers ::getPendingUpdateInformation
*/
- public function testGetPendingUpdateInformationWithExistingUpdates() {
+ public function testGetPendingUpdateInformationWithExistingUpdates(): void {
$this->setupBasicExtensions();
$key_value = $this->prophesize(KeyValueStoreInterface::class);
@@ -407,7 +407,7 @@ EOS;
/**
* @covers ::getPendingUpdateInformation
*/
- public function testGetPendingUpdateInformationWithRemovedUpdates() {
+ public function testGetPendingUpdateInformationWithRemovedUpdates(): void {
$this->setupBasicExtensions();
$key_value = $this->prophesize(KeyValueStoreInterface::class);
@@ -434,7 +434,7 @@ EOS;
/**
* @covers ::getUpdateFunctions
*/
- public function testGetUpdateFunctions() {
+ public function testGetUpdateFunctions(): void {
$this->setupBasicExtensions();
$key_value = $this->prophesize(KeyValueStoreInterface::class)->reveal();
@@ -470,7 +470,7 @@ EOS;
/**
* @covers ::registerInvokedUpdates
*/
- public function testRegisterInvokedUpdatesWithoutExistingUpdates() {
+ public function testRegisterInvokedUpdatesWithoutExistingUpdates(): void {
$this->setupBasicExtensions();
$key_value = $this->prophesize(KeyValueStoreInterface::class);
$key_value->get('existing_updates', [])
@@ -510,7 +510,7 @@ EOS;
/**
* @covers ::registerInvokedUpdates
*/
- public function testRegisterInvokedUpdatesWithMultiple() {
+ public function testRegisterInvokedUpdatesWithMultiple(): void {
$this->setupBasicExtensions();
$key_value = $this->prophesize(KeyValueStoreInterface::class);
$key_value->get('existing_updates', [])
@@ -550,7 +550,7 @@ EOS;
/**
* @covers ::registerInvokedUpdates
*/
- public function testRegisterInvokedUpdatesWithExistingUpdates() {
+ public function testRegisterInvokedUpdatesWithExistingUpdates(): void {
$this->setupBasicExtensions();
$key_value = $this->prophesize(KeyValueStoreInterface::class);
$key_value->get('existing_updates', [])
@@ -585,7 +585,7 @@ EOS;
/**
* @covers ::filterOutInvokedUpdatesByExtension
*/
- public function testFilterOutInvokedUpdatesByExtension() {
+ public function testFilterOutInvokedUpdatesByExtension(): void {
$this->setupBasicExtensions();
$key_value = $this->prophesize(KeyValueStoreInterface::class);
$key_value->get('existing_updates', [])
@@ -625,7 +625,7 @@ EOS;
/**
* @covers ::getPendingUpdateFunctions
*/
- public function testGetPendingCustomUpdateFunctions() {
+ public function testGetPendingCustomUpdateFunctions(): void {
// Set up a simplified module structure with custom update hooks.
$info_a = <<<'EOS'
type: module
diff --git a/core/tests/Drupal/Tests/Core/UrlTest.php b/core/tests/Drupal/Tests/Core/UrlTest.php
index be30899f53f..1693234623d 100644
--- a/core/tests/Drupal/Tests/Core/UrlTest.php
+++ b/core/tests/Drupal/Tests/Core/UrlTest.php
@@ -148,7 +148,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::fromRoute
*/
- public function testFromRouteFront() {
+ public function testFromRouteFront(): void {
$url = Url::fromRoute('<front>');
$this->assertSame('<front>', $url->getRouteName());
}
@@ -159,7 +159,7 @@ class UrlTest extends UnitTestCase {
* @covers ::fromUserInput
* @dataProvider providerFromValidInternalUri
*/
- public function testFromUserInput($path) {
+ public function testFromUserInput($path): void {
$url = Url::fromUserInput($path);
$uri = $url->getUri();
@@ -191,7 +191,7 @@ class UrlTest extends UnitTestCase {
* @covers ::fromUserInput
* @dataProvider providerFromInvalidInternalUri
*/
- public function testFromInvalidUserInput($path) {
+ public function testFromInvalidUserInput($path): void {
$this->expectException(\InvalidArgumentException::class);
$url = Url::fromUserInput($path);
}
@@ -201,7 +201,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::fromUri
*/
- public function testFromRoutedPathWithInvalidRoute() {
+ public function testFromRoutedPathWithInvalidRoute(): void {
$this->pathValidator->expects($this->once())
->method('getUrlIfValidWithoutAccessCheck')
->with('invalid-path')
@@ -216,7 +216,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::fromUri
*/
- public function testFromRoutedPathWithValidRoute() {
+ public function testFromRoutedPathWithValidRoute(): void {
$url = Url::fromRoute('test_route');
$this->pathValidator->expects($this->once())
->method('getUrlIfValidWithoutAccessCheck')
@@ -231,7 +231,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::createFromRequest
*/
- public function testCreateFromRequest() {
+ public function testCreateFromRequest(): void {
$attributes = [
'_raw_variables' => new InputBag([
'color' => 'chartreuse',
@@ -255,7 +255,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::createFromRequest
*/
- public function testUrlFromRequestInvalid() {
+ public function testUrlFromRequestInvalid(): void {
$request = Request::create('/test-path');
$this->router->expects($this->once())
@@ -274,7 +274,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::isExternal
*/
- public function testIsExternal($urls) {
+ public function testIsExternal($urls): void {
foreach ($urls as $url) {
$this->assertFalse($url->isExternal());
}
@@ -290,7 +290,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::getUri
*/
- public function testGetUriForInternalUrl($urls) {
+ public function testGetUriForInternalUrl($urls): void {
$this->expectException(\UnexpectedValueException::class);
foreach ($urls as $url) {
$url->getUri();
@@ -302,7 +302,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::getUri
*/
- public function testGetUriForExternalUrl() {
+ public function testGetUriForExternalUrl(): void {
$url = Url::fromUri('http://example.com/test');
$this->assertEquals('http://example.com/test', $url->getUri());
}
@@ -313,7 +313,7 @@ class UrlTest extends UnitTestCase {
* @covers ::getUri
* @covers ::isExternal
*/
- public function testGetUriForProtocolRelativeUrl() {
+ public function testGetUriForProtocolRelativeUrl(): void {
$url = Url::fromUri('//example.com/test');
$this->assertEquals('//example.com/test', $url->getUri());
$this->assertTrue($url->isExternal());
@@ -329,7 +329,7 @@ class UrlTest extends UnitTestCase {
*
* @depends testUrlFromRequest
*/
- public function testGetInternalPath($urls) {
+ public function testGetInternalPath($urls): void {
$map = [];
$map[] = ['view.frontpage.page_1', [], '/node'];
$map[] = ['node_view', ['node' => '1'], '/node/1'];
@@ -360,7 +360,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::toString
*/
- public function testToString($urls) {
+ public function testToString($urls): void {
foreach ($urls as $index => $url) {
$path = array_pop($this->map[$index]);
$this->assertSame($path, $url->toString());
@@ -380,7 +380,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::getRouteName
*/
- public function testGetRouteName($urls) {
+ public function testGetRouteName($urls): void {
foreach ($urls as $index => $url) {
$this->assertSame($this->map[$index][0], $url->getRouteName());
}
@@ -391,7 +391,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::getRouteName
*/
- public function testGetRouteNameWithExternalUrl() {
+ public function testGetRouteNameWithExternalUrl(): void {
$url = Url::fromUri('http://example.com');
$this->expectException(\UnexpectedValueException::class);
$url->getRouteName();
@@ -407,7 +407,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::getRouteParameters
*/
- public function testGetRouteParameters($urls) {
+ public function testGetRouteParameters($urls): void {
foreach ($urls as $index => $url) {
$this->assertSame($this->map[$index][1], $url->getRouteParameters());
}
@@ -418,7 +418,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::getRouteParameters
*/
- public function testGetRouteParametersWithExternalUrl() {
+ public function testGetRouteParametersWithExternalUrl(): void {
$url = Url::fromUri('http://example.com');
$this->expectException(\UnexpectedValueException::class);
$url->getRouteParameters();
@@ -434,7 +434,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::getOptions
*/
- public function testGetOptions($urls) {
+ public function testGetOptions($urls): void {
foreach ($urls as $index => $url) {
$this->assertSame($this->map[$index][2], $url->getOptions());
}
@@ -445,7 +445,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::setOptions
*/
- public function testSetOptions() {
+ public function testSetOptions(): void {
$url = Url::fromRoute('test_route', []);
$this->assertEquals([], $url->getOptions());
$url->setOptions(['foo' => 'bar']);
@@ -459,7 +459,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::mergeOptions
*/
- public function testMergeOptions() {
+ public function testMergeOptions(): void {
$url = Url::fromRoute('test_route', [], ['foo' => 'bar', 'bar' => ['key' => 'value']]);
$url->mergeOptions(['bar' => ['key' => 'value1', 'key2' => 'value2']]);
$this->assertEquals(['foo' => 'bar', 'bar' => ['key' => 'value1', 'key2' => 'value2']], $url->getOptions());
@@ -475,7 +475,7 @@ class UrlTest extends UnitTestCase {
* @covers ::accessManager
* @dataProvider accessProvider
*/
- public function testAccessRouted($access) {
+ public function testAccessRouted($access): void {
$account = $this->createMock('Drupal\Core\Session\AccountInterface');
$url = new TestUrl('entity.node.canonical', ['node' => 3]);
$url->setAccessManager($this->getMockAccessManager($access, $account));
@@ -487,7 +487,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::access
*/
- public function testAccessUnrouted() {
+ public function testAccessUnrouted(): void {
$account = $this->createMock('Drupal\Core\Session\AccountInterface');
$url = TestUrl::fromUri('base:kittens');
$access_manager = $this->createMock('Drupal\Core\Access\AccessManagerInterface');
@@ -500,7 +500,7 @@ class UrlTest extends UnitTestCase {
/**
* Tests the fromRouteMatch() method.
*/
- public function testFromRouteMatch() {
+ public function testFromRouteMatch(): void {
$route = new Route('/test-route/{foo}');
$route_match = new RouteMatch('test_route', $route, ['foo' => (object) [1]], ['foo' => 1]);
$url = Url::fromRouteMatch($route_match);
@@ -574,7 +574,7 @@ class UrlTest extends UnitTestCase {
*
* @dataProvider providerTestEntityUris
*/
- public function testEntityUris($uri, $options, $route_name, $route_parameters, $query, $fragment) {
+ public function testEntityUris($uri, $options, $route_name, $route_parameters, $query, $fragment): void {
$url = Url::fromUri($uri, $options);
$this->assertSame($route_name, $url->getRouteName());
$this->assertEquals($route_parameters, $url->getRouteParameters());
@@ -587,7 +587,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::fromUri
*/
- public function testInvalidEntityUriParameter() {
+ public function testInvalidEntityUriParameter(): void {
// Make the mocked URL generator behave like the actual one.
$this->urlGenerator->expects($this->once())
->method('generateFromRoute')
@@ -605,7 +605,7 @@ class UrlTest extends UnitTestCase {
*
* @dataProvider providerTestToUriStringForEntity
*/
- public function testToUriStringForEntity($uri, $options, $uri_string) {
+ public function testToUriStringForEntity($uri, $options, $uri_string): void {
$url = Url::fromUri($uri, $options);
$this->assertSame($url->toUriString(), $uri_string);
}
@@ -628,7 +628,7 @@ class UrlTest extends UnitTestCase {
*
* @dataProvider providerTestToUriStringForInternal
*/
- public function testToUriStringForInternal($uri, $options, $uri_string) {
+ public function testToUriStringForInternal($uri, $options, $uri_string): void {
$url = Url::fromRoute('entity.test_entity.canonical', ['test_entity' => '1']);
$this->pathValidator->expects($this->any())
->method('getUrlIfValidWithoutAccessCheck')
@@ -672,7 +672,7 @@ class UrlTest extends UnitTestCase {
* @covers ::fromUri
* @dataProvider providerFromValidInternalUri
*/
- public function testFromValidInternalUri($path) {
+ public function testFromValidInternalUri($path): void {
$url = Url::fromUri('internal:' . $path);
$this->assertInstanceOf('Drupal\Core\Url', $url);
}
@@ -712,7 +712,7 @@ class UrlTest extends UnitTestCase {
* @covers ::fromUri
* @dataProvider providerFromInvalidInternalUri
*/
- public function testFromInvalidInternalUri($path) {
+ public function testFromInvalidInternalUri($path): void {
$this->expectException(\InvalidArgumentException::class);
Url::fromUri('internal:' . $path);
}
@@ -747,7 +747,7 @@ class UrlTest extends UnitTestCase {
*
* @covers ::fromUri
*/
- public function testFromUriNumber() {
+ public function testFromUriNumber(): void {
$url = Url::fromUri('base:2015/10/06');
$this->assertSame($url->toUriString(), 'base:/2015/10/06');
}
@@ -759,7 +759,7 @@ class UrlTest extends UnitTestCase {
*
* @dataProvider providerTestToUriStringForRoute
*/
- public function testToUriStringForRoute($uri, $options, $uri_string) {
+ public function testToUriStringForRoute($uri, $options, $uri_string): void {
$url = Url::fromUri($uri, $options);
$this->assertSame($url->toUriString(), $uri_string);
}
@@ -784,7 +784,7 @@ class UrlTest extends UnitTestCase {
/**
* @covers ::fromUri
*/
- public function testFromRouteUriWithMissingRouteName() {
+ public function testFromRouteUriWithMissingRouteName(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage("The route URI 'route:' is invalid.");
Url::fromUri('route:');
diff --git a/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php b/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php
index 01bb1b97272..ed94cd09ff4 100644
--- a/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php
+++ b/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php
@@ -41,7 +41,7 @@ class CallableResolverTest extends UnitTestCase {
/**
* @covers ::getCallableFromDefinition
*/
- public function testCallbackResolver() {
+ public function testCallbackResolver(): void {
$cases = [
'Inline function' => [
function ($suffix) {
@@ -109,7 +109,7 @@ class CallableResolverTest extends UnitTestCase {
* @dataProvider callableResolverExceptionHandlingTestCases
* @covers ::getCallableFromDefinition
*/
- public function testCallbackResolverExceptionHandling($definition, $exception_class, $exception_message) {
+ public function testCallbackResolverExceptionHandling($definition, $exception_class, $exception_message): void {
$this->expectException($exception_class);
$this->expectExceptionMessage($exception_message);
$this->resolver->getCallableFromDefinition($definition);
diff --git a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
index 4ff0cdfe881..67afbed60bf 100644
--- a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
@@ -110,7 +110,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @dataProvider providerTestGenerateHrefs
*/
- public function testGenerateHrefs($route_name, array $parameters, $absolute, $expected_url) {
+ public function testGenerateHrefs($route_name, array $parameters, $absolute, $expected_url): void {
$this->urlGenerator->expects($this->once())
->method('generateFromRoute')
->with($route_name, $parameters, ['absolute' => $absolute] + $this->defaultOptions)
@@ -131,7 +131,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @covers ::generate
*/
- public function testGenerate() {
+ public function testGenerate(): void {
$this->urlGenerator->expects($this->once())
->method('generateFromRoute')
->with('test_route_1', [], ['fragment' => 'the-fragment'] + $this->defaultOptions)
@@ -161,7 +161,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @covers ::generate
*/
- public function testGenerateNoLink() {
+ public function testGenerateNoLink(): void {
$this->urlGenerator->expects($this->never())
->method('generateFromRoute');
$this->moduleHandler->expects($this->exactly(2))
@@ -193,7 +193,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @covers ::generate
*/
- public function testGenerateNone() {
+ public function testGenerateNone(): void {
$this->urlGenerator->expects($this->once())
->method('generateFromRoute')
->with('<none>', [], ['set_active_class' => TRUE] + $this->defaultOptions)
@@ -216,7 +216,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @covers ::generate
*/
- public function testGenerateButton() {
+ public function testGenerateButton(): void {
$this->urlGenerator->expects($this->never())
->method('generateFromRoute');
$this->moduleHandler->expects($this->exactly(2))
@@ -247,7 +247,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @covers ::generate
*/
- public function testGenerateExternal() {
+ public function testGenerateExternal(): void {
$this->urlAssembler->expects($this->once())
->method('assemble')
->with('https://www.drupal.org', ['set_active_class' => TRUE, 'external' => TRUE] + $this->defaultOptions)
@@ -281,7 +281,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @covers ::generate
*/
- public function testGenerateUrlWithQuotes() {
+ public function testGenerateUrlWithQuotes(): void {
$this->urlAssembler->expects($this->once())
->method('assemble')
->with('base:example', ['query' => ['foo' => '"bar"', 'zoo' => 'baz']] + $this->defaultOptions)
@@ -312,7 +312,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @see \Drupal\Core\Utility\LinkGenerator::generate()
*/
- public function testGenerateAttributes() {
+ public function testGenerateAttributes(): void {
$this->urlGenerator->expects($this->once())
->method('generateFromRoute')
->with('test_route_1', [], $this->defaultOptions)
@@ -337,7 +337,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @see \Drupal\Core\Utility\LinkGenerator::generate()
*/
- public function testGenerateQuery() {
+ public function testGenerateQuery(): void {
$this->urlGenerator->expects($this->once())
->method('generateFromRoute')
->with('test_route_1', [], ['query' => ['test' => 'value']] + $this->defaultOptions)
@@ -360,7 +360,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @see \Drupal\Core\Utility\LinkGenerator::generate()
*/
- public function testGenerateParametersAsQuery() {
+ public function testGenerateParametersAsQuery(): void {
$this->urlGenerator->expects($this->once())
->method('generateFromRoute')
->with('test_route_1', ['test' => 'value'], $this->defaultOptions)
@@ -381,7 +381,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @see \Drupal\Core\Utility\LinkGenerator::generate()
*/
- public function testGenerateOptions() {
+ public function testGenerateOptions(): void {
$this->urlGenerator->expects($this->once())
->method('generateFromRoute')
->with('test_route_1', [], ['key' => 'value'] + $this->defaultOptions)
@@ -403,7 +403,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @see \Drupal\Core\Utility\LinkGenerator::generate()
*/
- public function testGenerateXss() {
+ public function testGenerateXss(): void {
$this->urlGenerator->expects($this->once())
->method('generateFromRoute')
->with('test_route_4', [], $this->defaultOptions)
@@ -421,7 +421,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @see \Drupal\Core\Utility\LinkGenerator::generate()
*/
- public function testGenerateWithHtml() {
+ public function testGenerateWithHtml(): void {
$this->urlGenerator->expects($this->exactly(2))
->method('generateFromRoute')
->with('test_route_5', [], $this->defaultOptions)
@@ -460,7 +460,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @see \Drupal\Core\Utility\LinkGenerator::generate()
*/
- public function testGenerateActive() {
+ public function testGenerateActive(): void {
$this->urlGenerator->expects($this->exactly(5))
->method('generateFromRoute')
->willReturnCallback(function ($name, $parameters = [], $options = [], $collect_bubbleable_metadata = FALSE) {
@@ -551,7 +551,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @see \Drupal\Core\Utility\LinkGenerator::generate()
*/
- public function testGenerateBubbleableMetadata() {
+ public function testGenerateBubbleableMetadata(): void {
$options = ['query' => [], 'language' => NULL, 'set_active_class' => FALSE, 'absolute' => FALSE];
$this->urlGenerator->expects($this->any())
->method('generateFromRoute')
@@ -582,7 +582,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* @covers ::generate
*/
- public function testGenerateWithAlterHook() {
+ public function testGenerateWithAlterHook(): void {
$options = ['query' => [], 'language' => NULL, 'set_active_class' => FALSE, 'absolute' => FALSE];
$this->urlGenerator->expects($this->any())
->method('generateFromRoute')
@@ -621,7 +621,7 @@ class LinkGeneratorTest extends UnitTestCase {
*
* This is a regression test for https://www.drupal.org/node/2842399.
*/
- public function testGenerateTwice() {
+ public function testGenerateTwice(): void {
$this->urlGenerator->expects($this->any())
->method('generateFromRoute')
->willReturn((new GeneratedUrl())->setGeneratedUrl('/'));
diff --git a/core/tests/Drupal/Tests/Core/Utility/TokenTest.php b/core/tests/Drupal/Tests/Core/Utility/TokenTest.php
index 1aa30dba066..df3ede5da3b 100644
--- a/core/tests/Drupal/Tests/Core/Utility/TokenTest.php
+++ b/core/tests/Drupal/Tests/Core/Utility/TokenTest.php
@@ -107,7 +107,7 @@ class TokenTest extends UnitTestCase {
/**
* @covers ::getInfo
*/
- public function testGetInfo() {
+ public function testGetInfo(): void {
$token_info = [
'types' => [
'foo' => [
@@ -153,7 +153,7 @@ class TokenTest extends UnitTestCase {
/**
* @covers ::replace
*/
- public function testReplaceWithBubbleableMetadataObject() {
+ public function testReplaceWithBubbleableMetadataObject(): void {
$this->moduleHandler->expects($this->any())
->method('invokeAll')
->willReturn(['[node:title]' => 'hello world']);
@@ -182,7 +182,7 @@ class TokenTest extends UnitTestCase {
/**
* @covers ::replace
*/
- public function testReplaceWithHookTokensWithBubbleableMetadata() {
+ public function testReplaceWithHookTokensWithBubbleableMetadata(): void {
$this->moduleHandler->expects($this->any())
->method('invokeAll')
->willReturnCallback(function ($hook_name, $args) {
@@ -218,7 +218,7 @@ class TokenTest extends UnitTestCase {
* @covers ::replace
* @covers ::replace
*/
- public function testReplaceWithHookTokensAlterWithBubbleableMetadata() {
+ public function testReplaceWithHookTokensAlterWithBubbleableMetadata(): void {
$this->moduleHandler->expects($this->any())
->method('invokeAll')
->willReturn([]);
@@ -255,7 +255,7 @@ class TokenTest extends UnitTestCase {
/**
* @covers ::resetInfo
*/
- public function testResetInfo() {
+ public function testResetInfo(): void {
$this->cacheTagsInvalidator->expects($this->once())
->method('invalidateTags')
->with(['token_info']);
@@ -267,7 +267,7 @@ class TokenTest extends UnitTestCase {
* @covers ::replace
* @dataProvider providerTestReplaceEscaping
*/
- public function testReplaceEscaping($string, array $tokens, $expected) {
+ public function testReplaceEscaping($string, array $tokens, $expected): void {
$this->moduleHandler->expects($this->any())
->method('invokeAll')
->willReturnCallback(function ($type, $args) {
@@ -301,7 +301,7 @@ class TokenTest extends UnitTestCase {
/**
* @covers ::replacePlain
*/
- public function testReplacePlain() {
+ public function testReplacePlain(): void {
$this->setupSiteTokens();
$base = 'Wow, great "[site:name]" has a slogan "[site:slogan]"';
$plain = $this->token->replacePlain($base);
@@ -311,7 +311,7 @@ class TokenTest extends UnitTestCase {
/**
* Scans dummy text, then tests the output.
*/
- public function testScan() {
+ public function testScan(): void {
// Define text with valid and not valid, fake and existing token-like
// strings.
$text = 'First a [valid:simple], but dummy token, and a dummy [valid:token with: spaces].';
diff --git a/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php b/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
index d0eb9c871a7..a323484a68f 100644
--- a/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
+++ b/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
@@ -59,7 +59,7 @@ class UnroutedUrlAssemblerTest extends UnitTestCase {
/**
* @covers ::assemble
*/
- public function testAssembleWithNeitherExternalNorDomainLocalUri() {
+ public function testAssembleWithNeitherExternalNorDomainLocalUri(): void {
$this->expectException(\InvalidArgumentException::class);
$this->unroutedUrlAssembler->assemble('wrong-url');
}
@@ -67,7 +67,7 @@ class UnroutedUrlAssemblerTest extends UnitTestCase {
/**
* @covers ::assemble
*/
- public function testAssembleWithLeadingSlash() {
+ public function testAssembleWithLeadingSlash(): void {
$this->expectException(\InvalidArgumentException::class);
$this->unroutedUrlAssembler->assemble('/drupal.org');
}
@@ -78,7 +78,7 @@ class UnroutedUrlAssemblerTest extends UnitTestCase {
*
* @dataProvider providerTestAssembleWithExternalUrl
*/
- public function testAssembleWithExternalUrl($uri, array $options, $expected) {
+ public function testAssembleWithExternalUrl($uri, array $options, $expected): void {
$this->setupRequestStack(FALSE);
$this->assertEquals($expected, $this->unroutedUrlAssembler->assemble($uri, $options));
$generated_url = $this->unroutedUrlAssembler->assemble($uri, $options, TRUE);
@@ -113,7 +113,7 @@ class UnroutedUrlAssemblerTest extends UnitTestCase {
*
* @dataProvider providerTestAssembleWithLocalUri
*/
- public function testAssembleWithLocalUri($uri, array $options, $subdir, $expected) {
+ public function testAssembleWithLocalUri($uri, array $options, $subdir, $expected): void {
$this->setupRequestStack($subdir);
$this->assertEquals($expected, $this->unroutedUrlAssembler->assemble($uri, $options));
@@ -139,7 +139,7 @@ class UnroutedUrlAssemblerTest extends UnitTestCase {
/**
* @covers ::assemble
*/
- public function testAssembleWithNotEnabledProcessing() {
+ public function testAssembleWithNotEnabledProcessing(): void {
$this->setupRequestStack(FALSE);
$this->pathProcessor->expects($this->never())
->method('processOutbound');
@@ -150,7 +150,7 @@ class UnroutedUrlAssemblerTest extends UnitTestCase {
/**
* @covers ::assemble
*/
- public function testAssembleWithEnabledProcessing() {
+ public function testAssembleWithEnabledProcessing(): void {
$this->setupRequestStack(FALSE);
$this->pathProcessor->expects($this->exactly(2))
->method('processOutbound')
@@ -174,7 +174,7 @@ class UnroutedUrlAssemblerTest extends UnitTestCase {
/**
* @covers ::assemble
*/
- public function testAssembleWithStartingSlashEnabledProcessing() {
+ public function testAssembleWithStartingSlashEnabledProcessing(): void {
$this->setupRequestStack(FALSE);
$this->pathProcessor->expects($this->exactly(2))
->method('processOutbound')
diff --git a/core/tests/Drupal/Tests/ExpectDeprecationTest.php b/core/tests/Drupal/Tests/ExpectDeprecationTest.php
index 349a34f015f..df6045b075d 100644
--- a/core/tests/Drupal/Tests/ExpectDeprecationTest.php
+++ b/core/tests/Drupal/Tests/ExpectDeprecationTest.php
@@ -19,7 +19,7 @@ class ExpectDeprecationTest extends TestCase {
/**
* Tests expectDeprecation.
*/
- public function testExpectDeprecation() {
+ public function testExpectDeprecation(): void {
$this->expectDeprecation('Test deprecation');
// phpcs:ignore Drupal.Semantics.FunctionTriggerError
@trigger_error('Test deprecation', E_USER_DEPRECATED);
@@ -31,7 +31,7 @@ class ExpectDeprecationTest extends TestCase {
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
- public function testExpectDeprecationInIsolation() {
+ public function testExpectDeprecationInIsolation(): void {
$this->expectDeprecation('Test isolated deprecation');
// phpcs:ignore Drupal.Semantics.FunctionTriggerError
@trigger_error('Test isolated deprecation', E_USER_DEPRECATED);
diff --git a/core/tests/Drupal/Tests/PhpCs/SortTest.php b/core/tests/Drupal/Tests/PhpCs/SortTest.php
index 6927f442ccd..ec8b04eb5af 100644
--- a/core/tests/Drupal/Tests/PhpCs/SortTest.php
+++ b/core/tests/Drupal/Tests/PhpCs/SortTest.php
@@ -31,14 +31,14 @@ class SortTest extends TestCase {
/**
* Tests that the phpcs.xml.dist file exists.
*/
- public function testFileExists() {
+ public function testFileExists(): void {
$this->assertFileExists($this->filePath);
}
/**
* Tests that the phpcs.xml.dist file is properly sorted.
*/
- public function testSorted() {
+ public function testSorted(): void {
$content = file_get_contents($this->filePath);
$xml_encoder = new XmlEncoder();
$xml_encoded = $xml_encoder->decode($content, 'xml');
diff --git a/core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php b/core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php
index 42d6c78fb45..893a55e9309 100644
--- a/core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php
+++ b/core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php
@@ -50,7 +50,7 @@ class TestSiteApplicationTest extends UnitTestCase {
/**
* @coversNothing
*/
- public function testInstallWithNonExistingFile() {
+ public function testInstallWithNonExistingFile(): void {
$command_line = $this->php . ' core/scripts/test-site.php install --setup-file "this-class-does-not-exist" --db-url "' . getenv('SIMPLETEST_DB') . '"';
$process = Process::fromShellCommandline($command_line, $this->root);
$process->run();
@@ -61,7 +61,7 @@ class TestSiteApplicationTest extends UnitTestCase {
/**
* @coversNothing
*/
- public function testInstallWithFileWithNoClass() {
+ public function testInstallWithFileWithNoClass(): void {
$command_line = $this->php . ' core/scripts/test-site.php install --setup-file core/tests/fixtures/empty_file.php.module --db-url "' . getenv('SIMPLETEST_DB') . '"';
$process = Process::fromShellCommandline($command_line, $this->root);
$process->run();
@@ -72,7 +72,7 @@ class TestSiteApplicationTest extends UnitTestCase {
/**
* @coversNothing
*/
- public function testInstallWithNonSetupClass() {
+ public function testInstallWithNonSetupClass(): void {
$this->markTestIncomplete('Fix this test in https://www.drupal.org/project/drupal/issues/2962157.');
// Use __FILE__ to test absolute paths.
@@ -87,7 +87,7 @@ class TestSiteApplicationTest extends UnitTestCase {
/**
* @coversNothing
*/
- public function testInstallScript() {
+ public function testInstallScript(): void {
$simpletest_path = $this->root . DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . 'simpletest';
if (!is_writable($simpletest_path)) {
$this->markTestSkipped("Requires the directory $simpletest_path to exist and be writable");
@@ -187,7 +187,7 @@ class TestSiteApplicationTest extends UnitTestCase {
/**
* @coversNothing
*/
- public function testInstallInDifferentLanguage() {
+ public function testInstallInDifferentLanguage(): void {
$simpletest_path = $this->root . DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . 'simpletest';
if (!is_writable($simpletest_path)) {
$this->markTestSkipped("Requires the directory $simpletest_path to exist and be writable");
@@ -224,7 +224,7 @@ class TestSiteApplicationTest extends UnitTestCase {
/**
* @coversNothing
*/
- public function testTearDownDbPrefixValidation() {
+ public function testTearDownDbPrefixValidation(): void {
$command_line = $this->php . ' core/scripts/test-site.php tear-down not-a-valid-prefix';
$process = Process::fromShellCommandline($command_line, $this->root);
$process->setTimeout(500);
@@ -236,7 +236,7 @@ class TestSiteApplicationTest extends UnitTestCase {
/**
* @coversNothing
*/
- public function testUserLogin() {
+ public function testUserLogin(): void {
$this->markTestIncomplete('Fix this test in https://www.drupal.org/project/drupal/issues/2962157.');
$simpletest_path = $this->root . DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . 'simpletest';
if (!is_writable($simpletest_path)) {
diff --git a/core/tests/Drupal/Tests/Traits/Core/Config/SchemaConfigListenerTestTrait.php b/core/tests/Drupal/Tests/Traits/Core/Config/SchemaConfigListenerTestTrait.php
index 89493d5ef4a..8dd7e2398c4 100644
--- a/core/tests/Drupal/Tests/Traits/Core/Config/SchemaConfigListenerTestTrait.php
+++ b/core/tests/Drupal/Tests/Traits/Core/Config/SchemaConfigListenerTestTrait.php
@@ -14,7 +14,7 @@ trait SchemaConfigListenerTestTrait {
/**
* Tests \Drupal\Core\Config\Development\ConfigSchemaChecker.
*/
- public function testConfigSchemaChecker() {
+ public function testConfigSchemaChecker(): void {
// Test a non-existing schema.
$message = 'Expected SchemaIncompleteException thrown';
try {
diff --git a/core/tests/Drupal/Tests/UnitTestCaseTest.php b/core/tests/Drupal/Tests/UnitTestCaseTest.php
index ec22b183ab3..0ceeea843c5 100644
--- a/core/tests/Drupal/Tests/UnitTestCaseTest.php
+++ b/core/tests/Drupal/Tests/UnitTestCaseTest.php
@@ -14,7 +14,7 @@ class UnitTestCaseTest extends UnitTestCase {
/**
* Tests the dump() function in a test run in the same process.
*/
- public function testVarDumpSameProcess() {
+ public function testVarDumpSameProcess(): void {
// Append the stream capturer to the STDERR stream, so that we can test the
// dump() output and also prevent it from actually outputting in this
// particular test.
@@ -37,7 +37,7 @@ class UnitTestCaseTest extends UnitTestCase {
*
* @runInSeparateProcess
*/
- public function testVarDumpSeparateProcess() {
+ public function testVarDumpSeparateProcess(): void {
// Append the stream capturer to the STDERR stream, so that we can test the
// dump() output and also prevent it from actually outputting in this
// particular test.