WordPress.org

Make WordPress Core

Opened 10 months ago

Last modified 10 months ago

#41463 accepted enhancement

Improve REST API tests that don't perform any assertions

Reported by: johnbillion Owned by: johnbillion
Milestone: Future Release Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords: needs-unit-tests
Focuses: rest-api Cc:

Description

There are a bunch of REST API tests that don't perform any assertions. This creates noise in the test results as they get marked as risky tests.

These tests are present because their test class extends the abstract WP_Test_REST_Controller_Testcase class, which requires several methods to be implemented which don't make sense for all REST API routes.

These tests can be improved so they do actually perform assertions related to their behaviour.

Attachments (1)

41463.diff (3.7 KB) - added by johnbillion 10 months ago.

Download all attachments as: .zip

Change History (6)

#1 @johnbillion
10 months ago

  • Owner set to johnbillion
  • Status changed from new to accepted

#2 @johnbillion
10 months ago

In 41176:

REST API: Add some missing assertions to various REST API tests.

See #41463

@johnbillion
10 months ago

#3 @johnbillion
10 months ago

In 41228:

REST API: Populate some missing tests from test cases which extend the controller test case.

See #41463

#4 @johnbillion
10 months ago

Blocked by #41604 and #41605

#5 @johnbillion
10 months ago

  • Milestone changed from 4.9 to Future Release
Note: See TracTickets for help on using tickets.