#54661 closed defect (bug) (fixed)
Remove the assertion in `filter_rest_url_for_leading_slash()`
| Reported by: | johnbillion | Owned by: | johnbillion |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.9 |
| Component: | Build/Test Tools | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 52390: