#54661 closed defect (bug) (fixed)
Remove the assertion in `filter_rest_url_for_leading_slash()`
Reported by: | johnbillion | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 5.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
In https://github.com/WordPress/wordpress-develop/pull/1995 I identified some tests which work with faulty assumptions about the data they're testing. While debugging this I noticed that the WP_Test_REST_Controller_Testcase::filter_rest_url_for_leading_slash()
method performs an assertion which masks the fact that actual tests are not performing any assertions.
For example the WP_Test_REST_Tags_Controller::test_get_terms_post_args_paging()
test is faulty and does not perform any assertions, but this is not reported by PHPUnit because WP_Test_REST_Controller_Testcase::filter_rest_url_for_leading_slash()
performs 21 assertions during the test run.
The assertion in WP_Test_REST_Controller_Testcase::filter_rest_url_for_leading_slash()
should be converted to a conditional call to fail()
so that tests which don't perform any assertions get correctly reported.
In 52390: