From 98d61fbcd51425f9660dc364c675f7349020018f Mon Sep 17 00:00:00 2001 From: Sukhendu Sekhar Guria Date: Wed, 30 Sep 2026 15:40:46 +0530 Subject: [PATCH 1/3] test: prefix WordPress expectation helpers --- tests/phpunit/includes/abstract-testcase.php | 147 ++++++++++++++---- .../abilities-api/wpAbilitiesRegistry.php | 50 +++--- .../wpAbilityCategoryRegistry.php | 28 ++-- .../tests/abilities-api/wpRegisterAbility.php | 16 +- .../wpRegisterAbilityCategory.php | 16 +- tests/phpunit/tests/actions.php | 4 +- tests/phpunit/tests/admin/includesPlugin.php | 2 +- tests/phpunit/tests/admin/includesTheme.php | 4 +- .../tests/admin/wpAutomaticUpdater.php | 2 +- tests/phpunit/tests/admin/wpListTable.php | 2 +- tests/phpunit/tests/admin/wpUserSearch.php | 2 +- .../wpAiClientAbilityFunctionResolver.php | 12 +- .../ai-client/wpAiClientPromptBuilder.php | 6 +- tests/phpunit/tests/auth.php | 4 +- .../wpBlockBindingsRegistry.php | 18 +-- .../tests/block-supports/typography.php | 4 +- ...pCreateBlockStyleVariationInstanceName.php | 2 +- tests/phpunit/tests/block-template-utils.php | 4 +- tests/phpunit/tests/block-template.php | 2 +- .../WpBlockTemplatesRegistry.php | 8 +- tests/phpunit/tests/blocks/editor.php | 10 +- tests/phpunit/tests/blocks/register.php | 6 +- .../tests/blocks/wpBlockMetadataRegistry.php | 16 +- .../tests/blocks/wpBlockPatternsRegistry.php | 14 +- .../tests/blocks/wpBlockTypeRegistry.php | 6 +- tests/phpunit/tests/cache.php | 4 +- .../tests/category/getAllCategoryIds.php | 2 +- .../tests/category/getCategoryParents.php | 2 +- .../phpunit/tests/compat/jsonEncodeDecode.php | 18 +-- .../tests/connectors/wpConnectorRegistry.php | 38 ++--- ...ConnectorsGetConnectorScriptModuleData.php | 4 +- .../connectors/wpConnectorsIsApiKeyValid.php | 2 +- .../wpConnectorsResolveAiProviderLogoUrl.php | 2 +- .../tests/connectors/wpRegisterConnector.php | 2 +- tests/phpunit/tests/cron.php | 2 +- tests/phpunit/tests/customize/partial.php | 2 +- tests/phpunit/tests/customize/widgets.php | 8 +- tests/phpunit/tests/date/query.php | 24 +-- tests/phpunit/tests/db.php | 18 +-- tests/phpunit/tests/dependencies/jquery.php | 2 +- tests/phpunit/tests/dependencies/scripts.php | 30 ++-- tests/phpunit/tests/dependencies/styles.php | 10 +- .../tests/dependencies/wpInlineScriptTag.php | 2 +- .../wpRemoveSurroundingEmptyScriptTags.php | 2 +- .../wpSanitizeScriptAttributes.php | 12 +- tests/phpunit/tests/filters.php | 4 +- .../wpFontCollection/__construct.php | 2 +- .../font-library/wpFontCollection/getData.php | 6 +- .../wpFontLibrary/registerFontCollection.php | 2 +- .../wpRestFontCollectionsController.php | 4 +- tests/phpunit/tests/formatting/cleanPre.php | 2 +- tests/phpunit/tests/formatting/likeEscape.php | 2 +- .../tests/formatting/wpHtmleditPre.php | 2 +- .../tests/formatting/wpRicheditPre.php | 2 +- tests/phpunit/tests/formatting/wpSlash.php | 4 +- .../tests/functions/getNonCachedIds.php | 4 +- .../phpunit/tests/functions/wpAdminNotice.php | 2 +- .../tests/functions/wpGetAdminNotice.php | 2 +- tests/phpunit/tests/functions/wpListPluck.php | 4 +- tests/phpunit/tests/functions/wpListUtil.php | 4 +- .../tests/functions/wpUniqueIdFromValues.php | 2 +- .../template_CheckedSelectedHelper.php | 2 +- .../html-api/wpHtmlProcessor-bookmark.php | 2 +- .../tests/html-api/wpHtmlProcessor.php | 12 +- .../wpHtmlProcessorModifiableText.php | 2 +- .../html-api/wpHtmlTagProcessor-bookmark.php | 4 +- .../tests/html-api/wpHtmlTagProcessor.php | 4 +- .../wpHtmlTagProcessorModifiableText.php | 6 +- tests/phpunit/tests/http/wpGetHttpHeaders.php | 2 +- .../tests/icons/wpIconCollectionsRegistry.php | 8 +- tests/phpunit/tests/icons/wpIconsRegistry.php | 20 +-- tests/phpunit/tests/image/functions.php | 4 +- tests/phpunit/tests/image/size.php | 10 +- tests/phpunit/tests/includes/helpers.php | 38 ++++- .../wpInteractivityAPI-wp-bind.php | 14 +- .../wpInteractivityAPI-wp-class.php | 4 +- .../wpInteractivityAPI-wp-context.php | 2 +- .../wpInteractivityAPI-wp-style.php | 4 +- .../interactivity-api/wpInteractivityAPI.php | 28 ++-- tests/phpunit/tests/media.php | 36 ++--- .../tests/media/wpImageTagAddDecodingAttr.php | 4 +- tests/phpunit/tests/menu/nav-menu.php | 4 +- tests/phpunit/tests/meta/registerMeta.php | 4 +- tests/phpunit/tests/multisite/network.php | 2 +- tests/phpunit/tests/multisite/site.php | 2 +- tests/phpunit/tests/multisite/wpGetSites.php | 4 +- tests/phpunit/tests/oembed/wpOembed.php | 2 +- tests/phpunit/tests/option/registration.php | 4 +- tests/phpunit/tests/post/getPageByTitle.php | 2 +- tests/phpunit/tests/post/getTheExcerpt.php | 2 +- tests/phpunit/tests/post/truncatePostSlug.php | 2 +- tests/phpunit/tests/post/types.php | 4 +- tests/phpunit/tests/post/wpDeletePost.php | 2 +- ...pPrivacyGeneratePersonalDataExportFile.php | 6 +- tests/phpunit/tests/query/conditionals.php | 6 +- tests/phpunit/tests/query/isSitemap.php | 2 +- .../tests/query/lazyLoadCommentMeta.php | 4 +- tests/phpunit/tests/query/results.php | 2 +- tests/phpunit/tests/rest-api.php | 14 +- .../rest-api/rest-comments-controller.php | 2 +- .../tests/rest-api/rest-post-meta-fields.php | 6 +- .../tests/rest-api/rest-posts-controller.php | 4 +- .../rest-api/rest-schema-sanitization.php | 16 +- .../tests/rest-api/rest-schema-validation.php | 14 +- tests/phpunit/tests/rest-api/rest-server.php | 2 +- .../rest-api/rest-settings-controller.php | 6 +- .../tests/rest-api/rest-users-controller.php | 2 +- .../tests/script-modules/wpScriptModules.php | 14 +- tests/phpunit/tests/shortcode.php | 2 +- .../tests/sitemaps/wpSitemapsRenderer.php | 4 +- .../wpSpeculationRules.php | 4 +- tests/phpunit/tests/taxonomy.php | 4 +- tests/phpunit/tests/theme.php | 16 +- tests/phpunit/tests/theme/support.php | 8 +- tests/phpunit/tests/theme/themeDir.php | 22 +-- tests/phpunit/tests/theme/wpThemeJson.php | 6 +- tests/phpunit/tests/user.php | 8 +- tests/phpunit/tests/user/capabilities.php | 8 +- tests/phpunit/tests/user/mapMetaCap.php | 2 +- tests/phpunit/tests/user/multisite.php | 2 +- tests/phpunit/tests/user/query.php | 6 +- tests/phpunit/tests/user/queryCache.php | 4 +- tests/phpunit/tests/view-config-data.php | 18 +-- tests/phpunit/tests/view-config.php | 2 +- tests/phpunit/tests/widgets.php | 8 +- .../phpunit/tests/wp-token-map/wpTokenMap.php | 2 +- tests/phpunit/tests/xmlrpc/wp/getUsers.php | 2 +- 127 files changed, 600 insertions(+), 487 deletions(-) diff --git a/tests/phpunit/includes/abstract-testcase.php b/tests/phpunit/includes/abstract-testcase.php index 2dde7e8b5787c..4a275d045ae59 100644 --- a/tests/phpunit/includes/abstract-testcase.php +++ b/tests/phpunit/includes/abstract-testcase.php @@ -147,7 +147,7 @@ public function set_up() { } $this->start_transaction(); - $this->expectDeprecated(); + $this->set_up_deprecation_expectations(); add_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) ); add_filter( 'wp_hash_password_options', array( $this, 'wp_hash_password_options' ), 1, 2 ); @@ -592,35 +592,35 @@ public function wp_die_handler( $message, $title, $args ) { } /** - * Sets up the expectations for testing a deprecated call. + * Sets up the expectations for testing deprecated and incorrect usage calls. * - * @since 3.7.0 + * Supports the `@expectedWPDeprecated` and `@expectedWPIncorrectUsage` + * annotations, as well as their legacy unprefixed forms. + * + * @since 7.2.0 */ - public function expectDeprecated() { - if ( method_exists( $this, 'getAnnotations' ) ) { - // PHPUnit < 9.5.0. - $annotations = $this->getAnnotations(); - } else { - // PHPUnit >= 9.5.0. - $annotations = \PHPUnit\Util\Test::parseTestMethodAnnotations( - static::class, - $this->getName( false ) - ); - } + protected function set_up_deprecation_expectations() { + $annotations = $this->get_expected_annotations(); foreach ( array( 'class', 'method' ) as $depth ) { - if ( ! empty( $annotations[ $depth ]['expectedDeprecated'] ) ) { - $this->expected_deprecated = array_merge( - $this->expected_deprecated, - $annotations[ $depth ]['expectedDeprecated'] - ); + // Support the old annotation for backward compatibility. + foreach ( array( 'expectedWPDeprecated', 'expectedDeprecated' ) as $annotation ) { + if ( ! empty( $annotations[ $depth ][ $annotation ] ) ) { + $this->expected_deprecated = array_merge( + $this->expected_deprecated, + $annotations[ $depth ][ $annotation ] + ); + } } - if ( ! empty( $annotations[ $depth ]['expectedIncorrectUsage'] ) ) { - $this->expected_doing_it_wrong = array_merge( - $this->expected_doing_it_wrong, - $annotations[ $depth ]['expectedIncorrectUsage'] - ); + // Support the old annotation for backward compatibility. + foreach ( array( 'expectedWPIncorrectUsage', 'expectedIncorrectUsage' ) as $annotation ) { + if ( ! empty( $annotations[ $depth ][ $annotation ] ) ) { + $this->expected_doing_it_wrong = array_merge( + $this->expected_doing_it_wrong, + $annotations[ $depth ][ $annotation ] + ); + } } } @@ -640,15 +640,59 @@ public function expectDeprecated() { } /** - * Handles a deprecated expectation. - * - * The DocBlock should contain `@expectedDeprecated` to trigger this. + * Sets up the expectations for testing a deprecated call. * * @since 3.7.0 - * @since 6.1.0 Includes the actual unexpected `_doing_it_wrong()` message - * or deprecation notice in the output if one is encountered. + * @deprecated 7.2.0 Use WP_UnitTestCase_Base::set_up_deprecation_expectations() instead. */ - public function expectedDeprecated() { + public function expectDeprecated() { + $this->set_up_deprecation_expectations(); + } + + /** + * Retrieves expected deprecation and incorrect usage annotations. + * + * @since 7.2.0 + * + * @return array> Annotations grouped by class and method. + */ + private function get_expected_annotations() { + $method_name = method_exists( $this, 'name' ) ? $this->name() : $this->getName( false ); + $class = new ReflectionClass( $this ); + $method = $class->getMethod( $method_name ); + + return array( + 'class' => $this->parse_expected_annotations( $class->getDocComment() ), + 'method' => $this->parse_expected_annotations( $method->getDocComment() ), + ); + } + + /** + * Parses expected deprecation and incorrect usage annotations from a DocBlock. + * + * @since 7.2.0 + * + * @param string|false $doc_comment DocBlock to parse, or false if none exists. + * @return array Expected values grouped by annotation name. + */ + private function parse_expected_annotations( $doc_comment ) { + $annotations = array(); + + foreach ( array( 'expectedWPDeprecated', 'expectedDeprecated', 'expectedWPIncorrectUsage', 'expectedIncorrectUsage' ) as $annotation ) { + if ( preg_match_all( '/@' . $annotation . '[\t ]+([^\r\n*]+)/', (string) $doc_comment, $matches ) ) { + $annotations[ $annotation ] = array_map( 'trim', $matches[1] ); + } + } + + return $annotations; + } + + /** + * Handles deprecated and incorrect usage expectations. + * + * @since 7.2.0 + */ + protected function assert_expected_deprecations() { $errors = array(); $not_caught_deprecated = array_diff( @@ -698,6 +742,16 @@ public function expectedDeprecated() { } } + /** + * Handles a deprecated expectation. + * + * @since 3.7.0 + * @deprecated 7.2.0 Use WP_UnitTestCase_Base::assert_expected_deprecations() instead. + */ + public function expectedDeprecated() { + $this->assert_expected_deprecations(); + } + /** * Blocks an external HTTP request that no other filter has answered. * @@ -729,12 +783,12 @@ public function block_external_http_request( $response, array $args, string $url /** * Detects post-test failure conditions. * - * We use this method to detect expectedDeprecated and expectedIncorrectUsage annotations. + * We use this method to detect WordPress deprecation and incorrect usage annotations. * * @since 4.2.0 */ protected function assert_post_conditions() { - $this->expectedDeprecated(); + $this->assert_expected_deprecations(); if ( $this->blocked_http_requests ) { $this->fail( @@ -745,29 +799,54 @@ protected function assert_post_conditions() { } } + /** + * Declares an expected WordPress deprecation call from within a test. + * + * @since 7.2.0 + * + * @param string $deprecated Name of the function, method, class, file, hook, or argument that is deprecated. + */ + public function expectWPDeprecated( $deprecated ) { + $this->expected_deprecated[] = $deprecated; + } + /** * Declares an expected `_deprecated_function()` or `_deprecated_argument()` call from within a test. * * @since 4.2.0 + * @deprecated 7.2.0 Use WP_UnitTestCase_Base::expectWPDeprecated() instead. * * @param string $deprecated Name of the function, method, class, or argument that is deprecated. * Must match the first parameter of the `_deprecated_function()` * or `_deprecated_argument()` call. */ public function setExpectedDeprecated( $deprecated ) { - $this->expected_deprecated[] = $deprecated; + $this->expectWPDeprecated( $deprecated ); + } + + /** + * Declares an expected WordPress incorrect usage call from within a test. + * + * @since 7.2.0 + * + * @param string $doing_it_wrong Name of the function, method, or class that appears in + * the first argument of the source `_doing_it_wrong()` call. + */ + public function expectWPIncorrectUsage( $doing_it_wrong ) { + $this->expected_doing_it_wrong[] = $doing_it_wrong; } /** * Declares an expected `_doing_it_wrong()` call from within a test. * * @since 4.2.0 + * @deprecated 7.2.0 Use WP_UnitTestCase_Base::expectWPIncorrectUsage() instead. * * @param string $doing_it_wrong Name of the function, method, or class that appears in * the first argument of the source `_doing_it_wrong()` call. */ public function setExpectedIncorrectUsage( $doing_it_wrong ) { - $this->expected_doing_it_wrong[] = $doing_it_wrong; + $this->expectWPIncorrectUsage( $doing_it_wrong ); } /** diff --git a/tests/phpunit/tests/abilities-api/wpAbilitiesRegistry.php b/tests/phpunit/tests/abilities-api/wpAbilitiesRegistry.php index 613fb7afb0474..572f96ed8838b 100644 --- a/tests/phpunit/tests/abilities-api/wpAbilitiesRegistry.php +++ b/tests/phpunit/tests/abilities-api/wpAbilitiesRegistry.php @@ -101,7 +101,7 @@ public function tear_down(): void { * * @covers WP_Abilities_Registry::register * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_name_without_namespace() { $result = $this->registry->register( 'without-namespace', self::$test_ability_args ); @@ -115,7 +115,7 @@ public function test_register_invalid_name_without_namespace() { * * @covers WP_Abilities_Registry::register * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_characters_in_name() { $result = $this->registry->register( 'still/_doing_it_wrong', array() ); @@ -129,7 +129,7 @@ public function test_register_invalid_characters_in_name() { * * @covers WP_Abilities_Registry::register * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_uppercase_characters_in_name() { $result = $this->registry->register( 'Test/AddNumbers', self::$test_ability_args ); @@ -144,7 +144,7 @@ public function test_register_invalid_uppercase_characters_in_name() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_missing_label() { // Remove the label from the args. @@ -162,7 +162,7 @@ public function test_register_invalid_missing_label() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_label_type() { self::$test_ability_args['label'] = false; @@ -179,7 +179,7 @@ public function test_register_invalid_label_type() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_missing_description() { // Remove the description from the args. @@ -197,7 +197,7 @@ public function test_register_invalid_missing_description() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_description_type() { self::$test_ability_args['description'] = false; @@ -211,7 +211,7 @@ public function test_register_invalid_description_type() { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_ability_nonexistent_category(): void { $args = array_merge( @@ -233,7 +233,7 @@ public function test_register_ability_nonexistent_category(): void { * * @covers WP_Abilities_Registry::register * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register * * @param mixed $category Invalid category value. */ @@ -271,7 +271,7 @@ public static function data_invalid_category_types(): array { * * @covers WP_Abilities_Registry::register * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_ability_rejects_empty_category(): void { $args = self::$test_ability_args; @@ -294,7 +294,7 @@ public function test_register_ability_rejects_empty_category(): void { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_missing_execute_callback() { // Remove the execute_callback from the args. @@ -312,7 +312,7 @@ public function test_register_invalid_missing_execute_callback() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_incorrect_execute_callback_type() { self::$test_ability_args['execute_callback'] = 'not-a-callback'; @@ -359,7 +359,7 @@ public function test_register_with_custom_ability_class_without_execute_callback * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_missing_permission_callback() { // Remove the permission_callback from the args. @@ -377,7 +377,7 @@ public function test_register_invalid_missing_permission_callback() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_incorrect_permission_callback_type() { self::$test_ability_args['permission_callback'] = 'not-a-callback'; @@ -394,7 +394,7 @@ public function test_register_incorrect_permission_callback_type() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_incorrect_input_schema_type() { self::$test_ability_args['input_schema'] = 'not-an-array'; @@ -411,7 +411,7 @@ public function test_register_incorrect_input_schema_type() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_incorrect_output_schema_type() { self::$test_ability_args['output_schema'] = 'not-an-array'; @@ -428,7 +428,7 @@ public function test_register_incorrect_output_schema_type() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_annotations_type() { self::$test_ability_args['meta']['annotations'] = false; @@ -445,7 +445,7 @@ public function test_register_invalid_annotations_type() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_meta_type() { self::$test_ability_args['meta'] = false; @@ -462,7 +462,7 @@ public function test_register_invalid_meta_type() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_show_in_rest_type() { self::$test_ability_args['meta']['show_in_rest'] = 5; @@ -479,7 +479,7 @@ public function test_register_invalid_show_in_rest_type() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_public_type() { self::$test_ability_args['meta']['public'] = 5; @@ -495,7 +495,7 @@ public function test_register_invalid_public_type() { * * @covers WP_Abilities_Registry::register * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_incorrect_already_registered_ability() { $this->registry->register( self::$test_ability_name, self::$test_ability_args ); @@ -557,7 +557,7 @@ public function test_is_registered_for_known_ability() { * * @covers WP_Abilities_Registry::get_registered * - * @expectedIncorrectUsage WP_Abilities_Registry::get_registered + * @expectedWPIncorrectUsage WP_Abilities_Registry::get_registered */ public function test_get_registered_rejects_unknown_ability_name() { $ability = $this->registry->get_registered( 'test/unknown' ); @@ -588,7 +588,7 @@ public function test_get_registered_for_known_ability() { * * @covers WP_Abilities_Registry::unregister * - * @expectedIncorrectUsage WP_Abilities_Registry::unregister + * @expectedWPIncorrectUsage WP_Abilities_Registry::unregister */ public function test_unregister_not_registered_ability() { $result = $this->registry->unregister( 'test/unregistered' ); @@ -686,7 +686,7 @@ static function ( $args ) use ( &$was_filter_callback_fired ) { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_ability_args_filter_blocks_registration() { // Define the filter. @@ -712,7 +712,7 @@ static function ( $args ) { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_ability_args_filter_blocks_invalid_ability_class() { // Define the filter. diff --git a/tests/phpunit/tests/abilities-api/wpAbilityCategoryRegistry.php b/tests/phpunit/tests/abilities-api/wpAbilityCategoryRegistry.php index c517ad66a60fd..a3e52891cbd4f 100644 --- a/tests/phpunit/tests/abilities-api/wpAbilityCategoryRegistry.php +++ b/tests/phpunit/tests/abilities-api/wpAbilityCategoryRegistry.php @@ -118,7 +118,7 @@ public function test_register_valid_category(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_register_category_invalid_slug_format(): void { // Uppercase characters not allowed. @@ -139,7 +139,7 @@ public function test_register_category_invalid_slug_format(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_register_category_invalid_slug_underscore(): void { $result = $this->registry->register( @@ -159,7 +159,7 @@ public function test_register_category_invalid_slug_underscore(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_register_category_missing_label(): void { $result = $this->registry->register( @@ -178,7 +178,7 @@ public function test_register_category_missing_label(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_register_category_missing_description(): void { $result = $this->registry->register( @@ -197,7 +197,7 @@ public function test_register_category_missing_description(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_register_duplicate_category(): void { $result = $this->registry->register( @@ -247,7 +247,7 @@ public function test_unregister_existing_category(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::unregister + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::unregister */ public function test_unregister_nonexistent_category(): void { $result = $this->registry->unregister( 'test-nonexistent' ); @@ -281,7 +281,7 @@ public function test_get_existing_category(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::get_registered + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::get_registered */ public function test_get_nonexistent_category(): void { $result = $this->registry->get_registered( 'test-nonexistent' ); @@ -449,7 +449,7 @@ public function data_invalid_slug_provider(): array { * @ticket 64098 * * @dataProvider data_invalid_slug_provider - * @expectedIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register * * @param string $slug The category slug to test. */ @@ -471,7 +471,7 @@ public function test_category_slug_invalid_formats( string $slug ): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_category_constructor_non_string_label(): void { $result = $this->registry->register( @@ -491,7 +491,7 @@ public function test_category_constructor_non_string_label(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_category_constructor_empty_label(): void { $result = $this->registry->register( @@ -511,7 +511,7 @@ public function test_category_constructor_empty_label(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_category_constructor_non_string_description(): void { $result = $this->registry->register( @@ -531,7 +531,7 @@ public function test_category_constructor_non_string_description(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_category_constructor_empty_description(): void { $result = $this->registry->register( @@ -665,7 +665,7 @@ public function test_register_category_without_meta_returns_empty_array(): void * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_register_category_with_invalid_meta(): void { $result = $this->registry->register( @@ -686,7 +686,7 @@ public function test_register_category_with_invalid_meta(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Category::__construct + * @expectedWPIncorrectUsage WP_Ability_Category::__construct */ public function test_register_category_with_unknown_property(): void { $result = $this->registry->register( diff --git a/tests/phpunit/tests/abilities-api/wpRegisterAbility.php b/tests/phpunit/tests/abilities-api/wpRegisterAbility.php index cfa81924a0de2..a5b8558dd5c2e 100644 --- a/tests/phpunit/tests/abilities-api/wpRegisterAbility.php +++ b/tests/phpunit/tests/abilities-api/wpRegisterAbility.php @@ -121,7 +121,7 @@ private function simulate_doing_wp_abilities_init_action() { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Abilities_Registry::register + * @expectedWPIncorrectUsage WP_Abilities_Registry::register */ public function test_register_ability_invalid_name(): void { $this->simulate_doing_wp_abilities_init_action(); @@ -136,7 +136,7 @@ public function test_register_ability_invalid_name(): void { * * @ticket 64098 * - * @expectedIncorrectUsage wp_register_ability + * @expectedWPIncorrectUsage wp_register_ability */ public function test_register_ability_no_abilities_api_init_action(): void { $this->assertFalse( doing_action( 'wp_abilities_api_init' ) ); @@ -151,7 +151,7 @@ public function test_register_ability_no_abilities_api_init_action(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Abilities_Registry::get_instance + * @expectedWPIncorrectUsage WP_Abilities_Registry::get_instance */ public function test_register_ability_no_init_action(): void { global $wp_actions; @@ -326,7 +326,7 @@ public function test_register_ability_custom_ability_class(): void { ); // Try again with an invalid class throws a doing it wrong. - $this->setExpectedIncorrectUsage( WP_Abilities_Registry::class . '::register' ); + $this->expectWPIncorrectUsage( WP_Abilities_Registry::class . '::register' ); wp_register_ability( self::$test_ability_name, array_merge( @@ -484,7 +484,7 @@ public function test_permission_callback_receives_input(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Abilities_Registry::get_instance + * @expectedWPIncorrectUsage WP_Abilities_Registry::get_instance */ public function test_unregister_ability_no_init_action(): void { global $wp_actions; @@ -530,7 +530,7 @@ public function test_unregister_existing_ability() { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Abilities_Registry::get_instance + * @expectedWPIncorrectUsage WP_Abilities_Registry::get_instance */ public function test_get_ability_no_init_action(): void { global $wp_actions; @@ -593,7 +593,7 @@ static function ( $instance ) use ( $name, $args ) { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Abilities_Registry::get_instance + * @expectedWPIncorrectUsage WP_Abilities_Registry::get_instance */ public function test_has_ability_no_init_action(): void { global $wp_actions; @@ -649,7 +649,7 @@ public function test_has_registered_nonexistent_ability() { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Abilities_Registry::get_instance + * @expectedWPIncorrectUsage WP_Abilities_Registry::get_instance */ public function test_get_abilities_no_init_action(): void { global $wp_actions; diff --git a/tests/phpunit/tests/abilities-api/wpRegisterAbilityCategory.php b/tests/phpunit/tests/abilities-api/wpRegisterAbilityCategory.php index 9b83928e19d5c..b4f85859d0c07 100644 --- a/tests/phpunit/tests/abilities-api/wpRegisterAbilityCategory.php +++ b/tests/phpunit/tests/abilities-api/wpRegisterAbilityCategory.php @@ -58,7 +58,7 @@ private function simulate_doing_wp_ability_categories_init_action() { * * @ticket 64098 * - * @expectedIncorrectUsage wp_register_ability_category + * @expectedWPIncorrectUsage wp_register_ability_category */ public function test_register_category_before_init_hook(): void { $this->assertFalse( doing_action( 'wp_abilities_api_categories_init' ) ); @@ -76,7 +76,7 @@ public function test_register_category_before_init_hook(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::get_instance + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::get_instance */ public function test_register_ability_category_no_init_action(): void { global $wp_actions; @@ -126,7 +126,7 @@ public function test_register_valid_category(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::get_instance + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::get_instance */ public function test_unregister_ability_category_no_init_action(): void { global $wp_actions; @@ -154,7 +154,7 @@ public function test_unregister_ability_category_no_init_action(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::unregister + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::unregister */ public function test_unregister_nonexistent_category(): void { $this->simulate_doing_wp_ability_categories_init_action(); @@ -188,7 +188,7 @@ public function test_unregister_existing_category(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::get_instance + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::get_instance */ public function test_has_ability_category_no_init_action(): void { global $wp_actions; @@ -249,7 +249,7 @@ public function test_has_registered_ability_category(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::get_instance + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::get_instance */ public function test_get_ability_category_no_init_action(): void { global $wp_actions; @@ -277,7 +277,7 @@ public function test_get_ability_category_no_init_action(): void { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::get_registered + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::get_registered */ public function test_get_nonexistent_category(): void { $this->simulate_doing_wp_ability_categories_init_action(); @@ -322,7 +322,7 @@ static function ( $instance ) use ( $name, $args ) { * * @ticket 64098 * - * @expectedIncorrectUsage WP_Ability_Categories_Registry::get_instance + * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::get_instance */ public function test_get_ability_categories_no_init_action(): void { global $wp_actions; diff --git a/tests/phpunit/tests/actions.php b/tests/phpunit/tests/actions.php index 4e25cca0e2e99..2eccd37d9029b 100644 --- a/tests/phpunit/tests/actions.php +++ b/tests/phpunit/tests/actions.php @@ -806,7 +806,7 @@ public function apply_testing_nested_filter() { /** * @ticket 10441 - * @expectedDeprecated tests_do_action_deprecated + * @expectedWPDeprecated tests_do_action_deprecated * * @covers ::do_action_deprecated */ @@ -826,7 +826,7 @@ public static function deprecated_action_callback( $p ) { /** * @ticket 10441 - * @expectedDeprecated tests_do_action_deprecated + * @expectedWPDeprecated tests_do_action_deprecated * * @covers ::do_action_deprecated */ diff --git a/tests/phpunit/tests/admin/includesPlugin.php b/tests/phpunit/tests/admin/includesPlugin.php index 21e3064ff6b55..0a32873b0d2a7 100644 --- a/tests/phpunit/tests/admin/includesPlugin.php +++ b/tests/phpunit/tests/admin/includesPlugin.php @@ -341,7 +341,7 @@ public function test_position_when_parent_slug_child_slug_are_the_same() { * @ticket 48599 */ public function test_passing_string_as_position_fires_doing_it_wrong_submenu() { - $this->setExpectedIncorrectUsage( 'add_submenu_page' ); + $this->expectWPIncorrectUsage( 'add_submenu_page' ); global $submenu, $menu; // Reset menus. diff --git a/tests/phpunit/tests/admin/includesTheme.php b/tests/phpunit/tests/admin/includesTheme.php index 24d037442852d..ba38c7765f730 100644 --- a/tests/phpunit/tests/admin/includesTheme.php +++ b/tests/phpunit/tests/admin/includesTheme.php @@ -53,8 +53,8 @@ public function filter_theme_root( $dir ) { /** * @ticket 10959 * @ticket 11216 - * @expectedDeprecated get_theme - * @expectedDeprecated get_themes + * @expectedWPDeprecated get_theme + * @expectedWPDeprecated get_themes */ public function test_page_templates() { $theme = get_theme( 'Page Template Theme' ); diff --git a/tests/phpunit/tests/admin/wpAutomaticUpdater.php b/tests/phpunit/tests/admin/wpAutomaticUpdater.php index 2aca85616cb5f..76ec2c7497c2d 100644 --- a/tests/phpunit/tests/admin/wpAutomaticUpdater.php +++ b/tests/phpunit/tests/admin/wpAutomaticUpdater.php @@ -689,7 +689,7 @@ public function test_is_allowed_dir_should_return_false_if_open_basedir_is_set_a * * @covers WP_Automatic_Updater::is_allowed_dir * - * @expectedIncorrectUsage WP_Automatic_Updater::is_allowed_dir + * @expectedWPIncorrectUsage WP_Automatic_Updater::is_allowed_dir * * @dataProvider data_is_allowed_dir_should_throw_doing_it_wrong_with_invalid_dir * diff --git a/tests/phpunit/tests/admin/wpListTable.php b/tests/phpunit/tests/admin/wpListTable.php index ee6cca5cf53de..d984fd9562e5d 100644 --- a/tests/phpunit/tests/admin/wpListTable.php +++ b/tests/phpunit/tests/admin/wpListTable.php @@ -276,7 +276,7 @@ public function data_get_views_links() { * * @covers WP_List_Table::get_views_links * - * @expectedIncorrectUsage WP_List_Table::get_views_links + * @expectedWPIncorrectUsage WP_List_Table::get_views_links * * @dataProvider data_get_views_links_doing_it_wrong * diff --git a/tests/phpunit/tests/admin/wpUserSearch.php b/tests/phpunit/tests/admin/wpUserSearch.php index 4ad20f77c40e6..370a384ba4c3a 100644 --- a/tests/phpunit/tests/admin/wpUserSearch.php +++ b/tests/phpunit/tests/admin/wpUserSearch.php @@ -9,7 +9,7 @@ class Tests_Admin_wpUserSearch extends WP_UnitTestCase { /** * @covers ::__construct() - * @expectedDeprecated WP_User_Search + * @expectedWPDeprecated WP_User_Search */ public function test_class_is_deprecated() { $wp_user_search = new WP_User_Search(); diff --git a/tests/phpunit/tests/ai-client/wpAiClientAbilityFunctionResolver.php b/tests/phpunit/tests/ai-client/wpAiClientAbilityFunctionResolver.php index 92eadebf95963..81629f757fbfa 100644 --- a/tests/phpunit/tests/ai-client/wpAiClientAbilityFunctionResolver.php +++ b/tests/phpunit/tests/ai-client/wpAiClientAbilityFunctionResolver.php @@ -157,7 +157,7 @@ public function test_execute_ability_returns_error_for_non_ability_call() { * @ticket 64591 */ public function test_execute_ability_returns_error_when_ability_not_found() { - $this->setExpectedIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); + $this->expectWPIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); $resolver = new WP_AI_Client_Ability_Function_Resolver( 'nonexistent/ability' ); $call = new FunctionCall( @@ -185,7 +185,7 @@ public function test_execute_ability_returns_error_when_ability_not_found() { * @ticket 64591 */ public function test_execute_ability_handles_missing_id() { - $this->setExpectedIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); + $this->expectWPIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); $resolver = new WP_AI_Client_Ability_Function_Resolver( 'nonexistent/ability' ); $call = new FunctionCall( @@ -336,7 +336,7 @@ public function test_execute_abilities_with_empty_message() { * @ticket 64591 */ public function test_execute_abilities_handles_errors_gracefully() { - $this->setExpectedIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); + $this->expectWPIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); $resolver = new WP_AI_Client_Ability_Function_Resolver( 'nonexistent/ability' ); $call = new FunctionCall( @@ -369,7 +369,7 @@ public function test_execute_abilities_handles_errors_gracefully() { * @ticket 64591 */ public function test_execute_abilities_returns_user_message() { - $this->setExpectedIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); + $this->expectWPIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); $resolver = new WP_AI_Client_Ability_Function_Resolver( 'nonexistent/ability' ); $call = new FunctionCall( @@ -395,7 +395,7 @@ public function test_execute_abilities_returns_user_message() { * @ticket 64591 */ public function test_execute_abilities_processes_multiple_calls() { - $this->setExpectedIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); + $this->expectWPIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); $resolver = new WP_AI_Client_Ability_Function_Resolver( 'nonexistent/ability1', 'nonexistent/ability2' ); @@ -431,7 +431,7 @@ public function test_execute_abilities_processes_multiple_calls() { * @ticket 64591 */ public function test_execute_abilities_only_processes_function_calls() { - $this->setExpectedIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); + $this->expectWPIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); $resolver = new WP_AI_Client_Ability_Function_Resolver( 'nonexistent/ability' ); $call = new FunctionCall( diff --git a/tests/phpunit/tests/ai-client/wpAiClientPromptBuilder.php b/tests/phpunit/tests/ai-client/wpAiClientPromptBuilder.php index e76918c2d02e4..a41f23f8855f1 100644 --- a/tests/phpunit/tests/ai-client/wpAiClientPromptBuilder.php +++ b/tests/phpunit/tests/ai-client/wpAiClientPromptBuilder.php @@ -241,7 +241,7 @@ public function data_valid_request_timeout_overrides(): array { * * @dataProvider data_invalid_request_timeouts * - * @expectedIncorrectUsage WP_AI_Client_Prompt_Builder::__construct + * @expectedWPIncorrectUsage WP_AI_Client_Prompt_Builder::__construct * * @param mixed $timeout The invalid timeout value returned by the filter. */ @@ -2413,10 +2413,10 @@ public function test_using_ability_with_multiple_abilities() { * * @ticket 64591 * - * @expectedIncorrectUsage WP_AI_Client_Prompt_Builder::using_abilities + * @expectedWPIncorrectUsage WP_AI_Client_Prompt_Builder::using_abilities */ public function test_using_ability_skips_nonexistent_abilities() { - $this->setExpectedIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); + $this->expectWPIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); $builder = new WP_AI_Client_Prompt_Builder( $this->registry ); $result = $builder->using_abilities( diff --git a/tests/phpunit/tests/auth.php b/tests/phpunit/tests/auth.php index a290d11e118e6..e5e8c641f67ef 100644 --- a/tests/phpunit/tests/auth.php +++ b/tests/phpunit/tests/auth.php @@ -419,7 +419,7 @@ public function test_wp_nonce_verify_success() { * @ticket 36361 */ public function test_check_admin_referer_with_no_action_triggers_doing_it_wrong() { - $this->setExpectedIncorrectUsage( 'check_admin_referer' ); + $this->expectWPIncorrectUsage( 'check_admin_referer' ); // A valid nonce needs to be set so the check doesn't die(). $_REQUEST['_wpnonce'] = wp_create_nonce( -1 ); @@ -442,7 +442,7 @@ public function test_check_admin_referer_with_default_action_as_string_not_doing * @ticket 36361 */ public function test_check_ajax_referer_with_no_action_triggers_doing_it_wrong() { - $this->setExpectedIncorrectUsage( 'check_ajax_referer' ); + $this->expectWPIncorrectUsage( 'check_ajax_referer' ); // A valid nonce needs to be set so the check doesn't die(). $_REQUEST['_wpnonce'] = wp_create_nonce( -1 ); diff --git a/tests/phpunit/tests/block-bindings/wpBlockBindingsRegistry.php b/tests/phpunit/tests/block-bindings/wpBlockBindingsRegistry.php index b6ace253c575b..951ecc84a564b 100644 --- a/tests/phpunit/tests/block-bindings/wpBlockBindingsRegistry.php +++ b/tests/phpunit/tests/block-bindings/wpBlockBindingsRegistry.php @@ -59,7 +59,7 @@ public function tear_down() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_non_string_names() { $result = $this->registry->register( 1, self::$test_source_properties ); @@ -73,7 +73,7 @@ public function test_register_invalid_non_string_names() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_names_without_namespace() { $result = $this->registry->register( 'post-meta', self::$test_source_properties ); @@ -87,7 +87,7 @@ public function test_register_invalid_names_without_namespace() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_characters() { $result = $this->registry->register( 'still/_doing_it_wrong', array() ); @@ -101,7 +101,7 @@ public function test_register_invalid_characters() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_uppercase_characters() { $result = $this->registry->register( 'Core/PostMeta', self::$test_source_properties ); @@ -115,7 +115,7 @@ public function test_register_invalid_uppercase_characters() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_missing_label() { @@ -133,7 +133,7 @@ public function test_register_invalid_missing_label() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_missing_get_value_callback() { @@ -151,7 +151,7 @@ public function test_register_invalid_missing_get_value_callback() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_incorrect_callback_type() { @@ -168,7 +168,7 @@ public function test_register_invalid_incorrect_callback_type() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_string_uses_context() { @@ -211,7 +211,7 @@ public function test_register_block_binding_source() { * * @covers WP_Block_Bindings_Registry::unregister * - * @expectedIncorrectUsage WP_Block_Bindings_Registry::unregister + * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::unregister */ public function test_unregister_not_registered_block() { $result = $this->registry->unregister( 'test/unregistered' ); diff --git a/tests/phpunit/tests/block-supports/typography.php b/tests/phpunit/tests/block-supports/typography.php index b426b62dd3c0b..3f1c9e9e9ab1f 100644 --- a/tests/phpunit/tests/block-supports/typography.php +++ b/tests/phpunit/tests/block-supports/typography.php @@ -816,7 +816,7 @@ public function data_generate_font_size_preset_fixtures() { * * @covers ::wp_get_typography_font_size_value * - * @expectedDeprecated wp_get_typography_font_size_value + * @expectedWPDeprecated wp_get_typography_font_size_value * * @dataProvider data_generate_font_size_preset_should_use_fluid_typography_deprecated_fixtures * @@ -1307,7 +1307,7 @@ public function data_valid_size_wp_get_typography_value_and_unit() { * @covers ::wp_get_typography_value_and_unit * * @dataProvider data_invalid_size_wp_get_typography_value_and_unit - * @expectedIncorrectUsage wp_get_typography_value_and_unit + * @expectedWPIncorrectUsage wp_get_typography_value_and_unit * * @param mixed $raw_value Raw size value to test. */ diff --git a/tests/phpunit/tests/block-supports/wpCreateBlockStyleVariationInstanceName.php b/tests/phpunit/tests/block-supports/wpCreateBlockStyleVariationInstanceName.php index 10475587287a8..b23986ed3ceea 100644 --- a/tests/phpunit/tests/block-supports/wpCreateBlockStyleVariationInstanceName.php +++ b/tests/phpunit/tests/block-supports/wpCreateBlockStyleVariationInstanceName.php @@ -14,7 +14,7 @@ class Tests_Block_Supports_WpCreateBlockStyleVariationInstanceName extends WP_Un * * @covers ::wp_create_block_style_variation_instance_name * - * @expectedDeprecated wp_create_block_style_variation_instance_name + * @expectedWPDeprecated wp_create_block_style_variation_instance_name */ public function test_block_style_variation_instance_name_generation() { $block = array( 'name' => 'test/block' ); diff --git a/tests/phpunit/tests/block-template-utils.php b/tests/phpunit/tests/block-template-utils.php index d89aa35f06e72..4d3bfa53d62d4 100644 --- a/tests/phpunit/tests/block-template-utils.php +++ b/tests/phpunit/tests/block-template-utils.php @@ -196,7 +196,7 @@ public function test_not_inject_theme_attribute_non_template_part_block() { * * @covers ::_inject_theme_attribute_in_block_template_content * - * @expectedDeprecated _inject_theme_attribute_in_block_template_content + * @expectedWPDeprecated _inject_theme_attribute_in_block_template_content */ public function test_inject_theme_attribute_in_block_template_content() { $theme = get_stylesheet(); @@ -245,7 +245,7 @@ public function test_inject_theme_attribute_in_block_template_content() { * * @dataProvider data_remove_theme_attribute_in_block_template_content * - * @expectedDeprecated _remove_theme_attribute_in_block_template_content + * @expectedWPDeprecated _remove_theme_attribute_in_block_template_content */ public function test_remove_theme_attribute_in_block_template_content( $template_content, $expected ) { $this->assertSame( $expected, _remove_theme_attribute_in_block_template_content( $template_content ) ); diff --git a/tests/phpunit/tests/block-template.php b/tests/phpunit/tests/block-template.php index bfa60dadd65bb..f4054e9e6fb47 100644 --- a/tests/phpunit/tests/block-template.php +++ b/tests/phpunit/tests/block-template.php @@ -684,7 +684,7 @@ public function test_unregister_block_template_error_message_includes_template_n unregister_block_template( $template_name ); // Expect _doing_it_wrong() notice. - $this->setExpectedIncorrectUsage( 'WP_Block_Templates_Registry::unregister' ); + $this->expectWPIncorrectUsage( 'WP_Block_Templates_Registry::unregister' ); // Try to unregister again, should return WP_Error. $error = unregister_block_template( $template_name ); diff --git a/tests/phpunit/tests/block-templates/WpBlockTemplatesRegistry.php b/tests/phpunit/tests/block-templates/WpBlockTemplatesRegistry.php index ec227f3ad9dec..baedf787eba52 100644 --- a/tests/phpunit/tests/block-templates/WpBlockTemplatesRegistry.php +++ b/tests/phpunit/tests/block-templates/WpBlockTemplatesRegistry.php @@ -45,7 +45,7 @@ public function test_register_template_invalid_name() { // Try to register a template with invalid name (non-string). $template_name = array( 'invalid-template-name' ); - $this->setExpectedIncorrectUsage( 'WP_Block_Templates_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Block_Templates_Registry::register' ); $result = self::$registry->register( $template_name ); $this->assertWPError( $result, 'Template registration is expected to trigger an error.' ); @@ -65,7 +65,7 @@ public function test_register_template_invalid_name_uppercase() { // Try to register a template with uppercase characters in the name. $template_name = 'test-plugin//Invalid-Template-Name'; - $this->setExpectedIncorrectUsage( 'WP_Block_Templates_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Block_Templates_Registry::register' ); $result = self::$registry->register( $template_name ); $this->assertWPError( $result, 'Template registration is expected to trigger an error.' ); @@ -82,7 +82,7 @@ public function test_register_template_invalid_name_uppercase() { */ public function test_register_template_no_prefix() { // Try to register a template without a namespace. - $this->setExpectedIncorrectUsage( 'WP_Block_Templates_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Block_Templates_Registry::register' ); $result = self::$registry->register( 'template-no-plugin', array() ); $this->assertWPError( $result, 'Template registration is expected to trigger an error.' ); @@ -103,7 +103,7 @@ public function test_register_template_already_exists() { self::$registry->register( $template_name ); // Try to register the same template again. - $this->setExpectedIncorrectUsage( 'WP_Block_Templates_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Block_Templates_Registry::register' ); $result = self::$registry->register( $template_name ); $this->assertWPError( $result, 'Template registration is expected to trigger an error.' ); diff --git a/tests/phpunit/tests/blocks/editor.php b/tests/phpunit/tests/blocks/editor.php index 8f0b65fc5669d..3acd9687c9f29 100644 --- a/tests/phpunit/tests/blocks/editor.php +++ b/tests/phpunit/tests/blocks/editor.php @@ -175,7 +175,7 @@ public function test_block_editor_context_site() { /** * @ticket 52920 - * @expectedDeprecated block_categories + * @expectedWPDeprecated block_categories */ public function test_get_block_categories_deprecated_filter_post_object() { add_filter( 'block_categories', array( $this, 'filter_set_block_categories_post' ), 10, 2 ); @@ -198,7 +198,7 @@ public function test_get_block_categories_deprecated_filter_post_object() { /** * @ticket 52920 - * @expectedDeprecated block_categories + * @expectedWPDeprecated block_categories */ public function test_get_block_categories_deprecated_filter_post_editor() { add_filter( 'block_categories', array( $this, 'filter_set_block_categories_post' ), 10, 2 ); @@ -232,7 +232,7 @@ public function test_get_allowed_block_types_default() { /** * @ticket 52920 - * @expectedDeprecated allowed_block_types + * @expectedWPDeprecated allowed_block_types */ public function test_get_allowed_block_types_deprecated_filter_post_editor() { add_filter( 'allowed_block_types', array( $this, 'filter_set_allowed_block_types_post' ), 10, 2 ); @@ -598,7 +598,7 @@ public function test_get_block_editor_settings_without_post_content_block() { /** * @ticket 52920 - * @expectedDeprecated block_editor_settings + * @expectedWPDeprecated block_editor_settings */ public function test_get_block_editor_settings_deprecated_filter_post_editor() { add_filter( 'block_editor_settings', array( $this, 'filter_set_block_editor_settings_post' ), 10, 2 ); @@ -630,7 +630,7 @@ public function test_block_editor_rest_api_preload_no_paths() { /** * @ticket 52920 - * @expectedDeprecated block_editor_preload_paths + * @expectedWPDeprecated block_editor_preload_paths */ public function test_block_editor_rest_api_preload_deprecated_filter_post_editor() { function filter_remove_preload_paths( $preload_paths, $post ) { diff --git a/tests/phpunit/tests/blocks/register.php b/tests/phpunit/tests/blocks/register.php index 1901d0ccf6702..92e63e2ffcfec 100644 --- a/tests/phpunit/tests/blocks/register.php +++ b/tests/phpunit/tests/blocks/register.php @@ -1375,7 +1375,7 @@ public function data_register_block_type_accepts_editor_script_array() { * * @dataProvider data_register_block_type_throws_doing_it_wrong * - * @expectedIncorrectUsage WP_Block_Type::__set + * @expectedWPIncorrectUsage WP_Block_Type::__set * * @param array $editor_script The editor script array to register. * @param array $expected The expected registered editor script. @@ -1587,7 +1587,7 @@ public function test_filter_block_registration_metadata_settings() { * * @covers ::register_block_style * - * @expectedIncorrectUsage WP_Block_Styles_Registry::register + * @expectedWPIncorrectUsage WP_Block_Styles_Registry::register * @param array $block_styles Array of block styles to test. */ public function test_register_block_style_name_contains_spaces( array $block_styles ) { @@ -1639,7 +1639,7 @@ public function test_register_block_style_name_without_spaces() { * * @covers ::register_block_type * - * @expectedIncorrectUsage register_block_type_from_metadata + * @expectedWPIncorrectUsage register_block_type_from_metadata */ public function test_register_block_hooks_targeting_itself() { $block_type = register_block_type( diff --git a/tests/phpunit/tests/blocks/wpBlockMetadataRegistry.php b/tests/phpunit/tests/blocks/wpBlockMetadataRegistry.php index 6a9cb01479f69..6412e584e2535 100644 --- a/tests/phpunit/tests/blocks/wpBlockMetadataRegistry.php +++ b/tests/phpunit/tests/blocks/wpBlockMetadataRegistry.php @@ -75,7 +75,7 @@ public function test_register_collection_with_valid_plugin_path() { public function test_register_collection_with_invalid_plugin_path() { $invalid_plugin_path = WP_PLUGIN_DIR; - $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( $invalid_plugin_path, $this->temp_manifest_file ); $this->assertFalse( $result, 'Invalid plugin path should not be registered' ); @@ -96,7 +96,7 @@ public function test_register_collection_with_valid_muplugin_path() { public function test_register_collection_with_invalid_muplugin_path() { $invalid_plugin_path = WPMU_PLUGIN_DIR; - $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( $invalid_plugin_path, $this->temp_manifest_file ); $this->assertFalse( $result, 'Invalid must-use plugin path should not be registered' ); @@ -117,7 +117,7 @@ public function test_register_collection_with_valid_theme_path() { public function test_register_collection_with_invalid_theme_path() { $invalid_theme_path = WP_CONTENT_DIR . '/themes'; - $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( $invalid_theme_path, $this->temp_manifest_file ); $this->assertFalse( $result, 'Invalid theme path should not be registered' ); @@ -145,7 +145,7 @@ static function ( $paths ) use ( $arbitrary_path ) { } ); - $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( $arbitrary_path, $this->temp_manifest_file ); $this->assertFalse( $result, 'Arbitrary path should not be registered if it matches a collection root' ); @@ -163,7 +163,7 @@ static function ( $paths ) use ( $arbitrary_path ) { public function test_register_collection_with_wp_content_parent_directory_path() { $invalid_path = dirname( WP_CONTENT_DIR ); - $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( $invalid_path, $this->temp_manifest_file ); $this->assertFalse( $result, 'Invalid path (parent directory of "wp-content") should not be registered' ); @@ -175,7 +175,7 @@ public function test_register_collection_with_wp_content_parent_directory_path() public function test_register_collection_with_wp_includes_parent_directory_path() { $invalid_path = ABSPATH; - $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( $invalid_path, $this->temp_manifest_file ); $this->assertFalse( $result, 'Invalid path (parent directory of "wp-includes") should not be registered' ); @@ -184,7 +184,7 @@ public function test_register_collection_with_wp_includes_parent_directory_path( public function test_register_collection_with_non_existent_manifest() { $non_existent_manifest = '/path/that/does/not/exist/block-manifest.php'; - $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( '/var/arbitrary/path', $non_existent_manifest ); $this->assertFalse( $result, 'Non-existent manifest should not be registered' ); @@ -277,7 +277,7 @@ static function ( $paths ) use ( $plugins_path ) { } ); - $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( $plugins_path, $this->temp_manifest_file ); $this->assertFalse( $result, 'Arbitrary Windows path should not be registered if it matches a collection root' ); diff --git a/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php b/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php index b4b83be1048f3..cd7a66f1ec7f7 100644 --- a/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php +++ b/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php @@ -77,7 +77,7 @@ public function tear_down() { * * @covers WP_Block_Patterns_Registry::register * - * @expectedIncorrectUsage WP_Block_Patterns_Registry::register + * @expectedWPIncorrectUsage WP_Block_Patterns_Registry::register */ public function test_missing_name() { $name = null; @@ -97,7 +97,7 @@ public function test_missing_name() { * * @covers WP_Block_Patterns_Registry::register * - * @expectedIncorrectUsage WP_Block_Patterns_Registry::register + * @expectedWPIncorrectUsage WP_Block_Patterns_Registry::register */ public function test_invalid_non_string_name() { $name = 123; @@ -117,7 +117,7 @@ public function test_invalid_non_string_name() { * * @covers WP_Block_Patterns_Registry::register * - * @expectedIncorrectUsage WP_Block_Patterns_Registry::register + * @expectedWPIncorrectUsage WP_Block_Patterns_Registry::register */ public function test_missing_title() { $name = 'test/pattern'; @@ -136,7 +136,7 @@ public function test_missing_title() { * * @covers WP_Block_Patterns_Registry::register * - * @expectedIncorrectUsage WP_Block_Patterns_Registry::register + * @expectedWPIncorrectUsage WP_Block_Patterns_Registry::register */ public function test_invalid_non_string_title() { $name = 'test/pattern'; @@ -156,7 +156,7 @@ public function test_invalid_non_string_title() { * * @covers WP_Block_Patterns_Registry::register * - * @expectedIncorrectUsage WP_Block_Patterns_Registry::register + * @expectedWPIncorrectUsage WP_Block_Patterns_Registry::register */ public function test_missing_content() { $name = 'Test Pattern'; @@ -175,7 +175,7 @@ public function test_missing_content() { * * @covers WP_Block_Patterns_Registry::register * - * @expectedIncorrectUsage WP_Block_Patterns_Registry::register + * @expectedWPIncorrectUsage WP_Block_Patterns_Registry::register */ public function test_invalid_non_string_content() { $name = 'Test Pattern'; @@ -213,7 +213,7 @@ public function test_register_block_pattern() { * * @covers WP_Block_Patterns_Registry::unregister * - * @expectedIncorrectUsage WP_Block_Patterns_Registry::unregister + * @expectedWPIncorrectUsage WP_Block_Patterns_Registry::unregister */ public function test_unregister_not_registered_block() { $success = $this->registry->unregister( 'test/unregistered' ); diff --git a/tests/phpunit/tests/blocks/wpBlockTypeRegistry.php b/tests/phpunit/tests/blocks/wpBlockTypeRegistry.php index 97f35f2e8ac7a..d304dc4ba4587 100644 --- a/tests/phpunit/tests/blocks/wpBlockTypeRegistry.php +++ b/tests/phpunit/tests/blocks/wpBlockTypeRegistry.php @@ -51,7 +51,7 @@ public function tear_down() { * * @dataProvider data_invalid_block_names * - * @expectedIncorrectUsage WP_Block_Type_Registry::register + * @expectedWPIncorrectUsage WP_Block_Type_Registry::register */ public function test_invalid_block_names( $name ) { $result = $this->registry->register( $name, array() ); @@ -99,7 +99,7 @@ public function test_register_block_type() { * * @covers ::register * - * @expectedIncorrectUsage WP_Block_Type_Registry::register + * @expectedWPIncorrectUsage WP_Block_Type_Registry::register */ public function test_register_block_type_twice() { $name = 'core/paragraph'; @@ -134,7 +134,7 @@ public function test_register_block_type_instance() { * * @covers ::unregister * - * @expectedIncorrectUsage WP_Block_Type_Registry::unregister + * @expectedWPIncorrectUsage WP_Block_Type_Registry::unregister */ public function test_unregister_not_registered_block() { $result = $this->registry->unregister( 'core/unregistered' ); diff --git a/tests/phpunit/tests/cache.php b/tests/phpunit/tests/cache.php index 1f345652b1fd9..ece91725a03db 100644 --- a/tests/phpunit/tests/cache.php +++ b/tests/phpunit/tests/cache.php @@ -44,7 +44,7 @@ public function test_is_valid_key( $key, $valid ) { $this->assertTrue( $this->cache->add( $key, $val ), 'WP_Object_Cache:add() should return true for valid keys.' ); $this->assertSame( $val, $this->cache->get( $key ), 'The retrieved value should match the added value.' ); } else { - $this->setExpectedIncorrectUsage( 'WP_Object_Cache::add' ); + $this->expectWPIncorrectUsage( 'WP_Object_Cache::add' ); $this->assertFalse( $this->cache->add( $key, $val ), 'WP_Object_Cache:add() should return false for invalid keys.' ); } } @@ -213,7 +213,7 @@ public function test_wp_cache_flush_group() { $this->assertSame( $val, wp_cache_get( $key, 'group-test' ), 'group-test should contain my-val' ); if ( wp_using_ext_object_cache() ) { - $this->setExpectedIncorrectUsage( 'wp_cache_flush_group' ); + $this->expectWPIncorrectUsage( 'wp_cache_flush_group' ); } $results = wp_cache_flush_group( 'group-test' ); diff --git a/tests/phpunit/tests/category/getAllCategoryIds.php b/tests/phpunit/tests/category/getAllCategoryIds.php index 3fb8223afa060..28b46d493b0b0 100644 --- a/tests/phpunit/tests/category/getAllCategoryIds.php +++ b/tests/phpunit/tests/category/getAllCategoryIds.php @@ -10,7 +10,7 @@ class Tests_Category_GetAllCategoryIds extends WP_UnitTestCase { /** * Validate get_all_category_ids * - * @expectedDeprecated get_all_category_ids + * @expectedWPDeprecated get_all_category_ids */ public function test_get_all_category_ids() { // Ccreate categories. diff --git a/tests/phpunit/tests/category/getCategoryParents.php b/tests/phpunit/tests/category/getCategoryParents.php index f2b7e83d1dd38..cb63cb92a514d 100644 --- a/tests/phpunit/tests/category/getCategoryParents.php +++ b/tests/phpunit/tests/category/getCategoryParents.php @@ -56,7 +56,7 @@ public function test_nicename_true() { } public function test_deprecated_argument_visited() { - $this->setExpectedDeprecated( 'get_category_parents' ); + $this->expectWPDeprecated( 'get_category_parents' ); $found = get_category_parents( $this->c2->term_id, false, '/', false, array( $this->c1->term_id ) ); } diff --git a/tests/phpunit/tests/compat/jsonEncodeDecode.php b/tests/phpunit/tests/compat/jsonEncodeDecode.php index be51c6022b193..5821e4714acb2 100644 --- a/tests/phpunit/tests/compat/jsonEncodeDecode.php +++ b/tests/phpunit/tests/compat/jsonEncodeDecode.php @@ -8,15 +8,15 @@ class Tests_Compat_jsonEncodeDecode extends WP_UnitTestCase { public function test_json_encode_decode() { - $this->setExpectedDeprecated( 'class-json.php' ); - $this->setExpectedDeprecated( 'Services_JSON::__construct' ); - $this->setExpectedDeprecated( 'Services_JSON::encodeUnsafe' ); - $this->setExpectedDeprecated( 'Services_JSON::_encode' ); - $this->setExpectedDeprecated( 'Services_JSON::reduce_string' ); - $this->setExpectedDeprecated( 'Services_JSON::decode' ); - $this->setExpectedDeprecated( 'Services_JSON::isError' ); - $this->setExpectedDeprecated( 'Services_JSON::strlen8' ); - $this->setExpectedDeprecated( 'Services_JSON::substr8' ); + $this->expectWPDeprecated( 'class-json.php' ); + $this->expectWPDeprecated( 'Services_JSON::__construct' ); + $this->expectWPDeprecated( 'Services_JSON::encodeUnsafe' ); + $this->expectWPDeprecated( 'Services_JSON::_encode' ); + $this->expectWPDeprecated( 'Services_JSON::reduce_string' ); + $this->expectWPDeprecated( 'Services_JSON::decode' ); + $this->expectWPDeprecated( 'Services_JSON::isError' ); + $this->expectWPDeprecated( 'Services_JSON::strlen8' ); + $this->expectWPDeprecated( 'Services_JSON::substr8' ); require_once ABSPATH . WPINC . '/class-json.php'; $json = new Services_JSON(); diff --git a/tests/phpunit/tests/connectors/wpConnectorRegistry.php b/tests/phpunit/tests/connectors/wpConnectorRegistry.php index 71aae168252ac..12359888e5868 100644 --- a/tests/phpunit/tests/connectors/wpConnectorRegistry.php +++ b/tests/phpunit/tests/connectors/wpConnectorRegistry.php @@ -103,7 +103,7 @@ public function test_register_uses_custom_setting_name_when_provided() { * @ticket 64957 */ public function test_register_rejects_empty_setting_name() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication']['setting_name'] = ''; @@ -117,7 +117,7 @@ public function test_register_rejects_empty_setting_name() { * @ticket 64957 */ public function test_register_rejects_non_string_setting_name() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication']['setting_name'] = 123; @@ -184,7 +184,7 @@ public function test_register_accepts_application_password_constant_and_env_name * @param string $name_key Authentication argument key. */ public function test_register_rejects_empty_application_password_external_names( string $name_key ) { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication'] = array( @@ -234,7 +234,7 @@ public function test_register_omits_constant_name_when_not_provided() { * @ticket 64957 */ public function test_register_rejects_empty_constant_name() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication']['constant_name'] = ''; @@ -248,7 +248,7 @@ public function test_register_rejects_empty_constant_name() { * @ticket 64957 */ public function test_register_rejects_non_string_constant_name() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication']['constant_name'] = 123; @@ -283,7 +283,7 @@ public function test_register_omits_env_var_name_when_not_provided() { * @ticket 64957 */ public function test_register_rejects_empty_env_var_name() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication']['env_var_name'] = ''; @@ -297,7 +297,7 @@ public function test_register_rejects_empty_env_var_name() { * @ticket 64957 */ public function test_register_rejects_non_string_env_var_name() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication']['env_var_name'] = 123; @@ -405,7 +405,7 @@ public function test_register_stores_plugin_is_active_callback() { * @ticket 65020 */ public function test_register_rejects_non_callable_plugin_is_active() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['plugin'] = array( @@ -447,7 +447,7 @@ public function test_register_defaults_plugin_when_not_provided() { * @ticket 64791 */ public function test_register_rejects_invalid_id_with_uppercase() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $result = $this->registry->register( 'InvalidId', self::$default_args ); @@ -476,7 +476,7 @@ public function test_register_accepts_id_with_underscores() { * @ticket 64791 */ public function test_register_rejects_empty_id() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $result = $this->registry->register( '', self::$default_args ); @@ -487,7 +487,7 @@ public function test_register_rejects_empty_id() { * @ticket 64791 */ public function test_register_rejects_duplicate_id() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $this->registry->register( 'test-duplicate', self::$default_args ); $result = $this->registry->register( 'test-duplicate', self::$default_args ); @@ -499,7 +499,7 @@ public function test_register_rejects_duplicate_id() { * @ticket 64791 */ public function test_register_rejects_missing_name() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; unset( $args['name'] ); @@ -513,7 +513,7 @@ public function test_register_rejects_missing_name() { * @ticket 64791 */ public function test_register_rejects_empty_name() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['name'] = ''; @@ -527,7 +527,7 @@ public function test_register_rejects_empty_name() { * @ticket 64791 */ public function test_register_rejects_missing_type() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; unset( $args['type'] ); @@ -541,7 +541,7 @@ public function test_register_rejects_missing_type() { * @ticket 64791 */ public function test_register_rejects_missing_authentication() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; unset( $args['authentication'] ); @@ -555,7 +555,7 @@ public function test_register_rejects_missing_authentication() { * @ticket 64791 */ public function test_register_rejects_invalid_auth_method() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication']['method'] = 'oauth'; @@ -597,7 +597,7 @@ public function test_get_registered_returns_connector_data() { * @ticket 64791 */ public function test_get_registered_returns_null_for_unregistered() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::get_registered' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::get_registered' ); $result = $this->registry->get_registered( 'nonexistent' ); @@ -645,7 +645,7 @@ public function test_unregister_removes_connector() { * @ticket 64791 */ public function test_unregister_returns_null_for_unregistered() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::unregister' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::unregister' ); $result = $this->registry->unregister( 'nonexistent' ); @@ -665,7 +665,7 @@ public function test_get_instance_returns_registry() { * @ticket 64791 */ public function test_set_instance_rejects_after_init() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::set_instance' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::set_instance' ); WP_Connector_Registry::set_instance( new WP_Connector_Registry() ); } diff --git a/tests/phpunit/tests/connectors/wpConnectorsGetConnectorScriptModuleData.php b/tests/phpunit/tests/connectors/wpConnectorsGetConnectorScriptModuleData.php index b9b5014affdd1..ec22643931e42 100644 --- a/tests/phpunit/tests/connectors/wpConnectorsGetConnectorScriptModuleData.php +++ b/tests/phpunit/tests/connectors/wpConnectorsGetConnectorScriptModuleData.php @@ -161,7 +161,7 @@ public function test_environment_variable_takes_precedence_over_database(): void * @ticket 64850 */ public function test_malformed_environment_variable_credentials_fall_back_to_database(): void { - $this->setExpectedIncorrectUsage( 'wp_connectors_get_application_password_credentials' ); + $this->expectWPIncorrectUsage( 'wp_connectors_get_application_password_credentials' ); $this->register_connector( array( 'env_var_name' => self::CREDENTIALS_ENV_VAR_NAME ) ); putenv( self::CREDENTIALS_ENV_VAR_NAME . '=missing-a-separator' ); @@ -184,7 +184,7 @@ public function test_malformed_environment_variable_credentials_fall_back_to_dat * @ticket 64850 */ public function test_malformed_environment_variable_credentials_without_fallback_are_not_connected(): void { - $this->setExpectedIncorrectUsage( 'wp_connectors_get_application_password_credentials' ); + $this->expectWPIncorrectUsage( 'wp_connectors_get_application_password_credentials' ); $this->register_connector( array( 'env_var_name' => self::CREDENTIALS_ENV_VAR_NAME ) ); putenv( self::CREDENTIALS_ENV_VAR_NAME . '=missing-a-separator' ); diff --git a/tests/phpunit/tests/connectors/wpConnectorsIsApiKeyValid.php b/tests/phpunit/tests/connectors/wpConnectorsIsApiKeyValid.php index 4ec59670d2c38..c48b17d285d15 100644 --- a/tests/phpunit/tests/connectors/wpConnectorsIsApiKeyValid.php +++ b/tests/phpunit/tests/connectors/wpConnectorsIsApiKeyValid.php @@ -34,7 +34,7 @@ public function set_up() { * @ticket 64730 */ public function test_unregistered_provider_returns_null() { - $this->setExpectedIncorrectUsage( '_wp_connectors_is_ai_api_key_valid' ); + $this->expectWPIncorrectUsage( '_wp_connectors_is_ai_api_key_valid' ); $result = _wp_connectors_is_ai_api_key_valid( 'test-key', 'nonexistent_provider' ); diff --git a/tests/phpunit/tests/connectors/wpConnectorsResolveAiProviderLogoUrl.php b/tests/phpunit/tests/connectors/wpConnectorsResolveAiProviderLogoUrl.php index 71b1628af3311..15751a7e4642c 100644 --- a/tests/phpunit/tests/connectors/wpConnectorsResolveAiProviderLogoUrl.php +++ b/tests/phpunit/tests/connectors/wpConnectorsResolveAiProviderLogoUrl.php @@ -95,7 +95,7 @@ public function test_returns_null_when_file_does_not_exist() { /** * @ticket 64791 - * @expectedIncorrectUsage _wp_connectors_resolve_ai_provider_logo_url + * @expectedWPIncorrectUsage _wp_connectors_resolve_ai_provider_logo_url */ public function test_returns_null_and_triggers_doing_it_wrong_for_path_outside_plugin_dirs() { $tmp_file = tempnam( sys_get_temp_dir(), 'logo_' ); diff --git a/tests/phpunit/tests/connectors/wpRegisterConnector.php b/tests/phpunit/tests/connectors/wpRegisterConnector.php index ad55c012d97c7..80587774501f3 100644 --- a/tests/phpunit/tests/connectors/wpRegisterConnector.php +++ b/tests/phpunit/tests/connectors/wpRegisterConnector.php @@ -43,7 +43,7 @@ public function test_get_connector_returns_data_for_default() { * @ticket 64791 */ public function test_get_connector_returns_null_for_unregistered() { - $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::get_registered' ); + $this->expectWPIncorrectUsage( 'WP_Connector_Registry::get_registered' ); $result = wp_get_connector( 'nonexistent_provider' ); diff --git a/tests/phpunit/tests/cron.php b/tests/phpunit/tests/cron.php index 7abaf5c92095e..6d484be8ed059 100644 --- a/tests/phpunit/tests/cron.php +++ b/tests/phpunit/tests/cron.php @@ -1074,7 +1074,7 @@ public function data_wp_reschedule_event_works_with_args() { /** * @ticket 49961 - * @expectedDeprecated wp_clear_scheduled_hook + * @expectedWPDeprecated wp_clear_scheduled_hook * * @covers ::wp_clear_scheduled_hook */ diff --git a/tests/phpunit/tests/customize/partial.php b/tests/phpunit/tests/customize/partial.php index 9fc4a478a49b1..d50dcb075bd84 100644 --- a/tests/phpunit/tests/customize/partial.php +++ b/tests/phpunit/tests/customize/partial.php @@ -223,7 +223,7 @@ public function test_render_with_bad_callback_should_give_preference_to_return_v 'render_callback' => array( $this, 'render_echo_and_return' ), ) ); - $this->setExpectedIncorrectUsage( 'render' ); + $this->expectWPIncorrectUsage( 'render' ); $this->assertSame( 'bar', $partial->render() ); } diff --git a/tests/phpunit/tests/customize/widgets.php b/tests/phpunit/tests/customize/widgets.php index b28246ac35a3f..19b101bfa9e80 100644 --- a/tests/phpunit/tests/customize/widgets.php +++ b/tests/phpunit/tests/customize/widgets.php @@ -865,10 +865,10 @@ public function test_render_widget_partial() { * Test deprecated methods. */ public function test_deprecated_methods() { - $this->setExpectedDeprecated( 'WP_Customize_Widgets::setup_widget_addition_previews' ); - $this->setExpectedDeprecated( 'WP_Customize_Widgets::prepreview_added_sidebars_widgets' ); - $this->setExpectedDeprecated( 'WP_Customize_Widgets::prepreview_added_widget_instance' ); - $this->setExpectedDeprecated( 'WP_Customize_Widgets::remove_prepreview_filters' ); + $this->expectWPDeprecated( 'WP_Customize_Widgets::setup_widget_addition_previews' ); + $this->expectWPDeprecated( 'WP_Customize_Widgets::prepreview_added_sidebars_widgets' ); + $this->expectWPDeprecated( 'WP_Customize_Widgets::prepreview_added_widget_instance' ); + $this->expectWPDeprecated( 'WP_Customize_Widgets::remove_prepreview_filters' ); $this->manager->widgets->setup_widget_addition_previews(); $this->manager->widgets->prepreview_added_sidebars_widgets(); $this->manager->widgets->prepreview_added_widget_instance(); diff --git a/tests/phpunit/tests/date/query.php b/tests/phpunit/tests/date/query.php index a894572d01d78..92ef90f2ca2e8 100644 --- a/tests/phpunit/tests/date/query.php +++ b/tests/phpunit/tests/date/query.php @@ -751,7 +751,7 @@ public function test_build_time_query_minute_second() { /** * @ticket 25834 - * @expectedIncorrectUsage WP_Date_Query + * @expectedWPIncorrectUsage WP_Date_Query */ public function test_validate_date_query_before_after() { // Valid values. @@ -798,7 +798,7 @@ public function test_validate_date_query_before_after() { /** * @ticket 25834 - * @expectedIncorrectUsage WP_Date_Query + * @expectedWPIncorrectUsage WP_Date_Query */ public function test_validate_date_query_before_after_with_month() { // Both are valid. @@ -844,7 +844,7 @@ public function test_validate_date_query_before_after_with_month() { /** * @ticket 25834 - * @expectedIncorrectUsage WP_Date_Query + * @expectedWPIncorrectUsage WP_Date_Query */ public function test_validate_date_values_week() { // Valid values. @@ -897,7 +897,7 @@ public function test_validate_date_values_week() { /** * @ticket 25834 - * @expectedIncorrectUsage WP_Date_Query + * @expectedWPIncorrectUsage WP_Date_Query */ public function test_validate_date_values_month() { // Valid values. @@ -915,7 +915,7 @@ public function test_validate_date_values_month() { /** * @ticket 25834 - * @expectedIncorrectUsage WP_Date_Query + * @expectedWPIncorrectUsage WP_Date_Query */ public function test_validate_date_values_day() { // Valid values. @@ -972,7 +972,7 @@ public function test_validate_date_values_day() { /** * @ticket 25834 - * @expectedIncorrectUsage WP_Date_Query + * @expectedWPIncorrectUsage WP_Date_Query */ public function test_validate_date_values_hour() { // Valid values. @@ -990,7 +990,7 @@ public function test_validate_date_values_hour() { /** * @ticket 25834 - * @expectedIncorrectUsage WP_Date_Query + * @expectedWPIncorrectUsage WP_Date_Query */ public function test_validate_date_values_minute() { // Valid values. @@ -1008,7 +1008,7 @@ public function test_validate_date_values_minute() { /** * @ticket 25834 - * @expectedIncorrectUsage WP_Date_Query + * @expectedWPIncorrectUsage WP_Date_Query */ public function test_validate_date_values_second() { // Valid values. @@ -1026,7 +1026,7 @@ public function test_validate_date_values_second() { /** * @ticket 25834 - * @expectedIncorrectUsage WP_Date_Query + * @expectedWPIncorrectUsage WP_Date_Query */ public function test_validate_date_values_day_of_week() { // Valid values. @@ -1044,7 +1044,7 @@ public function test_validate_date_values_day_of_week() { /** * @ticket 28063 - * @expectedIncorrectUsage WP_Date_Query + * @expectedWPIncorrectUsage WP_Date_Query */ public function test_validate_date_values_day_of_week_iso() { // Valid values. @@ -1062,7 +1062,7 @@ public function test_validate_date_values_day_of_week_iso() { /** * @ticket 25834 - * @expectedIncorrectUsage WP_Date_Query + * @expectedWPIncorrectUsage WP_Date_Query */ public function test_validate_date_values_day_of_year() { // Valid values. @@ -1124,7 +1124,7 @@ public function test_validate_date_values_should_process_array_value_for_day() { /** * @ticket 31001 - * @expectedIncorrectUsage WP_Date_Query + * @expectedWPIncorrectUsage WP_Date_Query */ public function test_validate_date_values_should_process_array_value_for_day_when_values_are_invalid() { $p1 = self::factory()->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) ); diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php index 22eeb235e4819..5f047ed75955e 100644 --- a/tests/phpunit/tests/db.php +++ b/tests/phpunit/tests/db.php @@ -366,7 +366,7 @@ public function filter_allowed_incompatible_sql_mode( $modes ) { /** * @ticket 25604 - * @expectedIncorrectUsage wpdb::prepare + * @expectedWPIncorrectUsage wpdb::prepare */ public function test_prepare_without_arguments() { global $wpdb; @@ -385,7 +385,7 @@ public function test_prepare_sprintf() { } /** - * @expectedIncorrectUsage wpdb::prepare + * @expectedWPIncorrectUsage wpdb::prepare */ public function test_prepare_sprintf_invalid_args() { global $wpdb; @@ -407,7 +407,7 @@ public function test_prepare_vsprintf() { } /** - * @expectedIncorrectUsage wpdb::prepare + * @expectedWPIncorrectUsage wpdb::prepare */ public function test_prepare_vsprintf_invalid_args() { global $wpdb; @@ -424,7 +424,7 @@ public function test_prepare_vsprintf_invalid_args() { /** * @ticket 42040 * @dataProvider data_prepare_incorrect_arg_count - * @expectedIncorrectUsage wpdb::prepare + * @expectedWPIncorrectUsage wpdb::prepare */ public function test_prepare_incorrect_arg_count( $query, $args, $expected ) { global $wpdb; @@ -523,7 +523,7 @@ public function test_has_cap() { } /** - * @expectedDeprecated supports_collation + * @expectedWPDeprecated supports_collation */ public function test_supports_collation() { global $wpdb; @@ -1504,7 +1504,7 @@ public function test_prepare_with_placeholders_and_individual_args( $sql, $value global $wpdb; if ( is_string( $incorrect_usage ) || true === $incorrect_usage ) { - $this->setExpectedIncorrectUsage( 'wpdb::prepare' ); + $this->expectWPIncorrectUsage( 'wpdb::prepare' ); } if ( ! is_array( $values ) ) { @@ -1527,7 +1527,7 @@ public function test_prepare_with_placeholders_and_array_args( $sql, $values, $i global $wpdb; if ( is_string( $incorrect_usage ) || true === $incorrect_usage ) { - $this->setExpectedIncorrectUsage( 'wpdb::prepare' ); + $this->expectWPIncorrectUsage( 'wpdb::prepare' ); } if ( ! is_array( $values ) ) { @@ -2114,7 +2114,7 @@ public function test_escape_and_prepare( $escape, $sql, $values, $incorrect_usag global $wpdb; if ( $incorrect_usage ) { - $this->setExpectedIncorrectUsage( 'wpdb::prepare' ); + $this->expectWPIncorrectUsage( 'wpdb::prepare' ); } $escape = esc_sql( $escape ); @@ -2158,7 +2158,7 @@ public function data_escape_and_prepare() { } /** - * @expectedIncorrectUsage wpdb::prepare + * @expectedWPIncorrectUsage wpdb::prepare */ public function test_double_prepare() { global $wpdb; diff --git a/tests/phpunit/tests/dependencies/jquery.php b/tests/phpunit/tests/dependencies/jquery.php index 0305c748b11c5..9b4c031056d66 100644 --- a/tests/phpunit/tests/dependencies/jquery.php +++ b/tests/phpunit/tests/dependencies/jquery.php @@ -69,7 +69,7 @@ public function data_jquery_files_exist(): array { /** * @ticket 22896 * - * @expectedIncorrectUsage wp_deregister_script + * @expectedWPIncorrectUsage wp_deregister_script * * @covers ::wp_script_is */ diff --git a/tests/phpunit/tests/dependencies/scripts.php b/tests/phpunit/tests/dependencies/scripts.php index adb8f2d3d04a0..6c49f3aeac216 100644 --- a/tests/phpunit/tests/dependencies/scripts.php +++ b/tests/phpunit/tests/dependencies/scripts.php @@ -135,7 +135,7 @@ public function get_script_html() { * @param string $expected_msg Expected error message substring. */ public function test_unrecognized_keys_in_args( string $function_name, array $args, string $expected_msg ) { - $this->setExpectedIncorrectUsage( $function_name ); + $this->expectWPIncorrectUsage( $function_name ); call_user_func_array( $function_name, $args ); @@ -1347,7 +1347,7 @@ public function test_empty_fetchpriority_value() { * @covers ::wp_register_script * @covers WP_Scripts::add_data * - * @expectedIncorrectUsage WP_Scripts::add_data + * @expectedWPIncorrectUsage WP_Scripts::add_data */ public function test_invalid_fetchpriority_value() { wp_register_script( 'joke', '/joke.js', array(), null, array( 'fetchpriority' => 'silly' ) ); @@ -1364,7 +1364,7 @@ public function test_invalid_fetchpriority_value() { * @covers ::wp_register_script * @covers WP_Scripts::add_data * - * @expectedIncorrectUsage WP_Scripts::add_data + * @expectedWPIncorrectUsage WP_Scripts::add_data */ public function test_invalid_fetchpriority_value_type() { wp_register_script( 'bad', '/bad.js' ); @@ -1382,7 +1382,7 @@ public function test_invalid_fetchpriority_value_type() { * @covers ::wp_register_script * @covers WP_Scripts::add_data * - * @expectedIncorrectUsage WP_Scripts::add_data + * @expectedWPIncorrectUsage WP_Scripts::add_data */ public function test_invalid_fetchpriority_on_alias() { wp_register_script( 'alias', false, array(), null, array( 'fetchpriority' => 'low' ) ); @@ -1407,7 +1407,7 @@ public function test_add_data_module_dependencies_validation( $data, string $mes wp_register_script( 'test-script', '/test.js' ); $expected_incorrect_usage = 'WP_Scripts::add_data'; - $this->setExpectedIncorrectUsage( $expected_incorrect_usage ); + $this->expectWPIncorrectUsage( $expected_incorrect_usage ); $this->assertSame( $expected, wp_scripts()->add_data( 'test-script', 'module_dependencies', $data ) ); $this->assertStringContainsString( $message, $this->caught_doing_it_wrong[ $expected_incorrect_usage ] ); @@ -1461,7 +1461,7 @@ public function data_add_data_module_dependencies_validation(): array { */ public function test_module_dependencies_require_footer_or_defer( string $function_name, array $args, bool $should_warn ): void { if ( $should_warn ) { - $this->setExpectedIncorrectUsage( $function_name ); + $this->expectWPIncorrectUsage( $function_name ); } call_user_func_array( $function_name, $args ); @@ -2104,7 +2104,7 @@ public function test_setting_in_footer_and_strategy( $set_up, $expected_group, $ * @covers ::wp_register_script * @covers ::wp_enqueue_script * - * @expectedIncorrectUsage WP_Scripts::add_data + * @expectedWPIncorrectUsage WP_Scripts::add_data */ public function test_script_strategy_doing_it_wrong_via_register() { wp_register_script( 'invalid-strategy', '/defaults.js', array(), null, array( 'strategy' => 'random-strategy' ) ); @@ -2128,7 +2128,7 @@ public function test_script_strategy_doing_it_wrong_via_register() { * @covers ::wp_register_script * @covers ::wp_enqueue_script * - * @expectedIncorrectUsage WP_Scripts::add_data + * @expectedWPIncorrectUsage WP_Scripts::add_data */ public function test_script_strategy_doing_it_wrong_via_add_data() { wp_register_script( 'invalid-strategy', '/defaults.js', array(), null ); @@ -2151,7 +2151,7 @@ public function test_script_strategy_doing_it_wrong_via_add_data() { * @covers WP_Scripts::add_data * @covers ::wp_enqueue_script * - * @expectedIncorrectUsage WP_Scripts::add_data + * @expectedWPIncorrectUsage WP_Scripts::add_data */ public function test_script_strategy_doing_it_wrong_via_enqueue() { wp_enqueue_script( 'invalid-strategy', '/defaults.js', array(), null, array( 'strategy' => 'random-strategy' ) ); @@ -2350,7 +2350,7 @@ public function test_wp_script_add_data_with_data_key() { /** * Testing `wp_script_add_data` with the conditional key. * - * @expectedDeprecated WP_Dependencies->add_data() + * @expectedWPDeprecated WP_Dependencies->add_data() * * @since 6.9.0 Conditional comments should now return an empty string. * @@ -2770,7 +2770,7 @@ public function test_wp_add_inline_script_after_with_concat() { } /** - * @expectedDeprecated WP_Dependencies->add_data() + * @expectedWPDeprecated WP_Dependencies->add_data() * * @ticket 14853 * @ticket 63821 @@ -2821,7 +2821,7 @@ public function test_wp_add_inline_script_after_with_concat_and_core_dependency( } /** - * @expectedDeprecated WP_Dependencies->add_data() + * @expectedWPDeprecated WP_Dependencies->add_data() * * @ticket 36392 * @ticket 63821 @@ -3056,7 +3056,7 @@ public function data_provider_to_test_get_inline_script() { * @covers WP_Scripts::get_inline_script_tag * @covers WP_Scripts::print_inline_script * - * @expectedDeprecated WP_Scripts::print_inline_script + * @expectedWPDeprecated WP_Scripts::print_inline_script * * @dataProvider data_provider_to_test_get_inline_script * @@ -3747,7 +3747,7 @@ public function test_wp_enqueue_code_editor_when_simple_array_will_be_passed() { */ public function test_wp_localize_script_data_formats( $l10n_data, $expected ) { if ( ! is_array( $l10n_data ) ) { - $this->setExpectedIncorrectUsage( 'WP_Scripts::localize' ); + $this->expectWPIncorrectUsage( 'WP_Scripts::localize' ); } wp_enqueue_script( 'test-example', 'example.com', array(), null ); @@ -4404,7 +4404,7 @@ public function test_print_translations_no_display_no_sourceurl() { */ public function test_wp_scripts_doing_it_wrong_for_missing_dependencies() { $expected_incorrect_usage = 'WP_Scripts::add'; - $this->setExpectedIncorrectUsage( $expected_incorrect_usage ); + $this->expectWPIncorrectUsage( $expected_incorrect_usage ); wp_register_script( 'registered-dep', '/registered-dep.js' ); wp_enqueue_script( 'main', '/main.js', array( 'registered-dep', 'missing-dep' ) ); diff --git a/tests/phpunit/tests/dependencies/styles.php b/tests/phpunit/tests/dependencies/styles.php index 626a5861eb782..bc759746cf60b 100644 --- a/tests/phpunit/tests/dependencies/styles.php +++ b/tests/phpunit/tests/dependencies/styles.php @@ -324,7 +324,7 @@ public function test_multiple_inline_styles() { /** * Test if a plugin doing it the wrong way still works * - * @expectedIncorrectUsage wp_add_inline_style + * @expectedWPIncorrectUsage wp_add_inline_style * @ticket 24813 */ public function test_plugin_doing_inline_styles_wrong() { @@ -364,7 +364,7 @@ public function test_unnecessary_style_tags() { * Test to make sure that inline styles attached to conditional * stylesheets are also conditional. * - * @expectedDeprecated WP_Dependencies->add_data() + * @expectedWPDeprecated WP_Dependencies->add_data() */ public function test_conditional_inline_styles_are_also_conditional() { wp_enqueue_style( 'handle', 'http://example.com', array(), 1 ); @@ -772,7 +772,7 @@ public function test_wp_maybe_inline_styles_multiple_runs() { * @ticket 64447 * * @covers ::wp_maybe_inline_styles - * @expectedIncorrectUsage wp_maybe_inline_styles + * @expectedWPIncorrectUsage wp_maybe_inline_styles */ public function test_wp_maybe_inline_styles_missing_file() { $filter = new MockAction(); @@ -827,7 +827,7 @@ public function test_wp_maybe_inline_styles_no_path() { * @ticket 64447 * * @covers ::wp_maybe_inline_styles - * @expectedIncorrectUsage wp_maybe_inline_styles + * @expectedWPIncorrectUsage wp_maybe_inline_styles */ public function test_wp_maybe_inline_styles_bad_path_with_file_size_provided() { $style_path = '/css/invalid.css'; // Does not exist. @@ -951,7 +951,7 @@ public function test_source_url_with_concat() { */ public function test_wp_style_doing_it_wrong_for_missing_dependencies() { $expected_incorrect_usage = 'WP_Styles::add'; - $this->setExpectedIncorrectUsage( $expected_incorrect_usage ); + $this->expectWPIncorrectUsage( $expected_incorrect_usage ); wp_enqueue_style( 'main-style', diff --git a/tests/phpunit/tests/dependencies/wpInlineScriptTag.php b/tests/phpunit/tests/dependencies/wpInlineScriptTag.php index 590872ee3fd6c..0a59233fb10b6 100644 --- a/tests/phpunit/tests/dependencies/wpInlineScriptTag.php +++ b/tests/phpunit/tests/dependencies/wpInlineScriptTag.php @@ -170,7 +170,7 @@ public function test_script_tag_repeat_attributes() { * * @ticket 64500 * - * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text + * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text */ public function test_script_tag_dangerous_unescapeable_contents() { /* diff --git a/tests/phpunit/tests/dependencies/wpRemoveSurroundingEmptyScriptTags.php b/tests/phpunit/tests/dependencies/wpRemoveSurroundingEmptyScriptTags.php index 6bd8036c38d1d..4a6809fbbd52b 100644 --- a/tests/phpunit/tests/dependencies/wpRemoveSurroundingEmptyScriptTags.php +++ b/tests/phpunit/tests/dependencies/wpRemoveSurroundingEmptyScriptTags.php @@ -67,7 +67,7 @@ public function get_data_to_test_wp_remove_surrounding_empty_script_tags() { */ public function test_wp_remove_surrounding_empty_script_tags( $input, $expected, $expect_doing_it_wrong ) { if ( $expect_doing_it_wrong ) { - $this->setExpectedIncorrectUsage( 'wp_remove_surrounding_empty_script_tags' ); + $this->expectWPIncorrectUsage( 'wp_remove_surrounding_empty_script_tags' ); } $this->assertSame( diff --git a/tests/phpunit/tests/dependencies/wpSanitizeScriptAttributes.php b/tests/phpunit/tests/dependencies/wpSanitizeScriptAttributes.php index 92f10b8999d82..969fc0adc61ba 100644 --- a/tests/phpunit/tests/dependencies/wpSanitizeScriptAttributes.php +++ b/tests/phpunit/tests/dependencies/wpSanitizeScriptAttributes.php @@ -10,7 +10,7 @@ class Tests_Dependencies_wpSanitizeScriptAttributes extends WP_UnitTestCase { public function test_sanitize_script_attributes_type_set() { - $this->setExpectedDeprecated( 'wp_sanitize_script_attributes' ); + $this->expectWPDeprecated( 'wp_sanitize_script_attributes' ); $this->assertSame( ' type="application/javascript" src="https://DOMAIN.TLD/PATH/FILE.js" nomodule', wp_sanitize_script_attributes( @@ -25,7 +25,7 @@ public function test_sanitize_script_attributes_type_set() { } public function test_sanitize_script_attributes_type_not_set() { - $this->setExpectedDeprecated( 'wp_sanitize_script_attributes' ); + $this->expectWPDeprecated( 'wp_sanitize_script_attributes' ); $this->assertSame( ' src="https://DOMAIN.TLD/PATH/FILE.js" nomodule', wp_sanitize_script_attributes( @@ -40,7 +40,7 @@ public function test_sanitize_script_attributes_type_not_set() { public function test_sanitize_script_attributes_no_attributes() { - $this->setExpectedDeprecated( 'wp_sanitize_script_attributes' ); + $this->expectWPDeprecated( 'wp_sanitize_script_attributes' ); $this->assertSame( '', wp_sanitize_script_attributes( array() ) @@ -48,7 +48,7 @@ public function test_sanitize_script_attributes_no_attributes() { } public function test_sanitize_script_attributes_relative_src() { - $this->setExpectedDeprecated( 'wp_sanitize_script_attributes' ); + $this->expectWPDeprecated( 'wp_sanitize_script_attributes' ); $this->assertSame( ' src="PATH/FILE.js" nomodule', wp_sanitize_script_attributes( @@ -63,7 +63,7 @@ public function test_sanitize_script_attributes_relative_src() { public function test_sanitize_script_attributes_only_false_boolean_attributes() { - $this->setExpectedDeprecated( 'wp_sanitize_script_attributes' ); + $this->expectWPDeprecated( 'wp_sanitize_script_attributes' ); $this->assertSame( '', wp_sanitize_script_attributes( @@ -76,7 +76,7 @@ public function test_sanitize_script_attributes_only_false_boolean_attributes() } public function test_sanitize_script_attributes_only_true_boolean_attributes() { - $this->setExpectedDeprecated( 'wp_sanitize_script_attributes' ); + $this->expectWPDeprecated( 'wp_sanitize_script_attributes' ); $this->assertSame( ' async nomodule', wp_sanitize_script_attributes( diff --git a/tests/phpunit/tests/filters.php b/tests/phpunit/tests/filters.php index 87d72053dbf58..b04246da4318b 100644 --- a/tests/phpunit/tests/filters.php +++ b/tests/phpunit/tests/filters.php @@ -476,7 +476,7 @@ public function test_has_filter_after_remove_all_filters() { /** * @ticket 10441 - * @expectedDeprecated tests_apply_filters_deprecated + * @expectedWPDeprecated tests_apply_filters_deprecated */ public function test_apply_filters_deprecated() { $p = 'Foo'; @@ -495,7 +495,7 @@ public static function deprecated_filter_callback( $p ) { /** * @ticket 10441 - * @expectedDeprecated tests_apply_filters_deprecated + * @expectedWPDeprecated tests_apply_filters_deprecated */ public function test_apply_filters_deprecated_with_multiple_params() { $p1 = 'Foo1'; diff --git a/tests/phpunit/tests/fonts/font-library/wpFontCollection/__construct.php b/tests/phpunit/tests/fonts/font-library/wpFontCollection/__construct.php index a0693ce341456..e9b18cf09d4d8 100644 --- a/tests/phpunit/tests/fonts/font-library/wpFontCollection/__construct.php +++ b/tests/phpunit/tests/fonts/font-library/wpFontCollection/__construct.php @@ -13,7 +13,7 @@ class Tests_Fonts_WpFontCollection_Construct extends WP_UnitTestCase { public function test_should_do_it_wrong_with_invalid_slug() { - $this->setExpectedIncorrectUsage( 'WP_Font_Collection::__construct' ); + $this->expectWPIncorrectUsage( 'WP_Font_Collection::__construct' ); $mock_collection_data = array( 'name' => 'Test Collection', 'font_families' => array( 'mock ' ), diff --git a/tests/phpunit/tests/fonts/font-library/wpFontCollection/getData.php b/tests/phpunit/tests/fonts/font-library/wpFontCollection/getData.php index 97ea664d4867d..a76a14bc09484 100644 --- a/tests/phpunit/tests/fonts/font-library/wpFontCollection/getData.php +++ b/tests/phpunit/tests/fonts/font-library/wpFontCollection/getData.php @@ -207,7 +207,7 @@ public function data_create_font_collection() { * @param array $config Font collection config. */ public function test_should_error_when_missing_properties( $config ) { - $this->setExpectedIncorrectUsage( 'WP_Font_Collection::sanitize_and_validate_data' ); + $this->expectWPIncorrectUsage( 'WP_Font_Collection::sanitize_and_validate_data' ); $collection = new WP_Font_Collection( 'my-collection', $config ); $data = $collection->get_data(); @@ -253,7 +253,7 @@ public function data_should_error_when_missing_properties() { } public function test_should_error_with_invalid_json_file_path() { - $this->setExpectedIncorrectUsage( 'WP_Font_Collection::load_from_json' ); + $this->expectWPIncorrectUsage( 'WP_Font_Collection::load_from_json' ); $collection = new WP_Font_Collection( 'my-collection', @@ -296,7 +296,7 @@ public function test_should_error_with_invalid_json_from_file() { } public function test_should_error_with_invalid_url() { - $this->setExpectedIncorrectUsage( 'WP_Font_Collection::load_from_json' ); + $this->expectWPIncorrectUsage( 'WP_Font_Collection::load_from_json' ); $collection = new WP_Font_Collection( 'my-collection', diff --git a/tests/phpunit/tests/fonts/font-library/wpFontLibrary/registerFontCollection.php b/tests/phpunit/tests/fonts/font-library/wpFontLibrary/registerFontCollection.php index d3b0f126e2e7e..4a22b8251427c 100644 --- a/tests/phpunit/tests/fonts/font-library/wpFontLibrary/registerFontCollection.php +++ b/tests/phpunit/tests/fonts/font-library/wpFontLibrary/registerFontCollection.php @@ -32,7 +32,7 @@ public function test_should_return_error_if_slug_is_repeated() { $this->assertInstanceOf( 'WP_Font_Collection', $collection1, 'A collection should be registered.' ); // Expects a _doing_it_wrong notice. - $this->setExpectedIncorrectUsage( 'WP_Font_Library::register_font_collection' ); + $this->expectWPIncorrectUsage( 'WP_Font_Library::register_font_collection' ); // Try to register a second collection with same slug. WP_Font_Library::get_instance()->register_font_collection( 'my-collection-1', $mock_collection_data ); diff --git a/tests/phpunit/tests/fonts/font-library/wpRestFontCollectionsController.php b/tests/phpunit/tests/fonts/font-library/wpRestFontCollectionsController.php index b0965d119b103..52ee601ad1320 100644 --- a/tests/phpunit/tests/fonts/font-library/wpRestFontCollectionsController.php +++ b/tests/phpunit/tests/fonts/font-library/wpRestFontCollectionsController.php @@ -85,7 +85,7 @@ public function test_get_items() { * @param string $method The HTTP method to use. */ public function test_get_items_should_only_return_valid_collections( $method ) { - $this->setExpectedIncorrectUsage( 'WP_Font_Collection::load_from_json' ); + $this->expectWPIncorrectUsage( 'WP_Font_Collection::load_from_json' ); wp_set_current_user( self::$admin_id ); wp_register_font_collection( @@ -209,7 +209,7 @@ public function test_get_item_invalid_slug( $method ) { * @param string $method The HTTP method to use. */ public function test_get_item_invalid_collection( $method ) { - $this->setExpectedIncorrectUsage( 'WP_Font_Collection::load_from_json' ); + $this->expectWPIncorrectUsage( 'WP_Font_Collection::load_from_json' ); wp_set_current_user( self::$admin_id ); $slug = 'invalid-collection'; diff --git a/tests/phpunit/tests/formatting/cleanPre.php b/tests/phpunit/tests/formatting/cleanPre.php index 724b89bb76256..d793c74256c41 100644 --- a/tests/phpunit/tests/formatting/cleanPre.php +++ b/tests/phpunit/tests/formatting/cleanPre.php @@ -5,7 +5,7 @@ * tags within `
` elements as part of wpautop().
  *
  * @group formatting
- * @expectedDeprecated clean_pre
+ * @expectedWPDeprecated clean_pre
  *
  * @covers ::clean_pre
  */
diff --git a/tests/phpunit/tests/formatting/likeEscape.php b/tests/phpunit/tests/formatting/likeEscape.php
index 4902056730289..2808b94b820e9 100644
--- a/tests/phpunit/tests/formatting/likeEscape.php
+++ b/tests/phpunit/tests/formatting/likeEscape.php
@@ -8,7 +8,7 @@
 class Tests_Formatting_LikeEscape extends WP_UnitTestCase {
 	/**
 	 * @ticket 10041
-	 * @expectedDeprecated like_escape
+	 * @expectedWPDeprecated like_escape
 	 */
 	public function test_like_escape() {
 
diff --git a/tests/phpunit/tests/formatting/wpHtmleditPre.php b/tests/phpunit/tests/formatting/wpHtmleditPre.php
index 272aac2684bf9..46c22cc980236 100644
--- a/tests/phpunit/tests/formatting/wpHtmleditPre.php
+++ b/tests/phpunit/tests/formatting/wpHtmleditPre.php
@@ -2,7 +2,7 @@
 
 /**
  * @group formatting
- * @expectedDeprecated wp_htmledit_pre
+ * @expectedWPDeprecated wp_htmledit_pre
  *
  * @covers ::wp_htmledit_pre
  */
diff --git a/tests/phpunit/tests/formatting/wpRicheditPre.php b/tests/phpunit/tests/formatting/wpRicheditPre.php
index 323eda673c48d..850d58d8bf8e5 100644
--- a/tests/phpunit/tests/formatting/wpRicheditPre.php
+++ b/tests/phpunit/tests/formatting/wpRicheditPre.php
@@ -2,7 +2,7 @@
 
 /**
  * @group formatting
- * @expectedDeprecated wp_richedit_pre
+ * @expectedWPDeprecated wp_richedit_pre
  *
  * @covers ::wp_richedit_pre
  */
diff --git a/tests/phpunit/tests/formatting/wpSlash.php b/tests/phpunit/tests/formatting/wpSlash.php
index 3617b4bfa4ea0..56066d30a18eb 100644
--- a/tests/phpunit/tests/formatting/wpSlash.php
+++ b/tests/phpunit/tests/formatting/wpSlash.php
@@ -107,7 +107,7 @@ public function test_add_even_more_slashes() {
 	 *
 	 * @ticket 64539
 	 * @covers ::addslashes_gpc
-	 * @expectedDeprecated addslashes_gpc
+	 * @expectedWPDeprecated addslashes_gpc
 	 */
 	public function test_addslashes_gpc_matches_wp_slash_for_strings() {
 		$input = "String with 'quotes' and \"double quotes\"";
@@ -119,7 +119,7 @@ public function test_addslashes_gpc_matches_wp_slash_for_strings() {
 	 *
 	 * @ticket 64539
 	 * @covers ::addslashes_gpc
-	 * @expectedDeprecated addslashes_gpc
+	 * @expectedWPDeprecated addslashes_gpc
 	 */
 	public function test_addslashes_gpc_matches_wp_slash_for_arrays() {
 		$input = array(
diff --git a/tests/phpunit/tests/functions/getNonCachedIds.php b/tests/phpunit/tests/functions/getNonCachedIds.php
index 0f6b93227d710..9fbdd7c044a85 100644
--- a/tests/phpunit/tests/functions/getNonCachedIds.php
+++ b/tests/phpunit/tests/functions/getNonCachedIds.php
@@ -58,7 +58,7 @@ public function data_valid_ids_should_be_returned_as_integers() {
 	public function test_mix_of_valid_and_invalid_ids_should_return_the_valid_ids_and_throw_a_notice() {
 		$object_id = 1;
 
-		$this->setExpectedIncorrectUsage( '_get_non_cached_ids' );
+		$this->expectWPIncorrectUsage( '_get_non_cached_ids' );
 		$this->assertSame(
 			array( $object_id ),
 			_get_non_cached_ids( array( $object_id, null ), 'fake-group' ),
@@ -74,7 +74,7 @@ public function test_mix_of_valid_and_invalid_ids_should_return_the_valid_ids_an
 	 * @param mixed $object_id The object ID.
 	 */
 	public function test_invalid_cache_ids_should_throw_a_notice( $object_id ) {
-		$this->setExpectedIncorrectUsage( '_get_non_cached_ids' );
+		$this->expectWPIncorrectUsage( '_get_non_cached_ids' );
 		$this->assertSame(
 			array(),
 			_get_non_cached_ids( array( $object_id ), 'fake-group' ),
diff --git a/tests/phpunit/tests/functions/wpAdminNotice.php b/tests/phpunit/tests/functions/wpAdminNotice.php
index 3fb5391dead3e..0084b8b635a02 100644
--- a/tests/phpunit/tests/functions/wpAdminNotice.php
+++ b/tests/phpunit/tests/functions/wpAdminNotice.php
@@ -292,7 +292,7 @@ public function data_should_output_admin_notice() {
 	 *
 	 * @ticket 57791
 	 *
-	 * @expectedIncorrectUsage wp_get_admin_notice
+	 * @expectedWPIncorrectUsage wp_get_admin_notice
 	 */
 	public function test_should_throw_doing_it_wrong_with_a_type_containing_spaces() {
 		ob_start();
diff --git a/tests/phpunit/tests/functions/wpGetAdminNotice.php b/tests/phpunit/tests/functions/wpGetAdminNotice.php
index 87343479a2670..2415f42a73ef7 100644
--- a/tests/phpunit/tests/functions/wpGetAdminNotice.php
+++ b/tests/phpunit/tests/functions/wpGetAdminNotice.php
@@ -282,7 +282,7 @@ public function data_should_return_admin_notice() {
 	 *
 	 * @ticket 57791
 	 *
-	 * @expectedIncorrectUsage wp_get_admin_notice
+	 * @expectedWPIncorrectUsage wp_get_admin_notice
 	 */
 	public function test_should_throw_doing_it_wrong_with_a_type_containing_spaces() {
 		$this->assertSame(
diff --git a/tests/phpunit/tests/functions/wpListPluck.php b/tests/phpunit/tests/functions/wpListPluck.php
index 8313116294519..9edbcbcce5ff4 100644
--- a/tests/phpunit/tests/functions/wpListPluck.php
+++ b/tests/phpunit/tests/functions/wpListPluck.php
@@ -20,9 +20,9 @@ public function set_up() {
 		 * for this method.
 		 *
 		 * To ensure that deprecation and incorrect usage notices continue to be
-		 * detectable, this method uses WP_UnitTestCase_Base::expectDeprecated().
+		 * detectable, this method uses WP_UnitTestCase_Base::set_up_deprecation_expectations().
 		 */
-		$this->expectDeprecated();
+		$this->set_up_deprecation_expectations();
 
 		$this->array_list['foo'] = array(
 			'name'   => 'foo',
diff --git a/tests/phpunit/tests/functions/wpListUtil.php b/tests/phpunit/tests/functions/wpListUtil.php
index fd068387fd64c..def845f8d73d4 100644
--- a/tests/phpunit/tests/functions/wpListUtil.php
+++ b/tests/phpunit/tests/functions/wpListUtil.php
@@ -118,7 +118,7 @@ public function data_wp_list_util_pluck() {
 	 * @covers WP_List_Util::pluck
 	 * @covers ::wp_list_pluck
 	 *
-	 * @expectedIncorrectUsage WP_List_Util::pluck
+	 * @expectedWPIncorrectUsage WP_List_Util::pluck
 	 *
 	 * @param array $input An invalid input array.
 	 */
@@ -136,7 +136,7 @@ public function test_wp_list_pluck_should_throw_doing_it_wrong_with_invalid_inpu
 	 * @covers WP_List_Util::pluck
 	 * @covers ::wp_list_pluck
 	 *
-	 * @expectedIncorrectUsage WP_List_Util::pluck
+	 * @expectedWPIncorrectUsage WP_List_Util::pluck
 	 *
 	 * @param array $input An invalid input array.
 	 */
diff --git a/tests/phpunit/tests/functions/wpUniqueIdFromValues.php b/tests/phpunit/tests/functions/wpUniqueIdFromValues.php
index d46afd12f5fba..2e4d5ac8d4b6a 100644
--- a/tests/phpunit/tests/functions/wpUniqueIdFromValues.php
+++ b/tests/phpunit/tests/functions/wpUniqueIdFromValues.php
@@ -113,7 +113,7 @@ public function data_wp_unique_id_from_values() {
 	 *
 	 * @ticket 62985
 	 *
-	 * @expectedIncorrectUsage wp_unique_id_from_values
+	 * @expectedWPIncorrectUsage wp_unique_id_from_values
 	 *
 	 * @since 6.8.0
 	 */
diff --git a/tests/phpunit/tests/general/template_CheckedSelectedHelper.php b/tests/phpunit/tests/general/template_CheckedSelectedHelper.php
index c6d3a5b9deb89..5a1b3e9042ef7 100644
--- a/tests/phpunit/tests/general/template_CheckedSelectedHelper.php
+++ b/tests/phpunit/tests/general/template_CheckedSelectedHelper.php
@@ -59,7 +59,7 @@ public function test_disabled_with_equal_values() {
 	 * @requires PHP < 8.1
 	 */
 	public function test_readonly_with_equal_values() {
-		$this->setExpectedDeprecated( 'readonly' );
+		$this->expectWPDeprecated( 'readonly' );
 
 		// Call the function via a variable to prevent a parse error for this file on PHP 8.1.
 		$fn = 'readonly';
diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessor-bookmark.php b/tests/phpunit/tests/html-api/wpHtmlProcessor-bookmark.php
index 094fea367878a..90a1421818243 100644
--- a/tests/phpunit/tests/html-api/wpHtmlProcessor-bookmark.php
+++ b/tests/phpunit/tests/html-api/wpHtmlProcessor-bookmark.php
@@ -161,7 +161,7 @@ public static function data_processor_constructors(): array {
 	/**
 	 * @ticket 62521
 	 *
-	 * @expectedIncorrectUsage WP_HTML_Processor::set_bookmark
+	 * @expectedWPIncorrectUsage WP_HTML_Processor::set_bookmark
 	 */
 	public function test_bookmarks_not_allowed_on_virtual_nodes() {
 		$processor = WP_HTML_Processor::create_full_parser( 'text' );
diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessor.php b/tests/phpunit/tests/html-api/wpHtmlProcessor.php
index 58e7ef18cba41..e0799423f8f09 100644
--- a/tests/phpunit/tests/html-api/wpHtmlProcessor.php
+++ b/tests/phpunit/tests/html-api/wpHtmlProcessor.php
@@ -30,7 +30,7 @@ class Tests_HtmlApi_WpHtmlProcessor extends WP_UnitTestCase {
 	 * @ticket 58517
 	 *
 	 * @covers WP_HTML_Processor::__construct
-	 * @expectedIncorrectUsage WP_HTML_Processor::__construct
+	 * @expectedWPIncorrectUsage WP_HTML_Processor::__construct
 	 */
 	public function test_warns_that_the_static_creator_methods_should_be_called_instead_of_the_public_constructor() {
 		new WP_HTML_Processor( '

Light roast.

' ); @@ -40,7 +40,7 @@ public function test_warns_that_the_static_creator_methods_should_be_called_inst * @ticket 63854 * * @covers ::create_fragment - * @expectedIncorrectUsage WP_HTML_Processor::create_fragment + * @expectedWPIncorrectUsage WP_HTML_Processor::create_fragment */ public function test_create_fragment_validates_html_parameter() { $processor = WP_HTML_Processor::create_fragment( null ); @@ -51,7 +51,7 @@ public function test_create_fragment_validates_html_parameter() { * @ticket 63854 * * @covers ::create_full_parser - * @expectedIncorrectUsage WP_HTML_Processor::create_full_parser + * @expectedWPIncorrectUsage WP_HTML_Processor::create_full_parser */ public function test_create_full_parser_validates_html_parameter() { $processor = WP_HTML_Processor::create_full_parser( null ); @@ -1130,7 +1130,7 @@ public function test_next_tag_lowercase_tag_name() { * * @ticket 64394 * - * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_bookmark + * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_bookmark */ public function test_deep_nesting_fails_process_without_error() { $html = str_repeat( '', WP_HTML_Processor::MAX_BOOKMARKS * 2 ); @@ -1150,7 +1150,7 @@ public function test_deep_nesting_fails_process_without_error() { /** * @ticket 64394 * - * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_bookmark + * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_bookmark */ public function test_deep_nesting_fails_processing_virtual_tokens_without_error() { /* @@ -1209,7 +1209,7 @@ public function test_deep_nesting_fails_processing_virtual_tokens_without_error( /** * @ticket 64394 * - * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_bookmark + * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_bookmark */ public function test_prevents_unbounded_bookmarking() { $processor = WP_HTML_Processor::create_full_parser( '' ); diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessorModifiableText.php b/tests/phpunit/tests/html-api/wpHtmlProcessorModifiableText.php index 3072a46aa91d0..ac589474c7214 100644 --- a/tests/phpunit/tests/html-api/wpHtmlProcessorModifiableText.php +++ b/tests/phpunit/tests/html-api/wpHtmlProcessorModifiableText.php @@ -78,7 +78,7 @@ public static function data_modifiable_text_special_textarea(): array { * @ticket 64751 * @dataProvider data_set_modifiable_fails_non_atomic_tags * - * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text + * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text */ public function test_set_modifiable_fails_non_atomic_tags( string $html, diff --git a/tests/phpunit/tests/html-api/wpHtmlTagProcessor-bookmark.php b/tests/phpunit/tests/html-api/wpHtmlTagProcessor-bookmark.php index beb4cc60f6d95..ac721de9e9243 100644 --- a/tests/phpunit/tests/html-api/wpHtmlTagProcessor-bookmark.php +++ b/tests/phpunit/tests/html-api/wpHtmlTagProcessor-bookmark.php @@ -414,7 +414,7 @@ public function test_updates_bookmark_for_deletions_before_both_sides() { * @ticket 56299 * * @covers WP_HTML_Tag_Processor::set_bookmark - * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_bookmark + * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_bookmark */ public function test_limits_the_number_of_bookmarks() { $processor = new WP_HTML_Tag_Processor( '
  • One
  • Two
  • Three
' ); @@ -451,7 +451,7 @@ public function test_limits_the_number_of_seek_calls() { ); } - $this->setExpectedIncorrectUsage( 'WP_HTML_Tag_Processor::seek' ); + $this->expectWPIncorrectUsage( 'WP_HTML_Tag_Processor::seek' ); $this->assertFalse( $processor->seek( 'bookmark' ), "$i-th seek() to the bookmark succeeded, even though it should exceed the allowed limit" ); } diff --git a/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php b/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php index 7f59239608d6b..86f7cc3e5265e 100644 --- a/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php +++ b/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php @@ -76,7 +76,7 @@ public function test_has_self_closing_flag_matches_input_html( $html, $flag_is_s * @ticket 63854 * * @covers WP_HTML_Tag_Processor::__construct - * @expectedIncorrectUsage WP_HTML_Tag_Processor::__construct + * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::__construct */ public function test_constructor_validates_html_parameter() { // Test that passing null triggers _doing_it_wrong and sets HTML to empty string. @@ -321,7 +321,7 @@ public function test_set_attribute_is_case_insensitive() { * * @ticket 63863 * - * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_attribute + * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_attribute * * @dataProvider data_invalid_attribute_names * diff --git a/tests/phpunit/tests/html-api/wpHtmlTagProcessorModifiableText.php b/tests/phpunit/tests/html-api/wpHtmlTagProcessorModifiableText.php index cd844a8cee326..f8fde23354bc5 100644 --- a/tests/phpunit/tests/html-api/wpHtmlTagProcessorModifiableText.php +++ b/tests/phpunit/tests/html-api/wpHtmlTagProcessorModifiableText.php @@ -349,7 +349,7 @@ public function test_get_modifiable_text_ignores_newlines_after_seeking() { * * @dataProvider data_tokens_not_supporting_modifiable_text_updates * - * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text + * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text * * @param string $html Contains HTML with a token not supporting modifiable text updates. * @param int $advance_n_tokens Count of times to run `next_token()` before reaching target node. @@ -664,7 +664,7 @@ public static function data_rcdata_element_names(): array { * * @dataProvider data_unallowed_modifiable_text_updates * - * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text + * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text * * @param string $html_with_nonempty_modifiable_text Will be used to find the test element. * @param string $invalid_update Update containing possibly-compromising text. @@ -954,7 +954,7 @@ public function test_modifiable_text_special_textarea(): void { * @ticket 64751 * @dataProvider data_set_modifiable_fails_non_atomic_tags * - * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text + * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text */ public function test_set_modifiable_fails_non_atomic_tags( string $html, diff --git a/tests/phpunit/tests/http/wpGetHttpHeaders.php b/tests/phpunit/tests/http/wpGetHttpHeaders.php index fa77c61484818..1aa663684557f 100644 --- a/tests/phpunit/tests/http/wpGetHttpHeaders.php +++ b/tests/phpunit/tests/http/wpGetHttpHeaders.php @@ -36,7 +36,7 @@ public function test_wp_get_http_headers_invalid_url() { * Test to see if the deprecated argument is working */ public function test_wp_get_http_headers_deprecated_argument() { - $this->setExpectedDeprecated( 'wp_get_http_headers' ); + $this->expectWPDeprecated( 'wp_get_http_headers' ); wp_get_http_headers( 'does_not_matter', $deprecated = true ); } diff --git a/tests/phpunit/tests/icons/wpIconCollectionsRegistry.php b/tests/phpunit/tests/icons/wpIconCollectionsRegistry.php index a0155c4ed434c..ae01e30b2c18b 100644 --- a/tests/phpunit/tests/icons/wpIconCollectionsRegistry.php +++ b/tests/phpunit/tests/icons/wpIconCollectionsRegistry.php @@ -99,7 +99,7 @@ public function data_invalid_collection_slugs() { * * @covers ::register * - * @expectedIncorrectUsage WP_Icon_Collections_Registry::register + * @expectedWPIncorrectUsage WP_Icon_Collections_Registry::register * * @param mixed $slug Invalid slug candidate. */ @@ -115,7 +115,7 @@ public function test_register_rejects_invalid_slug( $slug ) { * * @covers ::register * - * @expectedIncorrectUsage WP_Icon_Collections_Registry::register + * @expectedWPIncorrectUsage WP_Icon_Collections_Registry::register */ public function test_register_twice_fails() { $this->assertTrue( $this->collections->register( 'my-collection', array( 'label' => 'A' ) ) ); @@ -129,7 +129,7 @@ public function test_register_twice_fails() { * * @covers ::register * - * @expectedIncorrectUsage WP_Icon_Collections_Registry::register + * @expectedWPIncorrectUsage WP_Icon_Collections_Registry::register */ public function test_register_rejects_unknown_property() { $result = $this->collections->register( @@ -196,7 +196,7 @@ public function test_unregister_collection_cascades_to_icons() { * * @covers ::unregister * - * @expectedIncorrectUsage WP_Icon_Collections_Registry::unregister + * @expectedWPIncorrectUsage WP_Icon_Collections_Registry::unregister */ public function test_unregister_unknown_collection() { $this->assertFalse( $this->collections->unregister( 'ghost' ) ); diff --git a/tests/phpunit/tests/icons/wpIconsRegistry.php b/tests/phpunit/tests/icons/wpIconsRegistry.php index 621ff00b0df20..0a8c9af2e8341 100644 --- a/tests/phpunit/tests/icons/wpIconsRegistry.php +++ b/tests/phpunit/tests/icons/wpIconsRegistry.php @@ -152,7 +152,7 @@ public function data_invalid_icon_names() { * * @covers ::register * - * @expectedIncorrectUsage WP_Icons_Registry::register + * @expectedWPIncorrectUsage WP_Icons_Registry::register */ public function test_register_icon_twice() { $settings = array( @@ -171,7 +171,7 @@ public function test_register_icon_twice() { * * @covers ::register * - * @expectedIncorrectUsage WP_Icons_Registry::register + * @expectedWPIncorrectUsage WP_Icons_Registry::register * * @param mixed $name Invalid icon name candidate. */ @@ -194,7 +194,7 @@ public function test_register_invalid_name( $name ) { * * @covers ::register * - * @expectedIncorrectUsage WP_Icons_Registry::register + * @expectedWPIncorrectUsage WP_Icons_Registry::register */ public function test_register_rejects_non_namespaced_name() { $result = $this->registry->register( @@ -217,7 +217,7 @@ public function test_register_rejects_non_namespaced_name() { * * @covers ::register * - * @expectedIncorrectUsage WP_Icons_Registry::register + * @expectedWPIncorrectUsage WP_Icons_Registry::register */ public function test_register_rejects_collection_property() { $result = $this->registry->register( @@ -238,7 +238,7 @@ public function test_register_rejects_collection_property() { * * @covers ::register * - * @expectedIncorrectUsage WP_Icons_Registry::register + * @expectedWPIncorrectUsage WP_Icons_Registry::register */ public function test_register_rejects_unregistered_collection() { $result = $this->registry->register( @@ -357,7 +357,7 @@ public function data_sanitize_icon_content(): array { * * @covers ::register * - * @expectedIncorrectUsage WP_Icons_Registry::register + * @expectedWPIncorrectUsage WP_Icons_Registry::register */ public function test_register_icon_with_content_and_file_path() { $result = $this->registry->register( @@ -379,7 +379,7 @@ public function test_register_icon_with_content_and_file_path() { * * @covers ::register * - * @expectedIncorrectUsage WP_Icons_Registry::register + * @expectedWPIncorrectUsage WP_Icons_Registry::register */ public function test_register_icon_without_content_or_file_path() { $result = $this->registry->register( @@ -453,7 +453,7 @@ public function test_unregister_icon() { * * @covers ::unregister * - * @expectedIncorrectUsage WP_Icons_Registry::unregister + * @expectedWPIncorrectUsage WP_Icons_Registry::unregister */ public function test_unregister_unknown_icon() { $this->assertFalse( $this->registry->unregister( 'test-collection/ghost' ) ); @@ -527,7 +527,7 @@ public function test_get_content_returns_null_for_invalid_file( $contents, $exte * * @covers ::register * - * @expectedIncorrectUsage WP_Icons_Registry::register + * @expectedWPIncorrectUsage WP_Icons_Registry::register */ public function test_register_rejects_non_boolean_public_property() { $result = $this->registry->register( @@ -611,7 +611,7 @@ public function data_invalid_keywords() { * @ticket 66158 * * @dataProvider data_invalid_keywords - * @expectedIncorrectUsage WP_Icons_Registry::register + * @expectedWPIncorrectUsage WP_Icons_Registry::register * * @param mixed $keywords Invalid keywords candidate. */ diff --git a/tests/phpunit/tests/image/functions.php b/tests/phpunit/tests/image/functions.php index 9d8b34c24363c..f19674992cde9 100644 --- a/tests/phpunit/tests/image/functions.php +++ b/tests/phpunit/tests/image/functions.php @@ -347,7 +347,7 @@ public function data_wp_save_image_file() { * Tests that wp_save_image_file() throws a deprecated argument notice when passed a GD resource. * * @ticket 6821 - * @expectedDeprecated wp_save_image_file + * @expectedWPDeprecated wp_save_image_file * @requires function imagejpeg * * @covers ::wp_save_image_file @@ -572,7 +572,7 @@ public function data_inferred_mime_types_when_saving_an_image() { * * @ticket 17814 * @covers ::wp_load_image - * @expectedDeprecated wp_load_image + * @expectedWPDeprecated wp_load_image */ public function test_wp_load_image_should_fail_with_error_message_when_loading_a_directory() { $editor = wp_load_image( DIR_TESTDATA ); diff --git a/tests/phpunit/tests/image/size.php b/tests/phpunit/tests/image/size.php index c8c6234b23742..4b0cb5385bc2c 100644 --- a/tests/phpunit/tests/image/size.php +++ b/tests/phpunit/tests/image/size.php @@ -85,7 +85,7 @@ public function test_constrain_dims_boundary() { } /** - * @expectedDeprecated wp_shrink_dimensions + * @expectedWPDeprecated wp_shrink_dimensions */ public function test_shrink_dimensions_default() { $out = wp_shrink_dimensions( 640, 480 ); @@ -96,7 +96,7 @@ public function test_shrink_dimensions_default() { } /** - * @expectedDeprecated wp_shrink_dimensions + * @expectedWPDeprecated wp_shrink_dimensions */ public function test_shrink_dimensions_smaller() { // Image size is smaller than the constraint - no effect. @@ -108,7 +108,7 @@ public function test_shrink_dimensions_smaller() { } /** - * @expectedDeprecated wp_shrink_dimensions + * @expectedWPDeprecated wp_shrink_dimensions */ public function test_shrink_dimensions_equal() { // Image size is equal to the constraint - no effect. @@ -120,7 +120,7 @@ public function test_shrink_dimensions_equal() { } /** - * @expectedDeprecated wp_shrink_dimensions + * @expectedWPDeprecated wp_shrink_dimensions */ public function test_shrink_dimensions_larger() { // Image size is larger than the constraint - result should be constrained. @@ -132,7 +132,7 @@ public function test_shrink_dimensions_larger() { } /** - * @expectedDeprecated wp_shrink_dimensions + * @expectedWPDeprecated wp_shrink_dimensions */ public function test_shrink_dimensions_boundary() { // One dimension is larger than the constraint, one smaller - result should be constrained. diff --git a/tests/phpunit/tests/includes/helpers.php b/tests/phpunit/tests/includes/helpers.php index 5b9b83f463f94..1b0c19079aea3 100644 --- a/tests/phpunit/tests/includes/helpers.php +++ b/tests/phpunit/tests/includes/helpers.php @@ -232,20 +232,54 @@ public function test__unregister_post_status() { /** * @ticket 28486 + * @ticket 54029 */ - public function test_setExpectedDeprecated() { + public function test_expectWPDeprecated() { + $this->expectWPDeprecated( 'Tests_TestHelpers::mock_deprecated' ); + $this->assertTrue( $this->mock_deprecated() ); + } + + /** + * @ticket 54029 + */ + public function test_setExpectedDeprecated_back_compat() { $this->setExpectedDeprecated( 'Tests_TestHelpers::mock_deprecated' ); $this->assertTrue( $this->mock_deprecated() ); } + /** + * @ticket 54029 + * @expectedDeprecated Tests_TestHelpers::mock_deprecated + */ + public function test_expected_deprecated_annotation_back_compat() { + $this->assertTrue( $this->mock_deprecated() ); + } + /** * @ticket 28486 + * @ticket 54029 */ - public function test_setExpectedIncorrectUsage() { + public function test_expectWPIncorrectUsage() { + $this->expectWPIncorrectUsage( 'Tests_TestHelpers::mock_incorrect_usage' ); + $this->assertTrue( $this->mock_incorrect_usage() ); + } + + /** + * @ticket 54029 + */ + public function test_setExpectedIncorrectUsage_back_compat() { $this->setExpectedIncorrectUsage( 'Tests_TestHelpers::mock_incorrect_usage' ); $this->assertTrue( $this->mock_incorrect_usage() ); } + /** + * @ticket 54029 + * @expectedIncorrectUsage Tests_TestHelpers::mock_incorrect_usage + */ + public function test_expected_incorrect_usage_annotation_back_compat() { + $this->assertTrue( $this->mock_incorrect_usage() ); + } + /** * @ticket 31417 */ diff --git a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-bind.php b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-bind.php index 1951919941a32..3f8c6bd1e9adb 100644 --- a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-bind.php +++ b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-bind.php @@ -212,7 +212,7 @@ public function test_wp_bind_doesnt_do_anything_on_non_existent_references() { * @ticket 60356 * * @covers ::process_directives - * @expectedIncorrectUsage WP_Interactivity_API::evaluate + * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate */ public function test_wp_bind_ignores_empty_value() { $html = '
Text
'; @@ -226,7 +226,7 @@ public function test_wp_bind_ignores_empty_value() { * @ticket 60356 * * @covers ::process_directives - * @expectedIncorrectUsage WP_Interactivity_API::evaluate + * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate */ public function test_wp_bind_ignores_without_value() { $html = '
Text
'; @@ -515,7 +515,7 @@ public function data_non_finite_values(): array { * * @dataProvider data_non_finite_values * - * @expectedIncorrectUsage WP_Interactivity_API::data_wp_bind_processor + * @expectedWPIncorrectUsage WP_Interactivity_API::data_wp_bind_processor * * @param float $value Non-finite value to bind. */ @@ -627,7 +627,7 @@ public function test_wp_bind_json_serializable_value_matches_the_client_store() * * @covers ::process_directives * - * @expectedIncorrectUsage WP_Interactivity_API::data_wp_bind_processor + * @expectedWPIncorrectUsage WP_Interactivity_API::data_wp_bind_processor */ public function test_wp_bind_rejects_object_which_fails_to_serialize() { $unserializable = new class() implements JsonSerializable { @@ -684,7 +684,7 @@ public function jsonSerialize() { * * @covers ::process_directives * - * @expectedIncorrectUsage WP_Interactivity_API::data_wp_bind_processor + * @expectedWPIncorrectUsage WP_Interactivity_API::data_wp_bind_processor */ public function test_wp_bind_rejects_object_serializing_to_a_non_finite_value() { $this->interactivity->state( 'myPlugin', array( 'nonFinite' => $this->get_json_serializable( INF ) ) ); @@ -926,7 +926,7 @@ public function jsonSerialize() { * * @dataProvider data_non_scalar_values * - * @expectedIncorrectUsage WP_Interactivity_API::data_wp_bind_processor + * @expectedWPIncorrectUsage WP_Interactivity_API::data_wp_bind_processor * * @param mixed $value Non-scalar value to bind. * @param string $tag_name Tag name to bind the value on. @@ -964,7 +964,7 @@ public function test_wp_bind_rejects_non_scalar_value( $value, string $tag_name, * * @dataProvider data_non_scalar_values * - * @expectedIncorrectUsage WP_Interactivity_API::data_wp_bind_processor + * @expectedWPIncorrectUsage WP_Interactivity_API::data_wp_bind_processor * * @param mixed $value Non-scalar value to bind. * @param string $tag_name Tag name to bind the value on. diff --git a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-class.php b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-class.php index 72162a3c684ef..f1cdcf652368b 100644 --- a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-class.php +++ b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-class.php @@ -237,7 +237,7 @@ public function test_wp_class_doesnt_change_class_attribute_with_empty_directive * @ticket 60356 * * @covers ::process_directives - * @expectedIncorrectUsage WP_Interactivity_API::evaluate + * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate */ public function test_wp_class_doesnt_change_class_attribute_with_empty_value() { $html = '
Text
'; @@ -252,7 +252,7 @@ public function test_wp_class_doesnt_change_class_attribute_with_empty_value() { * @ticket 60356 * * @covers ::process_directives - * @expectedIncorrectUsage WP_Interactivity_API::evaluate + * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate */ public function test_wp_class_doesnt_change_class_attribute_without_value() { $html = '
Text
'; diff --git a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-context.php b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-context.php index 9685a3f979cd9..88a984ad33ca7 100644 --- a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-context.php +++ b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-context.php @@ -317,7 +317,7 @@ public function test_wp_context_works_with_multiple_directives() { * @ticket 60356 * * @covers ::process_directives - * @expectedIncorrectUsage WP_Interactivity_API::evaluate + * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate */ public function test_wp_context_directive_doesnt_work_without_any_namespace() { $html = ' diff --git a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-style.php b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-style.php index 1a5884f34b8e6..92895da429d3f 100644 --- a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-style.php +++ b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-style.php @@ -367,7 +367,7 @@ public function test_wp_style_doesnt_change_style_attribute_with_empty_directive * @ticket 60356 * * @covers ::process_directives - * @expectedIncorrectUsage WP_Interactivity_API::evaluate + * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate */ public function test_wp_style_doesnt_change_style_attribute_with_empty_value() { $html = '
Text
'; @@ -382,7 +382,7 @@ public function test_wp_style_doesnt_change_style_attribute_with_empty_value() { * @ticket 60356 * * @covers ::process_directives - * @expectedIncorrectUsage WP_Interactivity_API::evaluate + * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate */ public function test_wp_style_doesnt_change_style_attribute_without_value() { $html = '
Text
'; diff --git a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php index 9d5a4024fc6c9..77cc043387dee 100644 --- a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php +++ b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php @@ -219,7 +219,7 @@ public function test_state_and_config_dont_print_when_empty() { * * @covers ::print_client_interactivity_data * - * @expectedDeprecated WP_Interactivity_API::print_client_interactivity_data + * @expectedWPDeprecated WP_Interactivity_API::print_client_interactivity_data */ public function test_config_not_printed_when_empty() { $this->interactivity->print_client_interactivity_data(); @@ -231,7 +231,7 @@ public function test_config_not_printed_when_empty() { * * @ticket 60647 * - * @expectedDeprecated WP_Interactivity_API::register_script_modules + * @expectedWPDeprecated WP_Interactivity_API::register_script_modules */ public function test_register_script_modules_deprecated() { $this->interactivity->register_script_modules(); @@ -528,7 +528,7 @@ public function test_state_without_namespace() { * @ticket 61037 * * @covers ::state - * @expectedIncorrectUsage WP_Interactivity_API::state + * @expectedWPIncorrectUsage WP_Interactivity_API::state */ public function test_state_with_data_and_invalid_namespace() { $this->set_internal_namespace_stack( 'myPlugin' ); @@ -548,7 +548,7 @@ public function test_state_with_data_and_invalid_namespace() { * @ticket 61037 * * @covers ::state - * @expectedIncorrectUsage WP_Interactivity_API::state + * @expectedWPIncorrectUsage WP_Interactivity_API::state */ public function test_state_with_empty_string_as_namespace() { $this->set_internal_namespace_stack( 'myPlugin' ); @@ -569,7 +569,7 @@ public function test_state_with_empty_string_as_namespace() { * @ticket 61037 * * @covers ::state - * @expectedIncorrectUsage WP_Interactivity_API::state + * @expectedWPIncorrectUsage WP_Interactivity_API::state */ public function test_state_without_namespace_outside_directive_processing() { $this->assertSame( @@ -683,7 +683,7 @@ public function test_get_context_with_undefined_namespace() { * @ticket 61037 * * @covers ::get_context - * @expectedIncorrectUsage WP_Interactivity_API::get_context + * @expectedWPIncorrectUsage WP_Interactivity_API::get_context */ public function test_get_context_with_empty_namespace() { $this->set_internal_namespace_stack( 'myPlugin' ); @@ -710,7 +710,7 @@ public function test_get_context_with_empty_namespace() { * @ticket 61037 * * @covers ::get_context - * @expectedIncorrectUsage WP_Interactivity_API::get_context + * @expectedWPIncorrectUsage WP_Interactivity_API::get_context */ public function test_get_context_outside_of_directive_processing() { $context = $this->interactivity->get_context(); @@ -1424,7 +1424,7 @@ public function test_process_directives_changes_html_if_contains_svgs() { * @ticket 60517 * * @covers ::process_directives - * @expectedIncorrectUsage WP_Interactivity_API_Directives_Processor::skip_to_tag_closer + * @expectedWPIncorrectUsage WP_Interactivity_API_Directives_Processor::skip_to_tag_closer */ public function test_process_directives_does_not_change_inner_html_in_svgs() { $this->interactivity->state( @@ -1454,7 +1454,7 @@ public function test_process_directives_does_not_change_inner_html_in_svgs() { * @ticket 60517 * * @covers ::process_directives - * @expectedIncorrectUsage WP_Interactivity_API::_process_directives + * @expectedWPIncorrectUsage WP_Interactivity_API::_process_directives */ public function test_process_directives_change_html_if_contains_math() { $this->interactivity->state( @@ -1489,8 +1489,8 @@ public function test_process_directives_change_html_if_contains_math() { * @ticket 60517 * * @covers ::process_directives - * @expectedIncorrectUsage WP_Interactivity_API::_process_directives - * @expectedIncorrectUsage WP_Interactivity_API_Directives_Processor::skip_to_tag_closer + * @expectedWPIncorrectUsage WP_Interactivity_API::_process_directives + * @expectedWPIncorrectUsage WP_Interactivity_API_Directives_Processor::skip_to_tag_closer */ public function test_process_directives_does_not_change_inner_html_in_math() { $this->interactivity->state( @@ -1880,7 +1880,7 @@ public function test_evaluate_nested_value() { * @ticket 61044 * * @covers ::evaluate - * @expectedIncorrectUsage WP_Interactivity_API::evaluate + * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate */ public function test_evaluate_unvalid_namespaces() { $this->set_internal_context_stack( array() ); @@ -2056,7 +2056,7 @@ public function test_evaluate_derived_state_defined_in_different_namespace() { * @ticket 61037 * * @covers ::evaluate - * @expectedIncorrectUsage WP_Interactivity_API::evaluate + * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate */ public function test_evaluate_derived_state_that_throws() { $this->interactivity->state( @@ -2258,7 +2258,7 @@ class="original" * @ticket 62136 * * @covers wp_interactivity_get_element - * @expectedIncorrectUsage WP_Interactivity_API::get_element + * @expectedWPIncorrectUsage WP_Interactivity_API::get_element */ public function test_get_element_outside_of_directive_processing() { $element = $this->interactivity->get_element(); diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php index d3e57d1b747df..a1813f8f538da 100644 --- a/tests/phpunit/tests/media.php +++ b/tests/phpunit/tests/media.php @@ -996,7 +996,7 @@ public function data_wp_prepare_attachment_for_js_filesize_falls_back_to_the_fil /** * @ticket 19067 - * @expectedDeprecated wp_convert_bytes_to_hr + * @expectedWPDeprecated wp_convert_bytes_to_hr */ public function test_wp_convert_bytes_to_hr() { $kb = 1024; @@ -3837,8 +3837,8 @@ public function test_wp_filter_content_tags_loading_lazy_opted_out() { * @ticket 44427 * @ticket 50367 * - * @expectedDeprecated wp_img_tag_add_loading_attr - * @expectedDeprecated wp_get_loading_attr_default + * @expectedWPDeprecated wp_img_tag_add_loading_attr + * @expectedWPDeprecated wp_get_loading_attr_default */ public function test_wp_img_tag_add_loading_attr() { $img = ' width='; @@ -3851,8 +3851,8 @@ public function test_wp_img_tag_add_loading_attr() { * @ticket 44427 * @ticket 50367 * - * @expectedDeprecated wp_img_tag_add_loading_attr - * @expectedDeprecated wp_get_loading_attr_default + * @expectedWPDeprecated wp_img_tag_add_loading_attr + * @expectedWPDeprecated wp_get_loading_attr_default */ public function test_wp_img_tag_add_loading_attr_without_src() { $img = ' width='; @@ -3865,8 +3865,8 @@ public function test_wp_img_tag_add_loading_attr_without_src() { * @ticket 44427 * @ticket 50367 * - * @expectedDeprecated wp_img_tag_add_loading_attr - * @expectedDeprecated wp_get_loading_attr_default + * @expectedWPDeprecated wp_img_tag_add_loading_attr + * @expectedWPDeprecated wp_get_loading_attr_default */ public function test_wp_img_tag_add_loading_attr_with_single_quotes() { $img = " width="; @@ -3895,7 +3895,7 @@ public function test_wp_img_tag_add_loading_attr_opt_out() { * * @ticket 56969 * - * @expectedDeprecated wp_img_tag_add_decoding_attr + * @expectedWPDeprecated wp_img_tag_add_decoding_attr */ public function test_wp_img_tag_add_decoding_attr_with_single_quotes() { $img = ""; @@ -4368,7 +4368,7 @@ public function data_attachment_permalinks_based_on_parent_status() { * * @covers ::wp_get_loading_attr_default * - * @expectedDeprecated wp_get_loading_attr_default + * @expectedWPDeprecated wp_get_loading_attr_default * * @dataProvider data_wp_get_loading_attr_default * @@ -4547,7 +4547,7 @@ public function test_wp_omit_loading_attr_threshold() { * * @dataProvider data_wp_get_loading_attr_default_before_and_no_loop * - * @expectedDeprecated wp_get_loading_attr_default + * @expectedWPDeprecated wp_get_loading_attr_default * * @param string $context Context for the element for which the `loading` attribute value is requested. */ @@ -4571,7 +4571,7 @@ public function test_wp_get_loading_attr_default_before_loop_if_not_main_query( * * @dataProvider data_wp_get_loading_attr_default_before_and_no_loop * - * @expectedDeprecated wp_get_loading_attr_default + * @expectedWPDeprecated wp_get_loading_attr_default * * @param string $context Context for the element for which the `loading` attribute value is requested. */ @@ -4594,7 +4594,7 @@ public function test_wp_get_loading_attr_default_before_loop_in_main_query_but_h * * @dataProvider data_wp_get_loading_attr_default_before_and_no_loop * - * @expectedDeprecated wp_get_loading_attr_default + * @expectedWPDeprecated wp_get_loading_attr_default * * @param string $context Context for the element for which the `loading` attribute value is requested. */ @@ -4617,7 +4617,7 @@ public function test_wp_get_loading_attr_default_before_loop_if_main_query( $con * * @dataProvider data_wp_get_loading_attr_default_before_and_no_loop * - * @expectedDeprecated wp_get_loading_attr_default + * @expectedWPDeprecated wp_get_loading_attr_default * * @param string $context Context for the element for which the `loading` attribute value is requested. */ @@ -4644,7 +4644,7 @@ public function test_wp_get_loading_attr_default_after_loop( $context ) { * * @dataProvider data_wp_get_loading_attr_default_before_and_no_loop * - * @expectedDeprecated wp_get_loading_attr_default + * @expectedWPDeprecated wp_get_loading_attr_default * * @param string $context Context for the element for which the `loading` attribute value is requested. */ @@ -4922,7 +4922,7 @@ static function () use ( &$image_within_content ) { * * @covers ::wp_get_loading_attr_default * - * @expectedDeprecated wp_get_loading_attr_default + * @expectedWPDeprecated wp_get_loading_attr_default * * @dataProvider data_special_contexts_for_the_content_wp_get_loading_attr_default * @@ -4939,7 +4939,7 @@ public function test_wp_get_loading_attr_default_should_return_lazy_for_special_ * * @covers ::wp_get_loading_attr_default * - * @expectedDeprecated wp_get_loading_attr_default + * @expectedWPDeprecated wp_get_loading_attr_default * * @dataProvider data_special_contexts_for_the_content_wp_get_loading_attr_default * @@ -6516,7 +6516,7 @@ public function test_wp_get_loading_optimization_attributes_header_block_templat * @ticket 58892 * * @covers ::wp_get_loading_optimization_attributes - * @expectedIncorrectUsage wp_get_loading_optimization_attributes + * @expectedWPIncorrectUsage wp_get_loading_optimization_attributes */ public function test_wp_get_loading_optimization_attributes_incorrect_loading_attrs() { $attr = $this->get_width_height_for_high_priority(); @@ -7435,7 +7435,7 @@ public function test_wp_enqueue_img_auto_sizes_contain_css_fix( ?Closure $set_up $set_up(); } if ( isset( $expected_deprecated ) ) { - $this->setExpectedDeprecated( $expected_deprecated ); + $this->expectWPDeprecated( $expected_deprecated ); } $this->assertCount( 0, wp_styles()->queue ); diff --git a/tests/phpunit/tests/media/wpImageTagAddDecodingAttr.php b/tests/phpunit/tests/media/wpImageTagAddDecodingAttr.php index 15e1859084a03..c2ec1016752d2 100644 --- a/tests/phpunit/tests/media/wpImageTagAddDecodingAttr.php +++ b/tests/phpunit/tests/media/wpImageTagAddDecodingAttr.php @@ -20,7 +20,7 @@ class Tests_Media_Wp_Img_Tag_Add_Decoding_Attr extends WP_UnitTestCase { * @param string $decoding The value for the 'decoding' attribute. 'no value' for default. * @param string $expected The expected `img` tag. * - * @expectedDeprecated wp_img_tag_add_decoding_attr + * @expectedWPDeprecated wp_img_tag_add_decoding_attr */ public function test_should_add_decoding_attr( $image, $context, $decoding, $expected ) { // Falsey values are allowed in the filter, cannot use `null` or `false` here. @@ -83,7 +83,7 @@ public function data_should_add_decoding_attr() { * @param mixed $decoding The value for the 'decoding' attribute. 'no value' for default. * @param string $expected The expected `img` tag. * - * @expectedDeprecated wp_img_tag_add_decoding_attr + * @expectedWPDeprecated wp_img_tag_add_decoding_attr */ public function test_should_not_add_decoding_attr( $image, $context, $decoding, $expected ) { // Falsey values are allowed in the filter, cannot use `null` or `false` here. diff --git a/tests/phpunit/tests/menu/nav-menu.php b/tests/phpunit/tests/menu/nav-menu.php index fcd3a3ac1059c..47542e97b4434 100644 --- a/tests/phpunit/tests/menu/nav-menu.php +++ b/tests/phpunit/tests/menu/nav-menu.php @@ -182,7 +182,7 @@ public function test_location_guessing_one_menu_per_location() { /** * Technically possible to register menu locations numerically. * - * @expectedIncorrectUsage register_nav_menus + * @expectedWPIncorrectUsage register_nav_menus * * @covers ::wp_map_nav_menu_locations */ @@ -207,7 +207,7 @@ public function test_numerical_locations() { /** * Technically possible old nav menu locations were registered numerically. * - * @expectedIncorrectUsage register_nav_menus + * @expectedWPIncorrectUsage register_nav_menus * * @covers ::wp_map_nav_menu_locations */ diff --git a/tests/phpunit/tests/meta/registerMeta.php b/tests/phpunit/tests/meta/registerMeta.php index 16655124c95ca..7c9a153beb73c 100644 --- a/tests/phpunit/tests/meta/registerMeta.php +++ b/tests/phpunit/tests/meta/registerMeta.php @@ -586,7 +586,7 @@ public function test_get_default_value( $args, $single, $expected ) { * @dataProvider data_get_invalid_default_data */ public function test_get_invalid_default_value( $args, $single, $expected ) { - $this->setExpectedIncorrectUsage( 'register_meta' ); + $this->expectWPIncorrectUsage( 'register_meta' ); $object_type = 'post'; $meta_key = 'registered_key1'; $register = register_meta( @@ -1176,7 +1176,7 @@ public function test_get_object_subtype_for_blog_with_registered_meta() { * @ticket 20564 */ public function test_register_meta_with_revisions_enabled_on_post_type_without_revisions() { - $this->setExpectedIncorrectUsage( 'register_meta' ); + $this->expectWPIncorrectUsage( 'register_meta' ); // Set up a custom post type with revisions disabled. register_post_type( diff --git a/tests/phpunit/tests/multisite/network.php b/tests/phpunit/tests/multisite/network.php index 3a50c6bc5c71a..34c4e5750106e 100644 --- a/tests/phpunit/tests/multisite/network.php +++ b/tests/phpunit/tests/multisite/network.php @@ -347,7 +347,7 @@ public function test_wp_schedule_update_network_counts() { } /** - * @expectedDeprecated get_dashboard_blog + * @expectedWPDeprecated get_dashboard_blog */ public function test_get_dashboard_blog() { // If there is no dashboard blog set, current blog is used. diff --git a/tests/phpunit/tests/multisite/site.php b/tests/phpunit/tests/multisite/site.php index 162b2b4035574..bba55c9e71c29 100644 --- a/tests/phpunit/tests/multisite/site.php +++ b/tests/phpunit/tests/multisite/site.php @@ -2195,7 +2195,7 @@ public function populate_options_callback() { */ public function test_wpmu_new_blog_action_backward_compatible( $meta, $expected_meta ) { // We are testing deprecated hook. Register it to expected deprecated notices. - $this->setExpectedDeprecated( 'wpmu_new_blog' ); + $this->expectWPDeprecated( 'wpmu_new_blog' ); add_action( 'wpmu_new_blog', array( $this, 'wpmu_new_blog_callback' ), 10, 6 ); wpmu_create_blog( 'testsite1.example.org', '/new-blog/', 'New Blog', get_current_user_id(), $meta, 1 ); diff --git a/tests/phpunit/tests/multisite/wpGetSites.php b/tests/phpunit/tests/multisite/wpGetSites.php index 4213b394fa365..ccd1ef2a1c812 100644 --- a/tests/phpunit/tests/multisite/wpGetSites.php +++ b/tests/phpunit/tests/multisite/wpGetSites.php @@ -48,7 +48,7 @@ public static function wpTearDownAfterClass() { } /** - * @expectedDeprecated wp_get_sites + * @expectedWPDeprecated wp_get_sites */ public function test_wp_get_sites_site_is_expected_array() { @@ -74,7 +74,7 @@ public function test_wp_get_sites_site_is_expected_array() { } /** - * @expectedDeprecated wp_get_sites + * @expectedWPDeprecated wp_get_sites * @dataProvider data_wp_get_sites * * @param $expected diff --git a/tests/phpunit/tests/oembed/wpOembed.php b/tests/phpunit/tests/oembed/wpOembed.php index 9240194e49f57..0657f0d41d872 100644 --- a/tests/phpunit/tests/oembed/wpOembed.php +++ b/tests/phpunit/tests/oembed/wpOembed.php @@ -291,7 +291,7 @@ public function test_malformed_provider_triggers_doing_it_wrong(): void { }; add_filter( 'oembed_providers', $filter ); - $this->setExpectedIncorrectUsage( 'WP_oEmbed::__construct' ); + $this->expectWPIncorrectUsage( 'WP_oEmbed::__construct' ); $oembed = new WP_oEmbed(); $this->assertArrayNotHasKey( 'bad_provider', $oembed->providers ); diff --git a/tests/phpunit/tests/option/registration.php b/tests/phpunit/tests/option/registration.php index 850376498e91a..ce880db088cc2 100644 --- a/tests/phpunit/tests/option/registration.php +++ b/tests/phpunit/tests/option/registration.php @@ -113,7 +113,7 @@ public function test_add_option_with_no_options_cache() { } /** - * @expectedDeprecated register_setting + * @expectedWPDeprecated register_setting * * @covers ::register_setting */ @@ -122,7 +122,7 @@ public function test_register_deprecated_group_misc() { } /** - * @expectedDeprecated register_setting + * @expectedWPDeprecated register_setting * * @covers ::register_setting */ diff --git a/tests/phpunit/tests/post/getPageByTitle.php b/tests/phpunit/tests/post/getPageByTitle.php index 084453cbb0144..5f4b33efa472b 100644 --- a/tests/phpunit/tests/post/getPageByTitle.php +++ b/tests/phpunit/tests/post/getPageByTitle.php @@ -12,7 +12,7 @@ class Tests_Post_GetPageByTitle extends WP_UnitTestCase { * * @ticket 57041 * - * @expectedDeprecated get_page_by_title + * @expectedWPDeprecated get_page_by_title */ public function test_get_page_by_title_should_be_deprecated() { $this->assertNull( get_page_by_title( '#57041 Page' ) ); diff --git a/tests/phpunit/tests/post/getTheExcerpt.php b/tests/phpunit/tests/post/getTheExcerpt.php index 8dbaef5a82de1..e38a7c179f1cc 100644 --- a/tests/phpunit/tests/post/getTheExcerpt.php +++ b/tests/phpunit/tests/post/getTheExcerpt.php @@ -16,7 +16,7 @@ public function test_the_excerpt_invalid_post() { /** * @ticket 27246 - * @expectedDeprecated get_the_excerpt + * @expectedWPDeprecated get_the_excerpt */ public function test_the_excerpt_deprecated() { $this->assertSame( '', get_the_excerpt( true ) ); diff --git a/tests/phpunit/tests/post/truncatePostSlug.php b/tests/phpunit/tests/post/truncatePostSlug.php index 81989d61db0e7..41761b53dc04f 100644 --- a/tests/phpunit/tests/post/truncatePostSlug.php +++ b/tests/phpunit/tests/post/truncatePostSlug.php @@ -15,7 +15,7 @@ class Tests_Post_TruncatePostSlug extends WP_UnitTestCase { * * @dataProvider data_truncate_post_slug_should_truncate * - * @expectedDeprecated _truncate_post_slug + * @expectedWPDeprecated _truncate_post_slug * * @param string $slug The slug to truncate. * @param int $length Max length of the slug. diff --git a/tests/phpunit/tests/post/types.php b/tests/phpunit/tests/post/types.php index 0c470a0b3eff2..fce15e9d0ed4a 100644 --- a/tests/phpunit/tests/post/types.php +++ b/tests/phpunit/tests/post/types.php @@ -63,7 +63,7 @@ public function test_register_post_type_return_value() { /** * @ticket 31134 * - * @expectedIncorrectUsage register_post_type + * @expectedWPIncorrectUsage register_post_type */ public function test_register_post_type_with_too_long_name() { // Post type too long. @@ -73,7 +73,7 @@ public function test_register_post_type_with_too_long_name() { /** * @ticket 31134 * - * @expectedIncorrectUsage register_post_type + * @expectedWPIncorrectUsage register_post_type */ public function test_register_post_type_with_empty_name() { // Post type too short. diff --git a/tests/phpunit/tests/post/wpDeletePost.php b/tests/phpunit/tests/post/wpDeletePost.php index 3c2a40fa92bec..29b3ed641840e 100644 --- a/tests/phpunit/tests/post/wpDeletePost.php +++ b/tests/phpunit/tests/post/wpDeletePost.php @@ -83,7 +83,7 @@ private function next_schedule_for_post( $hook, int $post_id ) { * @ticket 63975 */ public function test_wp_delete_post_short_circuit_on_post_id_zero() { - $this->setExpectedIncorrectUsage( 'wp_delete_post' ); + $this->expectWPIncorrectUsage( 'wp_delete_post' ); $this->assertFalse( wp_delete_post( 0, true ) ); } diff --git a/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php b/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php index 2c5ad1f513744..d52e6794411d3 100644 --- a/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php +++ b/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php @@ -221,7 +221,7 @@ public function test_detect_cannot_create_folder() { public function test_doing_it_wrong_for_export_data_grouped_invalid_type( $groups ) { update_post_meta( self::$export_request_id, '_export_data_grouped', $groups ); - $this->setExpectedIncorrectUsage( 'wp_privacy_generate_personal_data_export_file' ); + $this->expectWPIncorrectUsage( 'wp_privacy_generate_personal_data_export_file' ); wp_privacy_generate_personal_data_export_file( self::$export_request_id ); } @@ -318,7 +318,7 @@ public function test_can_succeed() { public function test_html_contents( $groups, array $expected_content = array() ) { // Set the _doing_it_wrong assertion. if ( ! is_array( $groups ) ) { - $this->setExpectedIncorrectUsage( 'wp_privacy_generate_personal_data_export_file' ); + $this->expectWPIncorrectUsage( 'wp_privacy_generate_personal_data_export_file' ); } $request = wp_get_user_request( self::$export_request_id ); @@ -360,7 +360,7 @@ public function test_html_contents( $groups, array $expected_content = array() ) public function test_json_contents( $groups, array $expected_content = array() ) { // Set the _doing_it_wrong assertion. if ( ! is_array( $groups ) ) { - $this->setExpectedIncorrectUsage( 'wp_privacy_generate_personal_data_export_file' ); + $this->expectWPIncorrectUsage( 'wp_privacy_generate_personal_data_export_file' ); } $request = wp_get_user_request( self::$export_request_id ); diff --git a/tests/phpunit/tests/query/conditionals.php b/tests/phpunit/tests/query/conditionals.php index 913e19f650de6..f831b373e6be9 100644 --- a/tests/phpunit/tests/query/conditionals.php +++ b/tests/phpunit/tests/query/conditionals.php @@ -803,7 +803,7 @@ public function test_post_attachment() { // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]', /** - * @expectedIncorrectUsage WP_Date_Query + * @expectedWPIncorrectUsage WP_Date_Query */ public function test_bad_dates() { $this->go_to( '/2013/13/13/' ); @@ -1630,10 +1630,10 @@ public function test_conditional_tags_trigger_doing_it_wrong_and_return_false_if if ( 'is_comments_popup' === $function_name ) { // `is_comments_popup()` is deprecated as of WP 4.5. - $this->setExpectedDeprecated( $function_name ); + $this->expectWPDeprecated( $function_name ); } else { // All the other functions should throw a `_doing_it_wrong()` notice. - $this->setExpectedIncorrectUsage( $function_name ); + $this->expectWPIncorrectUsage( $function_name ); } $this->assertFalse( call_user_func( $function_name ) ); diff --git a/tests/phpunit/tests/query/isSitemap.php b/tests/phpunit/tests/query/isSitemap.php index f772ed09d26e5..29f4e74c515fa 100644 --- a/tests/phpunit/tests/query/isSitemap.php +++ b/tests/phpunit/tests/query/isSitemap.php @@ -216,7 +216,7 @@ public function test_global_is_sitemap_false_on_home(): void { * * @covers ::is_sitemap * - * @expectedIncorrectUsage is_sitemap + * @expectedWPIncorrectUsage is_sitemap */ public function test_global_is_sitemap_before_query_is_run(): void { $wp_query_temp = $GLOBALS['wp_query']; diff --git a/tests/phpunit/tests/query/lazyLoadCommentMeta.php b/tests/phpunit/tests/query/lazyLoadCommentMeta.php index 420fd45b23ce3..26c9822eaa865 100644 --- a/tests/phpunit/tests/query/lazyLoadCommentMeta.php +++ b/tests/phpunit/tests/query/lazyLoadCommentMeta.php @@ -27,7 +27,7 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { * * @covers ::wp_queue_comments_for_comment_meta_lazyload * - * @expectedDeprecated wp_queue_comments_for_comment_meta_lazyload + * @expectedWPDeprecated wp_queue_comments_for_comment_meta_lazyload */ public function test_wp_queue_comments_for_comment_meta_lazyload() { $filter = new MockAction(); @@ -48,7 +48,7 @@ public function test_wp_queue_comments_for_comment_meta_lazyload() { * * @covers ::wp_queue_comments_for_comment_meta_lazyload * - * @expectedDeprecated wp_queue_comments_for_comment_meta_lazyload + * @expectedWPDeprecated wp_queue_comments_for_comment_meta_lazyload */ public function test_wp_queue_comments_for_comment_meta_lazyload_new_comment() { $filter = new MockAction(); diff --git a/tests/phpunit/tests/query/results.php b/tests/phpunit/tests/query/results.php index f5a12b33f374d..3337d6747eefb 100644 --- a/tests/phpunit/tests/query/results.php +++ b/tests/phpunit/tests/query/results.php @@ -1021,7 +1021,7 @@ public function test_query_is_date() { /** * @ticket 10935 - * @expectedIncorrectUsage WP_Date_Query + * @expectedWPIncorrectUsage WP_Date_Query */ public function test_query_is_date_with_bad_date() { $this->q->query( diff --git a/tests/phpunit/tests/rest-api.php b/tests/phpunit/tests/rest-api.php index 22182f3f9ca6c..17e953b1d12d6 100644 --- a/tests/phpunit/tests/rest-api.php +++ b/tests/phpunit/tests/rest-api.php @@ -239,7 +239,7 @@ public function test_route_override() { /** * Test that we reject routes without namespaces * - * @expectedIncorrectUsage register_rest_route + * @expectedWPIncorrectUsage register_rest_route */ public function test_route_reject_empty_namespace() { rest_get_server(); @@ -261,7 +261,7 @@ public function test_route_reject_empty_namespace() { /** * Test that we reject empty routes * - * @expectedIncorrectUsage register_rest_route + * @expectedWPIncorrectUsage register_rest_route */ public function test_route_reject_empty_route() { rest_get_server(); @@ -1197,7 +1197,7 @@ public function test_rest_filter_response_by_context( $schema, $data, $expected public function test_register_route_with_invalid_namespace() { rest_get_server(); - $this->setExpectedIncorrectUsage( 'register_rest_route' ); + $this->expectWPIncorrectUsage( 'register_rest_route' ); register_rest_route( '/my-namespace/v1/', @@ -1220,7 +1220,7 @@ public function test_register_route_with_invalid_namespace() { public function test_register_route_with_missing_permission_callback_top_level_route() { rest_get_server(); - $this->setExpectedIncorrectUsage( 'register_rest_route' ); + $this->expectWPIncorrectUsage( 'register_rest_route' ); $registered = register_rest_route( 'my-ns/v1', @@ -1239,7 +1239,7 @@ public function test_register_route_with_missing_permission_callback_top_level_r public function test_register_route_with_missing_permission_callback_single_wrapped_route() { rest_get_server(); - $this->setExpectedIncorrectUsage( 'register_rest_route' ); + $this->expectWPIncorrectUsage( 'register_rest_route' ); $registered = register_rest_route( 'my-ns/v1', @@ -1261,7 +1261,7 @@ public function test_register_route_with_missing_permission_callback_single_wrap public function test_register_route_with_missing_permission_callback_multiple_wrapped_route() { rest_get_server(); - $this->setExpectedIncorrectUsage( 'register_rest_route' ); + $this->expectWPIncorrectUsage( 'register_rest_route' ); $registered = register_rest_route( 'my-ns/v1', @@ -2901,7 +2901,7 @@ public function test_rest_preload_api_request_fields() { public function test_route_args_is_array_of_arrays() { rest_get_server(); - $this->setExpectedIncorrectUsage( 'register_rest_route' ); + $this->expectWPIncorrectUsage( 'register_rest_route' ); $registered = register_rest_route( 'my-ns/v1', diff --git a/tests/phpunit/tests/rest-api/rest-comments-controller.php b/tests/phpunit/tests/rest-api/rest-comments-controller.php index 308fc07e4c78c..05e9d81e510b8 100644 --- a/tests/phpunit/tests/rest-api/rest-comments-controller.php +++ b/tests/phpunit/tests/rest-api/rest-comments-controller.php @@ -3543,7 +3543,7 @@ public function test_check_read_post_permission_with_invalid_post_type( $method $comment_id = self::factory()->comment->create( array( 'comment_post_ID' => $post_id ) ); _unregister_post_type( 'bug-post' ); - $this->setExpectedIncorrectUsage( 'map_meta_cap' ); + $this->expectWPIncorrectUsage( 'map_meta_cap' ); wp_set_current_user( self::$admin_id ); $request = new WP_REST_Request( $method, '/wp/v2/comments/' . $comment_id ); diff --git a/tests/phpunit/tests/rest-api/rest-post-meta-fields.php b/tests/phpunit/tests/rest-api/rest-post-meta-fields.php index 4fcb97c6576ba..4e697eecaf38d 100644 --- a/tests/phpunit/tests/rest-api/rest-post-meta-fields.php +++ b/tests/phpunit/tests/rest-api/rest-post-meta-fields.php @@ -2353,7 +2353,7 @@ public function test_update_meta_with_unchanged_values_and_custom_authentication * @ticket 43392 */ public function test_register_meta_issues_doing_it_wrong_when_show_in_rest_is_true() { - $this->setExpectedIncorrectUsage( 'register_meta' ); + $this->expectWPIncorrectUsage( 'register_meta' ); $registered = register_meta( 'post', @@ -2371,7 +2371,7 @@ public function test_register_meta_issues_doing_it_wrong_when_show_in_rest_is_tr * @ticket 43392 */ public function test_register_meta_issues_doing_it_wrong_when_show_in_rest_omits_schema() { - $this->setExpectedIncorrectUsage( 'register_meta' ); + $this->expectWPIncorrectUsage( 'register_meta' ); $registered = register_meta( 'post', @@ -2391,7 +2391,7 @@ public function test_register_meta_issues_doing_it_wrong_when_show_in_rest_omits * @ticket 43392 */ public function test_register_meta_issues_doing_it_wrong_when_show_in_rest_omits_schema_items() { - $this->setExpectedIncorrectUsage( 'register_meta' ); + $this->expectWPIncorrectUsage( 'register_meta' ); $registered = register_meta( 'post', diff --git a/tests/phpunit/tests/rest-api/rest-posts-controller.php b/tests/phpunit/tests/rest-api/rest-posts-controller.php index e301a1c44a546..644062265dafb 100644 --- a/tests/phpunit/tests/rest-api/rest-posts-controller.php +++ b/tests/phpunit/tests/rest-api/rest-posts-controller.php @@ -4908,7 +4908,7 @@ public function test_get_item_schema() { * @ticket 48401 */ public function test_get_item_schema_issues_doing_it_wrong_when_taxonomy_name_is_already_set_in_properties() { - $this->setExpectedIncorrectUsage( 'register_taxonomy' ); + $this->expectWPIncorrectUsage( 'register_taxonomy' ); // Register a taxonomy with 'status' as name. register_taxonomy( 'status', 'post', array( 'show_in_rest' => true ) ); @@ -5854,7 +5854,7 @@ public function test_rest_post_type_item_schema_filter_change_property() { */ public function test_rest_post_type_item_schema_filter_add_property_triggers_doing_it_wrong() { add_filter( 'rest_post_item_schema', array( $this, 'filter_post_item_schema_add_property' ) ); - $this->setExpectedIncorrectUsage( 'WP_REST_Posts_Controller::get_item_schema' ); + $this->expectWPIncorrectUsage( 'WP_REST_Posts_Controller::get_item_schema' ); // Re-initialize the controller to cache-bust schemas from prior test runs. $GLOBALS['wp_rest_server']->override_by_default = true; diff --git a/tests/phpunit/tests/rest-api/rest-schema-sanitization.php b/tests/phpunit/tests/rest-api/rest-schema-sanitization.php index c3aa8fa799eb5..e78764218a4f8 100644 --- a/tests/phpunit/tests/rest-api/rest-schema-sanitization.php +++ b/tests/phpunit/tests/rest-api/rest-schema-sanitization.php @@ -406,7 +406,7 @@ public function test_type_object_accepts_empty_string() { } public function test_type_unknown() { - $this->setExpectedIncorrectUsage( 'rest_sanitize_value_from_schema' ); + $this->expectWPIncorrectUsage( 'rest_sanitize_value_from_schema' ); $schema = array( 'type' => 'lalala', @@ -417,7 +417,7 @@ public function test_type_unknown() { } public function test_no_type() { - $this->setExpectedIncorrectUsage( 'rest_sanitize_value_from_schema' ); + $this->expectWPIncorrectUsage( 'rest_sanitize_value_from_schema' ); $schema = array( 'type' => null, @@ -460,7 +460,7 @@ public function test_format_validation_is_applied_if_missing_type() { $this->expectNotice(); // For the undefined index. } - $this->setExpectedIncorrectUsage( 'rest_sanitize_value_from_schema' ); + $this->expectWPIncorrectUsage( 'rest_sanitize_value_from_schema' ); $schema = array( 'format' => 'hex-color' ); $this->assertSame( '#abc', rest_sanitize_value_from_schema( '#abc', $schema ) ); @@ -471,7 +471,7 @@ public function test_format_validation_is_applied_if_missing_type() { * @ticket 50189 */ public function test_format_validation_is_applied_if_unknown_type() { - $this->setExpectedIncorrectUsage( 'rest_sanitize_value_from_schema' ); + $this->expectWPIncorrectUsage( 'rest_sanitize_value_from_schema' ); $schema = array( 'format' => 'hex-color', @@ -529,8 +529,8 @@ public function test_object_or_bool() { * @ticket 50300 */ public function test_multi_type_with_no_known_types() { - $this->setExpectedIncorrectUsage( 'rest_handle_multi_type_schema' ); - $this->setExpectedIncorrectUsage( 'rest_sanitize_value_from_schema' ); + $this->expectWPIncorrectUsage( 'rest_handle_multi_type_schema' ); + $this->expectWPIncorrectUsage( 'rest_sanitize_value_from_schema' ); $schema = array( 'type' => array( 'invalid', 'type' ), @@ -543,8 +543,8 @@ public function test_multi_type_with_no_known_types() { * @ticket 50300 */ public function test_multi_type_with_some_unknown_types() { - $this->setExpectedIncorrectUsage( 'rest_handle_multi_type_schema' ); - $this->setExpectedIncorrectUsage( 'rest_sanitize_value_from_schema' ); + $this->expectWPIncorrectUsage( 'rest_handle_multi_type_schema' ); + $this->expectWPIncorrectUsage( 'rest_sanitize_value_from_schema' ); $schema = array( 'type' => array( 'object', 'type' ), diff --git a/tests/phpunit/tests/rest-api/rest-schema-validation.php b/tests/phpunit/tests/rest-api/rest-schema-validation.php index bee72dbf29a37..13dc777f04b41 100644 --- a/tests/phpunit/tests/rest-api/rest-schema-validation.php +++ b/tests/phpunit/tests/rest-api/rest-schema-validation.php @@ -160,7 +160,7 @@ public function test_format_validation_is_applied_if_missing_type() { $this->expectNotice(); // For the undefined index. } - $this->setExpectedIncorrectUsage( 'rest_validate_value_from_schema' ); + $this->expectWPIncorrectUsage( 'rest_validate_value_from_schema' ); $schema = array( 'format' => 'email' ); $this->assertTrue( rest_validate_value_from_schema( 'email@example.com', $schema ) ); @@ -171,7 +171,7 @@ public function test_format_validation_is_applied_if_missing_type() { * @ticket 50189 */ public function test_format_validation_is_applied_if_unknown_type() { - $this->setExpectedIncorrectUsage( 'rest_validate_value_from_schema' ); + $this->expectWPIncorrectUsage( 'rest_validate_value_from_schema' ); $schema = array( 'format' => 'email', @@ -990,7 +990,7 @@ public function test_type_object_allows_empty_string() { } public function test_type_unknown() { - $this->setExpectedIncorrectUsage( 'rest_validate_value_from_schema' ); + $this->expectWPIncorrectUsage( 'rest_validate_value_from_schema' ); $schema = array( 'type' => 'lalala', @@ -1108,8 +1108,8 @@ public function data_multiply_of() { * @ticket 50300 */ public function test_multi_type_with_no_known_types() { - $this->setExpectedIncorrectUsage( 'rest_handle_multi_type_schema' ); - $this->setExpectedIncorrectUsage( 'rest_validate_value_from_schema' ); + $this->expectWPIncorrectUsage( 'rest_handle_multi_type_schema' ); + $this->expectWPIncorrectUsage( 'rest_validate_value_from_schema' ); $schema = array( 'type' => array( 'invalid', 'type' ), @@ -1122,8 +1122,8 @@ public function test_multi_type_with_no_known_types() { * @ticket 50300 */ public function test_multi_type_with_some_unknown_types() { - $this->setExpectedIncorrectUsage( 'rest_handle_multi_type_schema' ); - $this->setExpectedIncorrectUsage( 'rest_validate_value_from_schema' ); + $this->expectWPIncorrectUsage( 'rest_handle_multi_type_schema' ); + $this->expectWPIncorrectUsage( 'rest_validate_value_from_schema' ); $schema = array( 'type' => array( 'object', 'type' ), diff --git a/tests/phpunit/tests/rest-api/rest-server.php b/tests/phpunit/tests/rest-api/rest-server.php index de6527059f6e2..eabd21bafe8cc 100644 --- a/tests/phpunit/tests/rest-api/rest-server.php +++ b/tests/phpunit/tests/rest-api/rest-server.php @@ -1580,7 +1580,7 @@ public function test_x_robot_tag_header_on_requests() { /** * @ticket 38446 - * @expectedDeprecated rest_enabled + * @expectedWPDeprecated rest_enabled */ public function test_rest_enable_filter_is_deprecated() { add_filter( 'rest_enabled', '__return_false' ); diff --git a/tests/phpunit/tests/rest-api/rest-settings-controller.php b/tests/phpunit/tests/rest-api/rest-settings-controller.php index 71b52fa2ce668..69536c9a67404 100644 --- a/tests/phpunit/tests/rest-api/rest-settings-controller.php +++ b/tests/phpunit/tests/rest-api/rest-settings-controller.php @@ -772,7 +772,7 @@ public function test_get_item_schema() { * @ticket 42875 */ public function test_register_setting_issues_doing_it_wrong_when_show_in_rest_is_true() { - $this->setExpectedIncorrectUsage( 'register_setting' ); + $this->expectWPIncorrectUsage( 'register_setting' ); register_setting( 'somegroup', @@ -788,7 +788,7 @@ public function test_register_setting_issues_doing_it_wrong_when_show_in_rest_is * @ticket 42875 */ public function test_register_setting_issues_doing_it_wrong_when_show_in_rest_omits_schema() { - $this->setExpectedIncorrectUsage( 'register_setting' ); + $this->expectWPIncorrectUsage( 'register_setting' ); register_setting( 'somegroup', @@ -806,7 +806,7 @@ public function test_register_setting_issues_doing_it_wrong_when_show_in_rest_om * @ticket 42875 */ public function test_register_setting_issues_doing_it_wrong_when_show_in_rest_omits_schema_items() { - $this->setExpectedIncorrectUsage( 'register_setting' ); + $this->expectWPIncorrectUsage( 'register_setting' ); register_setting( 'somegroup', diff --git a/tests/phpunit/tests/rest-api/rest-users-controller.php b/tests/phpunit/tests/rest-api/rest-users-controller.php index 412da7d560a75..239162e9ff34a 100644 --- a/tests/phpunit/tests/rest-api/rest-users-controller.php +++ b/tests/phpunit/tests/rest-api/rest-users-controller.php @@ -1045,7 +1045,7 @@ public function test_get_items_invalid_capabilities() { } /** - * @expectedDeprecated WP_User_Query + * @expectedWPDeprecated WP_User_Query */ public function test_get_items_who_author_query() { wp_set_current_user( self::$superadmin ); diff --git a/tests/phpunit/tests/script-modules/wpScriptModules.php b/tests/phpunit/tests/script-modules/wpScriptModules.php index 0d70e7e325d84..83dd47ee8a562 100644 --- a/tests/phpunit/tests/script-modules/wpScriptModules.php +++ b/tests/phpunit/tests/script-modules/wpScriptModules.php @@ -155,7 +155,7 @@ public function test_wp_script_modules() { * * @ticket 63486 * - * @expectedIncorrectUsage WP_Script_Modules::register + * @expectedWPIncorrectUsage WP_Script_Modules::register * * @covers ::wp_register_script_module * @covers WP_Script_Modules::register @@ -170,7 +170,7 @@ public function test_register_with_empty_id() { * * @ticket 63486 * - * @expectedIncorrectUsage WP_Script_Modules::enqueue + * @expectedWPIncorrectUsage WP_Script_Modules::enqueue * * @covers ::wp_enqueue_script_module * @covers WP_Script_Modules::enqueue @@ -1508,7 +1508,7 @@ public function test_in_footer_methods() { * @ticket 61734 * * @covers WP_Script_Modules::register - * @expectedIncorrectUsage WP_Script_Modules::register + * @expectedWPIncorrectUsage WP_Script_Modules::register */ public function test_register_script_module_having_fetchpriority_with_invalid_value() { $this->script_modules->register( 'foo', '/foo.js', array(), false, array( 'fetchpriority' => 'silly' ) ); @@ -1524,7 +1524,7 @@ public function test_register_script_module_having_fetchpriority_with_invalid_va * @ticket 61734 * * @covers WP_Script_Modules::register - * @expectedIncorrectUsage WP_Script_Modules::register + * @expectedWPIncorrectUsage WP_Script_Modules::register */ public function test_register_script_module_having_fetchpriority_with_invalid_value_type() { $this->script_modules->register( 'foo', '/foo.js', array(), false, array( 'fetchpriority' => array( 'WHY AM I NOT A STRING???' ) ) ); @@ -1541,7 +1541,7 @@ public function test_register_script_module_having_fetchpriority_with_invalid_va * * @covers WP_Script_Modules::register * @covers WP_Script_Modules::set_fetchpriority - * @expectedIncorrectUsage WP_Script_Modules::set_fetchpriority + * @expectedWPIncorrectUsage WP_Script_Modules::set_fetchpriority */ public function test_set_fetchpriority_with_invalid_value() { $this->script_modules->register( 'foo', '/foo.js' ); @@ -2196,7 +2196,7 @@ public function test_import_map_includes_dependencies_of_classic_scripts_recursi */ public function test_wp_scripts_doing_it_wrong_for_missing_script_module_dependencies() { $expected_incorrect_usage = 'WP_Scripts::add_data'; - $this->setExpectedIncorrectUsage( $expected_incorrect_usage ); + $this->expectWPIncorrectUsage( $expected_incorrect_usage ); wp_enqueue_script( 'registered-dep', @@ -2616,7 +2616,7 @@ public function test_static_import_dependency_with_dynamic_imports_depending_on_ */ public function test_missing_script_module_dependency_triggers_incorrect_usage() { $expected_incorrect_usage = 'WP_Script_Modules::register'; - $this->setExpectedIncorrectUsage( $expected_incorrect_usage ); + $this->expectWPIncorrectUsage( $expected_incorrect_usage ); $this->script_modules->enqueue( 'main-module', '/main-module.js', array( 'missing-mod-dep' ) ); diff --git a/tests/phpunit/tests/shortcode.php b/tests/phpunit/tests/shortcode.php index c14a17765075e..112c3abb5fa72 100644 --- a/tests/phpunit/tests/shortcode.php +++ b/tests/phpunit/tests/shortcode.php @@ -675,7 +675,7 @@ public function test_has_shortcode() { * Make sure invalid shortcode names are not allowed. * * @dataProvider data_registration_bad - * @expectedIncorrectUsage add_shortcode + * @expectedWPIncorrectUsage add_shortcode */ public function test_registration_bad( $input, $expected ) { $this->sub_registration( $input, $expected ); diff --git a/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php b/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php index b56737d0b8a75..fd1251c859c97 100644 --- a/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php +++ b/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php @@ -133,7 +133,7 @@ public function test_get_sitemap_index_xml_with_lastmod() { * Note that when a means of adding elements in extension namespaces is settled on, * this test will need to be updated accordingly. * - * @expectedIncorrectUsage WP_Sitemaps_Renderer::get_sitemap_index_xml + * @expectedWPIncorrectUsage WP_Sitemaps_Renderer::get_sitemap_index_xml */ public function test_get_sitemap_index_xml_extra_elements() { $url_list = array( @@ -253,7 +253,7 @@ public function test_get_sitemap_xml_without_stylesheet() { * Note that when a means of adding elements in extension namespaces is settled on, * this test will need to be updated accordingly. * - * @expectedIncorrectUsage WP_Sitemaps_Renderer::get_sitemap_xml + * @expectedWPIncorrectUsage WP_Sitemaps_Renderer::get_sitemap_xml */ public function test_get_sitemap_xml_extra_elements() { $url_list = array( diff --git a/tests/phpunit/tests/speculative-loading/wpSpeculationRules.php b/tests/phpunit/tests/speculative-loading/wpSpeculationRules.php index 9a59583f3f20c..37a087f12ee08 100644 --- a/tests/phpunit/tests/speculative-loading/wpSpeculationRules.php +++ b/tests/phpunit/tests/speculative-loading/wpSpeculationRules.php @@ -23,7 +23,7 @@ public function test_add_rule( string $mode, string $id, array $rule, bool $expe $speculation_rules = new WP_Speculation_Rules(); if ( ! $expected ) { - $this->setExpectedIncorrectUsage( 'WP_Speculation_Rules::add_rule' ); + $this->expectWPIncorrectUsage( 'WP_Speculation_Rules::add_rule' ); } $result = $speculation_rules->add_rule( $mode, $id, $rule ); @@ -49,7 +49,7 @@ public function test_add_rule_with_duplicate() { $this->assertTrue( $speculation_rules->add_rule( 'prefetch', 'my-custom-rule', array( 'where' => array( 'href_matches' => '/*' ) ) ) ); // But it should not be possible to add a rule of the same ID to a mode where it's already present. - $this->setExpectedIncorrectUsage( 'WP_Speculation_Rules::add_rule' ); + $this->expectWPIncorrectUsage( 'WP_Speculation_Rules::add_rule' ); $this->assertFalse( $speculation_rules->add_rule( 'prerender', 'my-custom-rule', array( 'urls' => array( 'https://important-url.com/' ) ) ) ); } diff --git a/tests/phpunit/tests/taxonomy.php b/tests/phpunit/tests/taxonomy.php index 6f112c36663ec..a7b6baf6206bf 100644 --- a/tests/phpunit/tests/taxonomy.php +++ b/tests/phpunit/tests/taxonomy.php @@ -239,7 +239,7 @@ public function test_register_taxonomy_return_value() { /** * @ticket 21593 * - * @expectedIncorrectUsage register_taxonomy + * @expectedWPIncorrectUsage register_taxonomy */ public function test_register_taxonomy_with_too_long_name() { $this->assertInstanceOf( 'WP_Error', register_taxonomy( 'abcdefghijklmnopqrstuvwxyz0123456789', 'post', array() ) ); @@ -248,7 +248,7 @@ public function test_register_taxonomy_with_too_long_name() { /** * @ticket 31135 * - * @expectedIncorrectUsage register_taxonomy + * @expectedWPIncorrectUsage register_taxonomy */ public function test_register_taxonomy_with_empty_name() { $this->assertInstanceOf( 'WP_Error', register_taxonomy( '', 'post', array() ) ); diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php index b7beb20c0dd67..1ac69bbc4a09d 100644 --- a/tests/phpunit/tests/theme.php +++ b/tests/phpunit/tests/theme.php @@ -83,8 +83,8 @@ public function test_wp_get_themes_default() { } /** - * @expectedDeprecated get_theme - * @expectedDeprecated get_themes + * @expectedWPDeprecated get_theme + * @expectedWPDeprecated get_themes */ public function test_get_themes_default() { $themes = get_themes(); @@ -97,8 +97,8 @@ public function test_get_themes_default() { } /** - * @expectedDeprecated get_theme - * @expectedDeprecated get_themes + * @expectedWPDeprecated get_theme + * @expectedWPDeprecated get_themes */ public function test_get_theme() { $themes = get_themes(); @@ -131,7 +131,7 @@ public function test_wp_get_theme() { } /** - * @expectedDeprecated get_themes + * @expectedWPDeprecated get_themes */ public function test_get_themes_contents() { $themes = get_themes(); @@ -419,7 +419,7 @@ public function test_version_consistency_in_package_json( string $theme ) { /** * @ticket 20897 - * @expectedDeprecated get_theme_data + * @expectedWPDeprecated get_theme_data */ public function test_extra_theme_headers() { $wp_theme = wp_get_theme( $this->theme_slug ); @@ -438,8 +438,8 @@ public function theme_data_extra_headers() { } /** - * @expectedDeprecated get_themes - * @expectedDeprecated get_current_theme + * @expectedWPDeprecated get_themes + * @expectedWPDeprecated get_current_theme */ public function test_switch_theme() { $themes = get_themes(); diff --git a/tests/phpunit/tests/theme/support.php b/tests/phpunit/tests/theme/support.php index e2810ab5cb8ee..8a7e8f1679fcf 100644 --- a/tests/phpunit/tests/theme/support.php +++ b/tests/phpunit/tests/theme/support.php @@ -111,7 +111,7 @@ public function test_post_thumbnails_mixed_args() { /** * @ticket 24932 * - * @expectedIncorrectUsage add_theme_support( 'html5' ) + * @expectedWPIncorrectUsage add_theme_support( 'html5' ) */ public function test_supports_html5() { remove_theme_support( 'html5' ); @@ -133,7 +133,7 @@ public function test_supports_html5() { /** * @ticket 24932 * - * @expectedIncorrectUsage add_theme_support( 'html5' ) + * @expectedWPIncorrectUsage add_theme_support( 'html5' ) */ public function test_supports_html5_subset() { remove_theme_support( 'html5' ); @@ -166,7 +166,7 @@ public function test_supports_html5_subset() { /** * @ticket 24932 * - * @expectedIncorrectUsage add_theme_support( 'html5' ) + * @expectedWPIncorrectUsage add_theme_support( 'html5' ) */ public function test_supports_html5_invalid() { remove_theme_support( 'html5' ); @@ -178,7 +178,7 @@ public function test_supports_html5_invalid() { /** * @ticket 51390 * - * @expectedIncorrectUsage add_theme_support( 'post-formats' ) + * @expectedWPIncorrectUsage add_theme_support( 'post-formats' ) */ public function test_supports_post_formats_doing_it_wrong() { // The second parameter should be an array. diff --git a/tests/phpunit/tests/theme/themeDir.php b/tests/phpunit/tests/theme/themeDir.php index cc7ca52a43cd2..5ef8c594a1235 100644 --- a/tests/phpunit/tests/theme/themeDir.php +++ b/tests/phpunit/tests/theme/themeDir.php @@ -50,8 +50,8 @@ public function filter_theme_root( $dir ) { } /** - * @expectedDeprecated get_theme - * @expectedDeprecated get_themes + * @expectedWPDeprecated get_theme + * @expectedWPDeprecated get_themes */ public function test_theme_default() { $themes = get_themes(); @@ -81,8 +81,8 @@ public function test_theme_default() { } /** - * @expectedDeprecated get_theme - * @expectedDeprecated get_themes + * @expectedWPDeprecated get_theme + * @expectedWPDeprecated get_themes */ public function test_theme_sandbox() { $theme = get_theme( 'Sandbox' ); @@ -117,7 +117,7 @@ public function test_theme_sandbox() { /** * A CSS-only theme * - * @expectedDeprecated get_themes + * @expectedWPDeprecated get_themes */ public function test_theme_stylesheet_only() { $themes = get_themes(); @@ -146,7 +146,7 @@ public function test_theme_stylesheet_only() { } /** - * @expectedDeprecated get_themes + * @expectedWPDeprecated get_themes */ public function test_theme_list() { $themes = get_themes(); @@ -198,8 +198,8 @@ public function test_theme_list() { } /** - * @expectedDeprecated get_themes - * @expectedDeprecated get_broken_themes + * @expectedWPDeprecated get_themes + * @expectedWPDeprecated get_broken_themes */ public function test_broken_themes() { $themes = get_themes(); @@ -226,7 +226,7 @@ public function test_wp_get_theme_with_non_default_theme_root() { } /** - * @expectedDeprecated get_themes + * @expectedWPDeprecated get_themes */ public function test_page_templates() { $themes = get_themes(); @@ -239,7 +239,7 @@ public function test_page_templates() { } /** - * @expectedDeprecated get_theme_data + * @expectedWPDeprecated get_theme_data */ public function test_get_theme_data_top_level() { $theme_data = get_theme_data( DIR_TESTDATA . '/themedir1/theme1/style.css' ); @@ -258,7 +258,7 @@ public function test_get_theme_data_top_level() { } /** - * @expectedDeprecated get_theme_data + * @expectedWPDeprecated get_theme_data */ public function test_get_theme_data_subdir() { $theme_data = get_theme_data( self::THEME_ROOT . '/subdir/theme2/style.css' ); diff --git a/tests/phpunit/tests/theme/wpThemeJson.php b/tests/phpunit/tests/theme/wpThemeJson.php index 54254b4252c7f..d05e996edd158 100644 --- a/tests/phpunit/tests/theme/wpThemeJson.php +++ b/tests/phpunit/tests/theme/wpThemeJson.php @@ -5164,7 +5164,7 @@ public function data_get_property_value_should_return_string_for_invalid_paths_o * @ticket 60936 * @ticket 61165 * @ticket 61704 - * @expectedIncorrectUsage get_property_value + * @expectedWPIncorrectUsage get_property_value */ public function test_get_property_value_loop() { $theme_json = new WP_Theme_JSON( @@ -5201,7 +5201,7 @@ public function test_get_property_value_loop() { * @ticket 60936 * @ticket 61165 * @ticket 61704 - * @expectedIncorrectUsage get_property_value + * @expectedWPIncorrectUsage get_property_value */ public function test_get_property_value_recursion() { $theme_json = new WP_Theme_JSON( @@ -5237,7 +5237,7 @@ public function test_get_property_value_recursion() { * @ticket 60936 * @ticket 61165 * @ticket 61704 - * @expectedIncorrectUsage get_property_value + * @expectedWPIncorrectUsage get_property_value */ public function test_get_property_value_self() { $theme_json = new WP_Theme_JSON( diff --git a/tests/phpunit/tests/user.php b/tests/phpunit/tests/user.php index caf570a36cab5..726e551a1a616 100644 --- a/tests/phpunit/tests/user.php +++ b/tests/phpunit/tests/user.php @@ -271,7 +271,7 @@ public function test_user_unset() { * Test 'id' (lowercase). * * @depends test_user_unset - * @expectedDeprecated WP_User->id + * @expectedWPDeprecated WP_User->id * @ticket 20043 */ public function test_user_unset_lowercase_id( $user ) { @@ -307,7 +307,7 @@ public function test_user_meta_properties() { } /** - * @expectedDeprecated WP_User->id + * @expectedWPDeprecated WP_User->id */ public function test_id_property_back_compat() { $user = new WP_User( self::$author_id ); @@ -1799,7 +1799,7 @@ public function data_wp_new_user_notifications() { * function signature `wp_new_user_notification( $user, 'plaintext_password' );`. * * @ticket 33654 - * @expectedDeprecated wp_new_user_notification + * @expectedWPDeprecated wp_new_user_notification */ public function test_wp_new_user_notification_old_signature_throws_deprecated_warning_but_sends() { reset_phpmailer_instance(); @@ -2683,7 +2683,7 @@ public function test_filter_wp_privacy_additional_user_profile_data() { // _doing_it_wrong() should be called because the filter callback // adds a item with a 'name' that is the same as one generated by core. - $this->setExpectedIncorrectUsage( 'wp_user_personal_data_exporter' ); + $this->expectWPIncorrectUsage( 'wp_user_personal_data_exporter' ); add_filter( 'wp_privacy_additional_user_profile_data', array( $this, 'export_additional_user_profile_data_with_dup_name' ) ); $actual = wp_user_personal_data_exporter( $test_user->user_email ); diff --git a/tests/phpunit/tests/user/capabilities.php b/tests/phpunit/tests/user/capabilities.php index 34f46dfb1eec2..7424d62cbbb35 100644 --- a/tests/phpunit/tests/user/capabilities.php +++ b/tests/phpunit/tests/user/capabilities.php @@ -1625,7 +1625,7 @@ public function test_taxonomy_meta_capabilities_with_non_existent_terms() { $editor = self::$users['editor']; - $this->setExpectedIncorrectUsage( 'map_meta_cap' ); + $this->expectWPIncorrectUsage( 'map_meta_cap' ); foreach ( $caps as $cap ) { // `null` represents a non-existent term ID. $this->assertFalse( user_can( $editor->ID, $cap, null ) ); @@ -1989,7 +1989,7 @@ public function test_multisite_administrator_with_manage_network_users_can_not_e /** * @ticket 16956 - * @expectedIncorrectUsage map_meta_cap + * @expectedWPIncorrectUsage map_meta_cap */ public function test_require_edit_others_posts_if_post_type_doesnt_exist() { register_post_type( 'existed' ); @@ -2012,7 +2012,7 @@ public function test_require_edit_others_posts_if_post_type_doesnt_exist() { /** * @ticket 48653 - * @expectedIncorrectUsage map_meta_cap + * @expectedWPIncorrectUsage map_meta_cap */ public function test_require_edit_others_posts_if_post_status_doesnt_exist() { register_post_status( 'existed' ); @@ -2144,7 +2144,7 @@ public function _hook_wp_roles_init( $wp_roles ) { /** * @ticket 23016 - * @expectedDeprecated WP_Roles::reinit + * @expectedWPDeprecated WP_Roles::reinit */ public function test_wp_roles_reinit_deprecated() { $wp_roles = new WP_Roles(); diff --git a/tests/phpunit/tests/user/mapMetaCap.php b/tests/phpunit/tests/user/mapMetaCap.php index 7bf46174a859b..20d193e9f238e 100644 --- a/tests/phpunit/tests/user/mapMetaCap.php +++ b/tests/phpunit/tests/user/mapMetaCap.php @@ -403,7 +403,7 @@ public function test_only_users_who_can_manage_options_can_delete_page_for_posts */ public function test_meta_caps_throw_doing_it_wrong_without_required_argument_provided( $cap ) { $admin_user = self::$user_id; - $this->setExpectedIncorrectUsage( 'map_meta_cap' ); + $this->expectWPIncorrectUsage( 'map_meta_cap' ); $this->assertContains( 'do_not_allow', map_meta_cap( $cap, $admin_user ) ); } diff --git a/tests/phpunit/tests/user/multisite.php b/tests/phpunit/tests/user/multisite.php index dfd1ba4d5c30f..6a3fbd7fc495c 100644 --- a/tests/phpunit/tests/user/multisite.php +++ b/tests/phpunit/tests/user/multisite.php @@ -95,7 +95,7 @@ public function test_get_blogs_of_user() { } /** - * @expectedDeprecated is_blog_user + * @expectedWPDeprecated is_blog_user */ public function test_is_blog_user() { global $wpdb; diff --git a/tests/phpunit/tests/user/query.php b/tests/phpunit/tests/user/query.php index 61b4f1b4d7588..e63677851e176 100644 --- a/tests/phpunit/tests/user/query.php +++ b/tests/phpunit/tests/user/query.php @@ -744,7 +744,7 @@ public function test_roles_and_caps_should_be_populated_for_explicit_value_of_di /** * @ticket 32019 * @group ms-required - * @expectedDeprecated WP_User_Query + * @expectedWPDeprecated WP_User_Query */ public function test_who_authors() { $b = self::factory()->blog->create(); @@ -770,7 +770,7 @@ public function test_who_authors() { /** * @ticket 32019 * @group ms-required - * @expectedDeprecated WP_User_Query + * @expectedWPDeprecated WP_User_Query */ public function test_who_authors_should_work_alongside_meta_query() { $b = self::factory()->blog->create(); @@ -805,7 +805,7 @@ public function test_who_authors_should_work_alongside_meta_query() { /** * @ticket 36724 * @group ms-required - * @expectedDeprecated WP_User_Query + * @expectedWPDeprecated WP_User_Query */ public function test_who_authors_should_work_alongside_meta_params() { $b = self::factory()->blog->create(); diff --git a/tests/phpunit/tests/user/queryCache.php b/tests/phpunit/tests/user/queryCache.php index fb556bfa36b21..2af5bcb7eb0db 100644 --- a/tests/phpunit/tests/user/queryCache.php +++ b/tests/phpunit/tests/user/queryCache.php @@ -131,7 +131,7 @@ public function test_query_cache_results() { /** * @ticket 40613 * @covers ::query - * @expectedDeprecated WP_User_Query + * @expectedWPDeprecated WP_User_Query */ public function test_query_cache_who() { $args = array( @@ -788,7 +788,7 @@ public function test_generate_cache_key_placeholder() { * @ticket 59011 * @covers ::generate_cache_key * - * @expectedDeprecated WP_User_Query + * @expectedWPDeprecated WP_User_Query */ public function test_generate_cache_key_with_orderby_post_count_and_deprecated_who_parameter() { $query = new WP_User_Query( diff --git a/tests/phpunit/tests/view-config-data.php b/tests/phpunit/tests/view-config-data.php index 68940ad6c2d5c..7819e95a4b25f 100644 --- a/tests/phpunit/tests/view-config-data.php +++ b/tests/phpunit/tests/view-config-data.php @@ -149,7 +149,7 @@ public function test_set_null_unsets_key() { * @covers ::set */ public function test_set_rejects_unknown_key() { - $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::set' ); + $this->expectWPIncorrectUsage( 'WP_View_Config_Data::set' ); $data = new WP_View_Config_Data( array( 'default_view' => array( 'type' => 'table' ) ) ); $before = self::read_config( $data ); @@ -165,7 +165,7 @@ public function test_set_rejects_unknown_key() { * @covers ::set */ public function test_set_rejects_updates_with_invalid_version() { - $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::set' ); + $this->expectWPIncorrectUsage( 'WP_View_Config_Data::set' ); $data = new WP_View_Config_Data( array( 'default_view' => array( 'type' => 'table' ) ) ); $before = self::read_config( $data ); @@ -446,7 +446,7 @@ public function test_replace_scalar_properties() { * @covers ::replace */ public function test_replace_rejects_unknown_key() { - $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::replace' ); + $this->expectWPIncorrectUsage( 'WP_View_Config_Data::replace' ); $data = new WP_View_Config_Data( array( 'default_view' => array( 'type' => 'table' ) ) ); $before = self::read_config( $data ); @@ -462,7 +462,7 @@ public function test_replace_rejects_unknown_key() { * @covers ::replace */ public function test_replace_rejects_updates_with_invalid_version() { - $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::replace' ); + $this->expectWPIncorrectUsage( 'WP_View_Config_Data::replace' ); $data = new WP_View_Config_Data( array( 'default_view' => array( 'type' => 'table' ) ) ); $before = self::read_config( $data ); @@ -1694,7 +1694,7 @@ public function test_merge_null_resets_top_level_keys_to_defaults() { * @covers ::merge */ public function test_merge_rejects_updates_with_invalid_version() { - $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::merge' ); + $this->expectWPIncorrectUsage( 'WP_View_Config_Data::merge' ); $data = new WP_View_Config_Data( array( 'default_view' => array( 'type' => 'table' ) ) ); $before = self::read_config( $data ); @@ -1713,7 +1713,7 @@ public function test_merge_rejects_updates_with_invalid_version() { * @covers ::merge */ public function test_merge_rejects_unknown_key() { - $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::merge' ); + $this->expectWPIncorrectUsage( 'WP_View_Config_Data::merge' ); $data = new WP_View_Config_Data( array( 'default_view' => array( 'type' => 'table' ) ) ); $data->merge( array( 'not_a_real_key' => 'nope' ), 1 ); @@ -1731,7 +1731,7 @@ public function test_merge_rejects_unknown_key() { * @covers ::merge */ public function test_merge_rejects_associative_patch_over_a_list() { - $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::merge_properties' ); + $this->expectWPIncorrectUsage( 'WP_View_Config_Data::merge_properties' ); $data = new WP_View_Config_Data( array( @@ -1768,7 +1768,7 @@ public function test_merge_rejects_associative_patch_over_a_list() { * @covers ::merge */ public function test_merge_rejects_list_patch_over_an_associative_value() { - $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::merge_properties' ); + $this->expectWPIncorrectUsage( 'WP_View_Config_Data::merge_properties' ); $data = new WP_View_Config_Data( array( @@ -1897,7 +1897,7 @@ public function test_merge_appended_member_drops_nested_nulls() { * @covers ::replace */ public function test_replace_rejects_list_patch_over_an_associative_value() { - $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::merge_properties' ); + $this->expectWPIncorrectUsage( 'WP_View_Config_Data::merge_properties' ); $data = new WP_View_Config_Data( array( diff --git a/tests/phpunit/tests/view-config.php b/tests/phpunit/tests/view-config.php index e30e7820368c6..d0175871932ef 100644 --- a/tests/phpunit/tests/view-config.php +++ b/tests/phpunit/tests/view-config.php @@ -313,7 +313,7 @@ function ( $data ) { * from the defaults. */ public function test_filter_data_normalized() { - $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::set' ); + $this->expectWPIncorrectUsage( 'WP_View_Config_Data::set' ); add_filter( 'get_entity_view_config_custom_kind_custom_name', diff --git a/tests/phpunit/tests/widgets.php b/tests/phpunit/tests/widgets.php index 7362146fda7fc..ea94e6492ab44 100644 --- a/tests/phpunit/tests/widgets.php +++ b/tests/phpunit/tests/widgets.php @@ -214,7 +214,7 @@ public function test_register_sidebars_multiple() { public function test_register_sidebar_with_no_id() { global $wp_registered_sidebars; - $this->setExpectedIncorrectUsage( 'register_sidebar' ); + $this->expectWPIncorrectUsage( 'register_sidebar' ); // Incorrectly register a couple of sidebars for fun. register_sidebar(); @@ -231,7 +231,7 @@ public function test_register_sidebar_with_no_id() { public function test_unregister_sidebar_registered_with_no_id() { global $wp_registered_sidebars; - $this->setExpectedIncorrectUsage( 'register_sidebar' ); + $this->expectWPIncorrectUsage( 'register_sidebar' ); // Incorrectly register a couple of sidebars for fun. register_sidebar(); @@ -347,7 +347,7 @@ public function retrieve_sidebar_id( $index, $valid_sidebar ) { * @group sidebar */ public function test_dynamic_sidebar_using_sidebar_registered_with_no_id() { - $this->setExpectedIncorrectUsage( 'register_sidebar' ); + $this->expectWPIncorrectUsage( 'register_sidebar' ); // Incorrectly register a couple of sidebars for fun. register_sidebar(); @@ -945,7 +945,7 @@ public function test_the_widget_custom_before_title_arg() { * @see \the_widget() */ public function test_the_widget_with_unregistered_widget() { - $this->setExpectedIncorrectUsage( 'the_widget' ); + $this->expectWPIncorrectUsage( 'the_widget' ); the_widget( 'Widget_Class' ); } diff --git a/tests/phpunit/tests/wp-token-map/wpTokenMap.php b/tests/phpunit/tests/wp-token-map/wpTokenMap.php index 5cdfccfbb5624..02fb9e0fee526 100644 --- a/tests/phpunit/tests/wp-token-map/wpTokenMap.php +++ b/tests/phpunit/tests/wp-token-map/wpTokenMap.php @@ -134,7 +134,7 @@ public function test_creates_map_from_array_containing_proper_values( $dataset ) * * @ticket 60698 * - * @expectedIncorrectUsage WP_Token_Map::from_array + * @expectedWPIncorrectUsage WP_Token_Map::from_array */ public function test_rejects_words_which_are_too_long() { $normal_length = str_pad( '', 255, '.' ); diff --git a/tests/phpunit/tests/xmlrpc/wp/getUsers.php b/tests/phpunit/tests/xmlrpc/wp/getUsers.php index a442ad4969d92..685d9d9a56257 100644 --- a/tests/phpunit/tests/xmlrpc/wp/getUsers.php +++ b/tests/phpunit/tests/xmlrpc/wp/getUsers.php @@ -55,7 +55,7 @@ public function test_invalid_role() { } /** - * @expectedDeprecated WP_User_Query + * @expectedWPDeprecated WP_User_Query */ public function test_role_filter() { $author_id = $this->make_user_by_role( 'author' ); From 02997470918ac7646f5719e1de4ccbd2c7acc4c6 Mon Sep 17 00:00:00 2001 From: Sukhendu Sekhar Guria Date: Wed, 4 Nov 2026 15:20:21 +0530 Subject: [PATCH 2/3] Build/Test Tools: Keep legacy deprecation expectation overrides running --- tests/phpunit/includes/abstract-testcase.php | 12 ++++- .../includes/legacyDeprecationOverrides.php | 47 +++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 tests/phpunit/tests/includes/legacyDeprecationOverrides.php diff --git a/tests/phpunit/includes/abstract-testcase.php b/tests/phpunit/includes/abstract-testcase.php index dc50907097310..93699e84a4120 100644 --- a/tests/phpunit/includes/abstract-testcase.php +++ b/tests/phpunit/includes/abstract-testcase.php @@ -187,7 +187,8 @@ public function set_up() { } $this->start_transaction(); - $this->set_up_deprecation_expectations(); + // Call through the legacy method so that subclass overrides of it keep running. + $this->expectDeprecated(); add_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) ); add_filter( 'wp_hash_password_options', array( $this, 'wp_hash_password_options' ), 1, 2 ); @@ -755,6 +756,9 @@ protected function set_up_deprecation_expectations() { /** * Sets up the expectations for testing a deprecated call. * + * Still called by set_up() so that subclass overrides keep running. Do not remove + * it without a replacement for those overrides. + * * @since 3.7.0 * @deprecated 7.2.0 Use WP_UnitTestCase_Base::set_up_deprecation_expectations() instead. */ @@ -858,6 +862,9 @@ protected function assert_expected_deprecations() { /** * Handles a deprecated expectation. * + * Still called by assert_post_conditions() so that subclass overrides keep running. + * Do not remove it without a replacement for those overrides. + * * @since 3.7.0 * @deprecated 7.2.0 Use WP_UnitTestCase_Base::assert_expected_deprecations() instead. */ @@ -901,7 +908,8 @@ public function block_external_http_request( $response, array $args, string $url * @since 4.2.0 */ protected function assert_post_conditions() { - $this->assert_expected_deprecations(); + // Call through the legacy method so that subclass overrides of it keep running. + $this->expectedDeprecated(); if ( $this->blocked_http_requests ) { $this->fail( diff --git a/tests/phpunit/tests/includes/legacyDeprecationOverrides.php b/tests/phpunit/tests/includes/legacyDeprecationOverrides.php new file mode 100644 index 0000000000000..eafb56e6f6564 --- /dev/null +++ b/tests/phpunit/tests/includes/legacyDeprecationOverrides.php @@ -0,0 +1,47 @@ +overrides_run[] = 'expectDeprecated'; + parent::expectDeprecated(); + } + + public function expectedDeprecated() { + $this->overrides_run[] = 'expectedDeprecated'; + parent::expectedDeprecated(); + } + + protected function assert_post_conditions() { + parent::assert_post_conditions(); + + $this->assertSame( array( 'expectDeprecated', 'expectedDeprecated' ), $this->overrides_run ); + } + + /** + * @expectedWPDeprecated Tests_Includes_LegacyDeprecationOverrides::mock_deprecated + */ + public function test_overrides_run_and_still_handle_expectations() { + $this->assertSame( array( 'expectDeprecated' ), $this->overrides_run ); + $this->assertTrue( $this->mock_deprecated() ); + } + + protected function mock_deprecated() { + _deprecated_function( __METHOD__, '2.5' ); + return true; + } +} From 6adcbe6ca60557e926b566fe4c91ccb42bcae591 Mon Sep 17 00:00:00 2001 From: Sukhendu Sekhar Guria Date: Wed, 11 Nov 2026 11:13:50 +0530 Subject: [PATCH 3/3] fix(tests): remove PHPUnit parser dependency --- tests/phpunit/includes/abstract-testcase.php | 168 ++++++------------ .../abilities-api/wpAbilitiesRegistry.php | 50 +++--- .../wpAbilityCategoryRegistry.php | 28 +-- .../tests/abilities-api/wpRegisterAbility.php | 18 +- .../wpRegisterAbilityCategory.php | 16 +- .../wpRegisterCoreSettingsGetAbility.php | 2 +- tests/phpunit/tests/actions.php | 4 +- tests/phpunit/tests/admin/includesPlugin.php | 2 +- tests/phpunit/tests/admin/includesTheme.php | 4 +- .../tests/admin/wpAutomaticUpdater.php | 2 +- tests/phpunit/tests/admin/wpListTable.php | 2 +- tests/phpunit/tests/admin/wpMenuOutput.php | 2 +- tests/phpunit/tests/admin/wpUserSearch.php | 2 +- tests/phpunit/tests/adminbar.php | 2 +- .../wpAiClientAbilityFunctionResolver.php | 12 +- .../ai-client/wpAiClientEmbeddingBuilder.php | 2 +- .../ai-client/wpAiClientPromptBuilder.php | 6 +- tests/phpunit/tests/auth.php | 4 +- .../tests/block-bindings/postDataSource.php | 2 +- .../wpBlockBindingsRegistry.php | 18 +- .../tests/block-supports/typography.php | 4 +- ...pCreateBlockStyleVariationInstanceName.php | 2 +- tests/phpunit/tests/block-template-utils.php | 4 +- tests/phpunit/tests/block-template.php | 2 +- .../WpBlockTemplatesRegistry.php | 8 +- tests/phpunit/tests/blocks/editor.php | 10 +- tests/phpunit/tests/blocks/register.php | 6 +- .../tests/blocks/wpBlockMetadataRegistry.php | 16 +- .../tests/blocks/wpBlockPatternsRegistry.php | 14 +- .../tests/blocks/wpBlockTypeRegistry.php | 6 +- tests/phpunit/tests/cache.php | 4 +- .../tests/category/getAllCategoryIds.php | 2 +- .../tests/category/getCategoryParents.php | 2 +- .../phpunit/tests/comment/getTrackbackUrl.php | 2 +- .../phpunit/tests/compat/jsonEncodeDecode.php | 18 +- .../tests/connectors/wpConnectorRegistry.php | 38 ++-- ...ConnectorsGetConnectorScriptModuleData.php | 4 +- .../connectors/wpConnectorsIsApiKeyValid.php | 2 +- .../wpConnectorsResolveAiProviderLogoUrl.php | 2 +- .../tests/connectors/wpRegisterConnector.php | 2 +- tests/phpunit/tests/cron.php | 2 +- tests/phpunit/tests/customize/partial.php | 2 +- tests/phpunit/tests/customize/widgets.php | 8 +- tests/phpunit/tests/date/query.php | 24 +-- tests/phpunit/tests/db.php | 18 +- tests/phpunit/tests/dependencies.php | 4 +- tests/phpunit/tests/dependencies/jquery.php | 2 +- .../dependencies/scriptConcatSettings.php | 8 +- tests/phpunit/tests/dependencies/scripts.php | 32 ++-- tests/phpunit/tests/dependencies/styles.php | 16 +- .../tests/dependencies/wpInlineScriptTag.php | 2 +- .../dependencies/wpPrefetchAdminAssets.php | 2 +- .../wpRemoveSurroundingEmptyScriptTags.php | 2 +- .../wpSanitizeScriptAttributes.php | 12 +- tests/phpunit/tests/entity-actions.php | 36 ++-- .../entity-fields/wpEntityFieldsRegistry.php | 30 ++-- .../wpRegisterEntityFieldCollection.php | 10 +- tests/phpunit/tests/filters.php | 4 +- .../wpFontCollection/__construct.php | 2 +- .../font-library/wpFontCollection/getData.php | 6 +- .../wpFontLibrary/registerFontCollection.php | 2 +- .../wpRestFontCollectionsController.php | 4 +- tests/phpunit/tests/formatting/cleanPre.php | 2 +- tests/phpunit/tests/formatting/likeEscape.php | 2 +- .../tests/formatting/wpHtmleditPre.php | 2 +- .../tests/formatting/wpRicheditPre.php | 2 +- tests/phpunit/tests/formatting/wpSlash.php | 4 +- .../tests/functions/getNonCachedIds.php | 4 +- .../tests/functions/registerUninstallHook.php | 2 +- .../phpunit/tests/functions/wpAdminNotice.php | 2 +- .../tests/functions/wpGetAdminNotice.php | 2 +- tests/phpunit/tests/functions/wpListPluck.php | 4 +- tests/phpunit/tests/functions/wpListUtil.php | 4 +- .../tests/functions/wpUniqueIdFromValues.php | 2 +- .../template_CheckedSelectedHelper.php | 2 +- .../html-api/wpHtmlProcessor-bookmark.php | 2 +- .../tests/html-api/wpHtmlProcessor.php | 12 +- .../wpHtmlProcessorModifiableText.php | 2 +- .../html-api/wpHtmlTagProcessor-bookmark.php | 4 +- .../tests/html-api/wpHtmlTagProcessor.php | 4 +- .../wpHtmlTagProcessorModifiableText.php | 6 +- tests/phpunit/tests/http/wpGetHttpHeaders.php | 2 +- .../tests/icons/wpIconCollectionsRegistry.php | 10 +- tests/phpunit/tests/icons/wpIconsRegistry.php | 18 +- tests/phpunit/tests/image/functions.php | 4 +- .../tests/image/imageEditApplyChanges.php | 4 +- tests/phpunit/tests/image/size.php | 10 +- tests/phpunit/tests/includes/helpers.php | 38 +--- .../includes/legacyDeprecationOverrides.php | 47 ----- .../wpInteractivityAPI-wp-bind.php | 18 +- .../wpInteractivityAPI-wp-class.php | 4 +- .../wpInteractivityAPI-wp-context.php | 2 +- .../wpInteractivityAPI-wp-html.php | 14 +- .../wpInteractivityAPI-wp-style.php | 4 +- .../interactivity-api/wpInteractivityAPI.php | 28 +-- tests/phpunit/tests/link/getCommentsLink.php | 2 +- .../phpunit/tests/link/getDeletePostLink.php | 2 +- tests/phpunit/tests/media.php | 36 ++-- .../tests/media/wpCrossOriginIsolation.php | 4 +- .../tests/media/wpImageTagAddDecodingAttr.php | 4 +- tests/phpunit/tests/menu/nav-menu.php | 4 +- tests/phpunit/tests/meta/registerMeta.php | 4 +- .../tests/meta/wpMetadataLazyloader.php | 4 +- tests/phpunit/tests/multisite/network.php | 2 +- tests/phpunit/tests/multisite/site.php | 2 +- tests/phpunit/tests/multisite/wpGetSites.php | 4 +- tests/phpunit/tests/oembed/wpOembed.php | 2 +- tests/phpunit/tests/option/registration.php | 4 +- tests/phpunit/tests/post/getPageByTitle.php | 2 +- tests/phpunit/tests/post/getTheExcerpt.php | 2 +- tests/phpunit/tests/post/truncatePostSlug.php | 2 +- tests/phpunit/tests/post/types.php | 4 +- tests/phpunit/tests/post/wpDeletePost.php | 2 +- .../privacy/wpAddPrivacyPolicyContent.php | 4 +- ...pPrivacyGeneratePersonalDataExportFile.php | 6 +- tests/phpunit/tests/query/conditionals.php | 6 +- tests/phpunit/tests/query/isSitemap.php | 2 +- .../tests/query/lazyLoadCommentMeta.php | 4 +- .../tests/query/randomContentRedirect.php | 10 +- tests/phpunit/tests/query/results.php | 2 +- tests/phpunit/tests/rest-api.php | 14 +- .../rest-api/rest-comments-controller.php | 2 +- .../rest-entity-actions-controller.php | 2 +- .../tests/rest-api/rest-post-meta-fields.php | 6 +- .../tests/rest-api/rest-posts-controller.php | 4 +- .../rest-api/rest-schema-sanitization.php | 16 +- .../tests/rest-api/rest-schema-validation.php | 14 +- tests/phpunit/tests/rest-api/rest-server.php | 2 +- .../rest-api/rest-settings-controller.php | 6 +- .../tests/rest-api/rest-users-controller.php | 2 +- .../tests/script-modules/wpScriptModules.php | 14 +- tests/phpunit/tests/secrets/networkScope.php | 2 +- .../phpunit/tests/secrets/wpSecretsCipher.php | 6 +- .../tests/secrets/wpSecretsKeyManager.php | 4 +- .../tests/secrets/wpSecretsValidateName.php | 2 +- .../secrets/wpSetSecretAndWpGetSecret.php | 2 +- tests/phpunit/tests/shortcode.php | 2 +- .../tests/sitemaps/wpSitemapsRenderer.php | 14 +- .../tests/sitemaps/wpSitemapsStylesheet.php | 2 +- .../wpSpeculationRules.php | 4 +- tests/phpunit/tests/taxonomy.php | 4 +- tests/phpunit/tests/theme.php | 16 +- tests/phpunit/tests/theme/support.php | 8 +- tests/phpunit/tests/theme/themeDir.php | 22 +-- tests/phpunit/tests/theme/wpThemeJson.php | 6 +- tests/phpunit/tests/user.php | 8 +- tests/phpunit/tests/user/capabilities.php | 8 +- tests/phpunit/tests/user/mapMetaCap.php | 2 +- tests/phpunit/tests/user/multisite.php | 2 +- tests/phpunit/tests/user/query.php | 6 +- tests/phpunit/tests/user/queryCache.php | 4 +- tests/phpunit/tests/user/theAuthor.php | 4 +- .../phpunit/tests/user/theAuthorPostsLink.php | 2 +- tests/phpunit/tests/view-config-data.php | 18 +- tests/phpunit/tests/view-config.php | 2 +- tests/phpunit/tests/widgets.php | 8 +- .../tests/widgets/wpWidgetRecentComments.php | 2 +- .../phpunit/tests/wp-token-map/wpTokenMap.php | 2 +- tests/phpunit/tests/xmlrpc/wp/getUsers.php | 2 +- 159 files changed, 603 insertions(+), 752 deletions(-) delete mode 100644 tests/phpunit/tests/includes/legacyDeprecationOverrides.php diff --git a/tests/phpunit/includes/abstract-testcase.php b/tests/phpunit/includes/abstract-testcase.php index 4705f7e9d4a0a..edae9d14c2035 100644 --- a/tests/phpunit/includes/abstract-testcase.php +++ b/tests/phpunit/includes/abstract-testcase.php @@ -280,7 +280,6 @@ public function set_up() { } $this->start_transaction(); - // Call through the legacy method so that subclass overrides of it keep running. $this->expectDeprecated(); add_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) ); add_filter( 'wp_hash_password_options', array( $this, 'wp_hash_password_options' ), 1, 2 ); @@ -834,35 +833,54 @@ public function wp_die_handler( $message, $title, $args ) { } /** - * Sets up the expectations for testing deprecated and incorrect usage calls. - * - * Supports the `@expectedWPDeprecated` and `@expectedWPIncorrectUsage` - * annotations, as well as their legacy unprefixed forms. + * Sets up the expectations for testing a deprecated call. * - * @since 7.2.0 + * @since 3.7.0 */ - protected function set_up_deprecation_expectations() { - $annotations = $this->get_expected_annotations(); + public function expectDeprecated() { + $method_name = method_exists( $this, 'name' ) ? $this->name() : $this->getName( false ); + $class = new ReflectionClass( $this ); + $reflectors = array( + 'class' => array_merge( array_values( $class->getTraits() ), array( $class ) ), + 'method' => array( $class->getMethod( $method_name ) ), + ); + $annotations = array( + 'class' => array(), + 'method' => array(), + ); - foreach ( array( 'class', 'method' ) as $depth ) { - // Support the old annotation for backward compatibility. - foreach ( array( 'expectedWPDeprecated', 'expectedDeprecated' ) as $annotation ) { - if ( ! empty( $annotations[ $depth ][ $annotation ] ) ) { - $this->expected_deprecated = array_merge( - $this->expected_deprecated, - $annotations[ $depth ][ $annotation ] - ); + foreach ( $reflectors as $depth => $depth_reflectors ) { + foreach ( $depth_reflectors as $reflector ) { + $docblock = substr( (string) $reflector->getDocComment(), 3, -2 ); + $doc_annotations = array(); + + // Parse all tags before filtering so annotation values remain intact. + if ( preg_match_all( '/@([A-Za-z_-]+)(?:[ \t]+(.*?))?[ \t]*\r?$/m', $docblock, $matches, PREG_SET_ORDER ) ) { + foreach ( $matches as $match ) { + if ( in_array( $match[1], array( 'expectedDeprecated', 'expectedIncorrectUsage' ), true ) ) { + $doc_annotations[ $match[1] ][] = $match[2] ?? ''; + } + } } + + // Later traits and the class replace earlier values for the same annotation. + $annotations[ $depth ] = array_merge( $annotations[ $depth ], $doc_annotations ); } + } - // Support the old annotation for backward compatibility. - foreach ( array( 'expectedWPIncorrectUsage', 'expectedIncorrectUsage' ) as $annotation ) { - if ( ! empty( $annotations[ $depth ][ $annotation ] ) ) { - $this->expected_doing_it_wrong = array_merge( - $this->expected_doing_it_wrong, - $annotations[ $depth ][ $annotation ] - ); - } + foreach ( array( 'class', 'method' ) as $depth ) { + if ( ! empty( $annotations[ $depth ]['expectedDeprecated'] ) ) { + $this->expected_deprecated = array_merge( + $this->expected_deprecated, + $annotations[ $depth ]['expectedDeprecated'] + ); + } + + if ( ! empty( $annotations[ $depth ]['expectedIncorrectUsage'] ) ) { + $this->expected_doing_it_wrong = array_merge( + $this->expected_doing_it_wrong, + $annotations[ $depth ]['expectedIncorrectUsage'] + ); } } @@ -882,62 +900,15 @@ protected function set_up_deprecation_expectations() { } /** - * Sets up the expectations for testing a deprecated call. + * Handles a deprecated expectation. * - * Still called by set_up() so that subclass overrides keep running. Do not remove - * it without a replacement for those overrides. + * The DocBlock should contain `@expectedDeprecated` to trigger this. * * @since 3.7.0 - * @deprecated 7.2.0 Use WP_UnitTestCase_Base::set_up_deprecation_expectations() instead. - */ - public function expectDeprecated() { - $this->set_up_deprecation_expectations(); - } - - /** - * Retrieves expected deprecation and incorrect usage annotations. - * - * @since 7.2.0 - * - * @return array> Annotations grouped by class and method. - */ - private function get_expected_annotations() { - $method_name = method_exists( $this, 'name' ) ? $this->name() : $this->getName( false ); - $class = new ReflectionClass( $this ); - $method = $class->getMethod( $method_name ); - - return array( - 'class' => $this->parse_expected_annotations( $class->getDocComment() ), - 'method' => $this->parse_expected_annotations( $method->getDocComment() ), - ); - } - - /** - * Parses expected deprecation and incorrect usage annotations from a DocBlock. - * - * @since 7.2.0 - * - * @param string|false $doc_comment DocBlock to parse, or false if none exists. - * @return array Expected values grouped by annotation name. + * @since 6.1.0 Includes the actual unexpected `_doing_it_wrong()` message + * or deprecation notice in the output if one is encountered. */ - private function parse_expected_annotations( $doc_comment ) { - $annotations = array(); - - foreach ( array( 'expectedWPDeprecated', 'expectedDeprecated', 'expectedWPIncorrectUsage', 'expectedIncorrectUsage' ) as $annotation ) { - if ( preg_match_all( '/@' . $annotation . '[\t ]+([^\r\n*]+)/', (string) $doc_comment, $matches ) ) { - $annotations[ $annotation ] = array_map( 'trim', $matches[1] ); - } - } - - return $annotations; - } - - /** - * Handles deprecated and incorrect usage expectations. - * - * @since 7.2.0 - */ - protected function assert_expected_deprecations() { + public function expectedDeprecated() { $errors = array(); $not_caught_deprecated = array_diff( @@ -987,19 +958,6 @@ protected function assert_expected_deprecations() { } } - /** - * Handles a deprecated expectation. - * - * Still called by assert_post_conditions() so that subclass overrides keep running. - * Do not remove it without a replacement for those overrides. - * - * @since 3.7.0 - * @deprecated 7.2.0 Use WP_UnitTestCase_Base::assert_expected_deprecations() instead. - */ - public function expectedDeprecated() { - $this->assert_expected_deprecations(); - } - /** * Blocks an external HTTP request that no other filter has answered. * @@ -1031,12 +989,11 @@ public function block_external_http_request( $response, array $args, string $url /** * Detects post-test failure conditions. * - * We use this method to detect WordPress deprecation and incorrect usage annotations. + * We use this method to detect expectedDeprecated and expectedIncorrectUsage annotations. * * @since 4.2.0 */ protected function assert_post_conditions() { - // Call through the legacy method so that subclass overrides of it keep running. $this->expectedDeprecated(); if ( $this->blocked_http_requests ) { @@ -1048,54 +1005,29 @@ protected function assert_post_conditions() { } } - /** - * Declares an expected WordPress deprecation call from within a test. - * - * @since 7.2.0 - * - * @param string $deprecated Name of the function, method, class, file, hook, or argument that is deprecated. - */ - public function expectWPDeprecated( $deprecated ) { - $this->expected_deprecated[] = $deprecated; - } - /** * Declares an expected `_deprecated_function()` or `_deprecated_argument()` call from within a test. * * @since 4.2.0 - * @deprecated 7.2.0 Use WP_UnitTestCase_Base::expectWPDeprecated() instead. * * @param string $deprecated Name of the function, method, class, or argument that is deprecated. * Must match the first parameter of the `_deprecated_function()` * or `_deprecated_argument()` call. */ public function setExpectedDeprecated( $deprecated ) { - $this->expectWPDeprecated( $deprecated ); - } - - /** - * Declares an expected WordPress incorrect usage call from within a test. - * - * @since 7.2.0 - * - * @param string $doing_it_wrong Name of the function, method, or class that appears in - * the first argument of the source `_doing_it_wrong()` call. - */ - public function expectWPIncorrectUsage( $doing_it_wrong ) { - $this->expected_doing_it_wrong[] = $doing_it_wrong; + $this->expected_deprecated[] = $deprecated; } /** * Declares an expected `_doing_it_wrong()` call from within a test. * * @since 4.2.0 - * @deprecated 7.2.0 Use WP_UnitTestCase_Base::expectWPIncorrectUsage() instead. * * @param string $doing_it_wrong Name of the function, method, or class that appears in * the first argument of the source `_doing_it_wrong()` call. */ public function setExpectedIncorrectUsage( $doing_it_wrong ) { - $this->expectWPIncorrectUsage( $doing_it_wrong ); + $this->expected_doing_it_wrong[] = $doing_it_wrong; } /** diff --git a/tests/phpunit/tests/abilities-api/wpAbilitiesRegistry.php b/tests/phpunit/tests/abilities-api/wpAbilitiesRegistry.php index 2f543891cd466..7d98cb2780454 100644 --- a/tests/phpunit/tests/abilities-api/wpAbilitiesRegistry.php +++ b/tests/phpunit/tests/abilities-api/wpAbilitiesRegistry.php @@ -101,7 +101,7 @@ public function tear_down(): void { * * @covers WP_Abilities_Registry::register * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_name_without_namespace() { $result = $this->registry->register( 'without-namespace', self::$test_ability_args ); @@ -115,7 +115,7 @@ public function test_register_invalid_name_without_namespace() { * * @covers WP_Abilities_Registry::register * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_characters_in_name() { $result = $this->registry->register( 'still/_doing_it_wrong', array() ); @@ -129,7 +129,7 @@ public function test_register_invalid_characters_in_name() { * * @covers WP_Abilities_Registry::register * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_uppercase_characters_in_name() { $result = $this->registry->register( 'Test/AddNumbers', self::$test_ability_args ); @@ -144,7 +144,7 @@ public function test_register_invalid_uppercase_characters_in_name() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_missing_label() { // Remove the label from the args. @@ -162,7 +162,7 @@ public function test_register_invalid_missing_label() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_label_type() { self::$test_ability_args['label'] = false; @@ -179,7 +179,7 @@ public function test_register_invalid_label_type() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_missing_description() { // Remove the description from the args. @@ -197,7 +197,7 @@ public function test_register_invalid_missing_description() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_description_type() { self::$test_ability_args['description'] = false; @@ -211,7 +211,7 @@ public function test_register_invalid_description_type() { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_ability_nonexistent_category(): void { $args = array_merge( @@ -233,7 +233,7 @@ public function test_register_ability_nonexistent_category(): void { * * @covers WP_Abilities_Registry::register * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register * * @param mixed $category Invalid category value. */ @@ -271,7 +271,7 @@ public static function data_invalid_category_types(): array { * * @covers WP_Abilities_Registry::register * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_ability_rejects_empty_category(): void { $args = self::$test_ability_args; @@ -294,7 +294,7 @@ public function test_register_ability_rejects_empty_category(): void { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_missing_execute_callback() { // Remove the execute_callback from the args. @@ -312,7 +312,7 @@ public function test_register_invalid_missing_execute_callback() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_incorrect_execute_callback_type() { self::$test_ability_args['execute_callback'] = 'not-a-callback'; @@ -359,7 +359,7 @@ public function test_register_with_custom_ability_class_without_execute_callback * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_missing_permission_callback() { // Remove the permission_callback from the args. @@ -377,7 +377,7 @@ public function test_register_invalid_missing_permission_callback() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_incorrect_permission_callback_type() { self::$test_ability_args['permission_callback'] = 'not-a-callback'; @@ -394,7 +394,7 @@ public function test_register_incorrect_permission_callback_type() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_incorrect_input_schema_type() { self::$test_ability_args['input_schema'] = 'not-an-array'; @@ -411,7 +411,7 @@ public function test_register_incorrect_input_schema_type() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_incorrect_output_schema_type() { self::$test_ability_args['output_schema'] = 'not-an-array'; @@ -428,7 +428,7 @@ public function test_register_incorrect_output_schema_type() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_annotations_type() { self::$test_ability_args['meta']['annotations'] = false; @@ -445,7 +445,7 @@ public function test_register_invalid_annotations_type() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_meta_type() { self::$test_ability_args['meta'] = false; @@ -462,7 +462,7 @@ public function test_register_invalid_meta_type() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_show_in_rest_type() { self::$test_ability_args['meta']['show_in_rest'] = 5; @@ -479,7 +479,7 @@ public function test_register_invalid_show_in_rest_type() { * @covers WP_Abilities_Registry::register * @covers WP_Ability::prepare_properties * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_invalid_public_type() { self::$test_ability_args['meta']['public'] = 5; @@ -495,7 +495,7 @@ public function test_register_invalid_public_type() { * * @covers WP_Abilities_Registry::register * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_incorrect_already_registered_ability() { $this->registry->register( self::$test_ability_name, self::$test_ability_args ); @@ -558,7 +558,7 @@ public function test_is_registered_for_known_ability() { * * @covers WP_Abilities_Registry::get_registered * - * @expectedWPIncorrectUsage WP_Abilities_Registry::get_registered + * @expectedIncorrectUsage WP_Abilities_Registry::get_registered */ public function test_get_registered_rejects_unknown_ability_name() { $ability = $this->registry->get_registered( 'test/unknown' ); @@ -589,7 +589,7 @@ public function test_get_registered_for_known_ability() { * * @covers WP_Abilities_Registry::unregister * - * @expectedWPIncorrectUsage WP_Abilities_Registry::unregister + * @expectedIncorrectUsage WP_Abilities_Registry::unregister */ public function test_unregister_not_registered_ability() { $result = $this->registry->unregister( 'test/unregistered' ); @@ -687,7 +687,7 @@ static function ( $args ) use ( &$was_filter_callback_fired ) { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_ability_args_filter_blocks_registration() { // Define the filter. @@ -713,7 +713,7 @@ static function ( $args ) { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_ability_args_filter_blocks_invalid_ability_class() { // Define the filter. diff --git a/tests/phpunit/tests/abilities-api/wpAbilityCategoryRegistry.php b/tests/phpunit/tests/abilities-api/wpAbilityCategoryRegistry.php index 4aa71fe4c43bd..b2f879e603f1c 100644 --- a/tests/phpunit/tests/abilities-api/wpAbilityCategoryRegistry.php +++ b/tests/phpunit/tests/abilities-api/wpAbilityCategoryRegistry.php @@ -118,7 +118,7 @@ public function test_register_valid_category(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_register_category_invalid_slug_format(): void { // Uppercase characters not allowed. @@ -139,7 +139,7 @@ public function test_register_category_invalid_slug_format(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_register_category_invalid_slug_underscore(): void { $result = $this->registry->register( @@ -159,7 +159,7 @@ public function test_register_category_invalid_slug_underscore(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_register_category_missing_label(): void { $result = $this->registry->register( @@ -178,7 +178,7 @@ public function test_register_category_missing_label(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_register_category_missing_description(): void { $result = $this->registry->register( @@ -197,7 +197,7 @@ public function test_register_category_missing_description(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_register_duplicate_category(): void { $result = $this->registry->register( @@ -247,7 +247,7 @@ public function test_unregister_existing_category(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::unregister + * @expectedIncorrectUsage WP_Ability_Categories_Registry::unregister */ public function test_unregister_nonexistent_category(): void { $result = $this->registry->unregister( 'test-nonexistent' ); @@ -281,7 +281,7 @@ public function test_get_existing_category(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::get_registered + * @expectedIncorrectUsage WP_Ability_Categories_Registry::get_registered */ public function test_get_nonexistent_category(): void { $result = $this->registry->get_registered( 'test-nonexistent' ); @@ -449,7 +449,7 @@ public static function data_invalid_slug_provider(): array { * @ticket 64098 * * @dataProvider data_invalid_slug_provider - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedIncorrectUsage WP_Ability_Categories_Registry::register * * @param string $slug The category slug to test. */ @@ -471,7 +471,7 @@ public function test_category_slug_invalid_formats( string $slug ): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_category_constructor_non_string_label(): void { $result = $this->registry->register( @@ -491,7 +491,7 @@ public function test_category_constructor_non_string_label(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_category_constructor_empty_label(): void { $result = $this->registry->register( @@ -511,7 +511,7 @@ public function test_category_constructor_empty_label(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_category_constructor_non_string_description(): void { $result = $this->registry->register( @@ -531,7 +531,7 @@ public function test_category_constructor_non_string_description(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_category_constructor_empty_description(): void { $result = $this->registry->register( @@ -665,7 +665,7 @@ public function test_register_category_without_meta_returns_empty_array(): void * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::register + * @expectedIncorrectUsage WP_Ability_Categories_Registry::register */ public function test_register_category_with_invalid_meta(): void { $result = $this->registry->register( @@ -686,7 +686,7 @@ public function test_register_category_with_invalid_meta(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Category::__construct + * @expectedIncorrectUsage WP_Ability_Category::__construct */ public function test_register_category_with_unknown_property(): void { $result = $this->registry->register( diff --git a/tests/phpunit/tests/abilities-api/wpRegisterAbility.php b/tests/phpunit/tests/abilities-api/wpRegisterAbility.php index b58f2ae3a170e..9a248b76ae478 100644 --- a/tests/phpunit/tests/abilities-api/wpRegisterAbility.php +++ b/tests/phpunit/tests/abilities-api/wpRegisterAbility.php @@ -118,7 +118,7 @@ private function simulate_doing_wp_abilities_init_action() { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_ability_invalid_name(): void { $this->simulate_doing_wp_abilities_init_action(); @@ -133,7 +133,7 @@ public function test_register_ability_invalid_name(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage wp_register_ability + * @expectedIncorrectUsage wp_register_ability */ public function test_register_ability_no_abilities_api_init_action(): void { $this->assertFalse( doing_action( 'wp_abilities_api_init' ) ); @@ -148,7 +148,7 @@ public function test_register_ability_no_abilities_api_init_action(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Abilities_Registry::get_instance + * @expectedIncorrectUsage WP_Abilities_Registry::get_instance */ public function test_register_ability_no_init_action(): void { global $wp_actions; @@ -226,7 +226,7 @@ public function test_register_valid_ability(): void { * Tests that registering an ability requires a category. * * @ticket 65569 - * @expectedWPIncorrectUsage WP_Abilities_Registry::register + * @expectedIncorrectUsage WP_Abilities_Registry::register */ public function test_register_ability_without_category_fails(): void { $this->simulate_doing_wp_abilities_init_action(); @@ -305,7 +305,7 @@ public function test_register_ability_custom_ability_class(): void { ); // Try again with an invalid class throws a doing it wrong. - $this->expectWPIncorrectUsage( WP_Abilities_Registry::class . '::register' ); + $this->setExpectedIncorrectUsage( WP_Abilities_Registry::class . '::register' ); wp_register_ability( self::$test_ability_name, array_merge( @@ -463,7 +463,7 @@ public function test_permission_callback_receives_input(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Abilities_Registry::get_instance + * @expectedIncorrectUsage WP_Abilities_Registry::get_instance */ public function test_unregister_ability_no_init_action(): void { global $wp_actions; @@ -510,7 +510,7 @@ public function test_unregister_existing_ability() { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Abilities_Registry::get_instance + * @expectedIncorrectUsage WP_Abilities_Registry::get_instance */ public function test_get_ability_no_init_action(): void { global $wp_actions; @@ -574,7 +574,7 @@ static function ( $instance ) use ( $name, $args ) { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Abilities_Registry::get_instance + * @expectedIncorrectUsage WP_Abilities_Registry::get_instance */ public function test_has_ability_no_init_action(): void { global $wp_actions; @@ -630,7 +630,7 @@ public function test_has_registered_nonexistent_ability() { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Abilities_Registry::get_instance + * @expectedIncorrectUsage WP_Abilities_Registry::get_instance */ public function test_get_abilities_no_init_action(): void { global $wp_actions; diff --git a/tests/phpunit/tests/abilities-api/wpRegisterAbilityCategory.php b/tests/phpunit/tests/abilities-api/wpRegisterAbilityCategory.php index b4f85859d0c07..9b83928e19d5c 100644 --- a/tests/phpunit/tests/abilities-api/wpRegisterAbilityCategory.php +++ b/tests/phpunit/tests/abilities-api/wpRegisterAbilityCategory.php @@ -58,7 +58,7 @@ private function simulate_doing_wp_ability_categories_init_action() { * * @ticket 64098 * - * @expectedWPIncorrectUsage wp_register_ability_category + * @expectedIncorrectUsage wp_register_ability_category */ public function test_register_category_before_init_hook(): void { $this->assertFalse( doing_action( 'wp_abilities_api_categories_init' ) ); @@ -76,7 +76,7 @@ public function test_register_category_before_init_hook(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::get_instance + * @expectedIncorrectUsage WP_Ability_Categories_Registry::get_instance */ public function test_register_ability_category_no_init_action(): void { global $wp_actions; @@ -126,7 +126,7 @@ public function test_register_valid_category(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::get_instance + * @expectedIncorrectUsage WP_Ability_Categories_Registry::get_instance */ public function test_unregister_ability_category_no_init_action(): void { global $wp_actions; @@ -154,7 +154,7 @@ public function test_unregister_ability_category_no_init_action(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::unregister + * @expectedIncorrectUsage WP_Ability_Categories_Registry::unregister */ public function test_unregister_nonexistent_category(): void { $this->simulate_doing_wp_ability_categories_init_action(); @@ -188,7 +188,7 @@ public function test_unregister_existing_category(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::get_instance + * @expectedIncorrectUsage WP_Ability_Categories_Registry::get_instance */ public function test_has_ability_category_no_init_action(): void { global $wp_actions; @@ -249,7 +249,7 @@ public function test_has_registered_ability_category(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::get_instance + * @expectedIncorrectUsage WP_Ability_Categories_Registry::get_instance */ public function test_get_ability_category_no_init_action(): void { global $wp_actions; @@ -277,7 +277,7 @@ public function test_get_ability_category_no_init_action(): void { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::get_registered + * @expectedIncorrectUsage WP_Ability_Categories_Registry::get_registered */ public function test_get_nonexistent_category(): void { $this->simulate_doing_wp_ability_categories_init_action(); @@ -322,7 +322,7 @@ static function ( $instance ) use ( $name, $args ) { * * @ticket 64098 * - * @expectedWPIncorrectUsage WP_Ability_Categories_Registry::get_instance + * @expectedIncorrectUsage WP_Ability_Categories_Registry::get_instance */ public function test_get_ability_categories_no_init_action(): void { global $wp_actions; diff --git a/tests/phpunit/tests/abilities-api/wpRegisterCoreSettingsGetAbility.php b/tests/phpunit/tests/abilities-api/wpRegisterCoreSettingsGetAbility.php index 4c1722a249791..cfdc6677fff8f 100644 --- a/tests/phpunit/tests/abilities-api/wpRegisterCoreSettingsGetAbility.php +++ b/tests/phpunit/tests/abilities-api/wpRegisterCoreSettingsGetAbility.php @@ -282,7 +282,7 @@ public function test_core_settings_get_inherits_rest_api_exposure(): void { * * @ticket 64605 * - * @expectedWPIncorrectUsage WP_Abilities_Settings::get_exposed_settings + * @expectedIncorrectUsage WP_Abilities_Settings::get_exposed_settings */ public function test_core_settings_get_warns_about_a_duplicate_exposed_name(): void { register_setting( diff --git a/tests/phpunit/tests/actions.php b/tests/phpunit/tests/actions.php index 4576ba1ecb162..e333fe181d790 100644 --- a/tests/phpunit/tests/actions.php +++ b/tests/phpunit/tests/actions.php @@ -806,7 +806,7 @@ public function apply_testing_nested_filter() { /** * @ticket 10441 - * @expectedWPDeprecated tests_do_action_deprecated + * @expectedDeprecated tests_do_action_deprecated * * @covers ::do_action_deprecated */ @@ -826,7 +826,7 @@ public static function deprecated_action_callback( $p ) { /** * @ticket 10441 - * @expectedWPDeprecated tests_do_action_deprecated + * @expectedDeprecated tests_do_action_deprecated * * @covers ::do_action_deprecated */ diff --git a/tests/phpunit/tests/admin/includesPlugin.php b/tests/phpunit/tests/admin/includesPlugin.php index 40fbd8a3dd49c..7f52a0e91be62 100644 --- a/tests/phpunit/tests/admin/includesPlugin.php +++ b/tests/phpunit/tests/admin/includesPlugin.php @@ -469,7 +469,7 @@ public function test_position_when_parent_slug_child_slug_are_the_same() { * @ticket 48599 */ public function test_passing_string_as_position_fires_doing_it_wrong_submenu() { - $this->expectWPIncorrectUsage( 'add_submenu_page' ); + $this->setExpectedIncorrectUsage( 'add_submenu_page' ); global $submenu, $menu; // Reset menus. diff --git a/tests/phpunit/tests/admin/includesTheme.php b/tests/phpunit/tests/admin/includesTheme.php index c2934a0dfa3e8..fd19aef178fff 100644 --- a/tests/phpunit/tests/admin/includesTheme.php +++ b/tests/phpunit/tests/admin/includesTheme.php @@ -68,8 +68,8 @@ public function filter_theme_root( $dir ) { /** * @ticket 10959 * @ticket 11216 - * @expectedWPDeprecated get_theme - * @expectedWPDeprecated get_themes + * @expectedDeprecated get_theme + * @expectedDeprecated get_themes */ public function test_page_templates() { $theme = get_theme( 'Page Template Theme' ); diff --git a/tests/phpunit/tests/admin/wpAutomaticUpdater.php b/tests/phpunit/tests/admin/wpAutomaticUpdater.php index 80a958aba9d93..e3c8dc27c0573 100644 --- a/tests/phpunit/tests/admin/wpAutomaticUpdater.php +++ b/tests/phpunit/tests/admin/wpAutomaticUpdater.php @@ -738,7 +738,7 @@ public function test_is_allowed_dir_should_return_false_if_open_basedir_is_set_a * * @covers WP_Automatic_Updater::is_allowed_dir * - * @expectedWPIncorrectUsage WP_Automatic_Updater::is_allowed_dir + * @expectedIncorrectUsage WP_Automatic_Updater::is_allowed_dir * * @dataProvider data_is_allowed_dir_should_throw_doing_it_wrong_with_invalid_dir * diff --git a/tests/phpunit/tests/admin/wpListTable.php b/tests/phpunit/tests/admin/wpListTable.php index 536da85e5eae3..909b232a2020c 100644 --- a/tests/phpunit/tests/admin/wpListTable.php +++ b/tests/phpunit/tests/admin/wpListTable.php @@ -276,7 +276,7 @@ public static function data_get_views_links() { * * @covers WP_List_Table::get_views_links * - * @expectedWPIncorrectUsage WP_List_Table::get_views_links + * @expectedIncorrectUsage WP_List_Table::get_views_links * * @dataProvider data_get_views_links_doing_it_wrong * diff --git a/tests/phpunit/tests/admin/wpMenuOutput.php b/tests/phpunit/tests/admin/wpMenuOutput.php index 113019d5dfb0b..09e2c2a8fd384 100644 --- a/tests/phpunit/tests/admin/wpMenuOutput.php +++ b/tests/phpunit/tests/admin/wpMenuOutput.php @@ -192,7 +192,7 @@ public function test_icon_name_is_rendered_as_svg_icon(): void { * * @covers ::_wp_menu_output * - * @expectedWPIncorrectUsage _wp_menu_output + * @expectedIncorrectUsage _wp_menu_output */ public function test_unregistered_icon_name_leaves_icon_element_empty(): void { // 0 = menu_title, 1 = capability, 2 = menu_slug, 3 = page_title, 4 = classes, 5 = hookname, 6 = icon_url. diff --git a/tests/phpunit/tests/admin/wpUserSearch.php b/tests/phpunit/tests/admin/wpUserSearch.php index 370a384ba4c3a..4ad20f77c40e6 100644 --- a/tests/phpunit/tests/admin/wpUserSearch.php +++ b/tests/phpunit/tests/admin/wpUserSearch.php @@ -9,7 +9,7 @@ class Tests_Admin_wpUserSearch extends WP_UnitTestCase { /** * @covers ::__construct() - * @expectedWPDeprecated WP_User_Search + * @expectedDeprecated WP_User_Search */ public function test_class_is_deprecated() { $wp_user_search = new WP_User_Search(); diff --git a/tests/phpunit/tests/adminbar.php b/tests/phpunit/tests/adminbar.php index f7cea67121351..1445aff8af47a 100644 --- a/tests/phpunit/tests/adminbar.php +++ b/tests/phpunit/tests/adminbar.php @@ -1219,7 +1219,7 @@ public function test_wp_logo_node_title_replaced_without_icon_renders_no_icon(): * * @covers WP_Admin_Bar::_render_item * - * @expectedWPIncorrectUsage WP_Admin_Bar::_render_item + * @expectedIncorrectUsage WP_Admin_Bar::_render_item */ public function test_unregistered_icon_renders_no_icon_element(): void { $admin_bar = new WP_Admin_Bar(); diff --git a/tests/phpunit/tests/ai-client/wpAiClientAbilityFunctionResolver.php b/tests/phpunit/tests/ai-client/wpAiClientAbilityFunctionResolver.php index 450e5fcce92aa..db1d10a3e50cd 100644 --- a/tests/phpunit/tests/ai-client/wpAiClientAbilityFunctionResolver.php +++ b/tests/phpunit/tests/ai-client/wpAiClientAbilityFunctionResolver.php @@ -157,7 +157,7 @@ public function test_execute_ability_returns_error_for_non_ability_call() { * @ticket 64591 */ public function test_execute_ability_returns_error_when_ability_not_found() { - $this->expectWPIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); + $this->setExpectedIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); $resolver = new WP_AI_Client_Ability_Function_Resolver( 'nonexistent/ability' ); $call = new FunctionCall( @@ -185,7 +185,7 @@ public function test_execute_ability_returns_error_when_ability_not_found() { * @ticket 64591 */ public function test_execute_ability_handles_missing_id() { - $this->expectWPIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); + $this->setExpectedIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); $resolver = new WP_AI_Client_Ability_Function_Resolver( 'nonexistent/ability' ); $call = new FunctionCall( @@ -336,7 +336,7 @@ public function test_execute_abilities_with_empty_message() { * @ticket 64591 */ public function test_execute_abilities_handles_errors_gracefully() { - $this->expectWPIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); + $this->setExpectedIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); $resolver = new WP_AI_Client_Ability_Function_Resolver( 'nonexistent/ability' ); $call = new FunctionCall( @@ -369,7 +369,7 @@ public function test_execute_abilities_handles_errors_gracefully() { * @ticket 64591 */ public function test_execute_abilities_returns_user_message() { - $this->expectWPIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); + $this->setExpectedIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); $resolver = new WP_AI_Client_Ability_Function_Resolver( 'nonexistent/ability' ); $call = new FunctionCall( @@ -395,7 +395,7 @@ public function test_execute_abilities_returns_user_message() { * @ticket 64591 */ public function test_execute_abilities_processes_multiple_calls() { - $this->expectWPIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); + $this->setExpectedIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); $resolver = new WP_AI_Client_Ability_Function_Resolver( 'nonexistent/ability1', 'nonexistent/ability2' ); @@ -431,7 +431,7 @@ public function test_execute_abilities_processes_multiple_calls() { * @ticket 64591 */ public function test_execute_abilities_only_processes_function_calls() { - $this->expectWPIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); + $this->setExpectedIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); $resolver = new WP_AI_Client_Ability_Function_Resolver( 'nonexistent/ability' ); $call = new FunctionCall( diff --git a/tests/phpunit/tests/ai-client/wpAiClientEmbeddingBuilder.php b/tests/phpunit/tests/ai-client/wpAiClientEmbeddingBuilder.php index 921f4090eba69..d4a80723f111d 100644 --- a/tests/phpunit/tests/ai-client/wpAiClientEmbeddingBuilder.php +++ b/tests/phpunit/tests/ai-client/wpAiClientEmbeddingBuilder.php @@ -323,7 +323,7 @@ static function () { * * @ticket 65638 * - * @expectedWPIncorrectUsage WP_AI_Client_Embedding_Builder::__construct + * @expectedIncorrectUsage WP_AI_Client_Embedding_Builder::__construct */ public function test_constructor_disallows_overriding_with_invalid_request_timeout() { add_filter( 'wp_ai_client_default_request_timeout', '__return_null' ); diff --git a/tests/phpunit/tests/ai-client/wpAiClientPromptBuilder.php b/tests/phpunit/tests/ai-client/wpAiClientPromptBuilder.php index b232381aca97f..89d864fa1f696 100644 --- a/tests/phpunit/tests/ai-client/wpAiClientPromptBuilder.php +++ b/tests/phpunit/tests/ai-client/wpAiClientPromptBuilder.php @@ -276,7 +276,7 @@ public static function data_valid_request_timeout_overrides(): array { * * @dataProvider data_invalid_request_timeouts * - * @expectedWPIncorrectUsage WP_AI_Client_Prompt_Builder::__construct + * @expectedIncorrectUsage WP_AI_Client_Prompt_Builder::__construct * * @param mixed $timeout The invalid timeout value returned by the filter. */ @@ -2440,10 +2440,10 @@ public function test_using_ability_with_multiple_abilities() { * * @ticket 64591 * - * @expectedWPIncorrectUsage WP_AI_Client_Prompt_Builder::using_abilities + * @expectedIncorrectUsage WP_AI_Client_Prompt_Builder::using_abilities */ public function test_using_ability_skips_nonexistent_abilities() { - $this->expectWPIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); + $this->setExpectedIncorrectUsage( 'WP_Abilities_Registry::get_registered' ); $builder = new WP_AI_Client_Prompt_Builder( $this->registry ); $result = $builder->using_abilities( diff --git a/tests/phpunit/tests/auth.php b/tests/phpunit/tests/auth.php index 32538f7e0c5b1..a419c93299a36 100644 --- a/tests/phpunit/tests/auth.php +++ b/tests/phpunit/tests/auth.php @@ -419,7 +419,7 @@ public function test_wp_nonce_verify_success() { * @ticket 36361 */ public function test_check_admin_referer_with_no_action_triggers_doing_it_wrong() { - $this->expectWPIncorrectUsage( 'check_admin_referer' ); + $this->setExpectedIncorrectUsage( 'check_admin_referer' ); // A valid nonce needs to be set so the check doesn't die(). $_REQUEST['_wpnonce'] = wp_create_nonce( -1 ); @@ -442,7 +442,7 @@ public function test_check_admin_referer_with_default_action_as_string_not_doing * @ticket 36361 */ public function test_check_ajax_referer_with_no_action_triggers_doing_it_wrong() { - $this->expectWPIncorrectUsage( 'check_ajax_referer' ); + $this->setExpectedIncorrectUsage( 'check_ajax_referer' ); // A valid nonce needs to be set so the check doesn't die(). $_REQUEST['_wpnonce'] = wp_create_nonce( -1 ); diff --git a/tests/phpunit/tests/block-bindings/postDataSource.php b/tests/phpunit/tests/block-bindings/postDataSource.php index cf581ec124cc3..57a0d3d641750 100644 --- a/tests/phpunit/tests/block-bindings/postDataSource.php +++ b/tests/phpunit/tests/block-bindings/postDataSource.php @@ -545,7 +545,7 @@ public function test_register_source() { * @covers ::_register_block_bindings_post_data_source */ public function test_register_source_already_registered_triggers_doing_it_wrong() { - $this->expectWPIncorrectUsage( 'WP_Block_Bindings_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Block_Bindings_Registry::register' ); _register_block_bindings_post_data_source(); } diff --git a/tests/phpunit/tests/block-bindings/wpBlockBindingsRegistry.php b/tests/phpunit/tests/block-bindings/wpBlockBindingsRegistry.php index 7309164454b50..3667fe19eff26 100644 --- a/tests/phpunit/tests/block-bindings/wpBlockBindingsRegistry.php +++ b/tests/phpunit/tests/block-bindings/wpBlockBindingsRegistry.php @@ -59,7 +59,7 @@ public function tear_down() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_non_string_names() { $result = $this->registry->register( 1, self::$test_source_properties ); @@ -73,7 +73,7 @@ public function test_register_invalid_non_string_names() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_names_without_namespace() { $result = $this->registry->register( 'post-meta', self::$test_source_properties ); @@ -87,7 +87,7 @@ public function test_register_invalid_names_without_namespace() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_characters() { $result = $this->registry->register( 'still/_doing_it_wrong', array() ); @@ -101,7 +101,7 @@ public function test_register_invalid_characters() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_uppercase_characters() { $result = $this->registry->register( 'Core/PostMeta', self::$test_source_properties ); @@ -115,7 +115,7 @@ public function test_register_invalid_uppercase_characters() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_missing_label() { @@ -133,7 +133,7 @@ public function test_register_invalid_missing_label() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_missing_get_value_callback() { @@ -151,7 +151,7 @@ public function test_register_invalid_missing_get_value_callback() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_incorrect_callback_type() { @@ -168,7 +168,7 @@ public function test_register_invalid_incorrect_callback_type() { * * @covers WP_Block_Bindings_Registry::register * - * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::register + * @expectedIncorrectUsage WP_Block_Bindings_Registry::register */ public function test_register_invalid_string_uses_context() { @@ -213,7 +213,7 @@ public function test_register_block_binding_source() { * * @covers WP_Block_Bindings_Registry::unregister * - * @expectedWPIncorrectUsage WP_Block_Bindings_Registry::unregister + * @expectedIncorrectUsage WP_Block_Bindings_Registry::unregister */ public function test_unregister_not_registered_block() { $result = $this->registry->unregister( 'test/unregistered' ); diff --git a/tests/phpunit/tests/block-supports/typography.php b/tests/phpunit/tests/block-supports/typography.php index e81473d78aad4..c481ae2b01a31 100644 --- a/tests/phpunit/tests/block-supports/typography.php +++ b/tests/phpunit/tests/block-supports/typography.php @@ -873,7 +873,7 @@ public static function data_generate_font_size_preset_fixtures() { * * @covers ::wp_get_typography_font_size_value * - * @expectedWPDeprecated wp_get_typography_font_size_value + * @expectedDeprecated wp_get_typography_font_size_value * * @dataProvider data_generate_font_size_preset_should_use_fluid_typography_deprecated_fixtures * @@ -1364,7 +1364,7 @@ public static function data_valid_size_wp_get_typography_value_and_unit() { * @covers ::wp_get_typography_value_and_unit * * @dataProvider data_invalid_size_wp_get_typography_value_and_unit - * @expectedWPIncorrectUsage wp_get_typography_value_and_unit + * @expectedIncorrectUsage wp_get_typography_value_and_unit * * @param mixed $raw_value Raw size value to test. */ diff --git a/tests/phpunit/tests/block-supports/wpCreateBlockStyleVariationInstanceName.php b/tests/phpunit/tests/block-supports/wpCreateBlockStyleVariationInstanceName.php index b23986ed3ceea..10475587287a8 100644 --- a/tests/phpunit/tests/block-supports/wpCreateBlockStyleVariationInstanceName.php +++ b/tests/phpunit/tests/block-supports/wpCreateBlockStyleVariationInstanceName.php @@ -14,7 +14,7 @@ class Tests_Block_Supports_WpCreateBlockStyleVariationInstanceName extends WP_Un * * @covers ::wp_create_block_style_variation_instance_name * - * @expectedWPDeprecated wp_create_block_style_variation_instance_name + * @expectedDeprecated wp_create_block_style_variation_instance_name */ public function test_block_style_variation_instance_name_generation() { $block = array( 'name' => 'test/block' ); diff --git a/tests/phpunit/tests/block-template-utils.php b/tests/phpunit/tests/block-template-utils.php index 200f7af96b888..7423afe03716a 100644 --- a/tests/phpunit/tests/block-template-utils.php +++ b/tests/phpunit/tests/block-template-utils.php @@ -208,7 +208,7 @@ public function test_not_inject_theme_attribute_non_template_part_block() { * * @covers ::_inject_theme_attribute_in_block_template_content * - * @expectedWPDeprecated _inject_theme_attribute_in_block_template_content + * @expectedDeprecated _inject_theme_attribute_in_block_template_content */ public function test_inject_theme_attribute_in_block_template_content() { $theme = get_stylesheet(); @@ -257,7 +257,7 @@ public function test_inject_theme_attribute_in_block_template_content() { * * @dataProvider data_remove_theme_attribute_in_block_template_content * - * @expectedWPDeprecated _remove_theme_attribute_in_block_template_content + * @expectedDeprecated _remove_theme_attribute_in_block_template_content */ public function test_remove_theme_attribute_in_block_template_content( $template_content, $expected ) { $this->assertSame( $expected, _remove_theme_attribute_in_block_template_content( $template_content ) ); diff --git a/tests/phpunit/tests/block-template.php b/tests/phpunit/tests/block-template.php index f65188cdd9b5f..a70f60f86cc89 100644 --- a/tests/phpunit/tests/block-template.php +++ b/tests/phpunit/tests/block-template.php @@ -697,7 +697,7 @@ public function test_unregister_block_template_error_message_includes_template_n unregister_block_template( $template_name ); // Expect _doing_it_wrong() notice. - $this->expectWPIncorrectUsage( 'WP_Block_Templates_Registry::unregister' ); + $this->setExpectedIncorrectUsage( 'WP_Block_Templates_Registry::unregister' ); // Try to unregister again, should return WP_Error. $error = unregister_block_template( $template_name ); diff --git a/tests/phpunit/tests/block-templates/WpBlockTemplatesRegistry.php b/tests/phpunit/tests/block-templates/WpBlockTemplatesRegistry.php index 0a9b48f37e512..113fdc61ace88 100644 --- a/tests/phpunit/tests/block-templates/WpBlockTemplatesRegistry.php +++ b/tests/phpunit/tests/block-templates/WpBlockTemplatesRegistry.php @@ -45,7 +45,7 @@ public function test_register_template_invalid_name() { // Try to register a template with invalid name (non-string). $template_name = array( 'invalid-template-name' ); - $this->expectWPIncorrectUsage( 'WP_Block_Templates_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Block_Templates_Registry::register' ); $result = self::$registry->register( $template_name ); $this->assertWPError( $result, 'Template registration is expected to trigger an error.' ); @@ -65,7 +65,7 @@ public function test_register_template_invalid_name_uppercase() { // Try to register a template with uppercase characters in the name. $template_name = 'test-plugin//Invalid-Template-Name'; - $this->expectWPIncorrectUsage( 'WP_Block_Templates_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Block_Templates_Registry::register' ); $result = self::$registry->register( $template_name ); $this->assertWPError( $result, 'Template registration is expected to trigger an error.' ); @@ -82,7 +82,7 @@ public function test_register_template_invalid_name_uppercase() { */ public function test_register_template_no_prefix() { // Try to register a template without a namespace. - $this->expectWPIncorrectUsage( 'WP_Block_Templates_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Block_Templates_Registry::register' ); $result = self::$registry->register( 'template-no-plugin', array() ); $this->assertWPError( $result, 'Template registration is expected to trigger an error.' ); @@ -103,7 +103,7 @@ public function test_register_template_already_exists() { self::$registry->register( $template_name ); // Try to register the same template again. - $this->expectWPIncorrectUsage( 'WP_Block_Templates_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Block_Templates_Registry::register' ); $result = self::$registry->register( $template_name ); $this->assertWPError( $result, 'Template registration is expected to trigger an error.' ); diff --git a/tests/phpunit/tests/blocks/editor.php b/tests/phpunit/tests/blocks/editor.php index 00820ce278094..5055aab4d999e 100644 --- a/tests/phpunit/tests/blocks/editor.php +++ b/tests/phpunit/tests/blocks/editor.php @@ -175,7 +175,7 @@ public function test_block_editor_context_site() { /** * @ticket 52920 - * @expectedWPDeprecated block_categories + * @expectedDeprecated block_categories */ public function test_get_block_categories_deprecated_filter_post_object() { add_filter( 'block_categories', array( $this, 'filter_set_block_categories_post' ), 10, 2 ); @@ -198,7 +198,7 @@ public function test_get_block_categories_deprecated_filter_post_object() { /** * @ticket 52920 - * @expectedWPDeprecated block_categories + * @expectedDeprecated block_categories */ public function test_get_block_categories_deprecated_filter_post_editor() { add_filter( 'block_categories', array( $this, 'filter_set_block_categories_post' ), 10, 2 ); @@ -232,7 +232,7 @@ public function test_get_allowed_block_types_default() { /** * @ticket 52920 - * @expectedWPDeprecated allowed_block_types + * @expectedDeprecated allowed_block_types */ public function test_get_allowed_block_types_deprecated_filter_post_editor() { add_filter( 'allowed_block_types', array( $this, 'filter_set_allowed_block_types_post' ), 10, 2 ); @@ -629,7 +629,7 @@ public function test_get_block_editor_settings_without_post_content_block() { /** * @ticket 52920 - * @expectedWPDeprecated block_editor_settings + * @expectedDeprecated block_editor_settings */ public function test_get_block_editor_settings_deprecated_filter_post_editor() { add_filter( 'block_editor_settings', array( $this, 'filter_set_block_editor_settings_post' ), 10, 2 ); @@ -661,7 +661,7 @@ public function test_block_editor_rest_api_preload_no_paths() { /** * @ticket 52920 - * @expectedWPDeprecated block_editor_preload_paths + * @expectedDeprecated block_editor_preload_paths */ public function test_block_editor_rest_api_preload_deprecated_filter_post_editor() { function filter_remove_preload_paths( $preload_paths, $post ) { diff --git a/tests/phpunit/tests/blocks/register.php b/tests/phpunit/tests/blocks/register.php index 073abd0463e5e..1ffc91a486fa0 100644 --- a/tests/phpunit/tests/blocks/register.php +++ b/tests/phpunit/tests/blocks/register.php @@ -1383,7 +1383,7 @@ public static function data_register_block_type_accepts_editor_script_array() { * * @dataProvider data_register_block_type_throws_doing_it_wrong * - * @expectedWPIncorrectUsage WP_Block_Type::__set + * @expectedIncorrectUsage WP_Block_Type::__set * * @param array $editor_script The editor script array to register. * @param array $expected The expected registered editor script. @@ -1595,7 +1595,7 @@ public function test_filter_block_registration_metadata_settings() { * * @covers ::register_block_style * - * @expectedWPIncorrectUsage WP_Block_Styles_Registry::register + * @expectedIncorrectUsage WP_Block_Styles_Registry::register * @param array $block_styles Array of block styles to test. */ public function test_register_block_style_name_contains_spaces( array $block_styles ) { @@ -1647,7 +1647,7 @@ public function test_register_block_style_name_without_spaces() { * * @covers ::register_block_type * - * @expectedWPIncorrectUsage register_block_type_from_metadata + * @expectedIncorrectUsage register_block_type_from_metadata */ public function test_register_block_hooks_targeting_itself() { $block_type = register_block_type( diff --git a/tests/phpunit/tests/blocks/wpBlockMetadataRegistry.php b/tests/phpunit/tests/blocks/wpBlockMetadataRegistry.php index 6412e584e2535..6a9cb01479f69 100644 --- a/tests/phpunit/tests/blocks/wpBlockMetadataRegistry.php +++ b/tests/phpunit/tests/blocks/wpBlockMetadataRegistry.php @@ -75,7 +75,7 @@ public function test_register_collection_with_valid_plugin_path() { public function test_register_collection_with_invalid_plugin_path() { $invalid_plugin_path = WP_PLUGIN_DIR; - $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( $invalid_plugin_path, $this->temp_manifest_file ); $this->assertFalse( $result, 'Invalid plugin path should not be registered' ); @@ -96,7 +96,7 @@ public function test_register_collection_with_valid_muplugin_path() { public function test_register_collection_with_invalid_muplugin_path() { $invalid_plugin_path = WPMU_PLUGIN_DIR; - $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( $invalid_plugin_path, $this->temp_manifest_file ); $this->assertFalse( $result, 'Invalid must-use plugin path should not be registered' ); @@ -117,7 +117,7 @@ public function test_register_collection_with_valid_theme_path() { public function test_register_collection_with_invalid_theme_path() { $invalid_theme_path = WP_CONTENT_DIR . '/themes'; - $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( $invalid_theme_path, $this->temp_manifest_file ); $this->assertFalse( $result, 'Invalid theme path should not be registered' ); @@ -145,7 +145,7 @@ static function ( $paths ) use ( $arbitrary_path ) { } ); - $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( $arbitrary_path, $this->temp_manifest_file ); $this->assertFalse( $result, 'Arbitrary path should not be registered if it matches a collection root' ); @@ -163,7 +163,7 @@ static function ( $paths ) use ( $arbitrary_path ) { public function test_register_collection_with_wp_content_parent_directory_path() { $invalid_path = dirname( WP_CONTENT_DIR ); - $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( $invalid_path, $this->temp_manifest_file ); $this->assertFalse( $result, 'Invalid path (parent directory of "wp-content") should not be registered' ); @@ -175,7 +175,7 @@ public function test_register_collection_with_wp_content_parent_directory_path() public function test_register_collection_with_wp_includes_parent_directory_path() { $invalid_path = ABSPATH; - $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( $invalid_path, $this->temp_manifest_file ); $this->assertFalse( $result, 'Invalid path (parent directory of "wp-includes") should not be registered' ); @@ -184,7 +184,7 @@ public function test_register_collection_with_wp_includes_parent_directory_path( public function test_register_collection_with_non_existent_manifest() { $non_existent_manifest = '/path/that/does/not/exist/block-manifest.php'; - $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( '/var/arbitrary/path', $non_existent_manifest ); $this->assertFalse( $result, 'Non-existent manifest should not be registered' ); @@ -277,7 +277,7 @@ static function ( $paths ) use ( $plugins_path ) { } ); - $this->expectWPIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); + $this->setExpectedIncorrectUsage( 'WP_Block_Metadata_Registry::register_collection' ); $result = WP_Block_Metadata_Registry::register_collection( $plugins_path, $this->temp_manifest_file ); $this->assertFalse( $result, 'Arbitrary Windows path should not be registered if it matches a collection root' ); diff --git a/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php b/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php index cd7a66f1ec7f7..b4b83be1048f3 100644 --- a/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php +++ b/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php @@ -77,7 +77,7 @@ public function tear_down() { * * @covers WP_Block_Patterns_Registry::register * - * @expectedWPIncorrectUsage WP_Block_Patterns_Registry::register + * @expectedIncorrectUsage WP_Block_Patterns_Registry::register */ public function test_missing_name() { $name = null; @@ -97,7 +97,7 @@ public function test_missing_name() { * * @covers WP_Block_Patterns_Registry::register * - * @expectedWPIncorrectUsage WP_Block_Patterns_Registry::register + * @expectedIncorrectUsage WP_Block_Patterns_Registry::register */ public function test_invalid_non_string_name() { $name = 123; @@ -117,7 +117,7 @@ public function test_invalid_non_string_name() { * * @covers WP_Block_Patterns_Registry::register * - * @expectedWPIncorrectUsage WP_Block_Patterns_Registry::register + * @expectedIncorrectUsage WP_Block_Patterns_Registry::register */ public function test_missing_title() { $name = 'test/pattern'; @@ -136,7 +136,7 @@ public function test_missing_title() { * * @covers WP_Block_Patterns_Registry::register * - * @expectedWPIncorrectUsage WP_Block_Patterns_Registry::register + * @expectedIncorrectUsage WP_Block_Patterns_Registry::register */ public function test_invalid_non_string_title() { $name = 'test/pattern'; @@ -156,7 +156,7 @@ public function test_invalid_non_string_title() { * * @covers WP_Block_Patterns_Registry::register * - * @expectedWPIncorrectUsage WP_Block_Patterns_Registry::register + * @expectedIncorrectUsage WP_Block_Patterns_Registry::register */ public function test_missing_content() { $name = 'Test Pattern'; @@ -175,7 +175,7 @@ public function test_missing_content() { * * @covers WP_Block_Patterns_Registry::register * - * @expectedWPIncorrectUsage WP_Block_Patterns_Registry::register + * @expectedIncorrectUsage WP_Block_Patterns_Registry::register */ public function test_invalid_non_string_content() { $name = 'Test Pattern'; @@ -213,7 +213,7 @@ public function test_register_block_pattern() { * * @covers WP_Block_Patterns_Registry::unregister * - * @expectedWPIncorrectUsage WP_Block_Patterns_Registry::unregister + * @expectedIncorrectUsage WP_Block_Patterns_Registry::unregister */ public function test_unregister_not_registered_block() { $success = $this->registry->unregister( 'test/unregistered' ); diff --git a/tests/phpunit/tests/blocks/wpBlockTypeRegistry.php b/tests/phpunit/tests/blocks/wpBlockTypeRegistry.php index 32ab77a05121d..5a4619bdde04d 100644 --- a/tests/phpunit/tests/blocks/wpBlockTypeRegistry.php +++ b/tests/phpunit/tests/blocks/wpBlockTypeRegistry.php @@ -51,7 +51,7 @@ public function tear_down() { * * @dataProvider data_invalid_block_names * - * @expectedWPIncorrectUsage WP_Block_Type_Registry::register + * @expectedIncorrectUsage WP_Block_Type_Registry::register */ public function test_invalid_block_names( $name ) { $result = $this->registry->register( $name, array() ); @@ -99,7 +99,7 @@ public function test_register_block_type() { * * @covers ::register * - * @expectedWPIncorrectUsage WP_Block_Type_Registry::register + * @expectedIncorrectUsage WP_Block_Type_Registry::register */ public function test_register_block_type_twice() { $name = 'core/paragraph'; @@ -134,7 +134,7 @@ public function test_register_block_type_instance() { * * @covers ::unregister * - * @expectedWPIncorrectUsage WP_Block_Type_Registry::unregister + * @expectedIncorrectUsage WP_Block_Type_Registry::unregister */ public function test_unregister_not_registered_block() { $result = $this->registry->unregister( 'core/unregistered' ); diff --git a/tests/phpunit/tests/cache.php b/tests/phpunit/tests/cache.php index 28513229d1bf4..7ca6de5ec8eda 100644 --- a/tests/phpunit/tests/cache.php +++ b/tests/phpunit/tests/cache.php @@ -44,7 +44,7 @@ public function test_is_valid_key( $key, $valid ) { $this->assertTrue( $this->cache->add( $key, $val ), 'WP_Object_Cache:add() should return true for valid keys.' ); $this->assertSame( $val, $this->cache->get( $key ), 'The retrieved value should match the added value.' ); } else { - $this->expectWPIncorrectUsage( 'WP_Object_Cache::add' ); + $this->setExpectedIncorrectUsage( 'WP_Object_Cache::add' ); $this->assertFalse( $this->cache->add( $key, $val ), 'WP_Object_Cache:add() should return false for invalid keys.' ); } } @@ -213,7 +213,7 @@ public function test_wp_cache_flush_group() { $this->assertSame( $val, wp_cache_get( $key, 'group-test' ), 'group-test should contain my-val' ); if ( wp_using_ext_object_cache() ) { - $this->expectWPIncorrectUsage( 'wp_cache_flush_group' ); + $this->setExpectedIncorrectUsage( 'wp_cache_flush_group' ); } $results = wp_cache_flush_group( 'group-test' ); diff --git a/tests/phpunit/tests/category/getAllCategoryIds.php b/tests/phpunit/tests/category/getAllCategoryIds.php index 28b46d493b0b0..3fb8223afa060 100644 --- a/tests/phpunit/tests/category/getAllCategoryIds.php +++ b/tests/phpunit/tests/category/getAllCategoryIds.php @@ -10,7 +10,7 @@ class Tests_Category_GetAllCategoryIds extends WP_UnitTestCase { /** * Validate get_all_category_ids * - * @expectedWPDeprecated get_all_category_ids + * @expectedDeprecated get_all_category_ids */ public function test_get_all_category_ids() { // Ccreate categories. diff --git a/tests/phpunit/tests/category/getCategoryParents.php b/tests/phpunit/tests/category/getCategoryParents.php index cb63cb92a514d..f2b7e83d1dd38 100644 --- a/tests/phpunit/tests/category/getCategoryParents.php +++ b/tests/phpunit/tests/category/getCategoryParents.php @@ -56,7 +56,7 @@ public function test_nicename_true() { } public function test_deprecated_argument_visited() { - $this->expectWPDeprecated( 'get_category_parents' ); + $this->setExpectedDeprecated( 'get_category_parents' ); $found = get_category_parents( $this->c2->term_id, false, '/', false, array( $this->c1->term_id ) ); } diff --git a/tests/phpunit/tests/comment/getTrackbackUrl.php b/tests/phpunit/tests/comment/getTrackbackUrl.php index 5d7ea7ec83f15..c3d110d083652 100644 --- a/tests/phpunit/tests/comment/getTrackbackUrl.php +++ b/tests/phpunit/tests/comment/getTrackbackUrl.php @@ -139,7 +139,7 @@ public function test_trackback_url_displays_url() { * * @covers ::trackback_url * - * @expectedWPDeprecated trackback_url + * @expectedDeprecated trackback_url */ public function test_trackback_url_returns_url_when_echo_is_false() { $this->set_permalink_structure( '/%postname%/' ); diff --git a/tests/phpunit/tests/compat/jsonEncodeDecode.php b/tests/phpunit/tests/compat/jsonEncodeDecode.php index 5821e4714acb2..be51c6022b193 100644 --- a/tests/phpunit/tests/compat/jsonEncodeDecode.php +++ b/tests/phpunit/tests/compat/jsonEncodeDecode.php @@ -8,15 +8,15 @@ class Tests_Compat_jsonEncodeDecode extends WP_UnitTestCase { public function test_json_encode_decode() { - $this->expectWPDeprecated( 'class-json.php' ); - $this->expectWPDeprecated( 'Services_JSON::__construct' ); - $this->expectWPDeprecated( 'Services_JSON::encodeUnsafe' ); - $this->expectWPDeprecated( 'Services_JSON::_encode' ); - $this->expectWPDeprecated( 'Services_JSON::reduce_string' ); - $this->expectWPDeprecated( 'Services_JSON::decode' ); - $this->expectWPDeprecated( 'Services_JSON::isError' ); - $this->expectWPDeprecated( 'Services_JSON::strlen8' ); - $this->expectWPDeprecated( 'Services_JSON::substr8' ); + $this->setExpectedDeprecated( 'class-json.php' ); + $this->setExpectedDeprecated( 'Services_JSON::__construct' ); + $this->setExpectedDeprecated( 'Services_JSON::encodeUnsafe' ); + $this->setExpectedDeprecated( 'Services_JSON::_encode' ); + $this->setExpectedDeprecated( 'Services_JSON::reduce_string' ); + $this->setExpectedDeprecated( 'Services_JSON::decode' ); + $this->setExpectedDeprecated( 'Services_JSON::isError' ); + $this->setExpectedDeprecated( 'Services_JSON::strlen8' ); + $this->setExpectedDeprecated( 'Services_JSON::substr8' ); require_once ABSPATH . WPINC . '/class-json.php'; $json = new Services_JSON(); diff --git a/tests/phpunit/tests/connectors/wpConnectorRegistry.php b/tests/phpunit/tests/connectors/wpConnectorRegistry.php index 9edc801faba96..ca824364b58b4 100644 --- a/tests/phpunit/tests/connectors/wpConnectorRegistry.php +++ b/tests/phpunit/tests/connectors/wpConnectorRegistry.php @@ -103,7 +103,7 @@ public function test_register_uses_custom_setting_name_when_provided() { * @ticket 64957 */ public function test_register_rejects_empty_setting_name() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication']['setting_name'] = ''; @@ -117,7 +117,7 @@ public function test_register_rejects_empty_setting_name() { * @ticket 64957 */ public function test_register_rejects_non_string_setting_name() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication']['setting_name'] = 123; @@ -184,7 +184,7 @@ public function test_register_accepts_application_password_constant_and_env_name * @param string $name_key Authentication argument key. */ public function test_register_rejects_empty_application_password_external_names( string $name_key ) { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication'] = array( @@ -234,7 +234,7 @@ public function test_register_omits_constant_name_when_not_provided() { * @ticket 64957 */ public function test_register_rejects_empty_constant_name() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication']['constant_name'] = ''; @@ -248,7 +248,7 @@ public function test_register_rejects_empty_constant_name() { * @ticket 64957 */ public function test_register_rejects_non_string_constant_name() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication']['constant_name'] = 123; @@ -283,7 +283,7 @@ public function test_register_omits_env_var_name_when_not_provided() { * @ticket 64957 */ public function test_register_rejects_empty_env_var_name() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication']['env_var_name'] = ''; @@ -297,7 +297,7 @@ public function test_register_rejects_empty_env_var_name() { * @ticket 64957 */ public function test_register_rejects_non_string_env_var_name() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication']['env_var_name'] = 123; @@ -405,7 +405,7 @@ public function test_register_stores_plugin_is_active_callback() { * @ticket 65020 */ public function test_register_rejects_non_callable_plugin_is_active() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['plugin'] = array( @@ -447,7 +447,7 @@ public function test_register_defaults_plugin_when_not_provided() { * @ticket 64791 */ public function test_register_rejects_invalid_id_with_uppercase() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $result = $this->registry->register( 'InvalidId', self::$default_args ); @@ -476,7 +476,7 @@ public function test_register_accepts_id_with_underscores() { * @ticket 64791 */ public function test_register_rejects_empty_id() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $result = $this->registry->register( '', self::$default_args ); @@ -487,7 +487,7 @@ public function test_register_rejects_empty_id() { * @ticket 64791 */ public function test_register_rejects_duplicate_id() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $this->registry->register( 'test-duplicate', self::$default_args ); $result = $this->registry->register( 'test-duplicate', self::$default_args ); @@ -499,7 +499,7 @@ public function test_register_rejects_duplicate_id() { * @ticket 64791 */ public function test_register_rejects_missing_name() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; unset( $args['name'] ); @@ -513,7 +513,7 @@ public function test_register_rejects_missing_name() { * @ticket 64791 */ public function test_register_rejects_empty_name() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['name'] = ''; @@ -527,7 +527,7 @@ public function test_register_rejects_empty_name() { * @ticket 64791 */ public function test_register_rejects_missing_type() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; unset( $args['type'] ); @@ -541,7 +541,7 @@ public function test_register_rejects_missing_type() { * @ticket 64791 */ public function test_register_rejects_missing_authentication() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; unset( $args['authentication'] ); @@ -555,7 +555,7 @@ public function test_register_rejects_missing_authentication() { * @ticket 64791 */ public function test_register_rejects_invalid_auth_method() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::register' ); $args = self::$default_args; $args['authentication']['method'] = 'oauth'; @@ -597,7 +597,7 @@ public function test_get_registered_returns_connector_data() { * @ticket 64791 */ public function test_get_registered_returns_null_for_unregistered() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::get_registered' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::get_registered' ); $result = $this->registry->get_registered( 'nonexistent' ); @@ -645,7 +645,7 @@ public function test_unregister_removes_connector() { * @ticket 64791 */ public function test_unregister_returns_null_for_unregistered() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::unregister' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::unregister' ); $result = $this->registry->unregister( 'nonexistent' ); @@ -665,7 +665,7 @@ public function test_get_instance_returns_registry() { * @ticket 64791 */ public function test_set_instance_rejects_after_init() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::set_instance' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::set_instance' ); WP_Connector_Registry::set_instance( new WP_Connector_Registry() ); } diff --git a/tests/phpunit/tests/connectors/wpConnectorsGetConnectorScriptModuleData.php b/tests/phpunit/tests/connectors/wpConnectorsGetConnectorScriptModuleData.php index ec22643931e42..b9b5014affdd1 100644 --- a/tests/phpunit/tests/connectors/wpConnectorsGetConnectorScriptModuleData.php +++ b/tests/phpunit/tests/connectors/wpConnectorsGetConnectorScriptModuleData.php @@ -161,7 +161,7 @@ public function test_environment_variable_takes_precedence_over_database(): void * @ticket 64850 */ public function test_malformed_environment_variable_credentials_fall_back_to_database(): void { - $this->expectWPIncorrectUsage( 'wp_connectors_get_application_password_credentials' ); + $this->setExpectedIncorrectUsage( 'wp_connectors_get_application_password_credentials' ); $this->register_connector( array( 'env_var_name' => self::CREDENTIALS_ENV_VAR_NAME ) ); putenv( self::CREDENTIALS_ENV_VAR_NAME . '=missing-a-separator' ); @@ -184,7 +184,7 @@ public function test_malformed_environment_variable_credentials_fall_back_to_dat * @ticket 64850 */ public function test_malformed_environment_variable_credentials_without_fallback_are_not_connected(): void { - $this->expectWPIncorrectUsage( 'wp_connectors_get_application_password_credentials' ); + $this->setExpectedIncorrectUsage( 'wp_connectors_get_application_password_credentials' ); $this->register_connector( array( 'env_var_name' => self::CREDENTIALS_ENV_VAR_NAME ) ); putenv( self::CREDENTIALS_ENV_VAR_NAME . '=missing-a-separator' ); diff --git a/tests/phpunit/tests/connectors/wpConnectorsIsApiKeyValid.php b/tests/phpunit/tests/connectors/wpConnectorsIsApiKeyValid.php index c48b17d285d15..4ec59670d2c38 100644 --- a/tests/phpunit/tests/connectors/wpConnectorsIsApiKeyValid.php +++ b/tests/phpunit/tests/connectors/wpConnectorsIsApiKeyValid.php @@ -34,7 +34,7 @@ public function set_up() { * @ticket 64730 */ public function test_unregistered_provider_returns_null() { - $this->expectWPIncorrectUsage( '_wp_connectors_is_ai_api_key_valid' ); + $this->setExpectedIncorrectUsage( '_wp_connectors_is_ai_api_key_valid' ); $result = _wp_connectors_is_ai_api_key_valid( 'test-key', 'nonexistent_provider' ); diff --git a/tests/phpunit/tests/connectors/wpConnectorsResolveAiProviderLogoUrl.php b/tests/phpunit/tests/connectors/wpConnectorsResolveAiProviderLogoUrl.php index 15751a7e4642c..71b1628af3311 100644 --- a/tests/phpunit/tests/connectors/wpConnectorsResolveAiProviderLogoUrl.php +++ b/tests/phpunit/tests/connectors/wpConnectorsResolveAiProviderLogoUrl.php @@ -95,7 +95,7 @@ public function test_returns_null_when_file_does_not_exist() { /** * @ticket 64791 - * @expectedWPIncorrectUsage _wp_connectors_resolve_ai_provider_logo_url + * @expectedIncorrectUsage _wp_connectors_resolve_ai_provider_logo_url */ public function test_returns_null_and_triggers_doing_it_wrong_for_path_outside_plugin_dirs() { $tmp_file = tempnam( sys_get_temp_dir(), 'logo_' ); diff --git a/tests/phpunit/tests/connectors/wpRegisterConnector.php b/tests/phpunit/tests/connectors/wpRegisterConnector.php index 80587774501f3..ad55c012d97c7 100644 --- a/tests/phpunit/tests/connectors/wpRegisterConnector.php +++ b/tests/phpunit/tests/connectors/wpRegisterConnector.php @@ -43,7 +43,7 @@ public function test_get_connector_returns_data_for_default() { * @ticket 64791 */ public function test_get_connector_returns_null_for_unregistered() { - $this->expectWPIncorrectUsage( 'WP_Connector_Registry::get_registered' ); + $this->setExpectedIncorrectUsage( 'WP_Connector_Registry::get_registered' ); $result = wp_get_connector( 'nonexistent_provider' ); diff --git a/tests/phpunit/tests/cron.php b/tests/phpunit/tests/cron.php index 2f5d85973bde7..2b553569ec36d 100644 --- a/tests/phpunit/tests/cron.php +++ b/tests/phpunit/tests/cron.php @@ -1187,7 +1187,7 @@ public static function data_wp_reschedule_event_works_with_args() { /** * @ticket 49961 - * @expectedWPDeprecated wp_clear_scheduled_hook + * @expectedDeprecated wp_clear_scheduled_hook * * @covers ::wp_clear_scheduled_hook */ diff --git a/tests/phpunit/tests/customize/partial.php b/tests/phpunit/tests/customize/partial.php index d50dcb075bd84..9fc4a478a49b1 100644 --- a/tests/phpunit/tests/customize/partial.php +++ b/tests/phpunit/tests/customize/partial.php @@ -223,7 +223,7 @@ public function test_render_with_bad_callback_should_give_preference_to_return_v 'render_callback' => array( $this, 'render_echo_and_return' ), ) ); - $this->expectWPIncorrectUsage( 'render' ); + $this->setExpectedIncorrectUsage( 'render' ); $this->assertSame( 'bar', $partial->render() ); } diff --git a/tests/phpunit/tests/customize/widgets.php b/tests/phpunit/tests/customize/widgets.php index cb64264aa9269..ff90ece0ba945 100644 --- a/tests/phpunit/tests/customize/widgets.php +++ b/tests/phpunit/tests/customize/widgets.php @@ -874,10 +874,10 @@ public function test_render_widget_partial() { * Test deprecated methods. */ public function test_deprecated_methods() { - $this->expectWPDeprecated( 'WP_Customize_Widgets::setup_widget_addition_previews' ); - $this->expectWPDeprecated( 'WP_Customize_Widgets::prepreview_added_sidebars_widgets' ); - $this->expectWPDeprecated( 'WP_Customize_Widgets::prepreview_added_widget_instance' ); - $this->expectWPDeprecated( 'WP_Customize_Widgets::remove_prepreview_filters' ); + $this->setExpectedDeprecated( 'WP_Customize_Widgets::setup_widget_addition_previews' ); + $this->setExpectedDeprecated( 'WP_Customize_Widgets::prepreview_added_sidebars_widgets' ); + $this->setExpectedDeprecated( 'WP_Customize_Widgets::prepreview_added_widget_instance' ); + $this->setExpectedDeprecated( 'WP_Customize_Widgets::remove_prepreview_filters' ); $this->manager->widgets->setup_widget_addition_previews(); $this->manager->widgets->prepreview_added_sidebars_widgets(); $this->manager->widgets->prepreview_added_widget_instance(); diff --git a/tests/phpunit/tests/date/query.php b/tests/phpunit/tests/date/query.php index 240187d9bfcb2..e2c0ea9be6d3f 100644 --- a/tests/phpunit/tests/date/query.php +++ b/tests/phpunit/tests/date/query.php @@ -749,7 +749,7 @@ public function test_build_time_query_minute_second() { /** * @ticket 25834 - * @expectedWPIncorrectUsage WP_Date_Query + * @expectedIncorrectUsage WP_Date_Query */ public function test_validate_date_query_before_after() { // Valid values. @@ -796,7 +796,7 @@ public function test_validate_date_query_before_after() { /** * @ticket 25834 - * @expectedWPIncorrectUsage WP_Date_Query + * @expectedIncorrectUsage WP_Date_Query */ public function test_validate_date_query_before_after_with_month() { // Both are valid. @@ -842,7 +842,7 @@ public function test_validate_date_query_before_after_with_month() { /** * @ticket 25834 - * @expectedWPIncorrectUsage WP_Date_Query + * @expectedIncorrectUsage WP_Date_Query */ public function test_validate_date_values_week() { // Valid values. @@ -895,7 +895,7 @@ public function test_validate_date_values_week() { /** * @ticket 25834 - * @expectedWPIncorrectUsage WP_Date_Query + * @expectedIncorrectUsage WP_Date_Query */ public function test_validate_date_values_month() { // Valid values. @@ -913,7 +913,7 @@ public function test_validate_date_values_month() { /** * @ticket 25834 - * @expectedWPIncorrectUsage WP_Date_Query + * @expectedIncorrectUsage WP_Date_Query */ public function test_validate_date_values_day() { // Valid values. @@ -970,7 +970,7 @@ public function test_validate_date_values_day() { /** * @ticket 25834 - * @expectedWPIncorrectUsage WP_Date_Query + * @expectedIncorrectUsage WP_Date_Query */ public function test_validate_date_values_hour() { // Valid values. @@ -988,7 +988,7 @@ public function test_validate_date_values_hour() { /** * @ticket 25834 - * @expectedWPIncorrectUsage WP_Date_Query + * @expectedIncorrectUsage WP_Date_Query */ public function test_validate_date_values_minute() { // Valid values. @@ -1006,7 +1006,7 @@ public function test_validate_date_values_minute() { /** * @ticket 25834 - * @expectedWPIncorrectUsage WP_Date_Query + * @expectedIncorrectUsage WP_Date_Query */ public function test_validate_date_values_second() { // Valid values. @@ -1024,7 +1024,7 @@ public function test_validate_date_values_second() { /** * @ticket 25834 - * @expectedWPIncorrectUsage WP_Date_Query + * @expectedIncorrectUsage WP_Date_Query */ public function test_validate_date_values_day_of_week() { // Valid values. @@ -1042,7 +1042,7 @@ public function test_validate_date_values_day_of_week() { /** * @ticket 28063 - * @expectedWPIncorrectUsage WP_Date_Query + * @expectedIncorrectUsage WP_Date_Query */ public function test_validate_date_values_day_of_week_iso() { // Valid values. @@ -1060,7 +1060,7 @@ public function test_validate_date_values_day_of_week_iso() { /** * @ticket 25834 - * @expectedWPIncorrectUsage WP_Date_Query + * @expectedIncorrectUsage WP_Date_Query */ public function test_validate_date_values_day_of_year() { // Valid values. @@ -1122,7 +1122,7 @@ public function test_validate_date_values_should_process_array_value_for_day() { /** * @ticket 31001 - * @expectedWPIncorrectUsage WP_Date_Query + * @expectedIncorrectUsage WP_Date_Query */ public function test_validate_date_values_should_process_array_value_for_day_when_values_are_invalid() { $p1 = self::factory()->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) ); diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php index 00f857aaf0f6c..50ab02b260d1d 100644 --- a/tests/phpunit/tests/db.php +++ b/tests/phpunit/tests/db.php @@ -388,7 +388,7 @@ public function filter_allowed_incompatible_sql_mode( $modes ) { /** * @ticket 25604 - * @expectedWPIncorrectUsage wpdb::prepare + * @expectedIncorrectUsage wpdb::prepare */ public function test_prepare_without_arguments() { global $wpdb; @@ -407,7 +407,7 @@ public function test_prepare_sprintf() { } /** - * @expectedWPIncorrectUsage wpdb::prepare + * @expectedIncorrectUsage wpdb::prepare */ public function test_prepare_sprintf_invalid_args() { global $wpdb; @@ -429,7 +429,7 @@ public function test_prepare_vsprintf() { } /** - * @expectedWPIncorrectUsage wpdb::prepare + * @expectedIncorrectUsage wpdb::prepare */ public function test_prepare_vsprintf_invalid_args() { global $wpdb; @@ -446,7 +446,7 @@ public function test_prepare_vsprintf_invalid_args() { /** * @ticket 42040 * @dataProvider data_prepare_incorrect_arg_count - * @expectedWPIncorrectUsage wpdb::prepare + * @expectedIncorrectUsage wpdb::prepare */ public function test_prepare_incorrect_arg_count( $query, $args, $expected ) { global $wpdb; @@ -545,7 +545,7 @@ public function test_has_cap() { } /** - * @expectedWPDeprecated supports_collation + * @expectedDeprecated supports_collation */ public function test_supports_collation() { global $wpdb; @@ -1560,7 +1560,7 @@ public function test_prepare_with_placeholders_and_individual_args( $sql, $value global $wpdb; if ( is_string( $incorrect_usage ) || true === $incorrect_usage ) { - $this->expectWPIncorrectUsage( 'wpdb::prepare' ); + $this->setExpectedIncorrectUsage( 'wpdb::prepare' ); } if ( ! is_array( $values ) ) { @@ -1583,7 +1583,7 @@ public function test_prepare_with_placeholders_and_array_args( $sql, $values, $i global $wpdb; if ( is_string( $incorrect_usage ) || true === $incorrect_usage ) { - $this->expectWPIncorrectUsage( 'wpdb::prepare' ); + $this->setExpectedIncorrectUsage( 'wpdb::prepare' ); } if ( ! is_array( $values ) ) { @@ -2170,7 +2170,7 @@ public function test_escape_and_prepare( $escape, $sql, $values, $incorrect_usag global $wpdb; if ( $incorrect_usage ) { - $this->expectWPIncorrectUsage( 'wpdb::prepare' ); + $this->setExpectedIncorrectUsage( 'wpdb::prepare' ); } $escape = esc_sql( $escape ); @@ -2214,7 +2214,7 @@ public static function data_escape_and_prepare() { } /** - * @expectedWPIncorrectUsage wpdb::prepare + * @expectedIncorrectUsage wpdb::prepare */ public function test_double_prepare() { global $wpdb; diff --git a/tests/phpunit/tests/dependencies.php b/tests/phpunit/tests/dependencies.php index b3956cef06c73..57dd62b2bd000 100644 --- a/tests/phpunit/tests/dependencies.php +++ b/tests/phpunit/tests/dependencies.php @@ -180,7 +180,7 @@ public static function data_provider_get_etag() { * * @covers WP_Dependencies::get_etag * - * @expectedWPDeprecated WP_Dependencies::get_etag + * @expectedDeprecated WP_Dependencies::get_etag * * @dataProvider data_provider_get_etag * @@ -217,7 +217,7 @@ public function test_get_etag_scripts( $load, $hash_source_string, $expected ) { * * @covers WP_Dependencies::get_etag * - * @expectedWPDeprecated WP_Dependencies::get_etag + * @expectedDeprecated WP_Dependencies::get_etag * * @dataProvider data_provider_get_etag * diff --git a/tests/phpunit/tests/dependencies/jquery.php b/tests/phpunit/tests/dependencies/jquery.php index 2f31f0e2dbf4c..8e332484e0a67 100644 --- a/tests/phpunit/tests/dependencies/jquery.php +++ b/tests/phpunit/tests/dependencies/jquery.php @@ -42,7 +42,7 @@ public function test_location_of_jquery() { /** * @ticket 22896 * - * @expectedWPIncorrectUsage wp_deregister_script + * @expectedIncorrectUsage wp_deregister_script * * @covers ::wp_script_is */ diff --git a/tests/phpunit/tests/dependencies/scriptConcatSettings.php b/tests/phpunit/tests/dependencies/scriptConcatSettings.php index 408899a6889d6..7aabd87ffb864 100644 --- a/tests/phpunit/tests/dependencies/scriptConcatSettings.php +++ b/tests/phpunit/tests/dependencies/scriptConcatSettings.php @@ -60,7 +60,7 @@ public function tear_down(): void { * * @ticket 57548 * - * @expectedWPDeprecated script_concat_settings + * @expectedDeprecated script_concat_settings */ public function test_concatenate_scripts_global_defaults_to_false(): void { set_current_screen( 'dashboard' ); @@ -75,7 +75,7 @@ public function test_concatenate_scripts_global_defaults_to_false(): void { * * @ticket 63017 * - * @expectedWPDeprecated script_concat_settings + * @expectedDeprecated script_concat_settings */ public function test_compression_globals_default_to_false(): void { // The result of the compression test, which used to turn the compression globals on. @@ -92,7 +92,7 @@ public function test_compression_globals_default_to_false(): void { * * @ticket 63017 * - * @expectedWPDeprecated script_concat_settings + * @expectedDeprecated script_concat_settings * * @runInSeparateProcess * @preserveGlobalState disabled @@ -113,7 +113,7 @@ public function test_compression_constants_are_ignored(): void { * * @ticket 63017 * - * @expectedWPDeprecated script_concat_settings + * @expectedDeprecated script_concat_settings */ public function test_compression_globals_already_set_are_kept(): void { $GLOBALS['compress_scripts'] = true; diff --git a/tests/phpunit/tests/dependencies/scripts.php b/tests/phpunit/tests/dependencies/scripts.php index 604a2e0370012..75e919355c76c 100644 --- a/tests/phpunit/tests/dependencies/scripts.php +++ b/tests/phpunit/tests/dependencies/scripts.php @@ -124,7 +124,7 @@ public function get_script_html() { * @param string $expected_msg Expected error message substring. */ public function test_unrecognized_keys_in_args( string $function_name, array $args, string $expected_msg ) { - $this->expectWPIncorrectUsage( $function_name ); + $this->setExpectedIncorrectUsage( $function_name ); call_user_func_array( $function_name, $args ); @@ -1315,7 +1315,7 @@ public function test_empty_fetchpriority_value() { * @covers ::wp_register_script * @covers WP_Scripts::add_data * - * @expectedWPIncorrectUsage WP_Scripts::add_data + * @expectedIncorrectUsage WP_Scripts::add_data */ public function test_invalid_fetchpriority_value() { wp_register_script( 'joke', '/joke.js', array(), null, array( 'fetchpriority' => 'silly' ) ); @@ -1332,7 +1332,7 @@ public function test_invalid_fetchpriority_value() { * @covers ::wp_register_script * @covers WP_Scripts::add_data * - * @expectedWPIncorrectUsage WP_Scripts::add_data + * @expectedIncorrectUsage WP_Scripts::add_data */ public function test_invalid_fetchpriority_value_type() { wp_register_script( 'bad', '/bad.js' ); @@ -1350,7 +1350,7 @@ public function test_invalid_fetchpriority_value_type() { * @covers ::wp_register_script * @covers WP_Scripts::add_data * - * @expectedWPIncorrectUsage WP_Scripts::add_data + * @expectedIncorrectUsage WP_Scripts::add_data */ public function test_invalid_fetchpriority_on_alias() { wp_register_script( 'alias', false, array(), null, array( 'fetchpriority' => 'low' ) ); @@ -1375,7 +1375,7 @@ public function test_add_data_module_dependencies_validation( $data, string $mes wp_register_script( 'test-script', '/test.js' ); $expected_incorrect_usage = 'WP_Scripts::add_data'; - $this->expectWPIncorrectUsage( $expected_incorrect_usage ); + $this->setExpectedIncorrectUsage( $expected_incorrect_usage ); $this->assertSame( $expected, wp_scripts()->add_data( 'test-script', 'module_dependencies', $data ) ); $this->assertStringContainsString( $message, $this->caught_doing_it_wrong[ $expected_incorrect_usage ] ); @@ -1429,7 +1429,7 @@ public static function data_add_data_module_dependencies_validation(): array { */ public function test_module_dependencies_require_footer_or_defer( string $function_name, array $args, bool $should_warn ): void { if ( $should_warn ) { - $this->expectWPIncorrectUsage( $function_name ); + $this->setExpectedIncorrectUsage( $function_name ); } call_user_func_array( $function_name, $args ); @@ -2072,7 +2072,7 @@ public function test_setting_in_footer_and_strategy( $set_up, $expected_group, $ * @covers ::wp_register_script * @covers ::wp_enqueue_script * - * @expectedWPIncorrectUsage WP_Scripts::add_data + * @expectedIncorrectUsage WP_Scripts::add_data */ public function test_script_strategy_doing_it_wrong_via_register() { wp_register_script( 'invalid-strategy', '/defaults.js', array(), null, array( 'strategy' => 'random-strategy' ) ); @@ -2096,7 +2096,7 @@ public function test_script_strategy_doing_it_wrong_via_register() { * @covers ::wp_register_script * @covers ::wp_enqueue_script * - * @expectedWPIncorrectUsage WP_Scripts::add_data + * @expectedIncorrectUsage WP_Scripts::add_data */ public function test_script_strategy_doing_it_wrong_via_add_data() { wp_register_script( 'invalid-strategy', '/defaults.js', array(), null ); @@ -2119,7 +2119,7 @@ public function test_script_strategy_doing_it_wrong_via_add_data() { * @covers WP_Scripts::add_data * @covers ::wp_enqueue_script * - * @expectedWPIncorrectUsage WP_Scripts::add_data + * @expectedIncorrectUsage WP_Scripts::add_data */ public function test_script_strategy_doing_it_wrong_via_enqueue() { wp_enqueue_script( 'invalid-strategy', '/defaults.js', array(), null, array( 'strategy' => 'random-strategy' ) ); @@ -2230,7 +2230,7 @@ public function test_do_concat_is_ignored(): void { * * @covers WP_Scripts::in_default_dir * - * @expectedWPDeprecated WP_Scripts::in_default_dir + * @expectedDeprecated WP_Scripts::in_default_dir */ public function test_in_default_dir_is_deprecated(): void { $wp_scripts = wp_scripts(); @@ -2262,8 +2262,8 @@ public function test_print_extra_script_skips_non_string_data(): void { * @covers ::print_head_scripts * @covers ::print_footer_scripts * - * @expectedWPDeprecated print_head_scripts - * @expectedWPDeprecated print_footer_scripts + * @expectedDeprecated print_head_scripts + * @expectedDeprecated print_footer_scripts */ public function test_print_scripts_filters_are_deprecated(): void { add_filter( 'print_head_scripts', '__return_false' ); @@ -2298,7 +2298,7 @@ public function test_wp_script_add_data_with_data_key() { /** * Testing `wp_script_add_data` with the conditional key. * - * @expectedWPDeprecated WP_Dependencies::add_data() + * @expectedDeprecated WP_Dependencies::add_data() * * @since 6.9.0 Conditional comments should now return an empty string. * @@ -2697,7 +2697,7 @@ public static function data_provider_to_test_get_inline_script() { * @covers WP_Scripts::get_inline_script_tag * @covers WP_Scripts::print_inline_script * - * @expectedWPDeprecated WP_Scripts::print_inline_script + * @expectedDeprecated WP_Scripts::print_inline_script * * @dataProvider data_provider_to_test_get_inline_script * @@ -3388,7 +3388,7 @@ public function test_wp_enqueue_code_editor_when_simple_array_will_be_passed() { */ public function test_wp_localize_script_data_formats( $l10n_data, $expected ) { if ( ! is_array( $l10n_data ) ) { - $this->expectWPIncorrectUsage( 'WP_Scripts::localize' ); + $this->setExpectedIncorrectUsage( 'WP_Scripts::localize' ); } wp_enqueue_script( 'test-example', 'example.com', array(), null ); @@ -3997,7 +3997,7 @@ public function test_print_translations_no_display_no_sourceurl() { */ public function test_wp_scripts_doing_it_wrong_for_missing_dependencies() { $expected_incorrect_usage = 'WP_Scripts::add'; - $this->expectWPIncorrectUsage( $expected_incorrect_usage ); + $this->setExpectedIncorrectUsage( $expected_incorrect_usage ); wp_register_script( 'registered-dep', '/registered-dep.js' ); wp_enqueue_script( 'main', '/main.js', array( 'registered-dep', 'missing-dep' ) ); diff --git a/tests/phpunit/tests/dependencies/styles.php b/tests/phpunit/tests/dependencies/styles.php index 213c861c7a016..d3dd3788478c9 100644 --- a/tests/phpunit/tests/dependencies/styles.php +++ b/tests/phpunit/tests/dependencies/styles.php @@ -229,8 +229,8 @@ public function test_inline_styles_concat() { * @covers ::print_admin_styles * @covers ::print_late_styles * - * @expectedWPDeprecated print_admin_styles - * @expectedWPDeprecated print_late_styles + * @expectedDeprecated print_admin_styles + * @expectedDeprecated print_late_styles */ public function test_print_styles_filters_are_deprecated(): void { add_filter( 'print_admin_styles', '__return_false' ); @@ -252,7 +252,7 @@ public function test_print_styles_filters_are_deprecated(): void { * * @covers WP_Styles::in_default_dir * - * @expectedWPDeprecated WP_Styles::in_default_dir + * @expectedDeprecated WP_Styles::in_default_dir */ public function test_in_default_dir_is_deprecated(): void { $wp_styles = wp_styles(); @@ -360,7 +360,7 @@ public function test_multiple_inline_styles() { /** * Test if a plugin doing it the wrong way still works * - * @expectedWPIncorrectUsage wp_add_inline_style + * @expectedIncorrectUsage wp_add_inline_style * @ticket 24813 */ public function test_plugin_doing_inline_styles_wrong() { @@ -400,7 +400,7 @@ public function test_unnecessary_style_tags() { * Test to make sure that inline styles attached to conditional * stylesheets are also conditional. * - * @expectedWPDeprecated WP_Dependencies::add_data() + * @expectedDeprecated WP_Dependencies::add_data() */ public function test_conditional_inline_styles_are_also_conditional() { wp_enqueue_style( 'handle', 'http://example.com', array(), 1 ); @@ -812,7 +812,7 @@ public function test_wp_maybe_inline_styles_multiple_runs() { * @ticket 64447 * * @covers ::wp_maybe_inline_styles - * @expectedWPIncorrectUsage wp_maybe_inline_styles + * @expectedIncorrectUsage wp_maybe_inline_styles */ public function test_wp_maybe_inline_styles_missing_file() { $filter = new MockAction(); @@ -867,7 +867,7 @@ public function test_wp_maybe_inline_styles_no_path() { * @ticket 64447 * * @covers ::wp_maybe_inline_styles - * @expectedWPIncorrectUsage wp_maybe_inline_styles + * @expectedIncorrectUsage wp_maybe_inline_styles */ public function test_wp_maybe_inline_styles_bad_path_with_file_size_provided() { $style_path = '/css/invalid.css'; // Does not exist. @@ -957,7 +957,7 @@ public function test_source_url_encoding() { */ public function test_wp_style_doing_it_wrong_for_missing_dependencies() { $expected_incorrect_usage = 'WP_Styles::add'; - $this->expectWPIncorrectUsage( $expected_incorrect_usage ); + $this->setExpectedIncorrectUsage( $expected_incorrect_usage ); wp_enqueue_style( 'main-style', diff --git a/tests/phpunit/tests/dependencies/wpInlineScriptTag.php b/tests/phpunit/tests/dependencies/wpInlineScriptTag.php index 0a59233fb10b6..590872ee3fd6c 100644 --- a/tests/phpunit/tests/dependencies/wpInlineScriptTag.php +++ b/tests/phpunit/tests/dependencies/wpInlineScriptTag.php @@ -170,7 +170,7 @@ public function test_script_tag_repeat_attributes() { * * @ticket 64500 * - * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text + * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text */ public function test_script_tag_dangerous_unescapeable_contents() { /* diff --git a/tests/phpunit/tests/dependencies/wpPrefetchAdminAssets.php b/tests/phpunit/tests/dependencies/wpPrefetchAdminAssets.php index b18231a94ac63..1daabba5e8435 100644 --- a/tests/phpunit/tests/dependencies/wpPrefetchAdminAssets.php +++ b/tests/phpunit/tests/dependencies/wpPrefetchAdminAssets.php @@ -745,7 +745,7 @@ public function test_prefetches_rtl_stylesheets(): void { * * @ticket 57548 * - * @expectedWPDeprecated WP_Dependencies::add_data() + * @expectedDeprecated WP_Dependencies::add_data() */ public function test_skips_conditional_handles(): void { wp_styles()->add_data( 'forms', 'conditional', 'IE' ); diff --git a/tests/phpunit/tests/dependencies/wpRemoveSurroundingEmptyScriptTags.php b/tests/phpunit/tests/dependencies/wpRemoveSurroundingEmptyScriptTags.php index 5b21cf3056b7c..f03a333b64057 100644 --- a/tests/phpunit/tests/dependencies/wpRemoveSurroundingEmptyScriptTags.php +++ b/tests/phpunit/tests/dependencies/wpRemoveSurroundingEmptyScriptTags.php @@ -67,7 +67,7 @@ public static function get_data_to_test_wp_remove_surrounding_empty_script_tags( */ public function test_wp_remove_surrounding_empty_script_tags( $input, $expected, $expect_doing_it_wrong ) { if ( $expect_doing_it_wrong ) { - $this->expectWPIncorrectUsage( 'wp_remove_surrounding_empty_script_tags' ); + $this->setExpectedIncorrectUsage( 'wp_remove_surrounding_empty_script_tags' ); } $this->assertSame( diff --git a/tests/phpunit/tests/dependencies/wpSanitizeScriptAttributes.php b/tests/phpunit/tests/dependencies/wpSanitizeScriptAttributes.php index 969fc0adc61ba..92f10b8999d82 100644 --- a/tests/phpunit/tests/dependencies/wpSanitizeScriptAttributes.php +++ b/tests/phpunit/tests/dependencies/wpSanitizeScriptAttributes.php @@ -10,7 +10,7 @@ class Tests_Dependencies_wpSanitizeScriptAttributes extends WP_UnitTestCase { public function test_sanitize_script_attributes_type_set() { - $this->expectWPDeprecated( 'wp_sanitize_script_attributes' ); + $this->setExpectedDeprecated( 'wp_sanitize_script_attributes' ); $this->assertSame( ' type="application/javascript" src="https://DOMAIN.TLD/PATH/FILE.js" nomodule', wp_sanitize_script_attributes( @@ -25,7 +25,7 @@ public function test_sanitize_script_attributes_type_set() { } public function test_sanitize_script_attributes_type_not_set() { - $this->expectWPDeprecated( 'wp_sanitize_script_attributes' ); + $this->setExpectedDeprecated( 'wp_sanitize_script_attributes' ); $this->assertSame( ' src="https://DOMAIN.TLD/PATH/FILE.js" nomodule', wp_sanitize_script_attributes( @@ -40,7 +40,7 @@ public function test_sanitize_script_attributes_type_not_set() { public function test_sanitize_script_attributes_no_attributes() { - $this->expectWPDeprecated( 'wp_sanitize_script_attributes' ); + $this->setExpectedDeprecated( 'wp_sanitize_script_attributes' ); $this->assertSame( '', wp_sanitize_script_attributes( array() ) @@ -48,7 +48,7 @@ public function test_sanitize_script_attributes_no_attributes() { } public function test_sanitize_script_attributes_relative_src() { - $this->expectWPDeprecated( 'wp_sanitize_script_attributes' ); + $this->setExpectedDeprecated( 'wp_sanitize_script_attributes' ); $this->assertSame( ' src="PATH/FILE.js" nomodule', wp_sanitize_script_attributes( @@ -63,7 +63,7 @@ public function test_sanitize_script_attributes_relative_src() { public function test_sanitize_script_attributes_only_false_boolean_attributes() { - $this->expectWPDeprecated( 'wp_sanitize_script_attributes' ); + $this->setExpectedDeprecated( 'wp_sanitize_script_attributes' ); $this->assertSame( '', wp_sanitize_script_attributes( @@ -76,7 +76,7 @@ public function test_sanitize_script_attributes_only_false_boolean_attributes() } public function test_sanitize_script_attributes_only_true_boolean_attributes() { - $this->expectWPDeprecated( 'wp_sanitize_script_attributes' ); + $this->setExpectedDeprecated( 'wp_sanitize_script_attributes' ); $this->assertSame( ' async nomodule', wp_sanitize_script_attributes( diff --git a/tests/phpunit/tests/entity-actions.php b/tests/phpunit/tests/entity-actions.php index e26d79922dae5..3951c15ee2d50 100644 --- a/tests/phpunit/tests/entity-actions.php +++ b/tests/phpunit/tests/entity-actions.php @@ -571,7 +571,7 @@ public function test_all_registered_action_modules_skips_entities_without_a_modu public function test_all_registered_action_modules_are_empty_while_init_runs() { global $wp_current_filter; - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::initialize' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::initialize' ); self::reset_registry(); $fired = did_action( 'wp_entity_actions_api_init' ); @@ -615,7 +615,7 @@ public function test_reading_the_registry_fires_the_action_once() { * @ticket 66343 */ public function test_firing_the_action_again_does_not_reopen_the_registry() { - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); $actions = wp_get_registered_entity_actions( 'postType', 'page' ); add_action( 'wp_entity_actions_api_init', @@ -708,7 +708,7 @@ public function test_actions_carry_the_origin_they_are_registered_with() { * @ticket 66343 */ public function test_registering_a_registered_action_is_skipped() { - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); $reported = &$this->record_notices( 'WP_Entity_Actions_Registry::register' ); $registered = $this->register_actions( 'postType', @@ -742,7 +742,7 @@ public function test_registering_a_registered_action_is_skipped() { * @ticket 66343 */ public function test_registering_an_action_with_invalid_values_is_reported() { - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); $reported = &$this->record_notices( 'WP_Entity_Actions_Registry::register' ); $registered = $this->register_actions( 'postType', @@ -784,7 +784,7 @@ public function test_registering_an_action_with_invalid_values_is_reported() { * @ticket 66343 */ public function test_registering_the_same_action_twice_keeps_the_first_definition() { - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); $reported = &$this->record_notices( 'WP_Entity_Actions_Registry::register' ); $registered = $this->register_actions( 'postType', @@ -939,7 +939,7 @@ function () use ( &$unregistered, &$modules ) { * @ticket 66343 */ public function test_an_invalid_definition_is_skipped() { - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); $reported = &$this->record_notices( 'WP_Entity_Actions_Registry::register' ); $registered = $this->register_actions( 'postType', @@ -971,7 +971,7 @@ public function test_an_invalid_definition_is_skipped() { * @ticket 66343 */ public function test_a_call_with_only_invalid_definitions_registers_nothing() { - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); $reported = &$this->record_notices( 'WP_Entity_Actions_Registry::register' ); $registered = $this->register_actions( 'postType', 'page', array( array( 'label' => 'No id' ) ) ); @@ -986,7 +986,7 @@ public function test_a_call_with_only_invalid_definitions_registers_nothing() { * @ticket 66343 */ public function test_registering_with_an_invalid_origin_is_refused() { - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); $registered = null; $this->on_entity_actions_api_init( static function () use ( &$registered ) { @@ -1005,7 +1005,7 @@ static function () use ( &$registered ) { * @ticket 66343 */ public function test_registering_actions_that_are_not_a_list_is_refused() { - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); $reported = &$this->record_notices( 'WP_Entity_Actions_Registry::register' ); $results = array(); $this->on_entity_actions_api_init( @@ -1037,7 +1037,7 @@ static function () use ( &$results ) { * @ticket 66343 */ public function test_unregistering_with_an_invalid_entity_is_refused() { - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::unregister' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::unregister' ); $results = array(); $this->on_entity_actions_api_init( static function () use ( &$results ) { @@ -1063,7 +1063,7 @@ static function () use ( &$results ) { * @ticket 66343 */ public function test_unregistering_with_an_invalid_id_skips_it() { - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::unregister' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::unregister' ); $unregistered = null; $this->on_entity_actions_api_init( static function () use ( &$unregistered ) { @@ -1084,7 +1084,7 @@ static function () use ( &$unregistered ) { * @ticket 66343 */ public function test_unregistering_only_invalid_ids_unregisters_nothing() { - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::unregister' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::unregister' ); $reported = &$this->record_notices( 'WP_Entity_Actions_Registry::unregister' ); $unregistered = null; $this->on_entity_actions_api_init( @@ -1106,8 +1106,8 @@ static function () use ( &$unregistered ) { * @ticket 66343 */ public function test_reading_an_invalid_entity_is_reported() { - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::get_registered' ); - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::get_registered_action_modules' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::get_registered' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::get_registered_action_modules' ); $this->assertSame( array(), wp_get_registered_entity_actions( 'postType', array( 'page' ) ) ); $this->assertSame( array(), wp_get_registered_entity_action_modules( '', 'page' ) ); @@ -1134,7 +1134,7 @@ public function test_a_numeric_module_id_is_read_as_a_string() { * @ticket 66343 */ public function test_registering_outside_the_action_is_refused() { - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::register' ); self::reset_registry(); $fired = did_action( 'wp_entity_actions_api_init' ); @@ -1153,7 +1153,7 @@ public function test_registering_outside_the_action_is_refused() { * @ticket 66343 */ public function test_unregistering_outside_the_action_is_refused() { - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::unregister' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::unregister' ); self::reset_registry(); $fired = did_action( 'wp_entity_actions_api_init' ); @@ -1173,7 +1173,7 @@ public function test_unregistering_outside_the_action_is_refused() { public function test_reading_before_init_does_not_fire_the_action() { global $wp_actions; - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::initialize' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::initialize' ); self::reset_registry(); $fired = did_action( 'wp_entity_actions_api_init' ); @@ -1204,7 +1204,7 @@ public function test_reading_before_init_does_not_fire_the_action() { public function test_reading_during_init_does_not_fire_the_action() { global $wp_current_filter; - $this->expectWPIncorrectUsage( 'WP_Entity_Actions_Registry::initialize' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Actions_Registry::initialize' ); self::reset_registry(); $fired = did_action( 'wp_entity_actions_api_init' ); diff --git a/tests/phpunit/tests/entity-fields/wpEntityFieldsRegistry.php b/tests/phpunit/tests/entity-fields/wpEntityFieldsRegistry.php index 5cb340103d2d9..6a035503d1f1f 100644 --- a/tests/phpunit/tests/entity-fields/wpEntityFieldsRegistry.php +++ b/tests/phpunit/tests/entity-fields/wpEntityFieldsRegistry.php @@ -109,7 +109,7 @@ public function test_fields_carry_the_origin_they_are_registered_with() { * @ticket 66229 */ public function test_registering_a_registered_field_is_skipped() { - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); $reported = &$this->record_notices( 'WP_Entity_Fields_Registry::register' ); $registered = $this->register_fields( 'postType', @@ -143,7 +143,7 @@ public function test_registering_a_registered_field_is_skipped() { * @ticket 66229 */ public function test_registering_the_same_field_twice_keeps_the_first_definition() { - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); $reported = &$this->record_notices( 'WP_Entity_Fields_Registry::register' ); $registered = $this->register_fields( 'postType', @@ -357,7 +357,7 @@ static function () use ( &$updated ) { * @ticket 66229 */ public function test_registering_a_field_with_an_unknown_type_is_reported() { - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); $reported = &$this->record_notices( 'WP_Entity_Fields_Registry::register' ); $registered = $this->register_fields( 'postType', @@ -389,7 +389,7 @@ public function test_registering_a_field_with_an_unknown_type_is_reported() { * @ticket 66229 */ public function test_updating_an_unregistered_field_is_skipped() { - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::update' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::update' ); $reported = &$this->record_notices( 'WP_Entity_Fields_Registry::update' ); $updated = array(); $this->on_entity_fields_api_init( @@ -432,8 +432,8 @@ static function () use ( &$updated ) { * @ticket 66229 */ public function test_an_invalid_definition_is_skipped() { - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::update' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::update' ); $reported = &$this->record_notices( 'WP_Entity_Fields_Registry::register' ); $registered = null; $updated = null; @@ -491,7 +491,7 @@ function () use ( &$registered, &$updated ) { * @ticket 66229 */ public function test_registering_with_an_invalid_origin_is_refused() { - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); $registered = null; $this->on_entity_fields_api_init( static function () use ( &$registered ) { @@ -509,7 +509,7 @@ static function () use ( &$registered ) { * @ticket 66229 */ public function test_registering_fields_that_are_not_a_list_is_refused() { - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); $registered = null; $this->on_entity_fields_api_init( static function () use ( &$registered ) { @@ -529,7 +529,7 @@ static function () use ( &$registered ) { * @ticket 66229 */ public function test_unregistering_with_an_invalid_entity_is_refused() { - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::unregister' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::unregister' ); $results = array(); $this->on_entity_fields_api_init( static function () use ( &$results ) { @@ -555,7 +555,7 @@ static function () use ( &$results ) { * @ticket 66229 */ public function test_unregistering_with_an_invalid_id_skips_it() { - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::unregister' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::unregister' ); $unregistered = null; $this->on_entity_fields_api_init( static function () use ( &$unregistered ) { @@ -578,7 +578,7 @@ static function () use ( &$unregistered ) { * @ticket 66229 */ public function test_registering_outside_the_action_is_refused() { - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); self::reset_registry(); $fired = did_action( 'wp_entity_fields_api_init' ); @@ -595,7 +595,7 @@ public function test_registering_outside_the_action_is_refused() { * @ticket 66229 */ public function test_updating_outside_the_action_is_refused() { - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::update' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::update' ); self::reset_registry(); $fired = did_action( 'wp_entity_fields_api_init' ); @@ -627,7 +627,7 @@ public function test_updating_outside_the_action_is_refused() { * @ticket 66229 */ public function test_unregistering_outside_the_action_is_refused() { - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::unregister' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::unregister' ); self::reset_registry(); $fired = did_action( 'wp_entity_fields_api_init' ); @@ -647,7 +647,7 @@ public function test_unregistering_outside_the_action_is_refused() { public function test_reading_before_init_does_not_fire_the_action() { global $wp_actions; - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::initialize' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::initialize' ); self::reset_registry(); $fired = did_action( 'wp_entity_fields_api_init' ); @@ -678,7 +678,7 @@ public function test_reading_before_init_does_not_fire_the_action() { public function test_reading_during_init_does_not_fire_the_action() { global $wp_current_filter; - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::initialize' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::initialize' ); self::reset_registry(); $fired = did_action( 'wp_entity_fields_api_init' ); diff --git a/tests/phpunit/tests/entity-fields/wpRegisterEntityFieldCollection.php b/tests/phpunit/tests/entity-fields/wpRegisterEntityFieldCollection.php index 9555458590af0..52e8c5abfc874 100644 --- a/tests/phpunit/tests/entity-fields/wpRegisterEntityFieldCollection.php +++ b/tests/phpunit/tests/entity-fields/wpRegisterEntityFieldCollection.php @@ -141,7 +141,7 @@ public function test_the_files_of_a_collection_have_their_own_scope() { public function test_a_collection_redefining_a_registered_field_is_skipped() { $this->register_post_types( array( 'test_book' => array( 'title' ) ) ); - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::register' ); $directory = DIR_TESTDATA . '/entity-fields/collections/duplicate/book'; $result = null; $this->on_entity_fields_api_init( @@ -178,7 +178,7 @@ static function () use ( $directory, &$result ) { public function test_an_invalid_collection_is_skipped() { $this->register_post_types( array( 'test_book' => array( 'title' ) ) ); - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::register_collection' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::register_collection' ); $reported = &$this->record_notices( 'WP_Entity_Fields_Registry::register_collection' ); $results = $this->register_fixture_collections( 'invalid', array( 'book', 'no_name', 'null_name', 'no_origin', 'missing' ) ); $ids = array_column( wp_get_registered_entity_fields( 'postType', 'test_book' ), 'id' ); @@ -211,7 +211,7 @@ public function test_an_invalid_collection_is_skipped() { * @ticket 66229 */ public function test_invalid_collection_fields_are_skipped() { - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::get_collection_fields' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::get_collection_fields' ); $reported = &$this->record_notices( 'WP_Entity_Fields_Registry::get_collection_fields' ); $fields = wp_get_entity_field_collection_fields( DIR_TESTDATA . '/entity-fields/collections/invalid_fields/book' ); @@ -231,7 +231,7 @@ public function test_invalid_collection_fields_are_skipped() { public function test_a_collection_with_invalid_fields_registers_the_valid_ones() { $this->register_post_types( array( 'test_book' => array( 'title' ) ) ); - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::register_collection' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::register_collection' ); $reported = &$this->record_notices( 'WP_Entity_Fields_Registry::register_collection' ); $results = $this->register_fixture_collections( 'invalid_fields', array( 'book' ) ); $fields = wp_get_registered_entity_fields( 'postType', 'test_book' ); @@ -249,7 +249,7 @@ public function test_a_collection_with_invalid_fields_registers_the_valid_ones() * @ticket 66229 */ public function test_registering_a_collection_outside_the_action_is_refused() { - $this->expectWPIncorrectUsage( 'WP_Entity_Fields_Registry::register_collection' ); + $this->setExpectedIncorrectUsage( 'WP_Entity_Fields_Registry::register_collection' ); self::reset_registry(); $fired = did_action( 'wp_entity_fields_api_init' ); diff --git a/tests/phpunit/tests/filters.php b/tests/phpunit/tests/filters.php index 18f1c3bc37020..1ca7c98a51ba9 100644 --- a/tests/phpunit/tests/filters.php +++ b/tests/phpunit/tests/filters.php @@ -476,7 +476,7 @@ public function test_has_filter_after_remove_all_filters() { /** * @ticket 10441 - * @expectedWPDeprecated tests_apply_filters_deprecated + * @expectedDeprecated tests_apply_filters_deprecated */ public function test_apply_filters_deprecated() { $p = 'Foo'; @@ -495,7 +495,7 @@ public static function deprecated_filter_callback( $p ) { /** * @ticket 10441 - * @expectedWPDeprecated tests_apply_filters_deprecated + * @expectedDeprecated tests_apply_filters_deprecated */ public function test_apply_filters_deprecated_with_multiple_params() { $p1 = 'Foo1'; diff --git a/tests/phpunit/tests/fonts/font-library/wpFontCollection/__construct.php b/tests/phpunit/tests/fonts/font-library/wpFontCollection/__construct.php index e9b18cf09d4d8..a0693ce341456 100644 --- a/tests/phpunit/tests/fonts/font-library/wpFontCollection/__construct.php +++ b/tests/phpunit/tests/fonts/font-library/wpFontCollection/__construct.php @@ -13,7 +13,7 @@ class Tests_Fonts_WpFontCollection_Construct extends WP_UnitTestCase { public function test_should_do_it_wrong_with_invalid_slug() { - $this->expectWPIncorrectUsage( 'WP_Font_Collection::__construct' ); + $this->setExpectedIncorrectUsage( 'WP_Font_Collection::__construct' ); $mock_collection_data = array( 'name' => 'Test Collection', 'font_families' => array( 'mock ' ), diff --git a/tests/phpunit/tests/fonts/font-library/wpFontCollection/getData.php b/tests/phpunit/tests/fonts/font-library/wpFontCollection/getData.php index b5df86e425859..dc82b2a67fdb8 100644 --- a/tests/phpunit/tests/fonts/font-library/wpFontCollection/getData.php +++ b/tests/phpunit/tests/fonts/font-library/wpFontCollection/getData.php @@ -207,7 +207,7 @@ public static function data_create_font_collection() { * @param array $config Font collection config. */ public function test_should_error_when_missing_properties( $config ) { - $this->expectWPIncorrectUsage( 'WP_Font_Collection::sanitize_and_validate_data' ); + $this->setExpectedIncorrectUsage( 'WP_Font_Collection::sanitize_and_validate_data' ); $collection = new WP_Font_Collection( 'my-collection', $config ); $data = $collection->get_data(); @@ -253,7 +253,7 @@ public static function data_should_error_when_missing_properties() { } public function test_should_error_with_invalid_json_file_path() { - $this->expectWPIncorrectUsage( 'WP_Font_Collection::load_from_json' ); + $this->setExpectedIncorrectUsage( 'WP_Font_Collection::load_from_json' ); $collection = new WP_Font_Collection( 'my-collection', @@ -296,7 +296,7 @@ public function test_should_error_with_invalid_json_from_file() { } public function test_should_error_with_invalid_url() { - $this->expectWPIncorrectUsage( 'WP_Font_Collection::load_from_json' ); + $this->setExpectedIncorrectUsage( 'WP_Font_Collection::load_from_json' ); $collection = new WP_Font_Collection( 'my-collection', diff --git a/tests/phpunit/tests/fonts/font-library/wpFontLibrary/registerFontCollection.php b/tests/phpunit/tests/fonts/font-library/wpFontLibrary/registerFontCollection.php index 4a22b8251427c..d3b0f126e2e7e 100644 --- a/tests/phpunit/tests/fonts/font-library/wpFontLibrary/registerFontCollection.php +++ b/tests/phpunit/tests/fonts/font-library/wpFontLibrary/registerFontCollection.php @@ -32,7 +32,7 @@ public function test_should_return_error_if_slug_is_repeated() { $this->assertInstanceOf( 'WP_Font_Collection', $collection1, 'A collection should be registered.' ); // Expects a _doing_it_wrong notice. - $this->expectWPIncorrectUsage( 'WP_Font_Library::register_font_collection' ); + $this->setExpectedIncorrectUsage( 'WP_Font_Library::register_font_collection' ); // Try to register a second collection with same slug. WP_Font_Library::get_instance()->register_font_collection( 'my-collection-1', $mock_collection_data ); diff --git a/tests/phpunit/tests/fonts/font-library/wpRestFontCollectionsController.php b/tests/phpunit/tests/fonts/font-library/wpRestFontCollectionsController.php index 22e2c010abd7c..50c3e5d30bd93 100644 --- a/tests/phpunit/tests/fonts/font-library/wpRestFontCollectionsController.php +++ b/tests/phpunit/tests/fonts/font-library/wpRestFontCollectionsController.php @@ -85,7 +85,7 @@ public function test_get_items() { * @param string $method The HTTP method to use. */ public function test_get_items_should_only_return_valid_collections( $method ) { - $this->expectWPIncorrectUsage( 'WP_Font_Collection::load_from_json' ); + $this->setExpectedIncorrectUsage( 'WP_Font_Collection::load_from_json' ); wp_set_current_user( self::$admin_id ); wp_register_font_collection( @@ -209,7 +209,7 @@ public function test_get_item_invalid_slug( $method ) { * @param string $method The HTTP method to use. */ public function test_get_item_invalid_collection( $method ) { - $this->expectWPIncorrectUsage( 'WP_Font_Collection::load_from_json' ); + $this->setExpectedIncorrectUsage( 'WP_Font_Collection::load_from_json' ); wp_set_current_user( self::$admin_id ); $slug = 'invalid-collection'; diff --git a/tests/phpunit/tests/formatting/cleanPre.php b/tests/phpunit/tests/formatting/cleanPre.php index d793c74256c41..724b89bb76256 100644 --- a/tests/phpunit/tests/formatting/cleanPre.php +++ b/tests/phpunit/tests/formatting/cleanPre.php @@ -5,7 +5,7 @@ * tags within `
` elements as part of wpautop().
  *
  * @group formatting
- * @expectedWPDeprecated clean_pre
+ * @expectedDeprecated clean_pre
  *
  * @covers ::clean_pre
  */
diff --git a/tests/phpunit/tests/formatting/likeEscape.php b/tests/phpunit/tests/formatting/likeEscape.php
index 2808b94b820e9..4902056730289 100644
--- a/tests/phpunit/tests/formatting/likeEscape.php
+++ b/tests/phpunit/tests/formatting/likeEscape.php
@@ -8,7 +8,7 @@
 class Tests_Formatting_LikeEscape extends WP_UnitTestCase {
 	/**
 	 * @ticket 10041
-	 * @expectedWPDeprecated like_escape
+	 * @expectedDeprecated like_escape
 	 */
 	public function test_like_escape() {
 
diff --git a/tests/phpunit/tests/formatting/wpHtmleditPre.php b/tests/phpunit/tests/formatting/wpHtmleditPre.php
index 46c22cc980236..272aac2684bf9 100644
--- a/tests/phpunit/tests/formatting/wpHtmleditPre.php
+++ b/tests/phpunit/tests/formatting/wpHtmleditPre.php
@@ -2,7 +2,7 @@
 
 /**
  * @group formatting
- * @expectedWPDeprecated wp_htmledit_pre
+ * @expectedDeprecated wp_htmledit_pre
  *
  * @covers ::wp_htmledit_pre
  */
diff --git a/tests/phpunit/tests/formatting/wpRicheditPre.php b/tests/phpunit/tests/formatting/wpRicheditPre.php
index 850d58d8bf8e5..323eda673c48d 100644
--- a/tests/phpunit/tests/formatting/wpRicheditPre.php
+++ b/tests/phpunit/tests/formatting/wpRicheditPre.php
@@ -2,7 +2,7 @@
 
 /**
  * @group formatting
- * @expectedWPDeprecated wp_richedit_pre
+ * @expectedDeprecated wp_richedit_pre
  *
  * @covers ::wp_richedit_pre
  */
diff --git a/tests/phpunit/tests/formatting/wpSlash.php b/tests/phpunit/tests/formatting/wpSlash.php
index 7198237e4d84a..8ddbc81f65748 100644
--- a/tests/phpunit/tests/formatting/wpSlash.php
+++ b/tests/phpunit/tests/formatting/wpSlash.php
@@ -107,7 +107,7 @@ public function test_add_even_more_slashes() {
 	 *
 	 * @ticket 64539
 	 * @covers ::addslashes_gpc
-	 * @expectedWPDeprecated addslashes_gpc
+	 * @expectedDeprecated addslashes_gpc
 	 */
 	public function test_addslashes_gpc_matches_wp_slash_for_strings() {
 		$input = "String with 'quotes' and \"double quotes\"";
@@ -119,7 +119,7 @@ public function test_addslashes_gpc_matches_wp_slash_for_strings() {
 	 *
 	 * @ticket 64539
 	 * @covers ::addslashes_gpc
-	 * @expectedWPDeprecated addslashes_gpc
+	 * @expectedDeprecated addslashes_gpc
 	 */
 	public function test_addslashes_gpc_matches_wp_slash_for_arrays() {
 		$input = array(
diff --git a/tests/phpunit/tests/functions/getNonCachedIds.php b/tests/phpunit/tests/functions/getNonCachedIds.php
index ce21fd7a45416..5536453701e83 100644
--- a/tests/phpunit/tests/functions/getNonCachedIds.php
+++ b/tests/phpunit/tests/functions/getNonCachedIds.php
@@ -58,7 +58,7 @@ public static function data_valid_ids_should_be_returned_as_integers() {
 	public function test_mix_of_valid_and_invalid_ids_should_return_the_valid_ids_and_throw_a_notice() {
 		$object_id = 1;
 
-		$this->expectWPIncorrectUsage( '_get_non_cached_ids' );
+		$this->setExpectedIncorrectUsage( '_get_non_cached_ids' );
 		$this->assertSame(
 			array( $object_id ),
 			_get_non_cached_ids( array( $object_id, null ), 'fake-group' ),
@@ -74,7 +74,7 @@ public function test_mix_of_valid_and_invalid_ids_should_return_the_valid_ids_an
 	 * @param mixed $object_id The object ID.
 	 */
 	public function test_invalid_cache_ids_should_throw_a_notice( $object_id ) {
-		$this->expectWPIncorrectUsage( '_get_non_cached_ids' );
+		$this->setExpectedIncorrectUsage( '_get_non_cached_ids' );
 		$this->assertSame(
 			array(),
 			_get_non_cached_ids( array( $object_id ), 'fake-group' ),
diff --git a/tests/phpunit/tests/functions/registerUninstallHook.php b/tests/phpunit/tests/functions/registerUninstallHook.php
index 88ba1c7e6dbea..338f6a069ce93 100644
--- a/tests/phpunit/tests/functions/registerUninstallHook.php
+++ b/tests/phpunit/tests/functions/registerUninstallHook.php
@@ -61,7 +61,7 @@ public static function data_callbacks() {
 	 *
 	 * @ticket 65819
 	 *
-	 * @expectedWPIncorrectUsage register_uninstall_hook
+	 * @expectedIncorrectUsage register_uninstall_hook
 	 */
 	public function test_should_reject_object_method() {
 		register_uninstall_hook( WP_PLUGIN_DIR . '/my-plugin/my-plugin.php', array( new stdClass(), 'uninstall' ) );
diff --git a/tests/phpunit/tests/functions/wpAdminNotice.php b/tests/phpunit/tests/functions/wpAdminNotice.php
index 9fea1eb055f62..9ced4e920937a 100644
--- a/tests/phpunit/tests/functions/wpAdminNotice.php
+++ b/tests/phpunit/tests/functions/wpAdminNotice.php
@@ -292,7 +292,7 @@ public static function data_should_output_admin_notice() {
 	 *
 	 * @ticket 57791
 	 *
-	 * @expectedWPIncorrectUsage wp_get_admin_notice
+	 * @expectedIncorrectUsage wp_get_admin_notice
 	 */
 	public function test_should_throw_doing_it_wrong_with_a_type_containing_spaces() {
 		ob_start();
diff --git a/tests/phpunit/tests/functions/wpGetAdminNotice.php b/tests/phpunit/tests/functions/wpGetAdminNotice.php
index 3eaeeffa65195..0c1716c3ce3b8 100644
--- a/tests/phpunit/tests/functions/wpGetAdminNotice.php
+++ b/tests/phpunit/tests/functions/wpGetAdminNotice.php
@@ -282,7 +282,7 @@ public static function data_should_return_admin_notice() {
 	 *
 	 * @ticket 57791
 	 *
-	 * @expectedWPIncorrectUsage wp_get_admin_notice
+	 * @expectedIncorrectUsage wp_get_admin_notice
 	 */
 	public function test_should_throw_doing_it_wrong_with_a_type_containing_spaces() {
 		$this->assertSame(
diff --git a/tests/phpunit/tests/functions/wpListPluck.php b/tests/phpunit/tests/functions/wpListPluck.php
index 244facca66b0d..428555ad0a40d 100644
--- a/tests/phpunit/tests/functions/wpListPluck.php
+++ b/tests/phpunit/tests/functions/wpListPluck.php
@@ -20,9 +20,9 @@ public function set_up() {
 		 * for this method.
 		 *
 		 * To ensure that deprecation and incorrect usage notices continue to be
-		 * detectable, this method uses WP_UnitTestCase_Base::set_up_deprecation_expectations().
+		 * detectable, this method uses WP_UnitTestCase_Base::expectDeprecated().
 		 */
-		$this->set_up_deprecation_expectations();
+		$this->expectDeprecated();
 
 		$this->array_list['foo'] = array(
 			'name'   => 'foo',
diff --git a/tests/phpunit/tests/functions/wpListUtil.php b/tests/phpunit/tests/functions/wpListUtil.php
index 35ffa506d83f5..e7d92c90f8106 100644
--- a/tests/phpunit/tests/functions/wpListUtil.php
+++ b/tests/phpunit/tests/functions/wpListUtil.php
@@ -118,7 +118,7 @@ public static function data_wp_list_util_pluck() {
 	 * @covers WP_List_Util::pluck
 	 * @covers ::wp_list_pluck
 	 *
-	 * @expectedWPIncorrectUsage WP_List_Util::pluck
+	 * @expectedIncorrectUsage WP_List_Util::pluck
 	 *
 	 * @param array $input An invalid input array.
 	 */
@@ -136,7 +136,7 @@ public function test_wp_list_pluck_should_throw_doing_it_wrong_with_invalid_inpu
 	 * @covers WP_List_Util::pluck
 	 * @covers ::wp_list_pluck
 	 *
-	 * @expectedWPIncorrectUsage WP_List_Util::pluck
+	 * @expectedIncorrectUsage WP_List_Util::pluck
 	 *
 	 * @param array $input An invalid input array.
 	 */
diff --git a/tests/phpunit/tests/functions/wpUniqueIdFromValues.php b/tests/phpunit/tests/functions/wpUniqueIdFromValues.php
index c3727b2bf9706..5051a14cc7e0d 100644
--- a/tests/phpunit/tests/functions/wpUniqueIdFromValues.php
+++ b/tests/phpunit/tests/functions/wpUniqueIdFromValues.php
@@ -113,7 +113,7 @@ public static function data_wp_unique_id_from_values() {
 	 *
 	 * @ticket 62985
 	 *
-	 * @expectedWPIncorrectUsage wp_unique_id_from_values
+	 * @expectedIncorrectUsage wp_unique_id_from_values
 	 *
 	 * @since 6.8.0
 	 */
diff --git a/tests/phpunit/tests/general/template_CheckedSelectedHelper.php b/tests/phpunit/tests/general/template_CheckedSelectedHelper.php
index 3a26aca51367b..5b61afe45410d 100644
--- a/tests/phpunit/tests/general/template_CheckedSelectedHelper.php
+++ b/tests/phpunit/tests/general/template_CheckedSelectedHelper.php
@@ -59,7 +59,7 @@ public function test_disabled_with_equal_values() {
 	 * @requires PHP < 8.1
 	 */
 	public function test_readonly_with_equal_values() {
-		$this->expectWPDeprecated( 'readonly' );
+		$this->setExpectedDeprecated( 'readonly' );
 
 		// Call the function via a variable to prevent a parse error for this file on PHP 8.1.
 		$fn = 'readonly';
diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessor-bookmark.php b/tests/phpunit/tests/html-api/wpHtmlProcessor-bookmark.php
index 90a1421818243..094fea367878a 100644
--- a/tests/phpunit/tests/html-api/wpHtmlProcessor-bookmark.php
+++ b/tests/phpunit/tests/html-api/wpHtmlProcessor-bookmark.php
@@ -161,7 +161,7 @@ public static function data_processor_constructors(): array {
 	/**
 	 * @ticket 62521
 	 *
-	 * @expectedWPIncorrectUsage WP_HTML_Processor::set_bookmark
+	 * @expectedIncorrectUsage WP_HTML_Processor::set_bookmark
 	 */
 	public function test_bookmarks_not_allowed_on_virtual_nodes() {
 		$processor = WP_HTML_Processor::create_full_parser( 'text' );
diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessor.php b/tests/phpunit/tests/html-api/wpHtmlProcessor.php
index 05185e921e392..49eadd89f996d 100644
--- a/tests/phpunit/tests/html-api/wpHtmlProcessor.php
+++ b/tests/phpunit/tests/html-api/wpHtmlProcessor.php
@@ -30,7 +30,7 @@ class Tests_HtmlApi_WpHtmlProcessor extends WP_UnitTestCase {
 	 * @ticket 58517
 	 *
 	 * @covers WP_HTML_Processor::__construct
-	 * @expectedWPIncorrectUsage WP_HTML_Processor::__construct
+	 * @expectedIncorrectUsage WP_HTML_Processor::__construct
 	 */
 	public function test_warns_that_the_static_creator_methods_should_be_called_instead_of_the_public_constructor() {
 		new WP_HTML_Processor( '

Light roast.

' ); @@ -40,7 +40,7 @@ public function test_warns_that_the_static_creator_methods_should_be_called_inst * @ticket 63854 * * @covers ::create_fragment - * @expectedWPIncorrectUsage WP_HTML_Processor::create_fragment + * @expectedIncorrectUsage WP_HTML_Processor::create_fragment */ public function test_create_fragment_validates_html_parameter() { $processor = WP_HTML_Processor::create_fragment( null ); @@ -51,7 +51,7 @@ public function test_create_fragment_validates_html_parameter() { * @ticket 63854 * * @covers ::create_full_parser - * @expectedWPIncorrectUsage WP_HTML_Processor::create_full_parser + * @expectedIncorrectUsage WP_HTML_Processor::create_full_parser */ public function test_create_full_parser_validates_html_parameter() { $processor = WP_HTML_Processor::create_full_parser( null ); @@ -1130,7 +1130,7 @@ public function test_next_tag_lowercase_tag_name() { * * @ticket 64394 * - * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_bookmark + * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_bookmark */ public function test_deep_nesting_fails_process_without_error() { $html = str_repeat( '', WP_HTML_Processor::MAX_BOOKMARKS * 2 ); @@ -1150,7 +1150,7 @@ public function test_deep_nesting_fails_process_without_error() { /** * @ticket 64394 * - * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_bookmark + * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_bookmark */ public function test_deep_nesting_fails_processing_virtual_tokens_without_error() { /* @@ -1209,7 +1209,7 @@ public function test_deep_nesting_fails_processing_virtual_tokens_without_error( /** * @ticket 64394 * - * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_bookmark + * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_bookmark */ public function test_prevents_unbounded_bookmarking() { $processor = WP_HTML_Processor::create_full_parser( '' ); diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessorModifiableText.php b/tests/phpunit/tests/html-api/wpHtmlProcessorModifiableText.php index ac589474c7214..3072a46aa91d0 100644 --- a/tests/phpunit/tests/html-api/wpHtmlProcessorModifiableText.php +++ b/tests/phpunit/tests/html-api/wpHtmlProcessorModifiableText.php @@ -78,7 +78,7 @@ public static function data_modifiable_text_special_textarea(): array { * @ticket 64751 * @dataProvider data_set_modifiable_fails_non_atomic_tags * - * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text + * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text */ public function test_set_modifiable_fails_non_atomic_tags( string $html, diff --git a/tests/phpunit/tests/html-api/wpHtmlTagProcessor-bookmark.php b/tests/phpunit/tests/html-api/wpHtmlTagProcessor-bookmark.php index ac721de9e9243..beb4cc60f6d95 100644 --- a/tests/phpunit/tests/html-api/wpHtmlTagProcessor-bookmark.php +++ b/tests/phpunit/tests/html-api/wpHtmlTagProcessor-bookmark.php @@ -414,7 +414,7 @@ public function test_updates_bookmark_for_deletions_before_both_sides() { * @ticket 56299 * * @covers WP_HTML_Tag_Processor::set_bookmark - * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_bookmark + * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_bookmark */ public function test_limits_the_number_of_bookmarks() { $processor = new WP_HTML_Tag_Processor( '
  • One
  • Two
  • Three
' ); @@ -451,7 +451,7 @@ public function test_limits_the_number_of_seek_calls() { ); } - $this->expectWPIncorrectUsage( 'WP_HTML_Tag_Processor::seek' ); + $this->setExpectedIncorrectUsage( 'WP_HTML_Tag_Processor::seek' ); $this->assertFalse( $processor->seek( 'bookmark' ), "$i-th seek() to the bookmark succeeded, even though it should exceed the allowed limit" ); } diff --git a/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php b/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php index 130f90e116ff1..1bfaa01bf0453 100644 --- a/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php +++ b/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php @@ -76,7 +76,7 @@ public function test_has_self_closing_flag_matches_input_html( $html, $flag_is_s * @ticket 63854 * * @covers WP_HTML_Tag_Processor::__construct - * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::__construct + * @expectedIncorrectUsage WP_HTML_Tag_Processor::__construct */ public function test_constructor_validates_html_parameter() { // Test that passing null triggers _doing_it_wrong and sets HTML to empty string. @@ -321,7 +321,7 @@ public function test_set_attribute_is_case_insensitive() { * * @ticket 63863 * - * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_attribute + * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_attribute * * @dataProvider data_invalid_attribute_names * diff --git a/tests/phpunit/tests/html-api/wpHtmlTagProcessorModifiableText.php b/tests/phpunit/tests/html-api/wpHtmlTagProcessorModifiableText.php index f8fde23354bc5..cd844a8cee326 100644 --- a/tests/phpunit/tests/html-api/wpHtmlTagProcessorModifiableText.php +++ b/tests/phpunit/tests/html-api/wpHtmlTagProcessorModifiableText.php @@ -349,7 +349,7 @@ public function test_get_modifiable_text_ignores_newlines_after_seeking() { * * @dataProvider data_tokens_not_supporting_modifiable_text_updates * - * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text + * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text * * @param string $html Contains HTML with a token not supporting modifiable text updates. * @param int $advance_n_tokens Count of times to run `next_token()` before reaching target node. @@ -664,7 +664,7 @@ public static function data_rcdata_element_names(): array { * * @dataProvider data_unallowed_modifiable_text_updates * - * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text + * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text * * @param string $html_with_nonempty_modifiable_text Will be used to find the test element. * @param string $invalid_update Update containing possibly-compromising text. @@ -954,7 +954,7 @@ public function test_modifiable_text_special_textarea(): void { * @ticket 64751 * @dataProvider data_set_modifiable_fails_non_atomic_tags * - * @expectedWPIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text + * @expectedIncorrectUsage WP_HTML_Tag_Processor::set_modifiable_text */ public function test_set_modifiable_fails_non_atomic_tags( string $html, diff --git a/tests/phpunit/tests/http/wpGetHttpHeaders.php b/tests/phpunit/tests/http/wpGetHttpHeaders.php index 1aa663684557f..fa77c61484818 100644 --- a/tests/phpunit/tests/http/wpGetHttpHeaders.php +++ b/tests/phpunit/tests/http/wpGetHttpHeaders.php @@ -36,7 +36,7 @@ public function test_wp_get_http_headers_invalid_url() { * Test to see if the deprecated argument is working */ public function test_wp_get_http_headers_deprecated_argument() { - $this->expectWPDeprecated( 'wp_get_http_headers' ); + $this->setExpectedDeprecated( 'wp_get_http_headers' ); wp_get_http_headers( 'does_not_matter', $deprecated = true ); } diff --git a/tests/phpunit/tests/icons/wpIconCollectionsRegistry.php b/tests/phpunit/tests/icons/wpIconCollectionsRegistry.php index 515ccf65e6f6b..f66661a71745e 100644 --- a/tests/phpunit/tests/icons/wpIconCollectionsRegistry.php +++ b/tests/phpunit/tests/icons/wpIconCollectionsRegistry.php @@ -99,7 +99,7 @@ public static function data_invalid_collection_slugs() { * * @covers ::register * - * @expectedWPIncorrectUsage WP_Icon_Collections_Registry::register + * @expectedIncorrectUsage WP_Icon_Collections_Registry::register * * @param mixed $slug Invalid slug candidate. */ @@ -115,7 +115,7 @@ public function test_register_rejects_invalid_slug( $slug ) { * * @covers ::register * - * @expectedWPIncorrectUsage WP_Icon_Collections_Registry::register + * @expectedIncorrectUsage WP_Icon_Collections_Registry::register */ public function test_register_twice_fails() { $this->assertTrue( $this->collections->register( 'my-collection', array( 'label' => 'A' ) ) ); @@ -129,7 +129,7 @@ public function test_register_twice_fails() { * * @covers ::register * - * @expectedWPIncorrectUsage WP_Icon_Collections_Registry::register + * @expectedIncorrectUsage WP_Icon_Collections_Registry::register */ public function test_register_rejects_unknown_property() { $result = $this->collections->register( @@ -196,7 +196,7 @@ public function test_unregister_collection_cascades_to_icons() { * * @covers ::unregister * - * @expectedWPIncorrectUsage WP_Icon_Collections_Registry::unregister + * @expectedIncorrectUsage WP_Icon_Collections_Registry::unregister */ public function test_unregister_unknown_collection() { $this->assertFalse( $this->collections->unregister( 'ghost' ) ); @@ -260,7 +260,7 @@ public static function data_boolean_public_properties() { * * @covers ::register * - * @expectedWPIncorrectUsage WP_Icon_Collections_Registry::register + * @expectedIncorrectUsage WP_Icon_Collections_Registry::register * * @param mixed $is_public Invalid collection visibility value. */ diff --git a/tests/phpunit/tests/icons/wpIconsRegistry.php b/tests/phpunit/tests/icons/wpIconsRegistry.php index aedd8b3a3b0ec..ddfef00218a02 100644 --- a/tests/phpunit/tests/icons/wpIconsRegistry.php +++ b/tests/phpunit/tests/icons/wpIconsRegistry.php @@ -172,7 +172,7 @@ public static function data_invalid_icon_names() { * * @covers ::register * - * @expectedWPIncorrectUsage WP_Icons_Registry::register + * @expectedIncorrectUsage WP_Icons_Registry::register */ public function test_register_icon_twice() { $settings = array( @@ -191,7 +191,7 @@ public function test_register_icon_twice() { * * @covers ::register * - * @expectedWPIncorrectUsage WP_Icons_Registry::register + * @expectedIncorrectUsage WP_Icons_Registry::register * * @param mixed $name Invalid icon name candidate. */ @@ -214,7 +214,7 @@ public function test_register_invalid_name( $name ) { * * @covers ::register * - * @expectedWPIncorrectUsage WP_Icons_Registry::register + * @expectedIncorrectUsage WP_Icons_Registry::register */ public function test_register_rejects_non_namespaced_name() { $result = $this->registry->register( @@ -237,7 +237,7 @@ public function test_register_rejects_non_namespaced_name() { * * @covers ::register * - * @expectedWPIncorrectUsage WP_Icons_Registry::register + * @expectedIncorrectUsage WP_Icons_Registry::register */ public function test_register_rejects_collection_property() { $result = $this->registry->register( @@ -258,7 +258,7 @@ public function test_register_rejects_collection_property() { * * @covers ::register * - * @expectedWPIncorrectUsage WP_Icons_Registry::register + * @expectedIncorrectUsage WP_Icons_Registry::register */ public function test_register_rejects_unregistered_collection() { $result = $this->registry->register( @@ -377,7 +377,7 @@ public static function data_sanitize_icon_content(): array { * * @covers ::register * - * @expectedWPIncorrectUsage WP_Icons_Registry::register + * @expectedIncorrectUsage WP_Icons_Registry::register */ public function test_register_icon_with_content_and_file_path() { $result = $this->registry->register( @@ -399,7 +399,7 @@ public function test_register_icon_with_content_and_file_path() { * * @covers ::register * - * @expectedWPIncorrectUsage WP_Icons_Registry::register + * @expectedIncorrectUsage WP_Icons_Registry::register */ public function test_register_icon_without_content_or_file_path() { $result = $this->registry->register( @@ -473,7 +473,7 @@ public function test_unregister_icon() { * * @covers ::unregister * - * @expectedWPIncorrectUsage WP_Icons_Registry::unregister + * @expectedIncorrectUsage WP_Icons_Registry::unregister */ public function test_unregister_unknown_icon() { $this->assertFalse( $this->registry->unregister( 'test-collection/ghost' ) ); @@ -641,7 +641,7 @@ public static function data_invalid_keywords() { * @ticket 66158 * * @dataProvider data_invalid_keywords - * @expectedWPIncorrectUsage WP_Icons_Registry::register + * @expectedIncorrectUsage WP_Icons_Registry::register * * @param mixed $keywords Invalid keywords candidate. */ diff --git a/tests/phpunit/tests/image/functions.php b/tests/phpunit/tests/image/functions.php index 0e31a3d77c69e..d55937eadf1f3 100644 --- a/tests/phpunit/tests/image/functions.php +++ b/tests/phpunit/tests/image/functions.php @@ -350,7 +350,7 @@ public static function data_wp_save_image_file() { * Tests that wp_save_image_file() throws a deprecated argument notice when passed a GD resource. * * @ticket 6821 - * @expectedWPDeprecated wp_save_image_file + * @expectedDeprecated wp_save_image_file * @requires function imagejpeg * * @covers ::wp_save_image_file @@ -605,7 +605,7 @@ public static function data_inferred_mime_types_when_saving_an_image() { * * @ticket 17814 * @covers ::wp_load_image - * @expectedWPDeprecated wp_load_image + * @expectedDeprecated wp_load_image */ public function test_wp_load_image_should_fail_with_error_message_when_loading_a_directory() { $editor = wp_load_image( DIR_TESTDATA ); diff --git a/tests/phpunit/tests/image/imageEditApplyChanges.php b/tests/phpunit/tests/image/imageEditApplyChanges.php index 73ffd0a739426..3b519ca03d072 100644 --- a/tests/phpunit/tests/image/imageEditApplyChanges.php +++ b/tests/phpunit/tests/image/imageEditApplyChanges.php @@ -316,8 +316,8 @@ static function () use ( $replacement ) { * * @requires function imagecreatetruecolor * - * @expectedWPDeprecated image_edit_apply_changes - * @expectedWPDeprecated _rotate_image_resource + * @expectedDeprecated image_edit_apply_changes + * @expectedDeprecated _rotate_image_resource */ public function test_applies_changes_to_gd_image() { $image = imagecreatetruecolor( 40, 20 ); diff --git a/tests/phpunit/tests/image/size.php b/tests/phpunit/tests/image/size.php index 0c6a3ed03ddf8..fb137b392c021 100644 --- a/tests/phpunit/tests/image/size.php +++ b/tests/phpunit/tests/image/size.php @@ -85,7 +85,7 @@ public function test_constrain_dims_boundary() { } /** - * @expectedWPDeprecated wp_shrink_dimensions + * @expectedDeprecated wp_shrink_dimensions */ public function test_shrink_dimensions_default() { $out = wp_shrink_dimensions( 640, 480 ); @@ -96,7 +96,7 @@ public function test_shrink_dimensions_default() { } /** - * @expectedWPDeprecated wp_shrink_dimensions + * @expectedDeprecated wp_shrink_dimensions */ public function test_shrink_dimensions_smaller() { // Image size is smaller than the constraint - no effect. @@ -108,7 +108,7 @@ public function test_shrink_dimensions_smaller() { } /** - * @expectedWPDeprecated wp_shrink_dimensions + * @expectedDeprecated wp_shrink_dimensions */ public function test_shrink_dimensions_equal() { // Image size is equal to the constraint - no effect. @@ -120,7 +120,7 @@ public function test_shrink_dimensions_equal() { } /** - * @expectedWPDeprecated wp_shrink_dimensions + * @expectedDeprecated wp_shrink_dimensions */ public function test_shrink_dimensions_larger() { // Image size is larger than the constraint - result should be constrained. @@ -132,7 +132,7 @@ public function test_shrink_dimensions_larger() { } /** - * @expectedWPDeprecated wp_shrink_dimensions + * @expectedDeprecated wp_shrink_dimensions */ public function test_shrink_dimensions_boundary() { // One dimension is larger than the constraint, one smaller - result should be constrained. diff --git a/tests/phpunit/tests/includes/helpers.php b/tests/phpunit/tests/includes/helpers.php index a70ff9611d7b4..1160f3b901310 100644 --- a/tests/phpunit/tests/includes/helpers.php +++ b/tests/phpunit/tests/includes/helpers.php @@ -232,54 +232,20 @@ public function test__unregister_post_status() { /** * @ticket 28486 - * @ticket 54029 */ - public function test_expectWPDeprecated() { - $this->expectWPDeprecated( 'Tests_TestHelpers::mock_deprecated' ); - $this->assertTrue( $this->mock_deprecated() ); - } - - /** - * @ticket 54029 - */ - public function test_setExpectedDeprecated_back_compat() { + public function test_setExpectedDeprecated() { $this->setExpectedDeprecated( 'Tests_TestHelpers::mock_deprecated' ); $this->assertTrue( $this->mock_deprecated() ); } - /** - * @ticket 54029 - * @expectedDeprecated Tests_TestHelpers::mock_deprecated - */ - public function test_expected_deprecated_annotation_back_compat() { - $this->assertTrue( $this->mock_deprecated() ); - } - /** * @ticket 28486 - * @ticket 54029 */ - public function test_expectWPIncorrectUsage() { - $this->expectWPIncorrectUsage( 'Tests_TestHelpers::mock_incorrect_usage' ); - $this->assertTrue( $this->mock_incorrect_usage() ); - } - - /** - * @ticket 54029 - */ - public function test_setExpectedIncorrectUsage_back_compat() { + public function test_setExpectedIncorrectUsage() { $this->setExpectedIncorrectUsage( 'Tests_TestHelpers::mock_incorrect_usage' ); $this->assertTrue( $this->mock_incorrect_usage() ); } - /** - * @ticket 54029 - * @expectedIncorrectUsage Tests_TestHelpers::mock_incorrect_usage - */ - public function test_expected_incorrect_usage_annotation_back_compat() { - $this->assertTrue( $this->mock_incorrect_usage() ); - } - /** * @ticket 31417 */ diff --git a/tests/phpunit/tests/includes/legacyDeprecationOverrides.php b/tests/phpunit/tests/includes/legacyDeprecationOverrides.php deleted file mode 100644 index eafb56e6f6564..0000000000000 --- a/tests/phpunit/tests/includes/legacyDeprecationOverrides.php +++ /dev/null @@ -1,47 +0,0 @@ -overrides_run[] = 'expectDeprecated'; - parent::expectDeprecated(); - } - - public function expectedDeprecated() { - $this->overrides_run[] = 'expectedDeprecated'; - parent::expectedDeprecated(); - } - - protected function assert_post_conditions() { - parent::assert_post_conditions(); - - $this->assertSame( array( 'expectDeprecated', 'expectedDeprecated' ), $this->overrides_run ); - } - - /** - * @expectedWPDeprecated Tests_Includes_LegacyDeprecationOverrides::mock_deprecated - */ - public function test_overrides_run_and_still_handle_expectations() { - $this->assertSame( array( 'expectDeprecated' ), $this->overrides_run ); - $this->assertTrue( $this->mock_deprecated() ); - } - - protected function mock_deprecated() { - _deprecated_function( __METHOD__, '2.5' ); - return true; - } -} diff --git a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-bind.php b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-bind.php index 7612730878cba..5d6306827faf1 100644 --- a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-bind.php +++ b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-bind.php @@ -212,7 +212,7 @@ public function test_wp_bind_doesnt_do_anything_on_non_existent_references() { * @ticket 60356 * * @covers ::process_directives - * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate + * @expectedIncorrectUsage WP_Interactivity_API::evaluate */ public function test_wp_bind_ignores_empty_value() { $html = '
Text
'; @@ -226,7 +226,7 @@ public function test_wp_bind_ignores_empty_value() { * @ticket 60356 * * @covers ::process_directives - * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate + * @expectedIncorrectUsage WP_Interactivity_API::evaluate */ public function test_wp_bind_ignores_without_value() { $html = '
Text
'; @@ -515,7 +515,7 @@ public static function data_non_finite_values(): array { * * @dataProvider data_non_finite_values * - * @expectedWPIncorrectUsage WP_Interactivity_API::data_wp_bind_processor + * @expectedIncorrectUsage WP_Interactivity_API::data_wp_bind_processor * * @param float $value Non-finite value to bind. */ @@ -627,7 +627,7 @@ public function test_wp_bind_json_serializable_value_matches_the_client_store() * * @covers ::process_directives * - * @expectedWPIncorrectUsage WP_Interactivity_API::data_wp_bind_processor + * @expectedIncorrectUsage WP_Interactivity_API::data_wp_bind_processor */ public function test_wp_bind_rejects_object_which_fails_to_serialize() { $unserializable = new class() implements JsonSerializable { @@ -684,7 +684,7 @@ public function jsonSerialize() { * * @covers ::process_directives * - * @expectedWPIncorrectUsage WP_Interactivity_API::data_wp_bind_processor + * @expectedIncorrectUsage WP_Interactivity_API::data_wp_bind_processor */ public function test_wp_bind_rejects_object_serializing_to_a_non_finite_value() { $this->interactivity->state( 'myPlugin', array( 'nonFinite' => $this->get_json_serializable( INF ) ) ); @@ -926,7 +926,7 @@ public function jsonSerialize() { * * @dataProvider data_non_scalar_values * - * @expectedWPIncorrectUsage WP_Interactivity_API::data_wp_bind_processor + * @expectedIncorrectUsage WP_Interactivity_API::data_wp_bind_processor * * @param mixed $value Non-scalar value to bind. * @param string $tag_name Tag name to bind the value on. @@ -964,7 +964,7 @@ public function test_wp_bind_rejects_non_scalar_value( $value, string $tag_name, * * @dataProvider data_non_scalar_values * - * @expectedWPIncorrectUsage WP_Interactivity_API::data_wp_bind_processor + * @expectedIncorrectUsage WP_Interactivity_API::data_wp_bind_processor * * @param mixed $value Non-scalar value to bind. * @param string $tag_name Tag name to bind the value on. @@ -1012,7 +1012,7 @@ public static function data_event_handler_bindings(): array { * * @dataProvider data_event_handler_bindings * - * @expectedWPIncorrectUsage WP_Interactivity_API::data_wp_bind_processor + * @expectedIncorrectUsage WP_Interactivity_API::data_wp_bind_processor * * @param non-empty-string $attribute Directive attribute name. */ @@ -1030,7 +1030,7 @@ public function test_wp_bind_removes_event_handler_bindings( string $attribute ) * * @covers ::process_directives * - * @expectedWPIncorrectUsage WP_Interactivity_API::data_wp_bind_processor + * @expectedIncorrectUsage WP_Interactivity_API::data_wp_bind_processor */ public function test_wp_bind_removes_event_handler_binding_but_processes_valid_binds(): void { $html = ''; diff --git a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-class.php b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-class.php index f1cdcf652368b..72162a3c684ef 100644 --- a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-class.php +++ b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-class.php @@ -237,7 +237,7 @@ public function test_wp_class_doesnt_change_class_attribute_with_empty_directive * @ticket 60356 * * @covers ::process_directives - * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate + * @expectedIncorrectUsage WP_Interactivity_API::evaluate */ public function test_wp_class_doesnt_change_class_attribute_with_empty_value() { $html = '
Text
'; @@ -252,7 +252,7 @@ public function test_wp_class_doesnt_change_class_attribute_with_empty_value() { * @ticket 60356 * * @covers ::process_directives - * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate + * @expectedIncorrectUsage WP_Interactivity_API::evaluate */ public function test_wp_class_doesnt_change_class_attribute_without_value() { $html = '
Text
'; diff --git a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-context.php b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-context.php index 88a984ad33ca7..9685a3f979cd9 100644 --- a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-context.php +++ b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-context.php @@ -317,7 +317,7 @@ public function test_wp_context_works_with_multiple_directives() { * @ticket 60356 * * @covers ::process_directives - * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate + * @expectedIncorrectUsage WP_Interactivity_API::evaluate */ public function test_wp_context_directive_doesnt_work_without_any_namespace() { $html = ' diff --git a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-html.php b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-html.php index 4a590bb2672d0..5223808a71ebf 100644 --- a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-html.php +++ b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-html.php @@ -196,7 +196,7 @@ private function announced_paths(): array { * @param string $printed How `state.html` is expected to print in the client data. */ public function test_token_reaches_the_output_only_as_host_content( callable $make_state, string $printed ) { - $this->expectWPIncorrectUsage( 'WP_Interactivity_API::data_wp_bind_processor' ); + $this->setExpectedIncorrectUsage( 'WP_Interactivity_API::data_wp_bind_processor' ); $this->set_state( $make_state() ); $output = wp_interactivity_process_directives( @@ -369,7 +369,7 @@ public function test_host_resolves_in_its_own_context() { * @param array $state The state of the `test` namespace. */ public function test_value_that_is_not_a_token_empties_the_host_with_one_notice( string $attributes, array $state ) { - $this->expectWPIncorrectUsage( self::NOTICE_SOURCE ); + $this->setExpectedIncorrectUsage( self::NOTICE_SOURCE ); $this->set_state( $state ); $output = wp_interactivity_process_directives( $this->page( '
' . self::CHILDREN . '
' ) ); @@ -598,7 +598,7 @@ public function test_host_under_a_unique_id_interactive_directive_keeps_the_encl * @param string $name The name of the conflicting directive. */ public function test_conflicting_directive_ignores_data_wp_html_with_one_notice( string $host, string $expected, string $name ) { - $this->expectWPIncorrectUsage( self::NOTICE_SOURCE ); + $this->setExpectedIncorrectUsage( self::NOTICE_SOURCE ); $token = $this->token(); $this->set_state( array( @@ -1146,8 +1146,8 @@ public function test_unbalanced_markup_returns_input_unchanged() { * @covers WP_Interactivity_Dangerous_HTML::__wakeup */ public function test_unserialized_token_is_not_a_token() { - $this->expectWPIncorrectUsage( 'WP_Interactivity_Dangerous_HTML::__wakeup' ); - $this->expectWPIncorrectUsage( self::NOTICE_SOURCE ); + $this->setExpectedIncorrectUsage( 'WP_Interactivity_Dangerous_HTML::__wakeup' ); + $this->setExpectedIncorrectUsage( self::NOTICE_SOURCE ); $original = $this->token(); $value = unserialize( serialize( $original ) ); @@ -1195,8 +1195,8 @@ public function test_unserialized_token_is_not_a_token() { * @covers ::process_directives */ public function test_token_in_context_helper_reaches_no_output_or_client_data() { - $this->expectWPIncorrectUsage( 'WP_Interactivity_API::data_wp_bind_processor' ); - $this->expectWPIncorrectUsage( self::NOTICE_SOURCE ); + $this->setExpectedIncorrectUsage( 'WP_Interactivity_API::data_wp_bind_processor' ); + $this->setExpectedIncorrectUsage( self::NOTICE_SOURCE ); $wrapper = '
$this->token() ) ) . '>'; $output = wp_interactivity_process_directives( diff --git a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-style.php b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-style.php index 92895da429d3f..1a5884f34b8e6 100644 --- a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-style.php +++ b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-style.php @@ -367,7 +367,7 @@ public function test_wp_style_doesnt_change_style_attribute_with_empty_directive * @ticket 60356 * * @covers ::process_directives - * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate + * @expectedIncorrectUsage WP_Interactivity_API::evaluate */ public function test_wp_style_doesnt_change_style_attribute_with_empty_value() { $html = '
Text
'; @@ -382,7 +382,7 @@ public function test_wp_style_doesnt_change_style_attribute_with_empty_value() { * @ticket 60356 * * @covers ::process_directives - * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate + * @expectedIncorrectUsage WP_Interactivity_API::evaluate */ public function test_wp_style_doesnt_change_style_attribute_without_value() { $html = '
Text
'; diff --git a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php index 9cfe113c22251..561c1c4eca93e 100644 --- a/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php +++ b/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php @@ -248,7 +248,7 @@ public function test_state_and_config_dont_print_when_empty() { * * @covers ::print_client_interactivity_data * - * @expectedWPDeprecated WP_Interactivity_API::print_client_interactivity_data + * @expectedDeprecated WP_Interactivity_API::print_client_interactivity_data */ public function test_config_not_printed_when_empty() { $this->interactivity->print_client_interactivity_data(); @@ -260,7 +260,7 @@ public function test_config_not_printed_when_empty() { * * @ticket 60647 * - * @expectedWPDeprecated WP_Interactivity_API::register_script_modules + * @expectedDeprecated WP_Interactivity_API::register_script_modules */ public function test_register_script_modules_deprecated() { $this->interactivity->register_script_modules(); @@ -557,7 +557,7 @@ public function test_state_without_namespace() { * @ticket 61037 * * @covers ::state - * @expectedWPIncorrectUsage WP_Interactivity_API::state + * @expectedIncorrectUsage WP_Interactivity_API::state */ public function test_state_with_data_and_invalid_namespace() { $this->set_internal_namespace_stack( 'myPlugin' ); @@ -577,7 +577,7 @@ public function test_state_with_data_and_invalid_namespace() { * @ticket 61037 * * @covers ::state - * @expectedWPIncorrectUsage WP_Interactivity_API::state + * @expectedIncorrectUsage WP_Interactivity_API::state */ public function test_state_with_empty_string_as_namespace() { $this->set_internal_namespace_stack( 'myPlugin' ); @@ -598,7 +598,7 @@ public function test_state_with_empty_string_as_namespace() { * @ticket 61037 * * @covers ::state - * @expectedWPIncorrectUsage WP_Interactivity_API::state + * @expectedIncorrectUsage WP_Interactivity_API::state */ public function test_state_without_namespace_outside_directive_processing() { $this->assertSame( @@ -712,7 +712,7 @@ public function test_get_context_with_undefined_namespace() { * @ticket 61037 * * @covers ::get_context - * @expectedWPIncorrectUsage WP_Interactivity_API::get_context + * @expectedIncorrectUsage WP_Interactivity_API::get_context */ public function test_get_context_with_empty_namespace() { $this->set_internal_namespace_stack( 'myPlugin' ); @@ -739,7 +739,7 @@ public function test_get_context_with_empty_namespace() { * @ticket 61037 * * @covers ::get_context - * @expectedWPIncorrectUsage WP_Interactivity_API::get_context + * @expectedIncorrectUsage WP_Interactivity_API::get_context */ public function test_get_context_outside_of_directive_processing() { $context = $this->interactivity->get_context(); @@ -1463,7 +1463,7 @@ public function test_process_directives_changes_html_if_contains_svgs() { * @ticket 60517 * * @covers ::process_directives - * @expectedWPIncorrectUsage WP_Interactivity_API_Directives_Processor::skip_to_tag_closer + * @expectedIncorrectUsage WP_Interactivity_API_Directives_Processor::skip_to_tag_closer */ public function test_process_directives_does_not_change_inner_html_in_svgs() { $this->interactivity->state( @@ -1493,7 +1493,7 @@ public function test_process_directives_does_not_change_inner_html_in_svgs() { * @ticket 60517 * * @covers ::process_directives - * @expectedWPIncorrectUsage WP_Interactivity_API::_process_directives + * @expectedIncorrectUsage WP_Interactivity_API::_process_directives */ public function test_process_directives_change_html_if_contains_math() { $this->interactivity->state( @@ -1528,8 +1528,8 @@ public function test_process_directives_change_html_if_contains_math() { * @ticket 60517 * * @covers ::process_directives - * @expectedWPIncorrectUsage WP_Interactivity_API::_process_directives - * @expectedWPIncorrectUsage WP_Interactivity_API_Directives_Processor::skip_to_tag_closer + * @expectedIncorrectUsage WP_Interactivity_API::_process_directives + * @expectedIncorrectUsage WP_Interactivity_API_Directives_Processor::skip_to_tag_closer */ public function test_process_directives_does_not_change_inner_html_in_math() { $this->interactivity->state( @@ -1919,7 +1919,7 @@ public function test_evaluate_nested_value() { * @ticket 61044 * * @covers ::evaluate - * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate + * @expectedIncorrectUsage WP_Interactivity_API::evaluate */ public function test_evaluate_unvalid_namespaces() { $this->set_internal_context_stack( array() ); @@ -2095,7 +2095,7 @@ public function test_evaluate_derived_state_defined_in_different_namespace() { * @ticket 61037 * * @covers ::evaluate - * @expectedWPIncorrectUsage WP_Interactivity_API::evaluate + * @expectedIncorrectUsage WP_Interactivity_API::evaluate */ public function test_evaluate_derived_state_that_throws() { $this->interactivity->state( @@ -2297,7 +2297,7 @@ class="original" * @ticket 62136 * * @covers wp_interactivity_get_element - * @expectedWPIncorrectUsage WP_Interactivity_API::get_element + * @expectedIncorrectUsage WP_Interactivity_API::get_element */ public function test_get_element_outside_of_directive_processing() { $element = $this->interactivity->get_element(); diff --git a/tests/phpunit/tests/link/getCommentsLink.php b/tests/phpunit/tests/link/getCommentsLink.php index 747b83e7d7cf9..47e00281abd5e 100644 --- a/tests/phpunit/tests/link/getCommentsLink.php +++ b/tests/phpunit/tests/link/getCommentsLink.php @@ -177,7 +177,7 @@ static function () { * @param string $deprecated_2 Second deprecated argument. */ public function test_comments_link_deprecated_arguments( $deprecated, $deprecated_2 ) { - $this->expectWPDeprecated( 'comments_link' ); + $this->setExpectedDeprecated( 'comments_link' ); $GLOBALS['post'] = get_post( self::$post_without_comments ); diff --git a/tests/phpunit/tests/link/getDeletePostLink.php b/tests/phpunit/tests/link/getDeletePostLink.php index 404e5ccc1b7ee..59ce75f6bceb7 100644 --- a/tests/phpunit/tests/link/getDeletePostLink.php +++ b/tests/phpunit/tests/link/getDeletePostLink.php @@ -274,7 +274,7 @@ public function test_get_delete_post_link_custom_post_type() { * Tests that get_delete_post_link() triggers deprecation notice when deprecated second argument is passed. * * @ticket 65819 - * @expectedWPDeprecated get_delete_post_link + * @expectedDeprecated get_delete_post_link */ public function test_get_delete_post_link_triggers_deprecation_for_deprecated_argument() { $link = get_delete_post_link( self::$post_id, 'deprecated_argument_value' ); diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php index 84e56913b3fc7..af84065113267 100644 --- a/tests/phpunit/tests/media.php +++ b/tests/phpunit/tests/media.php @@ -1000,7 +1000,7 @@ public static function data_wp_prepare_attachment_for_js_filesize_falls_back_to_ /** * @ticket 19067 - * @expectedWPDeprecated wp_convert_bytes_to_hr + * @expectedDeprecated wp_convert_bytes_to_hr */ public function test_wp_convert_bytes_to_hr() { $kb = 1024; @@ -3918,8 +3918,8 @@ public function test_wp_filter_content_tags_loading_lazy_opted_out() { * @ticket 44427 * @ticket 50367 * - * @expectedWPDeprecated wp_img_tag_add_loading_attr - * @expectedWPDeprecated wp_get_loading_attr_default + * @expectedDeprecated wp_img_tag_add_loading_attr + * @expectedDeprecated wp_get_loading_attr_default */ public function test_wp_img_tag_add_loading_attr() { $img = ' width='; @@ -3932,8 +3932,8 @@ public function test_wp_img_tag_add_loading_attr() { * @ticket 44427 * @ticket 50367 * - * @expectedWPDeprecated wp_img_tag_add_loading_attr - * @expectedWPDeprecated wp_get_loading_attr_default + * @expectedDeprecated wp_img_tag_add_loading_attr + * @expectedDeprecated wp_get_loading_attr_default */ public function test_wp_img_tag_add_loading_attr_without_src() { $img = ' width='; @@ -3946,8 +3946,8 @@ public function test_wp_img_tag_add_loading_attr_without_src() { * @ticket 44427 * @ticket 50367 * - * @expectedWPDeprecated wp_img_tag_add_loading_attr - * @expectedWPDeprecated wp_get_loading_attr_default + * @expectedDeprecated wp_img_tag_add_loading_attr + * @expectedDeprecated wp_get_loading_attr_default */ public function test_wp_img_tag_add_loading_attr_with_single_quotes() { $img = " width="; @@ -3976,7 +3976,7 @@ public function test_wp_img_tag_add_loading_attr_opt_out() { * * @ticket 56969 * - * @expectedWPDeprecated wp_img_tag_add_decoding_attr + * @expectedDeprecated wp_img_tag_add_decoding_attr */ public function test_wp_img_tag_add_decoding_attr_with_single_quotes() { $img = ""; @@ -4450,7 +4450,7 @@ public static function data_attachment_permalinks_based_on_parent_status() { * * @covers ::wp_get_loading_attr_default * - * @expectedWPDeprecated wp_get_loading_attr_default + * @expectedDeprecated wp_get_loading_attr_default * * @dataProvider data_wp_get_loading_attr_default * @@ -4629,7 +4629,7 @@ public function test_wp_omit_loading_attr_threshold() { * * @dataProvider data_wp_get_loading_attr_default_before_and_no_loop * - * @expectedWPDeprecated wp_get_loading_attr_default + * @expectedDeprecated wp_get_loading_attr_default * * @param string $context Context for the element for which the `loading` attribute value is requested. */ @@ -4653,7 +4653,7 @@ public function test_wp_get_loading_attr_default_before_loop_if_not_main_query( * * @dataProvider data_wp_get_loading_attr_default_before_and_no_loop * - * @expectedWPDeprecated wp_get_loading_attr_default + * @expectedDeprecated wp_get_loading_attr_default * * @param string $context Context for the element for which the `loading` attribute value is requested. */ @@ -4676,7 +4676,7 @@ public function test_wp_get_loading_attr_default_before_loop_in_main_query_but_h * * @dataProvider data_wp_get_loading_attr_default_before_and_no_loop * - * @expectedWPDeprecated wp_get_loading_attr_default + * @expectedDeprecated wp_get_loading_attr_default * * @param string $context Context for the element for which the `loading` attribute value is requested. */ @@ -4699,7 +4699,7 @@ public function test_wp_get_loading_attr_default_before_loop_if_main_query( $con * * @dataProvider data_wp_get_loading_attr_default_before_and_no_loop * - * @expectedWPDeprecated wp_get_loading_attr_default + * @expectedDeprecated wp_get_loading_attr_default * * @param string $context Context for the element for which the `loading` attribute value is requested. */ @@ -4726,7 +4726,7 @@ public function test_wp_get_loading_attr_default_after_loop( $context ) { * * @dataProvider data_wp_get_loading_attr_default_before_and_no_loop * - * @expectedWPDeprecated wp_get_loading_attr_default + * @expectedDeprecated wp_get_loading_attr_default * * @param string $context Context for the element for which the `loading` attribute value is requested. */ @@ -5004,7 +5004,7 @@ static function () use ( &$image_within_content ) { * * @covers ::wp_get_loading_attr_default * - * @expectedWPDeprecated wp_get_loading_attr_default + * @expectedDeprecated wp_get_loading_attr_default * * @dataProvider data_special_contexts_for_the_content_wp_get_loading_attr_default * @@ -5021,7 +5021,7 @@ public function test_wp_get_loading_attr_default_should_return_lazy_for_special_ * * @covers ::wp_get_loading_attr_default * - * @expectedWPDeprecated wp_get_loading_attr_default + * @expectedDeprecated wp_get_loading_attr_default * * @dataProvider data_special_contexts_for_the_content_wp_get_loading_attr_default * @@ -6626,7 +6626,7 @@ public function test_wp_get_loading_optimization_attributes_header_block_templat * @ticket 58892 * * @covers ::wp_get_loading_optimization_attributes - * @expectedWPIncorrectUsage wp_get_loading_optimization_attributes + * @expectedIncorrectUsage wp_get_loading_optimization_attributes */ public function test_wp_get_loading_optimization_attributes_incorrect_loading_attrs() { $attr = self::get_width_height_for_high_priority(); @@ -7545,7 +7545,7 @@ public function test_wp_enqueue_img_auto_sizes_contain_css_fix( ?Closure $set_up $set_up(); } if ( isset( $expected_deprecated ) ) { - $this->expectWPDeprecated( $expected_deprecated ); + $this->setExpectedDeprecated( $expected_deprecated ); } $this->assertCount( 0, wp_styles()->queue ); diff --git a/tests/phpunit/tests/media/wpCrossOriginIsolation.php b/tests/phpunit/tests/media/wpCrossOriginIsolation.php index 77ddc83ed443e..64884b4e284f9 100644 --- a/tests/phpunit/tests/media/wpCrossOriginIsolation.php +++ b/tests/phpunit/tests/media/wpCrossOriginIsolation.php @@ -328,7 +328,7 @@ public function test_set_flag_preserves_upload_media_module_dependencies() { * * @ticket 65930 * - * @expectedWPDeprecated wp_start_cross_origin_isolation_output_buffer + * @expectedDeprecated wp_start_cross_origin_isolation_output_buffer * * @runInSeparateProcess * @preserveGlobalState disabled @@ -352,7 +352,7 @@ public function test_deprecated_output_buffer_helper_does_not_buffer() { * * @ticket 65930 * - * @expectedWPDeprecated wp_add_crossorigin_attributes + * @expectedDeprecated wp_add_crossorigin_attributes * * @dataProvider data_cross_origin_elements * diff --git a/tests/phpunit/tests/media/wpImageTagAddDecodingAttr.php b/tests/phpunit/tests/media/wpImageTagAddDecodingAttr.php index 5ef49c271bb6f..73afdb023fcf3 100644 --- a/tests/phpunit/tests/media/wpImageTagAddDecodingAttr.php +++ b/tests/phpunit/tests/media/wpImageTagAddDecodingAttr.php @@ -20,7 +20,7 @@ class Tests_Media_Wp_Img_Tag_Add_Decoding_Attr extends WP_UnitTestCase { * @param string $decoding The value for the 'decoding' attribute. 'no value' for default. * @param string $expected The expected `img` tag. * - * @expectedWPDeprecated wp_img_tag_add_decoding_attr + * @expectedDeprecated wp_img_tag_add_decoding_attr */ public function test_should_add_decoding_attr( $image, $context, $decoding, $expected ) { // Falsey values are allowed in the filter, cannot use `null` or `false` here. @@ -83,7 +83,7 @@ public static function data_should_add_decoding_attr() { * @param mixed $decoding The value for the 'decoding' attribute. 'no value' for default. * @param string $expected The expected `img` tag. * - * @expectedWPDeprecated wp_img_tag_add_decoding_attr + * @expectedDeprecated wp_img_tag_add_decoding_attr */ public function test_should_not_add_decoding_attr( $image, $context, $decoding, $expected ) { // Falsey values are allowed in the filter, cannot use `null` or `false` here. diff --git a/tests/phpunit/tests/menu/nav-menu.php b/tests/phpunit/tests/menu/nav-menu.php index 47542e97b4434..fcd3a3ac1059c 100644 --- a/tests/phpunit/tests/menu/nav-menu.php +++ b/tests/phpunit/tests/menu/nav-menu.php @@ -182,7 +182,7 @@ public function test_location_guessing_one_menu_per_location() { /** * Technically possible to register menu locations numerically. * - * @expectedWPIncorrectUsage register_nav_menus + * @expectedIncorrectUsage register_nav_menus * * @covers ::wp_map_nav_menu_locations */ @@ -207,7 +207,7 @@ public function test_numerical_locations() { /** * Technically possible old nav menu locations were registered numerically. * - * @expectedWPIncorrectUsage register_nav_menus + * @expectedIncorrectUsage register_nav_menus * * @covers ::wp_map_nav_menu_locations */ diff --git a/tests/phpunit/tests/meta/registerMeta.php b/tests/phpunit/tests/meta/registerMeta.php index d8cc2e21388b7..1b3ad3113095b 100644 --- a/tests/phpunit/tests/meta/registerMeta.php +++ b/tests/phpunit/tests/meta/registerMeta.php @@ -593,7 +593,7 @@ public function test_get_default_value( $args, $single, $expected ) { * @dataProvider data_get_invalid_default_data */ public function test_get_invalid_default_value( $args, $single, $expected ) { - $this->expectWPIncorrectUsage( 'register_meta' ); + $this->setExpectedIncorrectUsage( 'register_meta' ); $object_type = 'post'; $meta_key = 'registered_key1'; $register = register_meta( @@ -1183,7 +1183,7 @@ public function test_get_object_subtype_for_blog_with_registered_meta() { * @ticket 20564 */ public function test_register_meta_with_revisions_enabled_on_post_type_without_revisions() { - $this->expectWPIncorrectUsage( 'register_meta' ); + $this->setExpectedIncorrectUsage( 'register_meta' ); // Set up a custom post type with revisions disabled. register_post_type( diff --git a/tests/phpunit/tests/meta/wpMetadataLazyloader.php b/tests/phpunit/tests/meta/wpMetadataLazyloader.php index dc812dd0f05c7..119efb60b70f5 100644 --- a/tests/phpunit/tests/meta/wpMetadataLazyloader.php +++ b/tests/phpunit/tests/meta/wpMetadataLazyloader.php @@ -333,7 +333,7 @@ public function test_queued_objects_are_primed_when_metadata_is_requested() { * * @covers ::lazyload_term_meta * - * @expectedWPDeprecated WP_Metadata_Lazyloader::lazyload_term_meta + * @expectedDeprecated WP_Metadata_Lazyloader::lazyload_term_meta */ public function test_lazyload_term_meta_is_deprecated_and_primes_term_meta() { $lazyloader = new WP_Metadata_Lazyloader(); @@ -352,7 +352,7 @@ public function test_lazyload_term_meta_is_deprecated_and_primes_term_meta() { * * @covers ::lazyload_comment_meta * - * @expectedWPDeprecated WP_Metadata_Lazyloader::lazyload_comment_meta + * @expectedDeprecated WP_Metadata_Lazyloader::lazyload_comment_meta */ public function test_lazyload_comment_meta_is_deprecated_and_primes_comment_meta() { $lazyloader = new WP_Metadata_Lazyloader(); diff --git a/tests/phpunit/tests/multisite/network.php b/tests/phpunit/tests/multisite/network.php index 06be9bb373e83..b4d7f4e4694a7 100644 --- a/tests/phpunit/tests/multisite/network.php +++ b/tests/phpunit/tests/multisite/network.php @@ -350,7 +350,7 @@ public function test_wp_schedule_update_network_counts() { } /** - * @expectedWPDeprecated get_dashboard_blog + * @expectedDeprecated get_dashboard_blog */ public function test_get_dashboard_blog() { // If there is no dashboard blog set, current blog is used. diff --git a/tests/phpunit/tests/multisite/site.php b/tests/phpunit/tests/multisite/site.php index 5c55b617b534f..3e40955c18920 100644 --- a/tests/phpunit/tests/multisite/site.php +++ b/tests/phpunit/tests/multisite/site.php @@ -2200,7 +2200,7 @@ public function populate_options_callback() { */ public function test_wpmu_new_blog_action_backward_compatible( $meta, $expected_meta ) { // We are testing deprecated hook. Register it to expected deprecated notices. - $this->expectWPDeprecated( 'wpmu_new_blog' ); + $this->setExpectedDeprecated( 'wpmu_new_blog' ); add_action( 'wpmu_new_blog', array( $this, 'wpmu_new_blog_callback' ), 10, 6 ); wpmu_create_blog( 'testsite1.example.org', '/new-blog/', 'New Blog', get_current_user_id(), $meta, 1 ); diff --git a/tests/phpunit/tests/multisite/wpGetSites.php b/tests/phpunit/tests/multisite/wpGetSites.php index 29e361d7fc996..a89e543ef7ff6 100644 --- a/tests/phpunit/tests/multisite/wpGetSites.php +++ b/tests/phpunit/tests/multisite/wpGetSites.php @@ -48,7 +48,7 @@ public static function wpTearDownAfterClass() { } /** - * @expectedWPDeprecated wp_get_sites + * @expectedDeprecated wp_get_sites */ public function test_wp_get_sites_site_is_expected_array() { @@ -74,7 +74,7 @@ public function test_wp_get_sites_site_is_expected_array() { } /** - * @expectedWPDeprecated wp_get_sites + * @expectedDeprecated wp_get_sites * @dataProvider data_wp_get_sites * * @param $expected diff --git a/tests/phpunit/tests/oembed/wpOembed.php b/tests/phpunit/tests/oembed/wpOembed.php index c6d094a2dcce3..6c8c61f3246dd 100644 --- a/tests/phpunit/tests/oembed/wpOembed.php +++ b/tests/phpunit/tests/oembed/wpOembed.php @@ -293,7 +293,7 @@ public function test_malformed_provider_triggers_doing_it_wrong(): void { }; add_filter( 'oembed_providers', $filter ); - $this->expectWPIncorrectUsage( 'WP_oEmbed::__construct' ); + $this->setExpectedIncorrectUsage( 'WP_oEmbed::__construct' ); $oembed = new WP_oEmbed(); $this->assertArrayNotHasKey( 'bad_provider', $oembed->providers ); diff --git a/tests/phpunit/tests/option/registration.php b/tests/phpunit/tests/option/registration.php index 6b8722b2397ab..48ee025d2536d 100644 --- a/tests/phpunit/tests/option/registration.php +++ b/tests/phpunit/tests/option/registration.php @@ -114,7 +114,7 @@ public function test_add_option_with_no_options_cache() { } /** - * @expectedWPDeprecated register_setting + * @expectedDeprecated register_setting * * @covers ::register_setting */ @@ -123,7 +123,7 @@ public function test_register_deprecated_group_misc() { } /** - * @expectedWPDeprecated register_setting + * @expectedDeprecated register_setting * * @covers ::register_setting */ diff --git a/tests/phpunit/tests/post/getPageByTitle.php b/tests/phpunit/tests/post/getPageByTitle.php index 5f4b33efa472b..084453cbb0144 100644 --- a/tests/phpunit/tests/post/getPageByTitle.php +++ b/tests/phpunit/tests/post/getPageByTitle.php @@ -12,7 +12,7 @@ class Tests_Post_GetPageByTitle extends WP_UnitTestCase { * * @ticket 57041 * - * @expectedWPDeprecated get_page_by_title + * @expectedDeprecated get_page_by_title */ public function test_get_page_by_title_should_be_deprecated() { $this->assertNull( get_page_by_title( '#57041 Page' ) ); diff --git a/tests/phpunit/tests/post/getTheExcerpt.php b/tests/phpunit/tests/post/getTheExcerpt.php index e38a7c179f1cc..8dbaef5a82de1 100644 --- a/tests/phpunit/tests/post/getTheExcerpt.php +++ b/tests/phpunit/tests/post/getTheExcerpt.php @@ -16,7 +16,7 @@ public function test_the_excerpt_invalid_post() { /** * @ticket 27246 - * @expectedWPDeprecated get_the_excerpt + * @expectedDeprecated get_the_excerpt */ public function test_the_excerpt_deprecated() { $this->assertSame( '', get_the_excerpt( true ) ); diff --git a/tests/phpunit/tests/post/truncatePostSlug.php b/tests/phpunit/tests/post/truncatePostSlug.php index a6e8eb0bae996..10f8dbabef9de 100644 --- a/tests/phpunit/tests/post/truncatePostSlug.php +++ b/tests/phpunit/tests/post/truncatePostSlug.php @@ -15,7 +15,7 @@ class Tests_Post_TruncatePostSlug extends WP_UnitTestCase { * * @dataProvider data_truncate_post_slug_should_truncate * - * @expectedWPDeprecated _truncate_post_slug + * @expectedDeprecated _truncate_post_slug * * @param string $slug The slug to truncate. * @param int $length Max length of the slug. diff --git a/tests/phpunit/tests/post/types.php b/tests/phpunit/tests/post/types.php index 9eec87b4d73d1..d7486b6c5b397 100644 --- a/tests/phpunit/tests/post/types.php +++ b/tests/phpunit/tests/post/types.php @@ -63,7 +63,7 @@ public function test_register_post_type_return_value() { /** * @ticket 31134 * - * @expectedWPIncorrectUsage register_post_type + * @expectedIncorrectUsage register_post_type */ public function test_register_post_type_with_too_long_name() { // Post type too long. @@ -73,7 +73,7 @@ public function test_register_post_type_with_too_long_name() { /** * @ticket 31134 * - * @expectedWPIncorrectUsage register_post_type + * @expectedIncorrectUsage register_post_type */ public function test_register_post_type_with_empty_name() { // Post type too short. diff --git a/tests/phpunit/tests/post/wpDeletePost.php b/tests/phpunit/tests/post/wpDeletePost.php index 29b3ed641840e..3c2a40fa92bec 100644 --- a/tests/phpunit/tests/post/wpDeletePost.php +++ b/tests/phpunit/tests/post/wpDeletePost.php @@ -83,7 +83,7 @@ private function next_schedule_for_post( $hook, int $post_id ) { * @ticket 63975 */ public function test_wp_delete_post_short_circuit_on_post_id_zero() { - $this->expectWPIncorrectUsage( 'wp_delete_post' ); + $this->setExpectedIncorrectUsage( 'wp_delete_post' ); $this->assertFalse( wp_delete_post( 0, true ) ); } diff --git a/tests/phpunit/tests/privacy/wpAddPrivacyPolicyContent.php b/tests/phpunit/tests/privacy/wpAddPrivacyPolicyContent.php index a78e2815b6f8d..222e1f2b1bd91 100644 --- a/tests/phpunit/tests/privacy/wpAddPrivacyPolicyContent.php +++ b/tests/phpunit/tests/privacy/wpAddPrivacyPolicyContent.php @@ -66,7 +66,7 @@ public function tear_down() { * * @ticket 65819 * - * @expectedWPIncorrectUsage wp_add_privacy_policy_content + * @expectedIncorrectUsage wp_add_privacy_policy_content */ public function test_should_reject_content_outside_admin() { set_current_screen( 'front' ); @@ -82,7 +82,7 @@ public function test_should_reject_content_outside_admin() { * * @ticket 65819 * - * @expectedWPIncorrectUsage wp_add_privacy_policy_content + * @expectedIncorrectUsage wp_add_privacy_policy_content */ public function test_should_reject_content_before_admin_init() { wp_add_privacy_policy_content( 'My Plugin', '

Policy.

' ); diff --git a/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php b/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php index 63731284e06e4..1bfb8b9b65da5 100644 --- a/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php +++ b/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php @@ -221,7 +221,7 @@ public function test_detect_cannot_create_folder() { public function test_doing_it_wrong_for_export_data_grouped_invalid_type( $groups ) { update_post_meta( self::$export_request_id, '_export_data_grouped', $groups ); - $this->expectWPIncorrectUsage( 'wp_privacy_generate_personal_data_export_file' ); + $this->setExpectedIncorrectUsage( 'wp_privacy_generate_personal_data_export_file' ); wp_privacy_generate_personal_data_export_file( self::$export_request_id ); } @@ -318,7 +318,7 @@ public function test_can_succeed() { public function test_html_contents( $groups, array $expected_content = array() ) { // Set the _doing_it_wrong assertion. if ( ! is_array( $groups ) ) { - $this->expectWPIncorrectUsage( 'wp_privacy_generate_personal_data_export_file' ); + $this->setExpectedIncorrectUsage( 'wp_privacy_generate_personal_data_export_file' ); } $request = wp_get_user_request( self::$export_request_id ); @@ -360,7 +360,7 @@ public function test_html_contents( $groups, array $expected_content = array() ) public function test_json_contents( $groups, array $expected_content = array() ) { // Set the _doing_it_wrong assertion. if ( ! is_array( $groups ) ) { - $this->expectWPIncorrectUsage( 'wp_privacy_generate_personal_data_export_file' ); + $this->setExpectedIncorrectUsage( 'wp_privacy_generate_personal_data_export_file' ); } $request = wp_get_user_request( self::$export_request_id ); diff --git a/tests/phpunit/tests/query/conditionals.php b/tests/phpunit/tests/query/conditionals.php index 3c252f9a2d29b..b3900e54312ab 100644 --- a/tests/phpunit/tests/query/conditionals.php +++ b/tests/phpunit/tests/query/conditionals.php @@ -801,7 +801,7 @@ public function test_post_attachment() { // '[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]', /** - * @expectedWPIncorrectUsage WP_Date_Query + * @expectedIncorrectUsage WP_Date_Query */ public function test_bad_dates() { $this->go_to( '/2013/13/13/' ); @@ -1634,10 +1634,10 @@ public function test_conditional_tags_trigger_doing_it_wrong_and_return_false_if if ( 'is_comments_popup' === $function_name ) { // `is_comments_popup()` is deprecated as of WP 4.5. - $this->expectWPDeprecated( $function_name ); + $this->setExpectedDeprecated( $function_name ); } else { // All the other functions should throw a `_doing_it_wrong()` notice. - $this->expectWPIncorrectUsage( $function_name ); + $this->setExpectedIncorrectUsage( $function_name ); } $this->assertFalse( call_user_func( $function_name ) ); diff --git a/tests/phpunit/tests/query/isSitemap.php b/tests/phpunit/tests/query/isSitemap.php index 67e5ae32d101c..bcf3f2e04ca3c 100644 --- a/tests/phpunit/tests/query/isSitemap.php +++ b/tests/phpunit/tests/query/isSitemap.php @@ -200,7 +200,7 @@ public function test_global_is_sitemap_false_on_home(): void { * * @covers ::is_sitemap * - * @expectedWPIncorrectUsage is_sitemap + * @expectedIncorrectUsage is_sitemap */ public function test_global_is_sitemap_before_query_is_run(): void { $wp_query_temp = $GLOBALS['wp_query']; diff --git a/tests/phpunit/tests/query/lazyLoadCommentMeta.php b/tests/phpunit/tests/query/lazyLoadCommentMeta.php index 26c9822eaa865..420fd45b23ce3 100644 --- a/tests/phpunit/tests/query/lazyLoadCommentMeta.php +++ b/tests/phpunit/tests/query/lazyLoadCommentMeta.php @@ -27,7 +27,7 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { * * @covers ::wp_queue_comments_for_comment_meta_lazyload * - * @expectedWPDeprecated wp_queue_comments_for_comment_meta_lazyload + * @expectedDeprecated wp_queue_comments_for_comment_meta_lazyload */ public function test_wp_queue_comments_for_comment_meta_lazyload() { $filter = new MockAction(); @@ -48,7 +48,7 @@ public function test_wp_queue_comments_for_comment_meta_lazyload() { * * @covers ::wp_queue_comments_for_comment_meta_lazyload * - * @expectedWPDeprecated wp_queue_comments_for_comment_meta_lazyload + * @expectedDeprecated wp_queue_comments_for_comment_meta_lazyload */ public function test_wp_queue_comments_for_comment_meta_lazyload_new_comment() { $filter = new MockAction(); diff --git a/tests/phpunit/tests/query/randomContentRedirect.php b/tests/phpunit/tests/query/randomContentRedirect.php index 5c2ce27d26528..4f1c06c8fcea6 100644 --- a/tests/phpunit/tests/query/randomContentRedirect.php +++ b/tests/phpunit/tests/query/randomContentRedirect.php @@ -1434,7 +1434,7 @@ function ( $arg ) { $args ); - $this->expectWPIncorrectUsage( 'wp_random_content_flush_rewrite_rules_for_post' ); + $this->setExpectedIncorrectUsage( 'wp_random_content_flush_rewrite_rules_for_post' ); $flushes = new MockAction(); add_filter( 'pre_update_option_rewrite_rules', array( $flushes, 'filter' ) ); @@ -1491,7 +1491,7 @@ protected function get_nonexistent_post_id(): int { * rewrite rules for whatever post is being displayed rather than the one passed in. */ public function test_omitted_post_does_not_fall_back_to_the_global_post(): void { - $this->expectWPIncorrectUsage( 'wp_random_content_flush_rewrite_rules_for_post' ); + $this->setExpectedIncorrectUsage( 'wp_random_content_flush_rewrite_rules_for_post' ); $GLOBALS['post'] = $this->create_post_object( array( @@ -1543,7 +1543,7 @@ public function test_after_delete_post_fired_with_only_a_post_id_does_not_flush_ $post_id = $this->create_post(); wp_delete_post( $post_id, true ); - $this->expectWPIncorrectUsage( 'wp_random_content_flush_rewrite_rules_for_post' ); + $this->setExpectedIncorrectUsage( 'wp_random_content_flush_rewrite_rules_for_post' ); $flushes = new MockAction(); add_filter( 'pre_update_option_rewrite_rules', array( $flushes, 'filter' ) ); @@ -1561,7 +1561,7 @@ public function test_page_named_random_still_flushes_rewrite_rules_when_the_othe ) ); - $this->expectWPIncorrectUsage( 'wp_random_content_flush_rewrite_rules_for_post' ); + $this->setExpectedIncorrectUsage( 'wp_random_content_flush_rewrite_rules_for_post' ); $flushes = new MockAction(); add_filter( 'pre_update_option_rewrite_rules', array( $flushes, 'filter' ) ); @@ -1836,7 +1836,7 @@ public function test_is_random_is_reset_when_the_query_is_a_404(): void { * * @covers ::is_random * - * @expectedWPIncorrectUsage is_random + * @expectedIncorrectUsage is_random */ public function test_is_random_before_the_query_is_run(): void { unset( $GLOBALS['wp_query'] ); diff --git a/tests/phpunit/tests/query/results.php b/tests/phpunit/tests/query/results.php index 3337d6747eefb..f5a12b33f374d 100644 --- a/tests/phpunit/tests/query/results.php +++ b/tests/phpunit/tests/query/results.php @@ -1021,7 +1021,7 @@ public function test_query_is_date() { /** * @ticket 10935 - * @expectedWPIncorrectUsage WP_Date_Query + * @expectedIncorrectUsage WP_Date_Query */ public function test_query_is_date_with_bad_date() { $this->q->query( diff --git a/tests/phpunit/tests/rest-api.php b/tests/phpunit/tests/rest-api.php index 988d889492142..0edb306a3b102 100644 --- a/tests/phpunit/tests/rest-api.php +++ b/tests/phpunit/tests/rest-api.php @@ -239,7 +239,7 @@ public function test_route_override() { /** * Test that we reject routes without namespaces * - * @expectedWPIncorrectUsage register_rest_route + * @expectedIncorrectUsage register_rest_route */ public function test_route_reject_empty_namespace() { rest_get_server(); @@ -261,7 +261,7 @@ public function test_route_reject_empty_namespace() { /** * Test that we reject empty routes * - * @expectedWPIncorrectUsage register_rest_route + * @expectedIncorrectUsage register_rest_route */ public function test_route_reject_empty_route() { rest_get_server(); @@ -1196,7 +1196,7 @@ public function test_rest_filter_response_by_context( $schema, $data, $expected public function test_register_route_with_invalid_namespace() { rest_get_server(); - $this->expectWPIncorrectUsage( 'register_rest_route' ); + $this->setExpectedIncorrectUsage( 'register_rest_route' ); register_rest_route( '/my-namespace/v1/', @@ -1219,7 +1219,7 @@ public function test_register_route_with_invalid_namespace() { public function test_register_route_with_missing_permission_callback_top_level_route() { rest_get_server(); - $this->expectWPIncorrectUsage( 'register_rest_route' ); + $this->setExpectedIncorrectUsage( 'register_rest_route' ); $registered = register_rest_route( 'my-ns/v1', @@ -1238,7 +1238,7 @@ public function test_register_route_with_missing_permission_callback_top_level_r public function test_register_route_with_missing_permission_callback_single_wrapped_route() { rest_get_server(); - $this->expectWPIncorrectUsage( 'register_rest_route' ); + $this->setExpectedIncorrectUsage( 'register_rest_route' ); $registered = register_rest_route( 'my-ns/v1', @@ -1260,7 +1260,7 @@ public function test_register_route_with_missing_permission_callback_single_wrap public function test_register_route_with_missing_permission_callback_multiple_wrapped_route() { rest_get_server(); - $this->expectWPIncorrectUsage( 'register_rest_route' ); + $this->setExpectedIncorrectUsage( 'register_rest_route' ); $registered = register_rest_route( 'my-ns/v1', @@ -2933,7 +2933,7 @@ public function test_rest_preload_api_request_fields() { public function test_route_args_is_array_of_arrays() { rest_get_server(); - $this->expectWPIncorrectUsage( 'register_rest_route' ); + $this->setExpectedIncorrectUsage( 'register_rest_route' ); $registered = register_rest_route( 'my-ns/v1', diff --git a/tests/phpunit/tests/rest-api/rest-comments-controller.php b/tests/phpunit/tests/rest-api/rest-comments-controller.php index c2c49063d7d48..898b344842f9a 100644 --- a/tests/phpunit/tests/rest-api/rest-comments-controller.php +++ b/tests/phpunit/tests/rest-api/rest-comments-controller.php @@ -3663,7 +3663,7 @@ public function test_check_read_post_permission_with_invalid_post_type( $method $comment_id = self::factory()->comment->create( array( 'comment_post_ID' => $post_id ) ); _unregister_post_type( 'bug-post' ); - $this->expectWPIncorrectUsage( 'map_meta_cap' ); + $this->setExpectedIncorrectUsage( 'map_meta_cap' ); wp_set_current_user( self::$admin_id ); $request = new WP_REST_Request( $method, '/wp/v2/comments/' . $comment_id ); diff --git a/tests/phpunit/tests/rest-api/rest-entity-actions-controller.php b/tests/phpunit/tests/rest-api/rest-entity-actions-controller.php index 50f13a5515116..c67107147493a 100644 --- a/tests/phpunit/tests/rest-api/rest-entity-actions-controller.php +++ b/tests/phpunit/tests/rest-api/rest-entity-actions-controller.php @@ -155,7 +155,7 @@ public function test_register_routes() { */ public function test_the_route_of_a_taxonomy_with_the_same_base_is_kept() { global $wp_rest_server; - $this->expectWPIncorrectUsage( 'WP_REST_Entity_Actions_Controller::is_route_of_entity_items' ); + $this->setExpectedIncorrectUsage( 'WP_REST_Entity_Actions_Controller::is_route_of_entity_items' ); register_taxonomy( 'entity-actions', 'post', array( 'show_in_rest' => true ) ); try { diff --git a/tests/phpunit/tests/rest-api/rest-post-meta-fields.php b/tests/phpunit/tests/rest-api/rest-post-meta-fields.php index a0f1db80516b3..91251bee8c729 100644 --- a/tests/phpunit/tests/rest-api/rest-post-meta-fields.php +++ b/tests/phpunit/tests/rest-api/rest-post-meta-fields.php @@ -2353,7 +2353,7 @@ public function test_update_meta_with_unchanged_values_and_custom_authentication * @ticket 43392 */ public function test_register_meta_issues_doing_it_wrong_when_show_in_rest_is_true() { - $this->expectWPIncorrectUsage( 'register_meta' ); + $this->setExpectedIncorrectUsage( 'register_meta' ); $registered = register_meta( 'post', @@ -2371,7 +2371,7 @@ public function test_register_meta_issues_doing_it_wrong_when_show_in_rest_is_tr * @ticket 43392 */ public function test_register_meta_issues_doing_it_wrong_when_show_in_rest_omits_schema() { - $this->expectWPIncorrectUsage( 'register_meta' ); + $this->setExpectedIncorrectUsage( 'register_meta' ); $registered = register_meta( 'post', @@ -2391,7 +2391,7 @@ public function test_register_meta_issues_doing_it_wrong_when_show_in_rest_omits * @ticket 43392 */ public function test_register_meta_issues_doing_it_wrong_when_show_in_rest_omits_schema_items() { - $this->expectWPIncorrectUsage( 'register_meta' ); + $this->setExpectedIncorrectUsage( 'register_meta' ); $registered = register_meta( 'post', diff --git a/tests/phpunit/tests/rest-api/rest-posts-controller.php b/tests/phpunit/tests/rest-api/rest-posts-controller.php index dd41b663b6755..7f4f09d78b308 100644 --- a/tests/phpunit/tests/rest-api/rest-posts-controller.php +++ b/tests/phpunit/tests/rest-api/rest-posts-controller.php @@ -4922,7 +4922,7 @@ public function test_get_item_schema() { * @ticket 48401 */ public function test_get_item_schema_issues_doing_it_wrong_when_taxonomy_name_is_already_set_in_properties() { - $this->expectWPIncorrectUsage( 'register_taxonomy' ); + $this->setExpectedIncorrectUsage( 'register_taxonomy' ); // Register a taxonomy with 'status' as name. register_taxonomy( 'status', 'post', array( 'show_in_rest' => true ) ); @@ -6018,7 +6018,7 @@ public function test_rest_post_type_item_schema_filter_change_property() { */ public function test_rest_post_type_item_schema_filter_add_property_triggers_doing_it_wrong() { add_filter( 'rest_post_item_schema', array( $this, 'filter_post_item_schema_add_property' ) ); - $this->expectWPIncorrectUsage( 'WP_REST_Posts_Controller::get_item_schema' ); + $this->setExpectedIncorrectUsage( 'WP_REST_Posts_Controller::get_item_schema' ); // Re-initialize the controller to cache-bust schemas from prior test runs. $GLOBALS['wp_rest_server']->override_by_default = true; diff --git a/tests/phpunit/tests/rest-api/rest-schema-sanitization.php b/tests/phpunit/tests/rest-api/rest-schema-sanitization.php index 68bae1635e4ee..4966b691b4b20 100644 --- a/tests/phpunit/tests/rest-api/rest-schema-sanitization.php +++ b/tests/phpunit/tests/rest-api/rest-schema-sanitization.php @@ -406,7 +406,7 @@ public function test_type_object_accepts_empty_string() { } public function test_type_unknown() { - $this->expectWPIncorrectUsage( 'rest_sanitize_value_from_schema' ); + $this->setExpectedIncorrectUsage( 'rest_sanitize_value_from_schema' ); $schema = array( 'type' => 'lalala', @@ -417,7 +417,7 @@ public function test_type_unknown() { } public function test_no_type() { - $this->expectWPIncorrectUsage( 'rest_sanitize_value_from_schema' ); + $this->setExpectedIncorrectUsage( 'rest_sanitize_value_from_schema' ); $schema = array( 'type' => null, @@ -460,7 +460,7 @@ public function test_format_validation_is_applied_if_missing_type() { $this->expectNotice(); // For the undefined index. } - $this->expectWPIncorrectUsage( 'rest_sanitize_value_from_schema' ); + $this->setExpectedIncorrectUsage( 'rest_sanitize_value_from_schema' ); $schema = array( 'format' => 'hex-color' ); $this->assertSame( '#abc', rest_sanitize_value_from_schema( '#abc', $schema ) ); @@ -471,7 +471,7 @@ public function test_format_validation_is_applied_if_missing_type() { * @ticket 50189 */ public function test_format_validation_is_applied_if_unknown_type() { - $this->expectWPIncorrectUsage( 'rest_sanitize_value_from_schema' ); + $this->setExpectedIncorrectUsage( 'rest_sanitize_value_from_schema' ); $schema = array( 'format' => 'hex-color', @@ -529,8 +529,8 @@ public function test_object_or_bool() { * @ticket 50300 */ public function test_multi_type_with_no_known_types() { - $this->expectWPIncorrectUsage( 'rest_handle_multi_type_schema' ); - $this->expectWPIncorrectUsage( 'rest_sanitize_value_from_schema' ); + $this->setExpectedIncorrectUsage( 'rest_handle_multi_type_schema' ); + $this->setExpectedIncorrectUsage( 'rest_sanitize_value_from_schema' ); $schema = array( 'type' => array( 'invalid', 'type' ), @@ -543,8 +543,8 @@ public function test_multi_type_with_no_known_types() { * @ticket 50300 */ public function test_multi_type_with_some_unknown_types() { - $this->expectWPIncorrectUsage( 'rest_handle_multi_type_schema' ); - $this->expectWPIncorrectUsage( 'rest_sanitize_value_from_schema' ); + $this->setExpectedIncorrectUsage( 'rest_handle_multi_type_schema' ); + $this->setExpectedIncorrectUsage( 'rest_sanitize_value_from_schema' ); $schema = array( 'type' => array( 'object', 'type' ), diff --git a/tests/phpunit/tests/rest-api/rest-schema-validation.php b/tests/phpunit/tests/rest-api/rest-schema-validation.php index fc3994b8177f6..3c57802c764c5 100644 --- a/tests/phpunit/tests/rest-api/rest-schema-validation.php +++ b/tests/phpunit/tests/rest-api/rest-schema-validation.php @@ -160,7 +160,7 @@ public function test_format_validation_is_applied_if_missing_type() { $this->expectNotice(); // For the undefined index. } - $this->expectWPIncorrectUsage( 'rest_validate_value_from_schema' ); + $this->setExpectedIncorrectUsage( 'rest_validate_value_from_schema' ); $schema = array( 'format' => 'email' ); $this->assertTrue( rest_validate_value_from_schema( 'email@example.com', $schema ) ); @@ -171,7 +171,7 @@ public function test_format_validation_is_applied_if_missing_type() { * @ticket 50189 */ public function test_format_validation_is_applied_if_unknown_type() { - $this->expectWPIncorrectUsage( 'rest_validate_value_from_schema' ); + $this->setExpectedIncorrectUsage( 'rest_validate_value_from_schema' ); $schema = array( 'format' => 'email', @@ -990,7 +990,7 @@ public function test_type_object_allows_empty_string() { } public function test_type_unknown() { - $this->expectWPIncorrectUsage( 'rest_validate_value_from_schema' ); + $this->setExpectedIncorrectUsage( 'rest_validate_value_from_schema' ); $schema = array( 'type' => 'lalala', @@ -1108,8 +1108,8 @@ public static function data_multiply_of() { * @ticket 50300 */ public function test_multi_type_with_no_known_types() { - $this->expectWPIncorrectUsage( 'rest_handle_multi_type_schema' ); - $this->expectWPIncorrectUsage( 'rest_validate_value_from_schema' ); + $this->setExpectedIncorrectUsage( 'rest_handle_multi_type_schema' ); + $this->setExpectedIncorrectUsage( 'rest_validate_value_from_schema' ); $schema = array( 'type' => array( 'invalid', 'type' ), @@ -1122,8 +1122,8 @@ public function test_multi_type_with_no_known_types() { * @ticket 50300 */ public function test_multi_type_with_some_unknown_types() { - $this->expectWPIncorrectUsage( 'rest_handle_multi_type_schema' ); - $this->expectWPIncorrectUsage( 'rest_validate_value_from_schema' ); + $this->setExpectedIncorrectUsage( 'rest_handle_multi_type_schema' ); + $this->setExpectedIncorrectUsage( 'rest_validate_value_from_schema' ); $schema = array( 'type' => array( 'object', 'type' ), diff --git a/tests/phpunit/tests/rest-api/rest-server.php b/tests/phpunit/tests/rest-api/rest-server.php index e79c3d45b1b8e..b822e3289b822 100644 --- a/tests/phpunit/tests/rest-api/rest-server.php +++ b/tests/phpunit/tests/rest-api/rest-server.php @@ -1589,7 +1589,7 @@ public function test_x_robot_tag_header_on_requests() { /** * @ticket 38446 - * @expectedWPDeprecated rest_enabled + * @expectedDeprecated rest_enabled */ public function test_rest_enable_filter_is_deprecated() { add_filter( 'rest_enabled', '__return_false' ); diff --git a/tests/phpunit/tests/rest-api/rest-settings-controller.php b/tests/phpunit/tests/rest-api/rest-settings-controller.php index a39271d85114d..0b061c8624362 100644 --- a/tests/phpunit/tests/rest-api/rest-settings-controller.php +++ b/tests/phpunit/tests/rest-api/rest-settings-controller.php @@ -810,7 +810,7 @@ public function test_get_item_schema() { * @ticket 42875 */ public function test_register_setting_issues_doing_it_wrong_when_show_in_rest_is_true() { - $this->expectWPIncorrectUsage( 'register_setting' ); + $this->setExpectedIncorrectUsage( 'register_setting' ); register_setting( 'somegroup', @@ -826,7 +826,7 @@ public function test_register_setting_issues_doing_it_wrong_when_show_in_rest_is * @ticket 42875 */ public function test_register_setting_issues_doing_it_wrong_when_show_in_rest_omits_schema() { - $this->expectWPIncorrectUsage( 'register_setting' ); + $this->setExpectedIncorrectUsage( 'register_setting' ); register_setting( 'somegroup', @@ -844,7 +844,7 @@ public function test_register_setting_issues_doing_it_wrong_when_show_in_rest_om * @ticket 42875 */ public function test_register_setting_issues_doing_it_wrong_when_show_in_rest_omits_schema_items() { - $this->expectWPIncorrectUsage( 'register_setting' ); + $this->setExpectedIncorrectUsage( 'register_setting' ); register_setting( 'somegroup', diff --git a/tests/phpunit/tests/rest-api/rest-users-controller.php b/tests/phpunit/tests/rest-api/rest-users-controller.php index f3158a31aa787..331c0fa6394d4 100644 --- a/tests/phpunit/tests/rest-api/rest-users-controller.php +++ b/tests/phpunit/tests/rest-api/rest-users-controller.php @@ -1045,7 +1045,7 @@ public function test_get_items_invalid_capabilities() { } /** - * @expectedWPDeprecated WP_User_Query + * @expectedDeprecated WP_User_Query */ public function test_get_items_who_author_query() { wp_set_current_user( self::$superadmin ); diff --git a/tests/phpunit/tests/script-modules/wpScriptModules.php b/tests/phpunit/tests/script-modules/wpScriptModules.php index 263f3f3b945e1..c2d30c2a94346 100644 --- a/tests/phpunit/tests/script-modules/wpScriptModules.php +++ b/tests/phpunit/tests/script-modules/wpScriptModules.php @@ -155,7 +155,7 @@ public function test_wp_script_modules() { * * @ticket 63486 * - * @expectedWPIncorrectUsage WP_Script_Modules::register + * @expectedIncorrectUsage WP_Script_Modules::register * * @covers ::wp_register_script_module * @covers WP_Script_Modules::register @@ -170,7 +170,7 @@ public function test_register_with_empty_id() { * * @ticket 63486 * - * @expectedWPIncorrectUsage WP_Script_Modules::enqueue + * @expectedIncorrectUsage WP_Script_Modules::enqueue * * @covers ::wp_enqueue_script_module * @covers WP_Script_Modules::enqueue @@ -1508,7 +1508,7 @@ public function test_in_footer_methods() { * @ticket 61734 * * @covers WP_Script_Modules::register - * @expectedWPIncorrectUsage WP_Script_Modules::register + * @expectedIncorrectUsage WP_Script_Modules::register */ public function test_register_script_module_having_fetchpriority_with_invalid_value() { $this->script_modules->register( 'foo', '/foo.js', array(), false, array( 'fetchpriority' => 'silly' ) ); @@ -1524,7 +1524,7 @@ public function test_register_script_module_having_fetchpriority_with_invalid_va * @ticket 61734 * * @covers WP_Script_Modules::register - * @expectedWPIncorrectUsage WP_Script_Modules::register + * @expectedIncorrectUsage WP_Script_Modules::register */ public function test_register_script_module_having_fetchpriority_with_invalid_value_type() { $this->script_modules->register( 'foo', '/foo.js', array(), false, array( 'fetchpriority' => array( 'WHY AM I NOT A STRING???' ) ) ); @@ -1541,7 +1541,7 @@ public function test_register_script_module_having_fetchpriority_with_invalid_va * * @covers WP_Script_Modules::register * @covers WP_Script_Modules::set_fetchpriority - * @expectedWPIncorrectUsage WP_Script_Modules::set_fetchpriority + * @expectedIncorrectUsage WP_Script_Modules::set_fetchpriority */ public function test_set_fetchpriority_with_invalid_value() { $this->script_modules->register( 'foo', '/foo.js' ); @@ -2196,7 +2196,7 @@ public function test_import_map_includes_dependencies_of_classic_scripts_recursi */ public function test_wp_scripts_doing_it_wrong_for_missing_script_module_dependencies() { $expected_incorrect_usage = 'WP_Scripts::add_data'; - $this->expectWPIncorrectUsage( $expected_incorrect_usage ); + $this->setExpectedIncorrectUsage( $expected_incorrect_usage ); wp_enqueue_script( 'registered-dep', @@ -2616,7 +2616,7 @@ public function test_static_import_dependency_with_dynamic_imports_depending_on_ */ public function test_missing_script_module_dependency_triggers_incorrect_usage() { $expected_incorrect_usage = 'WP_Script_Modules::register'; - $this->expectWPIncorrectUsage( $expected_incorrect_usage ); + $this->setExpectedIncorrectUsage( $expected_incorrect_usage ); $this->script_modules->enqueue( 'main-module', '/main-module.js', array( 'missing-mod-dep' ) ); diff --git a/tests/phpunit/tests/secrets/networkScope.php b/tests/phpunit/tests/secrets/networkScope.php index 00b6d7ce9a597..2f9764473948b 100644 --- a/tests/phpunit/tests/secrets/networkScope.php +++ b/tests/phpunit/tests/secrets/networkScope.php @@ -169,7 +169,7 @@ public function test_list_returns_network_secrets_only(): void { * @covers ::_wp_secrets_get */ public function test_an_invalid_version_is_a_wp_error_same_as_site_scope(): void { - $this->expectWPIncorrectUsage( '_wp_secrets_get' ); + $this->setExpectedIncorrectUsage( '_wp_secrets_get' ); $result = wp_get_network_secret( 'myplugin/api-key', 'not-a-real-version' ); // @phpstan-ignore argument.type (Intentionally passing an invalid value.) diff --git a/tests/phpunit/tests/secrets/wpSecretsCipher.php b/tests/phpunit/tests/secrets/wpSecretsCipher.php index c56844d3e2620..fc2a4ea9d693c 100644 --- a/tests/phpunit/tests/secrets/wpSecretsCipher.php +++ b/tests/phpunit/tests/secrets/wpSecretsCipher.php @@ -153,7 +153,7 @@ public function test_encrypt_propagates_an_invalid_name(): void { public function test_encrypt_reports_an_invalid_scope_as_a_wp_error(): void { $cipher = new WP_Secrets_Cipher(); - $this->expectWPIncorrectUsage( 'WP_Secrets_Cipher::encrypt_value()/decrypt_value()' ); + $this->setExpectedIncorrectUsage( 'WP_Secrets_Cipher::encrypt_value()/decrypt_value()' ); $result = $cipher->encrypt_value( $this->master_key(), 'bogus-scope', 1, self::NAME, WP_Secret_Version::CURRENT, 'value' ); // @phpstan-ignore argument.type (Intentionally passing an invalid value.) @@ -169,7 +169,7 @@ public function test_encrypt_reports_an_invalid_scope_as_a_wp_error(): void { public function test_encrypt_reports_a_negative_site_id_as_a_wp_error(): void { $cipher = new WP_Secrets_Cipher(); - $this->expectWPIncorrectUsage( 'WP_Secrets_Cipher::encrypt_value()/decrypt_value()' ); + $this->setExpectedIncorrectUsage( 'WP_Secrets_Cipher::encrypt_value()/decrypt_value()' ); $result = $cipher->encrypt_value( $this->master_key(), 'site', -1, self::NAME, WP_Secret_Version::CURRENT, 'value' ); @@ -185,7 +185,7 @@ public function test_encrypt_reports_a_negative_site_id_as_a_wp_error(): void { public function test_encrypt_reports_an_invalid_slot_as_a_wp_error(): void { $cipher = new WP_Secrets_Cipher(); - $this->expectWPIncorrectUsage( 'WP_Secrets_Cipher::encrypt_value()/decrypt_value()' ); + $this->setExpectedIncorrectUsage( 'WP_Secrets_Cipher::encrypt_value()/decrypt_value()' ); $result = $cipher->encrypt_value( $this->master_key(), 'site', 1, self::NAME, 'not-a-real-slot', 'value' ); // @phpstan-ignore argument.type (Intentionally passing an invalid value.) diff --git a/tests/phpunit/tests/secrets/wpSecretsKeyManager.php b/tests/phpunit/tests/secrets/wpSecretsKeyManager.php index eaa3401eb76c1..93b76ec9e52b2 100644 --- a/tests/phpunit/tests/secrets/wpSecretsKeyManager.php +++ b/tests/phpunit/tests/secrets/wpSecretsKeyManager.php @@ -150,7 +150,7 @@ public function test_get_master_key_defaults_site_id_to_the_current_blog(): void public function test_get_master_key_reports_an_invalid_scope_as_a_wp_error(): void { $manager = new WP_Secrets_Key_Manager(); - $this->expectWPIncorrectUsage( 'WP_Secrets_Key_Manager::get_master_key' ); + $this->setExpectedIncorrectUsage( 'WP_Secrets_Key_Manager::get_master_key' ); $result = $manager->get_master_key( 'bogus' ); // @phpstan-ignore argument.type (Intentionally passing an invalid value.) @@ -170,7 +170,7 @@ public function test_get_master_key_reports_an_invalid_scope_as_a_wp_error(): vo public function test_get_master_key_reports_an_invalid_site_id_as_a_wp_error( $site_id ): void { $manager = new WP_Secrets_Key_Manager(); - $this->expectWPIncorrectUsage( 'WP_Secrets_Key_Manager::get_master_key' ); + $this->setExpectedIncorrectUsage( 'WP_Secrets_Key_Manager::get_master_key' ); $result = $manager->get_master_key( 'site', $site_id ); diff --git a/tests/phpunit/tests/secrets/wpSecretsValidateName.php b/tests/phpunit/tests/secrets/wpSecretsValidateName.php index c3d9780e7b482..6daba01028b93 100644 --- a/tests/phpunit/tests/secrets/wpSecretsValidateName.php +++ b/tests/phpunit/tests/secrets/wpSecretsValidateName.php @@ -90,7 +90,7 @@ public static function data_rejects_invalid_names(): array { * @param string $name An unnamespaced name that must be accepted. */ public function test_accepts_an_unnamespaced_name_but_reports_it( $name ): void { - $this->expectWPIncorrectUsage( 'wp_secrets_validate_name' ); + $this->setExpectedIncorrectUsage( 'wp_secrets_validate_name' ); $this->assertTrue( wp_secrets_validate_name( $name ), 'An unnamespaced name should be accepted.' ); } diff --git a/tests/phpunit/tests/secrets/wpSetSecretAndWpGetSecret.php b/tests/phpunit/tests/secrets/wpSetSecretAndWpGetSecret.php index cce9ddeeb94e8..2c441dae96e65 100644 --- a/tests/phpunit/tests/secrets/wpSetSecretAndWpGetSecret.php +++ b/tests/phpunit/tests/secrets/wpSetSecretAndWpGetSecret.php @@ -52,7 +52,7 @@ public function test_get_defaults_to_the_current_version(): void { * @covers ::wp_get_secret */ public function test_an_invalid_version_is_a_wp_error_not_an_exception(): void { - $this->expectWPIncorrectUsage( '_wp_secrets_get' ); + $this->setExpectedIncorrectUsage( '_wp_secrets_get' ); $result = wp_get_secret( 'myplugin/api-key', 'not-a-real-version' ); // @phpstan-ignore argument.type (Intentionally passing an invalid value.) diff --git a/tests/phpunit/tests/shortcode.php b/tests/phpunit/tests/shortcode.php index 67cdfd6c4a115..a744ec50286cf 100644 --- a/tests/phpunit/tests/shortcode.php +++ b/tests/phpunit/tests/shortcode.php @@ -675,7 +675,7 @@ public function test_has_shortcode() { * Make sure invalid shortcode names are not allowed. * * @dataProvider data_registration_bad - * @expectedWPIncorrectUsage add_shortcode + * @expectedIncorrectUsage add_shortcode */ public function test_registration_bad( $input, $expected ) { $this->sub_registration( $input, $expected ); diff --git a/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php b/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php index a19de21bb51b3..e778c73ca9401 100644 --- a/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php +++ b/tests/phpunit/tests/sitemaps/wpSitemapsRenderer.php @@ -91,7 +91,7 @@ public function test_get_sitemap_index_xml_with_lastmod() { * Note that when a means of adding elements in extension namespaces is settled on, * this test will need to be updated accordingly. * - * @expectedWPIncorrectUsage WP_Sitemaps_Renderer::get_sitemap_index_xml + * @expectedIncorrectUsage WP_Sitemaps_Renderer::get_sitemap_index_xml */ public function test_get_sitemap_index_xml_extra_elements() { $url_list = array( @@ -162,7 +162,7 @@ public function test_get_sitemap_xml() { * Note that when a means of adding elements in extension namespaces is settled on, * this test will need to be updated accordingly. * - * @expectedWPIncorrectUsage WP_Sitemaps_Renderer::get_sitemap_xml + * @expectedIncorrectUsage WP_Sitemaps_Renderer::get_sitemap_xml */ public function test_get_sitemap_xml_extra_elements() { $url_list = array( @@ -197,7 +197,7 @@ public function test_get_sitemap_xml_extra_elements() { * @covers WP_Sitemaps_Renderer::get_sitemap_xml */ public function test_get_sitemap_stylesheet_url_filter() { - $this->expectWPDeprecated( 'wp_sitemaps_stylesheet_url' ); + $this->setExpectedDeprecated( 'wp_sitemaps_stylesheet_url' ); $custom_url = 'https://example.com/custom-sitemap.xsl'; @@ -225,7 +225,7 @@ static function () use ( $custom_url ) { * @covers WP_Sitemaps_Renderer::get_sitemap_index_xml */ public function test_get_sitemap_index_stylesheet_url_filter() { - $this->expectWPDeprecated( 'wp_sitemaps_stylesheet_index_url' ); + $this->setExpectedDeprecated( 'wp_sitemaps_stylesheet_index_url' ); $custom_url = 'https://example.com/custom-sitemap-index.xsl'; @@ -261,7 +261,7 @@ static function () use ( $custom_url ) { * @param string $method Renderer method that generates the XML. */ public function test_deprecated_stylesheet_filters( string $hook_name, string $method ): void { - $this->expectWPDeprecated( $hook_name ); + $this->setExpectedDeprecated( $hook_name ); add_filter( $hook_name, '__return_empty_string' ); @@ -285,8 +285,8 @@ public function test_deprecated_stylesheet_filters( string $hook_name, string $m * @covers WP_Sitemaps_Renderer::get_sitemap_stylesheet_url * @covers WP_Sitemaps_Renderer::get_sitemap_index_stylesheet_url * - * @expectedWPDeprecated WP_Sitemaps_Renderer::get_sitemap_stylesheet_url - * @expectedWPDeprecated WP_Sitemaps_Renderer::get_sitemap_index_stylesheet_url + * @expectedDeprecated WP_Sitemaps_Renderer::get_sitemap_stylesheet_url + * @expectedDeprecated WP_Sitemaps_Renderer::get_sitemap_index_stylesheet_url */ public function test_stylesheet_url_methods_are_deprecated(): void { $sitemap_renderer = new WP_Sitemaps_Renderer(); diff --git a/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php b/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php index bb3773bda7324..9e341a097d003 100644 --- a/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php +++ b/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php @@ -17,7 +17,7 @@ class Tests_Sitemaps_wpSitemapsStylesheet extends WP_UnitTestCase { * @param string $method Deprecated method name. */ public function test_deprecated_methods( string $method ): void { - $this->expectWPDeprecated( "WP_Sitemaps_Stylesheet::$method" ); + $this->setExpectedDeprecated( "WP_Sitemaps_Stylesheet::$method" ); $stylesheet = new WP_Sitemaps_Stylesheet(); diff --git a/tests/phpunit/tests/speculative-loading/wpSpeculationRules.php b/tests/phpunit/tests/speculative-loading/wpSpeculationRules.php index 37a087f12ee08..9a59583f3f20c 100644 --- a/tests/phpunit/tests/speculative-loading/wpSpeculationRules.php +++ b/tests/phpunit/tests/speculative-loading/wpSpeculationRules.php @@ -23,7 +23,7 @@ public function test_add_rule( string $mode, string $id, array $rule, bool $expe $speculation_rules = new WP_Speculation_Rules(); if ( ! $expected ) { - $this->expectWPIncorrectUsage( 'WP_Speculation_Rules::add_rule' ); + $this->setExpectedIncorrectUsage( 'WP_Speculation_Rules::add_rule' ); } $result = $speculation_rules->add_rule( $mode, $id, $rule ); @@ -49,7 +49,7 @@ public function test_add_rule_with_duplicate() { $this->assertTrue( $speculation_rules->add_rule( 'prefetch', 'my-custom-rule', array( 'where' => array( 'href_matches' => '/*' ) ) ) ); // But it should not be possible to add a rule of the same ID to a mode where it's already present. - $this->expectWPIncorrectUsage( 'WP_Speculation_Rules::add_rule' ); + $this->setExpectedIncorrectUsage( 'WP_Speculation_Rules::add_rule' ); $this->assertFalse( $speculation_rules->add_rule( 'prerender', 'my-custom-rule', array( 'urls' => array( 'https://important-url.com/' ) ) ) ); } diff --git a/tests/phpunit/tests/taxonomy.php b/tests/phpunit/tests/taxonomy.php index 6e5c29454543f..3162252598c53 100644 --- a/tests/phpunit/tests/taxonomy.php +++ b/tests/phpunit/tests/taxonomy.php @@ -233,7 +233,7 @@ public function test_register_taxonomy_return_value() { /** * @ticket 21593 * - * @expectedWPIncorrectUsage register_taxonomy + * @expectedIncorrectUsage register_taxonomy */ public function test_register_taxonomy_with_too_long_name() { $this->assertWPError( register_taxonomy( 'abcdefghijklmnopqrstuvwxyz0123456789', 'post', array() ) ); @@ -242,7 +242,7 @@ public function test_register_taxonomy_with_too_long_name() { /** * @ticket 31135 * - * @expectedWPIncorrectUsage register_taxonomy + * @expectedIncorrectUsage register_taxonomy */ public function test_register_taxonomy_with_empty_name() { $this->assertWPError( register_taxonomy( '', 'post', array() ) ); diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php index a49109d7bed5d..3fbb9dd2ae2f5 100644 --- a/tests/phpunit/tests/theme.php +++ b/tests/phpunit/tests/theme.php @@ -85,8 +85,8 @@ public function test_wp_get_themes_default() { } /** - * @expectedWPDeprecated get_theme - * @expectedWPDeprecated get_themes + * @expectedDeprecated get_theme + * @expectedDeprecated get_themes */ public function test_get_themes_default() { $themes = get_themes(); @@ -99,8 +99,8 @@ public function test_get_themes_default() { } /** - * @expectedWPDeprecated get_theme - * @expectedWPDeprecated get_themes + * @expectedDeprecated get_theme + * @expectedDeprecated get_themes */ public function test_get_theme() { $themes = get_themes(); @@ -134,7 +134,7 @@ public function test_wp_get_theme() { } /** - * @expectedWPDeprecated get_themes + * @expectedDeprecated get_themes */ public function test_get_themes_contents() { $themes = get_themes(); @@ -423,7 +423,7 @@ public function test_version_consistency_in_package_json( string $theme ) { /** * @ticket 20897 - * @expectedWPDeprecated get_theme_data + * @expectedDeprecated get_theme_data */ public function test_extra_theme_headers() { $wp_theme = wp_get_theme( $this->theme_slug ); @@ -442,8 +442,8 @@ public function theme_data_extra_headers() { } /** - * @expectedWPDeprecated get_themes - * @expectedWPDeprecated get_current_theme + * @expectedDeprecated get_themes + * @expectedDeprecated get_current_theme */ public function test_switch_theme() { $themes = get_themes(); diff --git a/tests/phpunit/tests/theme/support.php b/tests/phpunit/tests/theme/support.php index 4bce69b4de68a..0e7af3b1ab0b2 100644 --- a/tests/phpunit/tests/theme/support.php +++ b/tests/phpunit/tests/theme/support.php @@ -121,7 +121,7 @@ public function test_post_thumbnails_mixed_args() { /** * @ticket 24932 * - * @expectedWPIncorrectUsage add_theme_support( 'html5' ) + * @expectedIncorrectUsage add_theme_support( 'html5' ) */ public function test_supports_html5() { remove_theme_support( 'html5' ); @@ -143,7 +143,7 @@ public function test_supports_html5() { /** * @ticket 24932 * - * @expectedWPIncorrectUsage add_theme_support( 'html5' ) + * @expectedIncorrectUsage add_theme_support( 'html5' ) */ public function test_supports_html5_subset() { remove_theme_support( 'html5' ); @@ -176,7 +176,7 @@ public function test_supports_html5_subset() { /** * @ticket 24932 * - * @expectedWPIncorrectUsage add_theme_support( 'html5' ) + * @expectedIncorrectUsage add_theme_support( 'html5' ) */ public function test_supports_html5_invalid() { remove_theme_support( 'html5' ); @@ -188,7 +188,7 @@ public function test_supports_html5_invalid() { /** * @ticket 51390 * - * @expectedWPIncorrectUsage add_theme_support( 'post-formats' ) + * @expectedIncorrectUsage add_theme_support( 'post-formats' ) */ public function test_supports_post_formats_doing_it_wrong() { // The second parameter should be an array. diff --git a/tests/phpunit/tests/theme/themeDir.php b/tests/phpunit/tests/theme/themeDir.php index dddb2a2a52aff..5a57d154be1b5 100644 --- a/tests/phpunit/tests/theme/themeDir.php +++ b/tests/phpunit/tests/theme/themeDir.php @@ -50,8 +50,8 @@ public function filter_theme_root( $dir ) { } /** - * @expectedWPDeprecated get_theme - * @expectedWPDeprecated get_themes + * @expectedDeprecated get_theme + * @expectedDeprecated get_themes */ public function test_theme_default() { $themes = get_themes(); @@ -81,8 +81,8 @@ public function test_theme_default() { } /** - * @expectedWPDeprecated get_theme - * @expectedWPDeprecated get_themes + * @expectedDeprecated get_theme + * @expectedDeprecated get_themes */ public function test_theme_sandbox() { $theme = get_theme( 'Sandbox' ); @@ -117,7 +117,7 @@ public function test_theme_sandbox() { /** * A CSS-only theme * - * @expectedWPDeprecated get_themes + * @expectedDeprecated get_themes */ public function test_theme_stylesheet_only() { $themes = get_themes(); @@ -146,7 +146,7 @@ public function test_theme_stylesheet_only() { } /** - * @expectedWPDeprecated get_themes + * @expectedDeprecated get_themes */ public function test_theme_list() { $themes = get_themes(); @@ -199,8 +199,8 @@ public function test_theme_list() { } /** - * @expectedWPDeprecated get_themes - * @expectedWPDeprecated get_broken_themes + * @expectedDeprecated get_themes + * @expectedDeprecated get_broken_themes */ public function test_broken_themes() { $themes = get_themes(); @@ -227,7 +227,7 @@ public function test_wp_get_theme_with_non_default_theme_root() { } /** - * @expectedWPDeprecated get_themes + * @expectedDeprecated get_themes */ public function test_page_templates() { $themes = get_themes(); @@ -240,7 +240,7 @@ public function test_page_templates() { } /** - * @expectedWPDeprecated get_theme_data + * @expectedDeprecated get_theme_data */ public function test_get_theme_data_top_level() { $theme_data = get_theme_data( DIR_TESTDATA . '/themedir1/theme1/style.css' ); @@ -259,7 +259,7 @@ public function test_get_theme_data_top_level() { } /** - * @expectedWPDeprecated get_theme_data + * @expectedDeprecated get_theme_data */ public function test_get_theme_data_subdir() { $theme_data = get_theme_data( self::THEME_ROOT . '/subdir/theme2/style.css' ); diff --git a/tests/phpunit/tests/theme/wpThemeJson.php b/tests/phpunit/tests/theme/wpThemeJson.php index 119eeb536d5a0..12feba3b3ab4f 100644 --- a/tests/phpunit/tests/theme/wpThemeJson.php +++ b/tests/phpunit/tests/theme/wpThemeJson.php @@ -6179,7 +6179,7 @@ public static function data_get_property_value_should_return_string_for_invalid_ * @ticket 60936 * @ticket 61165 * @ticket 61704 - * @expectedWPIncorrectUsage get_property_value + * @expectedIncorrectUsage get_property_value */ public function test_get_property_value_loop() { $theme_json = new WP_Theme_JSON( @@ -6216,7 +6216,7 @@ public function test_get_property_value_loop() { * @ticket 60936 * @ticket 61165 * @ticket 61704 - * @expectedWPIncorrectUsage get_property_value + * @expectedIncorrectUsage get_property_value */ public function test_get_property_value_recursion() { $theme_json = new WP_Theme_JSON( @@ -6252,7 +6252,7 @@ public function test_get_property_value_recursion() { * @ticket 60936 * @ticket 61165 * @ticket 61704 - * @expectedWPIncorrectUsage get_property_value + * @expectedIncorrectUsage get_property_value */ public function test_get_property_value_self() { $theme_json = new WP_Theme_JSON( diff --git a/tests/phpunit/tests/user.php b/tests/phpunit/tests/user.php index 477ebb78a053c..c87e852012f1f 100644 --- a/tests/phpunit/tests/user.php +++ b/tests/phpunit/tests/user.php @@ -280,7 +280,7 @@ public function test_user_unset() { * Test 'id' (lowercase). * * @depends test_user_unset - * @expectedWPDeprecated WP_User->id + * @expectedDeprecated WP_User->id * @ticket 20043 */ public function test_user_unset_lowercase_id( $user ) { @@ -316,7 +316,7 @@ public function test_user_meta_properties() { } /** - * @expectedWPDeprecated WP_User->id + * @expectedDeprecated WP_User->id */ public function test_id_property_back_compat() { $user = new WP_User( self::$author_id ); @@ -1809,7 +1809,7 @@ public static function data_wp_new_user_notifications() { * function signature `wp_new_user_notification( $user, 'plaintext_password' );`. * * @ticket 33654 - * @expectedWPDeprecated wp_new_user_notification + * @expectedDeprecated wp_new_user_notification */ public function test_wp_new_user_notification_old_signature_throws_deprecated_warning_but_sends() { reset_phpmailer_instance(); @@ -2729,7 +2729,7 @@ public function test_filter_wp_privacy_additional_user_profile_data() { // _doing_it_wrong() should be called because the filter callback // adds a item with a 'name' that is the same as one generated by core. - $this->expectWPIncorrectUsage( 'wp_user_personal_data_exporter' ); + $this->setExpectedIncorrectUsage( 'wp_user_personal_data_exporter' ); add_filter( 'wp_privacy_additional_user_profile_data', array( $this, 'export_additional_user_profile_data_with_dup_name' ) ); $actual = wp_user_personal_data_exporter( $test_user->user_email ); diff --git a/tests/phpunit/tests/user/capabilities.php b/tests/phpunit/tests/user/capabilities.php index 2196f9dd884cf..b41d7c2aaaeb6 100644 --- a/tests/phpunit/tests/user/capabilities.php +++ b/tests/phpunit/tests/user/capabilities.php @@ -1629,7 +1629,7 @@ public function test_taxonomy_meta_capabilities_with_non_existent_terms() { $editor = self::$users['editor']; - $this->expectWPIncorrectUsage( 'map_meta_cap' ); + $this->setExpectedIncorrectUsage( 'map_meta_cap' ); foreach ( $caps as $cap ) { // `null` represents a non-existent term ID. $this->assertFalse( user_can( $editor->ID, $cap, null ) ); @@ -1993,7 +1993,7 @@ public function test_multisite_administrator_with_manage_network_users_can_not_e /** * @ticket 16956 - * @expectedWPIncorrectUsage map_meta_cap + * @expectedIncorrectUsage map_meta_cap */ public function test_require_edit_others_posts_if_post_type_doesnt_exist() { register_post_type( 'existed' ); @@ -2016,7 +2016,7 @@ public function test_require_edit_others_posts_if_post_type_doesnt_exist() { /** * @ticket 48653 - * @expectedWPIncorrectUsage map_meta_cap + * @expectedIncorrectUsage map_meta_cap */ public function test_require_edit_others_posts_if_post_status_doesnt_exist() { register_post_status( 'existed' ); @@ -2149,7 +2149,7 @@ public function _hook_wp_roles_init( $wp_roles ) { /** * @ticket 23016 - * @expectedWPDeprecated WP_Roles::reinit + * @expectedDeprecated WP_Roles::reinit */ public function test_wp_roles_reinit_deprecated() { $wp_roles = new WP_Roles(); diff --git a/tests/phpunit/tests/user/mapMetaCap.php b/tests/phpunit/tests/user/mapMetaCap.php index c7db4a84b0213..b969a5d8f4f58 100644 --- a/tests/phpunit/tests/user/mapMetaCap.php +++ b/tests/phpunit/tests/user/mapMetaCap.php @@ -403,7 +403,7 @@ public function test_only_users_who_can_manage_options_can_delete_page_for_posts */ public function test_meta_caps_throw_doing_it_wrong_without_required_argument_provided( $cap ) { $admin_user = self::$user_id; - $this->expectWPIncorrectUsage( 'map_meta_cap' ); + $this->setExpectedIncorrectUsage( 'map_meta_cap' ); $this->assertContains( 'do_not_allow', map_meta_cap( $cap, $admin_user ) ); } diff --git a/tests/phpunit/tests/user/multisite.php b/tests/phpunit/tests/user/multisite.php index 6a3fbd7fc495c..dfd1ba4d5c30f 100644 --- a/tests/phpunit/tests/user/multisite.php +++ b/tests/phpunit/tests/user/multisite.php @@ -95,7 +95,7 @@ public function test_get_blogs_of_user() { } /** - * @expectedWPDeprecated is_blog_user + * @expectedDeprecated is_blog_user */ public function test_is_blog_user() { global $wpdb; diff --git a/tests/phpunit/tests/user/query.php b/tests/phpunit/tests/user/query.php index e8dbabea8765d..ee73f1a2cb943 100644 --- a/tests/phpunit/tests/user/query.php +++ b/tests/phpunit/tests/user/query.php @@ -744,7 +744,7 @@ public function test_roles_and_caps_should_be_populated_for_explicit_value_of_di /** * @ticket 32019 * @group ms-required - * @expectedWPDeprecated WP_User_Query + * @expectedDeprecated WP_User_Query */ public function test_who_authors() { $b = self::factory()->blog->create(); @@ -770,7 +770,7 @@ public function test_who_authors() { /** * @ticket 32019 * @group ms-required - * @expectedWPDeprecated WP_User_Query + * @expectedDeprecated WP_User_Query */ public function test_who_authors_should_work_alongside_meta_query() { $b = self::factory()->blog->create(); @@ -805,7 +805,7 @@ public function test_who_authors_should_work_alongside_meta_query() { /** * @ticket 36724 * @group ms-required - * @expectedWPDeprecated WP_User_Query + * @expectedDeprecated WP_User_Query */ public function test_who_authors_should_work_alongside_meta_params() { $b = self::factory()->blog->create(); diff --git a/tests/phpunit/tests/user/queryCache.php b/tests/phpunit/tests/user/queryCache.php index 960c75d3936ba..988181f71f00d 100644 --- a/tests/phpunit/tests/user/queryCache.php +++ b/tests/phpunit/tests/user/queryCache.php @@ -131,7 +131,7 @@ public function test_query_cache_results() { /** * @ticket 40613 * @covers ::query - * @expectedWPDeprecated WP_User_Query + * @expectedDeprecated WP_User_Query */ public function test_query_cache_who() { $args = array( @@ -788,7 +788,7 @@ public function test_generate_cache_key_placeholder() { * @ticket 59011 * @covers ::generate_cache_key * - * @expectedWPDeprecated WP_User_Query + * @expectedDeprecated WP_User_Query */ public function test_generate_cache_key_with_orderby_post_count_and_deprecated_who_parameter() { $query = new WP_User_Query( diff --git a/tests/phpunit/tests/user/theAuthor.php b/tests/phpunit/tests/user/theAuthor.php index c0d69ceb1e410..a3e1e3738cb1b 100644 --- a/tests/phpunit/tests/user/theAuthor.php +++ b/tests/phpunit/tests/user/theAuthor.php @@ -74,7 +74,7 @@ public function test_outputs_and_returns_author_display_name() { * * @ticket 65819 * - * @expectedWPDeprecated the_author + * @expectedDeprecated the_author */ public function test_triggers_deprecated_argument_for_first_parameter() { $output = get_echo( 'the_author', array( 'deprecated_value' ) ); @@ -88,7 +88,7 @@ public function test_triggers_deprecated_argument_for_first_parameter() { * * @ticket 65819 * - * @expectedWPDeprecated the_author + * @expectedDeprecated the_author */ public function test_returns_without_echoing_when_deprecated_echo_is_false() { ob_start(); diff --git a/tests/phpunit/tests/user/theAuthorPostsLink.php b/tests/phpunit/tests/user/theAuthorPostsLink.php index 04bec9ad78bc7..2f8d4bb6746b9 100644 --- a/tests/phpunit/tests/user/theAuthorPostsLink.php +++ b/tests/phpunit/tests/user/theAuthorPostsLink.php @@ -97,7 +97,7 @@ public function test_outputs_empty_string_when_authordata_is_not_set() { * Tests that passing a deprecated argument triggers a deprecation notice. * * @ticket 65819 - * @expectedWPDeprecated the_author_posts_link + * @expectedDeprecated the_author_posts_link */ public function test_deprecated_argument() { get_echo( 'the_author_posts_link', array( 'deprecated' ) ); diff --git a/tests/phpunit/tests/view-config-data.php b/tests/phpunit/tests/view-config-data.php index 7819e95a4b25f..68940ad6c2d5c 100644 --- a/tests/phpunit/tests/view-config-data.php +++ b/tests/phpunit/tests/view-config-data.php @@ -149,7 +149,7 @@ public function test_set_null_unsets_key() { * @covers ::set */ public function test_set_rejects_unknown_key() { - $this->expectWPIncorrectUsage( 'WP_View_Config_Data::set' ); + $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::set' ); $data = new WP_View_Config_Data( array( 'default_view' => array( 'type' => 'table' ) ) ); $before = self::read_config( $data ); @@ -165,7 +165,7 @@ public function test_set_rejects_unknown_key() { * @covers ::set */ public function test_set_rejects_updates_with_invalid_version() { - $this->expectWPIncorrectUsage( 'WP_View_Config_Data::set' ); + $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::set' ); $data = new WP_View_Config_Data( array( 'default_view' => array( 'type' => 'table' ) ) ); $before = self::read_config( $data ); @@ -446,7 +446,7 @@ public function test_replace_scalar_properties() { * @covers ::replace */ public function test_replace_rejects_unknown_key() { - $this->expectWPIncorrectUsage( 'WP_View_Config_Data::replace' ); + $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::replace' ); $data = new WP_View_Config_Data( array( 'default_view' => array( 'type' => 'table' ) ) ); $before = self::read_config( $data ); @@ -462,7 +462,7 @@ public function test_replace_rejects_unknown_key() { * @covers ::replace */ public function test_replace_rejects_updates_with_invalid_version() { - $this->expectWPIncorrectUsage( 'WP_View_Config_Data::replace' ); + $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::replace' ); $data = new WP_View_Config_Data( array( 'default_view' => array( 'type' => 'table' ) ) ); $before = self::read_config( $data ); @@ -1694,7 +1694,7 @@ public function test_merge_null_resets_top_level_keys_to_defaults() { * @covers ::merge */ public function test_merge_rejects_updates_with_invalid_version() { - $this->expectWPIncorrectUsage( 'WP_View_Config_Data::merge' ); + $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::merge' ); $data = new WP_View_Config_Data( array( 'default_view' => array( 'type' => 'table' ) ) ); $before = self::read_config( $data ); @@ -1713,7 +1713,7 @@ public function test_merge_rejects_updates_with_invalid_version() { * @covers ::merge */ public function test_merge_rejects_unknown_key() { - $this->expectWPIncorrectUsage( 'WP_View_Config_Data::merge' ); + $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::merge' ); $data = new WP_View_Config_Data( array( 'default_view' => array( 'type' => 'table' ) ) ); $data->merge( array( 'not_a_real_key' => 'nope' ), 1 ); @@ -1731,7 +1731,7 @@ public function test_merge_rejects_unknown_key() { * @covers ::merge */ public function test_merge_rejects_associative_patch_over_a_list() { - $this->expectWPIncorrectUsage( 'WP_View_Config_Data::merge_properties' ); + $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::merge_properties' ); $data = new WP_View_Config_Data( array( @@ -1768,7 +1768,7 @@ public function test_merge_rejects_associative_patch_over_a_list() { * @covers ::merge */ public function test_merge_rejects_list_patch_over_an_associative_value() { - $this->expectWPIncorrectUsage( 'WP_View_Config_Data::merge_properties' ); + $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::merge_properties' ); $data = new WP_View_Config_Data( array( @@ -1897,7 +1897,7 @@ public function test_merge_appended_member_drops_nested_nulls() { * @covers ::replace */ public function test_replace_rejects_list_patch_over_an_associative_value() { - $this->expectWPIncorrectUsage( 'WP_View_Config_Data::merge_properties' ); + $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::merge_properties' ); $data = new WP_View_Config_Data( array( diff --git a/tests/phpunit/tests/view-config.php b/tests/phpunit/tests/view-config.php index b5cffcad16bc9..1d84c7e676113 100644 --- a/tests/phpunit/tests/view-config.php +++ b/tests/phpunit/tests/view-config.php @@ -558,7 +558,7 @@ function ( $data ) { * from the defaults. */ public function test_filter_data_normalized() { - $this->expectWPIncorrectUsage( 'WP_View_Config_Data::set' ); + $this->setExpectedIncorrectUsage( 'WP_View_Config_Data::set' ); add_filter( 'get_entity_view_config_custom_kind_custom_name', diff --git a/tests/phpunit/tests/widgets.php b/tests/phpunit/tests/widgets.php index c9d554300357f..431c3c2f22188 100644 --- a/tests/phpunit/tests/widgets.php +++ b/tests/phpunit/tests/widgets.php @@ -214,7 +214,7 @@ public function test_register_sidebars_multiple() { public function test_register_sidebar_with_no_id() { global $wp_registered_sidebars; - $this->expectWPIncorrectUsage( 'register_sidebar' ); + $this->setExpectedIncorrectUsage( 'register_sidebar' ); // Incorrectly register a couple of sidebars for fun. register_sidebar(); @@ -231,7 +231,7 @@ public function test_register_sidebar_with_no_id() { public function test_unregister_sidebar_registered_with_no_id() { global $wp_registered_sidebars; - $this->expectWPIncorrectUsage( 'register_sidebar' ); + $this->setExpectedIncorrectUsage( 'register_sidebar' ); // Incorrectly register a couple of sidebars for fun. register_sidebar(); @@ -347,7 +347,7 @@ public function retrieve_sidebar_id( $index, $valid_sidebar ) { * @group sidebar */ public function test_dynamic_sidebar_using_sidebar_registered_with_no_id() { - $this->expectWPIncorrectUsage( 'register_sidebar' ); + $this->setExpectedIncorrectUsage( 'register_sidebar' ); // Incorrectly register a couple of sidebars for fun. register_sidebar(); @@ -980,7 +980,7 @@ public function test_the_widget_custom_before_title_arg() { * @see \the_widget() */ public function test_the_widget_with_unregistered_widget() { - $this->expectWPIncorrectUsage( 'the_widget' ); + $this->setExpectedIncorrectUsage( 'the_widget' ); the_widget( 'Widget_Class' ); } diff --git a/tests/phpunit/tests/widgets/wpWidgetRecentComments.php b/tests/phpunit/tests/widgets/wpWidgetRecentComments.php index c3fe388f3773d..e42701f11e00b 100644 --- a/tests/phpunit/tests/widgets/wpWidgetRecentComments.php +++ b/tests/phpunit/tests/widgets/wpWidgetRecentComments.php @@ -721,7 +721,7 @@ public function test_form_with_empty_instance() { * * @covers WP_Widget_Recent_Comments::flush_widget_cache * - * @expectedWPDeprecated WP_Widget_Recent_Comments::flush_widget_cache + * @expectedDeprecated WP_Widget_Recent_Comments::flush_widget_cache */ public function test_flush_widget_cache_is_deprecated() { $widget = new WP_Widget_Recent_Comments(); diff --git a/tests/phpunit/tests/wp-token-map/wpTokenMap.php b/tests/phpunit/tests/wp-token-map/wpTokenMap.php index 02fb9e0fee526..5cdfccfbb5624 100644 --- a/tests/phpunit/tests/wp-token-map/wpTokenMap.php +++ b/tests/phpunit/tests/wp-token-map/wpTokenMap.php @@ -134,7 +134,7 @@ public function test_creates_map_from_array_containing_proper_values( $dataset ) * * @ticket 60698 * - * @expectedWPIncorrectUsage WP_Token_Map::from_array + * @expectedIncorrectUsage WP_Token_Map::from_array */ public function test_rejects_words_which_are_too_long() { $normal_length = str_pad( '', 255, '.' ); diff --git a/tests/phpunit/tests/xmlrpc/wp/getUsers.php b/tests/phpunit/tests/xmlrpc/wp/getUsers.php index 685d9d9a56257..a442ad4969d92 100644 --- a/tests/phpunit/tests/xmlrpc/wp/getUsers.php +++ b/tests/phpunit/tests/xmlrpc/wp/getUsers.php @@ -55,7 +55,7 @@ public function test_invalid_role() { } /** - * @expectedWPDeprecated WP_User_Query + * @expectedDeprecated WP_User_Query */ public function test_role_filter() { $author_id = $this->make_user_by_role( 'author' );