From 32ead26653dbb4e3e8ea3cc6fc93ce104f64538a Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 1 Sep 2022 22:54:19 +0000 Subject: [PATCH] Tests: Explicitly mark empty REST API tests as not performing any assertions. WordPress core test suite uses PHPUnit's `beStrictAboutTestsThatDoNotTestAnything` option set to true, which marks a test as risky when no assertions are performed. REST API test classes have some empty tests for non-implemented methods because these test classes extend the abstract `WP_Test_REST_Controller_Testcase` class, which requires several methods to be implemented that don't necessarily make sense for all REST API routes. As these tests are intentionally empty, they were previously marked as skipped, so that they are not reported as risky. This commit aims to further reduce noise in the test suite and effectively ignores these empty tests altogether, which seems like a more appropriate option at this time. The `@doesNotPerformAssertions` annotation can be reconsidered in the future when the tests are either removed as unnecessary or updated to actually perform assertions related to their behavior. Follow-up to [40534], [41176], [41228], [53921]. See #40538, #41463, #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@54058 602fd350-edb4-49c9-b593-d223f7449a82 --- .../rest-api/rest-autosaves-controller.php | 5 ++- .../rest-block-directory-controller.php | 20 ++++++++--- .../rest-block-renderer-controller.php | 24 +++++++++---- .../rest-api/rest-block-type-controller.php | 12 +++++-- .../rest-global-styles-controller.php | 25 ++++++++++--- .../tests/rest-api/rest-pages-controller.php | 20 ++++++++--- .../rest-pattern-directory-controller.php | 24 ++++++++++--- .../rest-api/rest-settings-controller.php | 21 ++++++++--- .../rest-api/rest-sidebars-controller.php | 12 +++++-- .../tests/rest-api/rest-themes-controller.php | 16 ++++++--- .../rest-api/rest-widget-types-controller.php | 12 +++++-- .../rest-api/rest-widgets-controller.php | 8 +++-- ...wpRestBlockPatternCategoriesController.php | 35 +++++++++++++++---- .../wpRestBlockPatternsController.php | 35 +++++++++++++++---- .../wpRestEditSiteExportController.php | 32 ++++++++--------- .../wpRestMenuLocationsController.php | 16 ++++++--- .../rest-api/wpRestTemplatesController.php | 5 ++- .../rest-api/wpRestUrlDetailsController.php | 30 ++++++++++++---- 18 files changed, 265 insertions(+), 87 deletions(-) diff --git a/tests/phpunit/tests/rest-api/rest-autosaves-controller.php b/tests/phpunit/tests/rest-api/rest-autosaves-controller.php index 533690f08c..0128c0dcec 100644 --- a/tests/phpunit/tests/rest-api/rest-autosaves-controller.php +++ b/tests/phpunit/tests/rest-api/rest-autosaves-controller.php @@ -271,8 +271,11 @@ class WP_Test_REST_Autosaves_Controller extends WP_Test_REST_Post_Type_Controlle $this->assertErrorResponse( 'rest_post_invalid_parent', $response, 404 ); } + /** + * @doesNotPerformAssertions + */ public function test_delete_item() { - $this->markTestSkipped( 'Controller does not implement delete_item().' ); + // Controller does not implement delete_item(). } public function test_prepare_item() { diff --git a/tests/phpunit/tests/rest-api/rest-block-directory-controller.php b/tests/phpunit/tests/rest-api/rest-block-directory-controller.php index 12af55d3e3..af014d93fd 100644 --- a/tests/phpunit/tests/rest-api/rest-block-directory-controller.php +++ b/tests/phpunit/tests/rest-api/rest-block-directory-controller.php @@ -130,20 +130,32 @@ class WP_REST_Block_Directory_Controller_Test extends WP_Test_REST_Controller_Te $this->assertSame( array(), $data ); } + /** + * @doesNotPerformAssertions + */ public function test_get_item() { - $this->markTestSkipped( 'Controller does not implement get_item().' ); + // Controller does not implement get_item(). } + /** + * @doesNotPerformAssertions + */ public function test_create_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } + /** + * @doesNotPerformAssertions + */ public function test_update_item() { - $this->markTestSkipped( 'Controller does not implement update_item().' ); + // Controller does not implement update_item(). } + /** + * @doesNotPerformAssertions + */ public function test_delete_item() { - $this->markTestSkipped( 'Controller does not implement delete_item().' ); + // Controller does not implement delete_item(). } /** diff --git a/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php b/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php index a2af93f990..9f2401e893 100644 --- a/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php +++ b/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php @@ -614,43 +614,55 @@ class REST_Block_Renderer_Controller_Test extends WP_Test_REST_Controller_Testca /** * The update_item() method does not exist for block rendering. + * + * @doesNotPerformAssertions */ public function test_update_item() { - $this->markTestSkipped( 'Controller does not implement update_item().' ); + // Controller does not implement update_item(). } /** * The create_item() method does not exist for block rendering. + * + * @doesNotPerformAssertions */ public function test_create_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } /** * The delete_item() method does not exist for block rendering. + * + * @doesNotPerformAssertions */ public function test_delete_item() { - $this->markTestSkipped( 'Controller does not implement delete_item().' ); + // Controller does not implement delete_item(). } /** * The get_items() method does not exist for block rendering. + * + * @doesNotPerformAssertions */ public function test_get_items() { - $this->markTestSkipped( 'Controller does not implement get_items().' ); + // Controller does not implement get_items(). } /** * The get_context_param() method is not used for block rendering. + * + * @doesNotPerformAssertions */ public function test_context_param() { - $this->markTestSkipped( 'Controller does not use get_context_param().' ); + // Controller does not use get_context_param(). } /** * The prepare_item() method does not exist for block rendering. + * + * @doesNotPerformAssertions */ public function test_prepare_item() { - $this->markTestSkipped( 'Controller does not implement prepare_item().' ); + // Controller does not implement prepare_item(). } } diff --git a/tests/phpunit/tests/rest-api/rest-block-type-controller.php b/tests/phpunit/tests/rest-api/rest-block-type-controller.php index 58f8e755f0..4f5be44cba 100644 --- a/tests/phpunit/tests/rest-api/rest-block-type-controller.php +++ b/tests/phpunit/tests/rest-api/rest-block-type-controller.php @@ -552,22 +552,28 @@ class REST_Block_Type_Controller_Test extends WP_Test_REST_Controller_Testcase { /** * The create_item() method does not exist for block types. + * + * @doesNotPerformAssertions */ public function test_create_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } /** * The update_item() method does not exist for block types. + * + * @doesNotPerformAssertions */ public function test_update_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } /** * The delete_item() method does not exist for block types. + * + * @doesNotPerformAssertions */ public function test_delete_item() { - $this->markTestSkipped( 'Controller does not implement delete_item().' ); + // Controller does not implement delete_item(). } } diff --git a/tests/phpunit/tests/rest-api/rest-global-styles-controller.php b/tests/phpunit/tests/rest-api/rest-global-styles-controller.php index 2da5e18ab0..0c27723a1c 100644 --- a/tests/phpunit/tests/rest-api/rest-global-styles-controller.php +++ b/tests/phpunit/tests/rest-api/rest-global-styles-controller.php @@ -124,12 +124,18 @@ class WP_REST_Global_Styles_Controller_Test extends WP_Test_REST_Controller_Test ); } + /** + * @doesNotPerformAssertions + */ public function test_context_param() { - $this->markTestSkipped( 'Controller does not use get_context_param().' ); + // Controller does not use get_context_param(). } + /** + * @doesNotPerformAssertions + */ public function test_get_items() { - $this->markTestSkipped( 'Controller does not implement get_items().' ); + // Controller does not implement get_items(). } /** @@ -382,8 +388,11 @@ class WP_REST_Global_Styles_Controller_Test extends WP_Test_REST_Controller_Test $this->assertStringContainsString( '/wp/v2/global-styles/' . self::$global_styles_id, $links['self'][0]['href'] ); } + /** + * @doesNotPerformAssertions + */ public function test_create_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } /** @@ -437,12 +446,18 @@ class WP_REST_Global_Styles_Controller_Test extends WP_Test_REST_Controller_Test $this->assertErrorResponse( 'rest_cannot_edit', $response, 403 ); } + /** + * @doesNotPerformAssertions + */ public function test_delete_item() { - $this->markTestSkipped( 'Controller does not implement delete_item().' ); + // Controller does not implement delete_item(). } + /** + * @doesNotPerformAssertions + */ public function test_prepare_item() { - $this->markTestSkipped( 'Controller does not implement prepare_item().' ); + // Controller does not implement prepare_item(). } /** diff --git a/tests/phpunit/tests/rest-api/rest-pages-controller.php b/tests/phpunit/tests/rest-api/rest-pages-controller.php index 3395d7ab9d..40b3dc714e 100644 --- a/tests/phpunit/tests/rest-api/rest-pages-controller.php +++ b/tests/phpunit/tests/rest-api/rest-pages-controller.php @@ -408,8 +408,11 @@ class WP_Test_REST_Pages_Controller extends WP_Test_REST_Post_Type_Controller_Te $this->assertSame( $post2, $data[0]['id'] ); } + /** + * @doesNotPerformAssertions + */ public function test_get_item() { - $this->markTestSkipped( 'Controller does not implement get_item().' ); + // Controller does not implement get_item(). } public function test_get_item_invalid_post_type() { @@ -419,8 +422,11 @@ class WP_Test_REST_Pages_Controller extends WP_Test_REST_Post_Type_Controller_Te $this->assertSame( 404, $response->get_status() ); } + /** + * @doesNotPerformAssertions + */ public function test_create_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } public function test_create_item_with_template() { @@ -484,8 +490,11 @@ class WP_Test_REST_Pages_Controller extends WP_Test_REST_Post_Type_Controller_Te $this->assertErrorResponse( 'rest_post_invalid_id', $response, 400 ); } + /** + * @doesNotPerformAssertions + */ public function test_update_item() { - $this->markTestSkipped( 'Controller does not implement update_item().' ); + // Controller does not implement update_item(). } public function test_delete_item() { @@ -507,8 +516,11 @@ class WP_Test_REST_Pages_Controller extends WP_Test_REST_Post_Type_Controller_Te $this->assertSame( 'trash', $data['status'] ); } + /** + * @doesNotPerformAssertions + */ public function test_prepare_item() { - $this->markTestSkipped( 'Controller does not implement prepare_item().' ); + // Controller does not implement prepare_item(). } public function test_prepare_item_limit_fields() { diff --git a/tests/phpunit/tests/rest-api/rest-pattern-directory-controller.php b/tests/phpunit/tests/rest-api/rest-pattern-directory-controller.php index ddcaf0f0f0..22a9e08ad1 100644 --- a/tests/phpunit/tests/rest-api/rest-pattern-directory-controller.php +++ b/tests/phpunit/tests/rest-api/rest-pattern-directory-controller.php @@ -310,20 +310,32 @@ class WP_REST_Pattern_Directory_Controller_Test extends WP_Test_REST_Controller_ $this->assertSame( 'modified the cache', $patterns[0] ); } + /** + * @doesNotPerformAssertions + */ public function test_get_item() { - $this->markTestSkipped( 'Controller does not implement get_item().' ); + // Controller does not implement get_item(). } + /** + * @doesNotPerformAssertions + */ public function test_create_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } + /** + * @doesNotPerformAssertions + */ public function test_update_item() { - $this->markTestSkipped( 'Controller does not implement update_item().' ); + // Controller does not implement update_item(). } + /** + * @doesNotPerformAssertions + */ public function test_delete_item() { - $this->markTestSkipped( 'Controller does not implement delete_item().' ); + // Controller does not implement delete_item(). } /** @@ -402,9 +414,11 @@ class WP_REST_Pattern_Directory_Controller_Test extends WP_Test_REST_Controller_ * @covers WP_REST_Pattern_Directory_Controller::get_item_schema * * @since 5.8.0 + * + * @doesNotPerformAssertions */ public function test_get_item_schema() { - $this->markTestSkipped( "The controller's schema is hardcoded, so tests would not be meaningful." ); + // The controller's schema is hardcoded, so tests would not be meaningful. } /** diff --git a/tests/phpunit/tests/rest-api/rest-settings-controller.php b/tests/phpunit/tests/rest-api/rest-settings-controller.php index e9238d34b3..b054236270 100644 --- a/tests/phpunit/tests/rest-api/rest-settings-controller.php +++ b/tests/phpunit/tests/rest-api/rest-settings-controller.php @@ -75,8 +75,11 @@ class WP_Test_REST_Settings_Controller extends WP_Test_REST_Controller_Testcase $this->assertSame( 404, $response->get_status() ); } + /** + * @doesNotPerformAssertions + */ public function test_context_param() { - $this->markTestSkipped( 'Controller does not use get_context_param().' ); + // Controller does not use get_context_param(). } public function test_get_item_is_not_public_not_authenticated() { @@ -383,9 +386,11 @@ class WP_Test_REST_Settings_Controller extends WP_Test_REST_Controller_Testcase $this->assertNull( $data['mycustomsettinginrest'] ); } - + /** + * @doesNotPerformAssertions + */ public function test_create_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } public function test_update_item() { @@ -665,12 +670,18 @@ class WP_Test_REST_Settings_Controller extends WP_Test_REST_Controller_Testcase $this->assertSame( 404, $response->get_status() ); } + /** + * @doesNotPerformAssertions + */ public function test_prepare_item() { - $this->markTestSkipped( 'Controller does not implement prepare_item().' ); + // Controller does not implement prepare_item(). } + /** + * @doesNotPerformAssertions + */ public function test_get_item_schema() { - $this->markTestSkipped( 'Controller does not implement get_item_schema().' ); + // Controller does not implement get_item_schema(). } /** diff --git a/tests/phpunit/tests/rest-api/rest-sidebars-controller.php b/tests/phpunit/tests/rest-api/rest-sidebars-controller.php index 66a4249f63..e15a7f910a 100644 --- a/tests/phpunit/tests/rest-api/rest-sidebars-controller.php +++ b/tests/phpunit/tests/rest-api/rest-sidebars-controller.php @@ -574,9 +574,11 @@ class WP_Test_REST_Sidebars_Controller extends WP_Test_REST_Controller_Testcase /** * The create_item() method does not exist for sidebar. + * + * @doesNotPerformAssertions */ public function test_create_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } /** @@ -892,16 +894,20 @@ class WP_Test_REST_Sidebars_Controller extends WP_Test_REST_Controller_Testcase /** * The delete_item() method does not exist for sidebar. + * + * @doesNotPerformAssertions */ public function test_delete_item() { - $this->markTestSkipped( 'Controller does not implement delete_item().' ); + // Controller does not implement delete_item(). } /** * The prepare_item() method does not exist for sidebar. + * + * @doesNotPerformAssertions */ public function test_prepare_item() { - $this->markTestSkipped( 'Controller does not implement prepare_item().' ); + // Controller does not implement prepare_item(). } /** diff --git a/tests/phpunit/tests/rest-api/rest-themes-controller.php b/tests/phpunit/tests/rest-api/rest-themes-controller.php index e168d0da81..da03319286 100644 --- a/tests/phpunit/tests/rest-api/rest-themes-controller.php +++ b/tests/phpunit/tests/rest-api/rest-themes-controller.php @@ -1200,16 +1200,20 @@ class WP_Test_REST_Themes_Controller extends WP_Test_REST_Controller_Testcase { /** * The create_item() method does not exist for themes. + * + * @doesNotPerformAssertions */ public function test_create_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } /** * The update_item() method does not exist for themes. + * + * @doesNotPerformAssertions */ public function test_update_item() { - $this->markTestSkipped( 'Controller does not implement update_item().' ); + // Controller does not implement update_item(). } /** @@ -1398,15 +1402,19 @@ class WP_Test_REST_Themes_Controller extends WP_Test_REST_Controller_Testcase { /** * The delete_item() method does not exist for themes. + * + * @doesNotPerformAssertions */ public function test_delete_item() { - $this->markTestSkipped( 'Controller does not implement delete_item().' ); + // Controller does not implement delete_item(). } /** * Context is not supported for themes. + * + * @doesNotPerformAssertions */ public function test_context_param() { - $this->markTestSkipped( 'Controller does not use get_context_param().' ); + // Controller does not use get_context_param(). } } diff --git a/tests/phpunit/tests/rest-api/rest-widget-types-controller.php b/tests/phpunit/tests/rest-api/rest-widget-types-controller.php index 56c67ca1d5..5c6f22bfee 100644 --- a/tests/phpunit/tests/rest-api/rest-widget-types-controller.php +++ b/tests/phpunit/tests/rest-api/rest-widget-types-controller.php @@ -532,22 +532,28 @@ class WP_Test_REST_Widget_Types_Controller extends WP_Test_REST_Controller_Testc /** * The create_item() method does not exist for widget types. + * + * @doesNotPerformAssertions */ public function test_create_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } /** * The update_item() method does not exist for widget types. + * + * @doesNotPerformAssertions */ public function test_update_item() { - $this->markTestSkipped( 'Controller does not implement update_item().' ); + // Controller does not implement update_item(). } /** * The delete_item() method does not exist for widget types. + * + * @doesNotPerformAssertions */ public function test_delete_item() { - $this->markTestSkipped( 'Controller does not implement delete_item().' ); + // Controller does not implement delete_item(). } } diff --git a/tests/phpunit/tests/rest-api/rest-widgets-controller.php b/tests/phpunit/tests/rest-api/rest-widgets-controller.php index 8684de31e0..28ac8bc6e3 100644 --- a/tests/phpunit/tests/rest-api/rest-widgets-controller.php +++ b/tests/phpunit/tests/rest-api/rest-widgets-controller.php @@ -214,10 +214,10 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { } /** - * @ticket 41683 + * @doesNotPerformAssertions */ public function test_context_param() { - $this->markTestSkipped( 'Controller does not use get_context_param().' ); + // Controller does not use get_context_param(). } /** @@ -1510,9 +1510,11 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase { /** * The prepare_item() method does not exist for sidebar. + * + * @doesNotPerformAssertions */ public function test_prepare_item() { - $this->markTestSkipped( 'Controller does not implement prepare_item().' ); + // Controller does not implement prepare_item(). } /** diff --git a/tests/phpunit/tests/rest-api/wpRestBlockPatternCategoriesController.php b/tests/phpunit/tests/rest-api/wpRestBlockPatternCategoriesController.php index 230c9dbc37..e2eab16d51 100644 --- a/tests/phpunit/tests/rest-api/wpRestBlockPatternCategoriesController.php +++ b/tests/phpunit/tests/rest-api/wpRestBlockPatternCategoriesController.php @@ -145,31 +145,52 @@ class Tests_REST_WpRestBlockPatternCategoriesController extends WP_Test_REST_Con $this->assertSame( 403, $response->get_status() ); } + /** + * @doesNotPerformAssertions + */ public function test_context_param() { - $this->markTestSkipped( 'Controller does not use get_context_param().' ); + // Controller does not use get_context_param(). } + /** + * @doesNotPerformAssertions + */ public function test_get_item() { - $this->markTestSkipped( 'Controller does not implement get_item().' ); + // Controller does not implement get_item(). } + /** + * @doesNotPerformAssertions + */ public function test_create_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } + /** + * @doesNotPerformAssertions + */ public function test_update_item() { - $this->markTestSkipped( 'Controller does not implement update_item().' ); + // Controller does not implement update_item(). } + /** + * @doesNotPerformAssertions + */ public function test_delete_item() { - $this->markTestSkipped( 'Controller does not implement delete_item().' ); + // Controller does not implement delete_item(). } + /** + * @doesNotPerformAssertions + */ public function test_prepare_item() { - $this->markTestSkipped( 'Controller does not implement prepare_item().' ); + // Controller does not implement prepare_item(). } + /** + * @doesNotPerformAssertions + */ public function test_get_item_schema() { - $this->markTestSkipped( 'Controller does not implement get_item_schema().' ); + // Controller does not implement get_item_schema(). } } diff --git a/tests/phpunit/tests/rest-api/wpRestBlockPatternsController.php b/tests/phpunit/tests/rest-api/wpRestBlockPatternsController.php index 6415a06366..2742d38bc3 100644 --- a/tests/phpunit/tests/rest-api/wpRestBlockPatternsController.php +++ b/tests/phpunit/tests/rest-api/wpRestBlockPatternsController.php @@ -171,31 +171,52 @@ class Tests_REST_WpRestBlockPatternsController extends WP_Test_REST_Controller_T $this->assertSame( 403, $response->get_status() ); } + /** + * @doesNotPerformAssertions + */ public function test_context_param() { - $this->markTestSkipped( 'Controller does not use get_context_param().' ); + // Controller does not use get_context_param(). } + /** + * @doesNotPerformAssertions + */ public function test_get_item() { - $this->markTestSkipped( 'Controller does not implement get_item().' ); + // Controller does not implement get_item(). } + /** + * @doesNotPerformAssertions + */ public function test_create_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } + /** + * @doesNotPerformAssertions + */ public function test_update_item() { - $this->markTestSkipped( 'Controller does not implement update_item().' ); + // Controller does not implement update_item(). } + /** + * @doesNotPerformAssertions + */ public function test_delete_item() { - $this->markTestSkipped( 'Controller does not implement delete_item().' ); + // Controller does not implement delete_item(). } + /** + * @doesNotPerformAssertions + */ public function test_prepare_item() { - $this->markTestSkipped( 'Controller does not implement prepare_item().' ); + // Controller does not implement prepare_item(). } + /** + * @doesNotPerformAssertions + */ public function test_get_item_schema() { - $this->markTestSkipped( 'Controller does not implement get_item_schema().' ); + // Controller does not implement get_item_schema(). } } diff --git a/tests/phpunit/tests/rest-api/wpRestEditSiteExportController.php b/tests/phpunit/tests/rest-api/wpRestEditSiteExportController.php index 431681926f..c32ea170b8 100644 --- a/tests/phpunit/tests/rest-api/wpRestEditSiteExportController.php +++ b/tests/phpunit/tests/rest-api/wpRestEditSiteExportController.php @@ -99,58 +99,58 @@ class Tests_REST_WpRestEditSiteExportController extends WP_Test_REST_Controller_ } /** - * @ticket 54448 + * @doesNotPerformAssertions */ public function test_context_param() { - $this->markTestSkipped( 'Controller does not use get_context_param().' ); + // Controller does not use get_context_param(). } /** - * @ticket 54448 + * @doesNotPerformAssertions */ public function test_get_item() { - $this->markTestSkipped( 'Controller does not implement get_item().' ); + // Controller does not implement get_item(). } /** - * @ticket 54448 + * @doesNotPerformAssertions */ public function test_get_items() { - $this->markTestSkipped( 'Controller does not implement get_items().' ); + // Controller does not implement get_items(). } /** - * @ticket 54448 + * @doesNotPerformAssertions */ public function test_create_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } /** - * @ticket 54448 + * @doesNotPerformAssertions */ public function test_update_item() { - $this->markTestSkipped( 'Controller does not implement update_item().' ); + // Controller does not implement update_item(). } /** - * @ticket 54448 + * @doesNotPerformAssertions */ public function test_delete_item() { - $this->markTestSkipped( 'Controller does not implement delete_item().' ); + // Controller does not implement delete_item(). } /** - * @ticket 54448 + * @doesNotPerformAssertions */ public function test_prepare_item() { - $this->markTestSkipped( 'Controller does not implement prepare_item().' ); + // Controller does not implement prepare_item(). } /** - * @ticket 54448 + * @doesNotPerformAssertions */ public function test_get_item_schema() { - $this->markTestSkipped( 'Controller does not implement get_item_schema().' ); + // Controller does not implement get_item_schema(). } } diff --git a/tests/phpunit/tests/rest-api/wpRestMenuLocationsController.php b/tests/phpunit/tests/rest-api/wpRestMenuLocationsController.php index 425fd9223c..c24714ea93 100644 --- a/tests/phpunit/tests/rest-api/wpRestMenuLocationsController.php +++ b/tests/phpunit/tests/rest-api/wpRestMenuLocationsController.php @@ -141,30 +141,38 @@ class Tests_REST_WpRestMenuLocationsController extends WP_Test_REST_Controller_T /** * The create_item() method does not exist for menu locations. + * + * @doesNotPerformAssertions */ public function test_create_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } /** * The update_item() method does not exist for menu locations. + * + * @doesNotPerformAssertions */ public function test_update_item() { - $this->markTestSkipped( 'Controller does not implement update_item().' ); + // Controller does not implement update_item(). } /** * The delete_item() method does not exist for menu locations. + * + * @doesNotPerformAssertions */ public function test_delete_item() { - $this->markTestSkipped( 'Controller does not implement delete_item().' ); + // Controller does not implement delete_item(). } /** * The prepare_item() method does not exist for menu locations. + * + * @doesNotPerformAssertions */ public function test_prepare_item() { - $this->markTestSkipped( 'Controller does not implement prepare_item().' ); + // Controller does not implement prepare_item(). } /** diff --git a/tests/phpunit/tests/rest-api/wpRestTemplatesController.php b/tests/phpunit/tests/rest-api/wpRestTemplatesController.php index 7acb040ede..c53701f9b6 100644 --- a/tests/phpunit/tests/rest-api/wpRestTemplatesController.php +++ b/tests/phpunit/tests/rest-api/wpRestTemplatesController.php @@ -614,8 +614,11 @@ class Tests_REST_WpRestTemplatesController extends WP_Test_REST_Controller_Testc $this->assertErrorResponse( 'rest_template_not_found', $response, 404 ); } + /** + * @doesNotPerformAssertions + */ public function test_prepare_item() { - $this->markTestSkipped( 'Controller does not implement prepare_item().' ); + // Controller does not implement prepare_item(). } public function test_prepare_item_limit_fields() { diff --git a/tests/phpunit/tests/rest-api/wpRestUrlDetailsController.php b/tests/phpunit/tests/rest-api/wpRestUrlDetailsController.php index 9141d22585..41ccc3c8bf 100644 --- a/tests/phpunit/tests/rest-api/wpRestUrlDetailsController.php +++ b/tests/phpunit/tests/rest-api/wpRestUrlDetailsController.php @@ -1048,28 +1048,46 @@ class Tests_REST_WpRestUrlDetailsController extends WP_Test_REST_Controller_Test ); } + /** + * @doesNotPerformAssertions + */ public function test_context_param() { - $this->markTestSkipped( 'Controller does not use get_context_param().' ); + // Controller does not use get_context_param(). } + /** + * @doesNotPerformAssertions + */ public function test_get_item() { - $this->markTestSkipped( 'Controller does not implement get_item().' ); + // Controller does not implement get_item(). } + /** + * @doesNotPerformAssertions + */ public function test_create_item() { - $this->markTestSkipped( 'Controller does not implement create_item().' ); + // Controller does not implement create_item(). } + /** + * @doesNotPerformAssertions + */ public function test_update_item() { - $this->markTestSkipped( 'Controller does not implement update_item().' ); + // Controller does not implement update_item(). } + /** + * @doesNotPerformAssertions + */ public function test_delete_item() { - $this->markTestSkipped( 'Controller does not implement delete_item().' ); + // Controller does not implement delete_item(). } + /** + * @doesNotPerformAssertions + */ public function test_prepare_item() { - $this->markTestSkipped( 'Controller does not implement prepare_item().' ); + // Controller does not implement prepare_item(). } /**