From f9d3ce1046da8ba569f097e54db2ee7c0d3f2c11 Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Wed, 1 May 2024 18:21:37 +0100 Subject: [PATCH] Issue #3444566 by mondrake: Fix remaining deprecated string array keys in data sets returned by data provider methods that do not match the parameter names --- .../src/Kernel/CKEditor5PluginManagerTest.php | 18 ++-- .../Migrate/d7/MigrateCommentTypeTest.php | 12 +-- ...nstanceLabelDescriptionTranslationTest.php | 2 +- .../ManageFieldsMultipleTypesTest.php | 8 +- .../MediaEmbedFilterTestBase.php | 88 +++++++++---------- .../migrate/source/d7/MenuTranslationTest.php | 2 +- .../src/Functional/UpdateContribTest.php | 18 ++-- ...ateSemverTestSecurityAvailabilityTrait.php | 6 +- .../Installer/SuperUserAccessInstallTest.php | 2 +- .../Libraries/JqueryUiLibraryAssetsTest.php | 2 +- 10 files changed, 79 insertions(+), 79 deletions(-) diff --git a/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php b/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php index aa913c2b3ce4..72b6dd7f39c3 100644 --- a/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php +++ b/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php @@ -1544,39 +1544,39 @@ public static function providerTestPluginSupportingElement() { return [ 'tag that belongs to a superset' => [ 'tag' => 'h2', - 'expected_plugin' => 'ckeditor5_heading', + 'expected_plugin_id' => 'ckeditor5_heading', ], 'tag only available as tag' => [ 'tag' => 'nav', - 'expected_plugin' => 'ckeditor5_definition_supporting_element_just_nav', + 'expected_plugin_id' => 'ckeditor5_definition_supporting_element_just_nav', ], 'between just tag, full use of class, and constrained use of class, return full use of class' => [ 'tag' => 'article', - 'expected_plugin' => 'ckeditor5_definition_supporting_element_article_class', + 'expected_plugin_id' => 'ckeditor5_definition_supporting_element_article_class', ], 'between just tag and full use of class, return full use of class' => [ 'tag' => 'footer', - 'expected_plugin' => 'ckeditor5_definition_supporting_element_footer_class', + 'expected_plugin_id' => 'ckeditor5_definition_supporting_element_footer_class', ], 'between just tag and constrained use of class, return constrained use of class' => [ 'tag' => 'aside', - 'expected_plugin' => 'ckeditor5_definition_supporting_element_aside_class_with_values', + 'expected_plugin_id' => 'ckeditor5_definition_supporting_element_aside_class_with_values', ], 'between full use of class and constrained use of class, return full use of class' => [ 'tag' => 'main', - 'expected_plugin' => 'ckeditor5_definition_supporting_element_main_class', + 'expected_plugin_id' => 'ckeditor5_definition_supporting_element_main_class', ], 'between one plugin allows one attribute, second allows two, return the one that allows two' => [ 'tag' => 'figure', - 'expected_plugin' => 'ckeditor5_definition_supporting_element_figure_two_attrib', + 'expected_plugin_id' => 'ckeditor5_definition_supporting_element_figure_two_attrib', ], 'between one plugin allows one attribute, second allows two (but appearing in opposite order), still return the one that allows two' => [ 'tag' => 'dialog', - 'expected_plugin' => 'ckeditor5_definition_supporting_element_dialog_two_attrib', + 'expected_plugin_id' => 'ckeditor5_definition_supporting_element_dialog_two_attrib', ], 'tag that belongs to a plugin with conditions' => [ 'tag' => 'drupal-media', - 'expected_plugin' => NULL, + 'expected_plugin_id' => NULL, ], ]; } 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 91221e248975..0bf90afa248c 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php @@ -124,24 +124,24 @@ public function testNoCommentTypeMigration(array $disabled_source_modules, array public static function providerTestNoCommentTypeMigration() { return [ 'Node module is disabled in source' => [ - 'Disabled source modules' => ['node'], - 'Expected messages' => [ + 'disabled_source_modules' => ['node'], + 'expected_messages' => [ 'error' => [ 'Migration d7_comment_type did not meet the requirements. The node module is not enabled in the source site.', ], ], ], 'Comment module is disabled in source' => [ - 'Disabled source modules' => ['comment'], - 'Expected messages' => [ + 'disabled_source_modules' => ['comment'], + 'expected_messages' => [ 'error' => [ 'Migration d7_comment_type did not meet the requirements. The module comment is not enabled in the source site.', ], ], ], 'Node and comment modules are disabled in source' => [ - 'Disabled source modules' => ['comment', 'node'], - 'Expected messages' => [ + 'disabled_source_modules' => ['comment', 'node'], + 'expected_messages' => [ 'error' => [ 'Migration d7_comment_type did not meet the requirements. The module comment is not enabled in the source site.', ], diff --git a/core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldInstanceLabelDescriptionTranslationTest.php b/core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldInstanceLabelDescriptionTranslationTest.php index c52e1dc4c7bb..fe6ad98dd932 100644 --- a/core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldInstanceLabelDescriptionTranslationTest.php +++ b/core/modules/field/tests/src/Kernel/Plugin/migrate/source/d6/FieldInstanceLabelDescriptionTranslationTest.php @@ -67,7 +67,7 @@ public static function providerSource() { ], ]; - $test[0]['expected_results'] = [ + $test[0]['expected_data'] = [ [ 'property' => 'widget_label', 'translation' => "fr - Integer Field", diff --git a/core/modules/field_ui/tests/src/Functional/ManageFieldsMultipleTypesTest.php b/core/modules/field_ui/tests/src/Functional/ManageFieldsMultipleTypesTest.php index 759bb05e4045..677d56da5e8d 100644 --- a/core/modules/field_ui/tests/src/Functional/ManageFieldsMultipleTypesTest.php +++ b/core/modules/field_ui/tests/src/Functional/ManageFieldsMultipleTypesTest.php @@ -144,22 +144,22 @@ public static function entityTypesProvider() { return [ 'node' => [ 'entity_type' => 'node', - 'article' => [ + 'bundle1' => [ 'id' => 'article', 'path' => 'admin/structure/types/manage/article', ], - 'page' => [ + 'bundle2' => [ 'id' => 'page', 'path' => 'admin/structure/types/manage/page', ], ], 'taxonomy' => [ 'entity_type' => 'taxonomy_term', - 'tags' => [ + 'bundle1' => [ 'id' => 'tags', 'path' => 'admin/structure/taxonomy/manage/tags/overview', ], - 'kittens' => [ + 'bundle2' => [ 'id' => 'kittens', 'path' => 'admin/structure/taxonomy/manage/kittens/overview', ], diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterTestBase.php b/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterTestBase.php index cac9f11c2651..57d5278ee1d8 100644 --- a/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterTestBase.php +++ b/core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterTestBase.php @@ -57,100 +57,100 @@ protected function setUp(): void { public static function providerTestValidations(): array { return [ 'Tests that no filter_html occurs when filter_html not enabled.' => [ - 'filters[filter_html][status]' => FALSE, - 'filters[filter_align][status]' => FALSE, - 'filters[filter_caption][status]' => FALSE, - 'filters[filter_html_image_secure][status]' => FALSE, + 'filter_html_status' => FALSE, + 'filter_align_status' => FALSE, + 'filter_caption_status' => FALSE, + 'filter_html_image_secure_status' => FALSE, 'media_embed' => TRUE, 'allowed_html' => FALSE, 'expected_error_message' => FALSE, ], 'Tests validation when both filter_html and media_embed are disabled.' => [ - 'filters[filter_html][status]' => FALSE, - 'filters[filter_align][status]' => FALSE, - 'filters[filter_caption][status]' => FALSE, - 'filters[filter_html_image_secure][status]' => FALSE, + 'filter_html_status' => FALSE, + 'filter_align_status' => FALSE, + 'filter_caption_status' => FALSE, + 'filter_html_image_secure_status' => FALSE, 'media_embed' => FALSE, 'allowed_html' => FALSE, 'expected_error_message' => FALSE, ], 'Tests validation when media_embed filter not enabled and filter_html is enabled.' => [ - 'filters[filter_html][status]' => TRUE, - 'filters[filter_align][status]' => FALSE, - 'filters[filter_caption][status]' => FALSE, - 'filters[filter_html_image_secure][status]' => FALSE, + 'filter_html_status' => TRUE, + 'filter_align_status' => FALSE, + 'filter_caption_status' => FALSE, + 'filter_html_image_secure_status' => FALSE, 'media_embed' => FALSE, 'allowed_html' => 'default', 'expected_error_message' => FALSE, ], 'Tests validation when drupal-media element has no attributes.' => [ - 'filters[filter_html][status]' => TRUE, - 'filters[filter_align][status]' => FALSE, - 'filters[filter_caption][status]' => FALSE, - 'filters[filter_html_image_secure][status]' => FALSE, + 'filter_html_status' => TRUE, + 'filter_align_status' => FALSE, + 'filter_caption_status' => FALSE, + 'filter_html_image_secure_status' => FALSE, 'media_embed' => TRUE, 'allowed_html' => "<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id> <drupal-media>", 'expected_error_message' => 'The <drupal-media> tag in the allowed HTML tags is missing the following attributes: data-entity-type, data-entity-uuid.', ], 'Tests validation when drupal-media element lacks some required attributes.' => [ - 'filters[filter_html][status]' => TRUE, - 'filters[filter_align][status]' => FALSE, - 'filters[filter_caption][status]' => FALSE, - 'filters[filter_html_image_secure][status]' => FALSE, + 'filter_html_status' => TRUE, + 'filter_align_status' => FALSE, + 'filter_caption_status' => FALSE, + 'filter_html_image_secure_status' => FALSE, 'media_embed' => TRUE, 'allowed_html' => "<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id> <drupal-media data-entity-uuid data-align>", 'expected_error_message' => 'The <drupal-media> tag in the allowed HTML tags is missing the following attributes: data-entity-type.', ], 'Tests validation when both filter_html and media_embed are enabled and configured correctly' => [ - 'filters[filter_html][status]' => TRUE, - 'filters[filter_align][status]' => FALSE, - 'filters[filter_caption][status]' => FALSE, - 'filters[filter_html_image_secure][status]' => FALSE, + 'filter_html_status' => TRUE, + 'filter_align_status' => FALSE, + 'filter_caption_status' => FALSE, + 'filter_html_image_secure_status' => FALSE, 'media_embed' => TRUE, 'allowed_html' => "<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id> <drupal-media data-entity-type data-entity-uuid data-view-mode>", 'expected_error_message' => FALSE, ], 'Order validation: media_embed before all filters' => [ - 'filters[filter_html][status]' => TRUE, - 'filters[filter_align][status]' => TRUE, - 'filters[filter_caption][status]' => TRUE, - 'filters[filter_html_image_secure][status]' => TRUE, + 'filter_html_status' => TRUE, + 'filter_align_status' => TRUE, + 'filter_caption_status' => TRUE, + 'filter_html_image_secure_status' => TRUE, 'media_embed' => '-5', 'allowed_html' => "<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id> <drupal-media data-entity-type data-entity-uuid data-view-mode>", 'expected_error_message' => 'The Embed media filter needs to be placed after the following filters: Align images, Caption images, Restrict images to this site.', ], 'Order validation: media_embed before filter_align' => [ - 'filters[filter_html][status]' => FALSE, - 'filters[filter_align][status]' => TRUE, - 'filters[filter_caption][status]' => FALSE, - 'filters[filter_html_image_secure][status]' => FALSE, + 'filter_html_status' => FALSE, + 'filter_align_status' => TRUE, + 'filter_caption_status' => FALSE, + 'filter_html_image_secure_status' => FALSE, 'media_embed' => '-5', 'allowed_html' => '', 'expected_error_message' => 'The Embed media filter needs to be placed after the Align images filter.', ], 'Order validation: media_embed before filter_caption' => [ - 'filters[filter_html][status]' => FALSE, - 'filters[filter_align][status]' => FALSE, - 'filters[filter_caption][status]' => TRUE, - 'filters[filter_html_image_secure][status]' => FALSE, + 'filter_html_status' => FALSE, + 'filter_align_status' => FALSE, + 'filter_caption_status' => TRUE, + 'filter_html_image_secure_status' => FALSE, 'media_embed' => '-5', 'allowed_html' => '', 'expected_error_message' => 'The Embed media filter needs to be placed after the Caption images filter.', ], 'Order validation: media_embed before filter_html_image_secure' => [ - 'filters[filter_html][status]' => FALSE, - 'filters[filter_align][status]' => FALSE, - 'filters[filter_caption][status]' => FALSE, - 'filters[filter_html_image_secure][status]' => TRUE, + 'filter_html_status' => FALSE, + 'filter_align_status' => FALSE, + 'filter_caption_status' => FALSE, + 'filter_html_image_secure_status' => TRUE, 'media_embed' => '-5', 'allowed_html' => '', 'expected_error_message' => 'The Embed media filter needs to be placed after the Restrict images to this site filter.', ], 'Order validation: media_embed after filter_align and filter_caption but before filter_html_image_secure' => [ - 'filters[filter_html][status]' => TRUE, - 'filters[filter_align][status]' => TRUE, - 'filters[filter_caption][status]' => TRUE, - 'filters[filter_html_image_secure][status]' => TRUE, + 'filter_html_status' => TRUE, + 'filter_align_status' => TRUE, + 'filter_caption_status' => TRUE, + 'filter_html_image_secure_status' => TRUE, 'media_embed' => '5', 'allowed_html' => "<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id> <drupal-media data-entity-type data-entity-uuid data-view-mode>", 'expected_error_message' => 'The Embed media filter needs to be placed after the Restrict images to this site filter.', diff --git a/core/modules/system/tests/src/Kernel/Plugin/migrate/source/d7/MenuTranslationTest.php b/core/modules/system/tests/src/Kernel/Plugin/migrate/source/d7/MenuTranslationTest.php index bbbbff68fdab..11408e7d7a3a 100644 --- a/core/modules/system/tests/src/Kernel/Plugin/migrate/source/d7/MenuTranslationTest.php +++ b/core/modules/system/tests/src/Kernel/Plugin/migrate/source/d7/MenuTranslationTest.php @@ -82,7 +82,7 @@ public static function providerSource() { 'i18n_status' => 0, ], ]; - $tests[0]['expected_results'] = [ + $tests[0]['expected_data'] = [ [ 'menu_name' => 'navigation', 'type' => 'menu', diff --git a/core/modules/update/tests/src/Functional/UpdateContribTest.php b/core/modules/update/tests/src/Functional/UpdateContribTest.php index 97932acade84..1447874a62ca 100644 --- a/core/modules/update/tests/src/Functional/UpdateContribTest.php +++ b/core/modules/update/tests/src/Functional/UpdateContribTest.php @@ -647,7 +647,7 @@ public static function securityUpdateAvailabilityProvider() { // Security releases available for module major release 1. // No releases for next major. '8.x-1.0, 8.x-1.2' => [ - 'module_patch_version' => '8.x-1.0', + 'module_version' => '8.x-1.0', 'expected_security_releases' => ['8.x-1.2'], 'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED, 'fixture' => 'sec.8.x-1.2', @@ -656,7 +656,7 @@ public static function securityUpdateAvailabilityProvider() { // 8.x-1.1 security release marked as insecure. // No releases for next major. '8.x-1.0, 8.x-1.1 8.x-1.2' => [ - 'module_patch_version' => '8.x-1.0', + 'module_version' => '8.x-1.0', 'expected_security_releases' => ['8.x-1.2'], 'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED, 'fixture' => 'sec.8.x-1.1_8.x-1.2', @@ -664,13 +664,13 @@ public static function securityUpdateAvailabilityProvider() { // Security release available for module major release 2. // No releases for next major. '8.x-2.0, 8.x-2.2' => [ - 'module_patch_version' => '8.x-2.0', + 'module_version' => '8.x-2.0', 'expected_security_releases' => ['8.x-2.2'], 'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED, 'fixture' => 'sec.8.x-2.2_1.x_secure', ], '8.x-2.2, 8.x-1.2 8.x-2.2' => [ - 'module_patch_version' => '8.x-2.2', + 'module_version' => '8.x-2.2', 'expected_security_releases' => [], 'expected_update_message_type' => static::UPDATE_NONE, 'fixture' => 'sec.8.x-1.2_8.x-2.2', @@ -678,7 +678,7 @@ public static function securityUpdateAvailabilityProvider() { // Security release available for module major release 1. // Security release also available for next major. '8.x-1.0, 8.x-1.2 8.x-2.2' => [ - 'module_patch_version' => '8.x-1.0', + 'module_version' => '8.x-1.0', 'expected_security_releases' => ['8.x-1.2'], 'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED, 'fixture' => 'sec.8.x-1.2_8.x-2.2', @@ -687,7 +687,7 @@ public static function securityUpdateAvailabilityProvider() { // releases are not marked as insecure. // Security release available for next major. '8.x-1.0, 8.x-2.2, not insecure' => [ - 'module_patch_version' => '8.x-1.0', + 'module_version' => '8.x-1.0', 'expected_security_releases' => [], 'expected_update_message_type' => static::UPDATE_AVAILABLE, 'fixture' => 'sec.8.x-2.2_1.x_secure', @@ -695,13 +695,13 @@ public static function securityUpdateAvailabilityProvider() { // On latest security release for module major release 1. // Security release also available for next major. '8.x-1.2, 8.x-1.2 8.x-2.2' => [ - 'module_patch_version' => '8.x-1.2', - 'expected_security_release' => [], + 'module_version' => '8.x-1.2', + 'expected_security_releases' => [], 'expected_update_message_type' => static::UPDATE_NONE, 'fixture' => 'sec.8.x-1.2_8.x-2.2', ], '8.x-2.0, 8.x-1.2 8.x-2.2' => [ - 'module_patch_version' => '8.x-2.0', + 'module_version' => '8.x-2.0', 'expected_security_releases' => ['8.x-2.2'], 'expected_update_message_type' => static::SECURITY_UPDATE_REQUIRED, 'fixture' => 'sec.8.x-1.2_8.x-2.2', diff --git a/core/modules/update/tests/src/Functional/UpdateSemverTestSecurityAvailabilityTrait.php b/core/modules/update/tests/src/Functional/UpdateSemverTestSecurityAvailabilityTrait.php index e2f679d61c30..b0b497a23f0a 100644 --- a/core/modules/update/tests/src/Functional/UpdateSemverTestSecurityAvailabilityTrait.php +++ b/core/modules/update/tests/src/Functional/UpdateSemverTestSecurityAvailabilityTrait.php @@ -104,7 +104,7 @@ public static function securityUpdateAvailabilityProvider() { // is marked as insecure. '0.2, 0.2' => [ 'site_patch_version' => '0.2', - 'expected_security_release' => ['1.2', '2.0-rc2'], + 'expected_security_releases' => ['1.2', '2.0-rc2'], 'expected_update_message_type' => static::UPDATE_AVAILABLE, 'fixture' => 'sec.8.2.0-rc2', ], @@ -162,13 +162,13 @@ public static function securityUpdateAvailabilityProvider() { // Security release available for next minor. '0.0, 1.2, secure' => [ 'site_patch_version' => '0.0', - 'expected_security_release' => ['1.2'], + 'expected_security_releases' => ['1.2'], 'expected_update_message_type' => static::UPDATE_AVAILABLE, 'fixture' => 'sec.8.1.2', ], '0.2, 1.2, secure' => [ 'site_patch_version' => '0.2', - 'expected_security_release' => ['1.2'], + 'expected_security_releases' => ['1.2'], 'expected_update_message_type' => static::UPDATE_AVAILABLE, 'fixture' => 'sec.8.1.2', ], diff --git a/core/tests/Drupal/FunctionalTests/Installer/SuperUserAccessInstallTest.php b/core/tests/Drupal/FunctionalTests/Installer/SuperUserAccessInstallTest.php index 826b73504dfb..a327866f16a6 100644 --- a/core/tests/Drupal/FunctionalTests/Installer/SuperUserAccessInstallTest.php +++ b/core/tests/Drupal/FunctionalTests/Installer/SuperUserAccessInstallTest.php @@ -73,7 +73,7 @@ protected function setUpSite() { * * @dataProvider getInstallTests */ - public function testInstalled(bool $expected_runtime_has_permission, bool $expected_no_access_message, array $expected_roles): void { + public function testInstalled(bool $expected_runtime_has_permission, bool $expected_no_access_message, array $expected_roles, string $install_code, bool $super_user_policy): void { $user = User::load(1); $this->assertSame($expected_runtime_has_permission, $user->hasPermission('administer software updates')); $this->assertTrue(\Drupal::state()->get('admin_permission_in_installer')); diff --git a/core/tests/Drupal/FunctionalTests/Libraries/JqueryUiLibraryAssetsTest.php b/core/tests/Drupal/FunctionalTests/Libraries/JqueryUiLibraryAssetsTest.php index 5682e321a08f..1429d3d6ec3e 100644 --- a/core/tests/Drupal/FunctionalTests/Libraries/JqueryUiLibraryAssetsTest.php +++ b/core/tests/Drupal/FunctionalTests/Libraries/JqueryUiLibraryAssetsTest.php @@ -218,7 +218,7 @@ protected function trimFilePath($path) { * * @dataProvider providerTestAssetLoading */ - public function testLibraryAssetLoadingOrder($library) { + public function testLibraryAssetLoadingOrder($library, array $expected_css, array $expected_js) { $this->drupalGet("jqueryui_library_assets_test/$library"); $this->assertSession()->statusCodeEquals(200); -- GitLab