From c6ada508e61abd1ed920c3ae51b7922b659b9e64 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 24 Jun 2022 14:18:20 +0000 Subject: [PATCH] Tests: Put `@covers` tags before `@params` in Ajax and Formatting groups. This makes the placement more consistent with the rest of the test suite. Follow-up to [53561], [53562]. See #39265. git-svn-id: https://develop.svn.wordpress.org/trunk@53571 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/ajax/CustomizeMenus.php | 28 ++++++++++----------- tests/phpunit/tests/ajax/DeleteComment.php | 22 ++++++++-------- tests/phpunit/tests/formatting/redirect.php | 4 +-- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/tests/phpunit/tests/ajax/CustomizeMenus.php b/tests/phpunit/tests/ajax/CustomizeMenus.php index 33c0d94e92..927354bec8 100644 --- a/tests/phpunit/tests/ajax/CustomizeMenus.php +++ b/tests/phpunit/tests/ajax/CustomizeMenus.php @@ -77,10 +77,10 @@ class Tests_Ajax_CustomizeMenus extends WP_Ajax_UnitTestCase { * * @dataProvider data_ajax_load_available_items_cap_check * + * @covers WP_Customize_Nav_Menus::ajax_load_available_items + * * @param string $role The role we're checking caps against. * @param array $expected_results Expected results. - * - * @covers WP_Customize_Nav_Menus::ajax_load_available_items */ public function test_ajax_load_available_items_cap_check( $role, $expected_results ) { @@ -157,10 +157,10 @@ class Tests_Ajax_CustomizeMenus extends WP_Ajax_UnitTestCase { * * @dataProvider data_ajax_load_available_items_error_messages * + * @covers WP_Customize_Nav_Menus::ajax_load_available_items + * * @param array $post_args POST args. * @param mixed $expected_results Expected results. - * - * @covers WP_Customize_Nav_Menus::ajax_load_available_items */ public function test_ajax_load_available_items_error_messages( $post_args, $expected_results ) { @@ -269,10 +269,10 @@ class Tests_Ajax_CustomizeMenus extends WP_Ajax_UnitTestCase { * * @dataProvider data_ajax_load_available_items_success_status * + * @covers WP_Customize_Nav_Menus::ajax_load_available_items + * * @param array $post_args POST args. * @param array $success_status Success status. - * - * @covers WP_Customize_Nav_Menus::ajax_load_available_items */ public function test_ajax_load_available_items_success_status( $post_args, $success_status ) { @@ -362,9 +362,9 @@ class Tests_Ajax_CustomizeMenus extends WP_Ajax_UnitTestCase { * * @dataProvider data_ajax_load_available_items_structure * - * @param array $post_args POST args. - * * @covers WP_Customize_Nav_Menus::ajax_load_available_items + * + * @param array $post_args POST args. */ public function test2_ajax_load_available_items_structure( $post_args ) { do_action( 'customize_register', $this->wp_customize ); @@ -472,11 +472,11 @@ class Tests_Ajax_CustomizeMenus extends WP_Ajax_UnitTestCase { * * @dataProvider data_ajax_search_available_items_caps_check * - * @param string $role Role. - * @param array $expected_results Expected results. - * * @covers WP_Customize_Nav_Menus::ajax_search_available_items * @covers WP_Customize_Nav_Menus::search_available_items_query + * + * @param string $role Role. + * @param array $expected_results Expected results. */ public function test_ajax_search_available_items_caps_check( $role, $expected_results ) { @@ -554,11 +554,11 @@ class Tests_Ajax_CustomizeMenus extends WP_Ajax_UnitTestCase { * * @dataProvider data_ajax_search_available_items_results * - * @param array $post_args POST args. - * @param array $expected_results Expected results. - * * @covers WP_Customize_Nav_Menus::ajax_search_available_items * @covers WP_Customize_Nav_Menus::search_available_items_query + * + * @param array $post_args POST args. + * @param array $expected_results Expected results. */ public function test_ajax_search_available_items_results( $post_args, $expected_results ) { do_action( 'customize_register', $this->wp_customize ); diff --git a/tests/phpunit/tests/ajax/DeleteComment.php b/tests/phpunit/tests/ajax/DeleteComment.php index c902752063..84dd82fc8e 100644 --- a/tests/phpunit/tests/ajax/DeleteComment.php +++ b/tests/phpunit/tests/ajax/DeleteComment.php @@ -57,11 +57,11 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { * * Expects test to pass. * - * @param WP_Comment $comment Comment object. - * @param string $action Action: 'trash', 'untrash', etc. - * * @covers ::wp_ajax_delete_comment * @covers ::_wp_ajax_delete_comment_response + * + * @param WP_Comment $comment Comment object. + * @param string $action Action: 'trash', 'untrash', etc. */ public function _test_as_admin( $comment, $action ) { @@ -119,10 +119,10 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { * * Expects test to fail. * + * @covers ::wp_ajax_delete_comment + * * @param WP_Comment $comment Comment object. * @param string $action Action: 'trash', 'untrash', etc. - * - * @covers ::wp_ajax_delete_comment */ public function _test_as_subscriber( $comment, $action ) { @@ -153,10 +153,10 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { * * Expects test to fail. * + * @covers ::wp_ajax_delete_comment + * * @param WP_Comment $comment Comment object. * @param string $action Action: 'trash', 'untrash', etc. - * - * @covers ::wp_ajax_delete_comment */ public function _test_with_bad_nonce( $comment, $action ) { @@ -186,10 +186,10 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { * * Expects test to fail. * + * @covers ::wp_ajax_delete_comment + * * @param WP_Comment $comment Comment object. * @param string $action Action: 'trash', 'untrash', etc. - * - * @covers ::wp_ajax_delete_comment */ public function _test_with_bad_id( $comment, $action ) { @@ -225,10 +225,10 @@ class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { * * Expects test to fail. * + * @covers ::wp_ajax_delete_comment + * * @param WP_Comment $comment Comment object. * @param string $action Action: 'trash', 'untrash', etc. - * - * @covers ::wp_ajax_delete_comment */ public function _test_double_action( $comment, $action ) { diff --git a/tests/phpunit/tests/formatting/redirect.php b/tests/phpunit/tests/formatting/redirect.php index c936943a65..213ba36bf5 100644 --- a/tests/phpunit/tests/formatting/redirect.php +++ b/tests/phpunit/tests/formatting/redirect.php @@ -20,10 +20,10 @@ class Tests_Formatting_Redirect extends WP_UnitTestCase { * * @dataProvider get_bad_status_codes * + * @covers ::wp_redirect + * * @param string $location The path or URL to redirect to. * @param int $status HTTP response status code to use. - * - * @covers ::wp_redirect */ public function test_wp_redirect_bad_status_code( $location, $status ) { $this->expectException( 'WPDieException' );