Opened 7 years ago
Last modified 2 years ago
#40538 accepted task (blessed)
Fix or remove useless PHPUnit tests
Reported by: | johnbillion | Owned by: | johnbillion |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | needs-unit-tests ongoing has-patch |
Focuses: | Cc: |
Description
There are 29 tests in the test suite which don't perform an assertion. They should be fixed or removed.
PHPUnit 6 has switched to being strict about useless tests by default, so that gives us an additional reason to address them. In addition, there's no reason for core's default PHPUnit configuration to not be strict about useless tests so the same behaviour is seen when running older versions of PHPUnit.
Previously: #36016
Attachments (2)
Change History (15)
This ticket was mentioned in Slack in #core by obenland. View the logs.
7 years ago
#8
@
7 years ago
- Keywords needs-unit-tests ongoing added
- Milestone changed from 4.8 to Future Release
There are still a bunch of tests that don't perform any assertions.
#9
@
7 years ago
- Keywords has-patch added
This patch remove the empty units for 4 tests :-)
Are missing:
There were 4 risky tests: 1) WP_Test_REST_Pages_Controller::test_prepare_item This test did not perform any assertions 2) WP_Test_REST_Settings_Controller::test_context_param This test did not perform any assertions 3) WP_Test_REST_Settings_Controller::test_prepare_item This test did not perform any assertions 4) WP_Test_REST_Settings_Controller::test_get_item_schema This test did not perform any assertions
I am not sure about prepare
, context
and get_item_schema
tests about what they have to do.
#10
@
7 years ago
Thanks for the patch, @Mte90. AFAICT these tests are actually blocked by a bug I found when working on #41463. See 4:ticket:41463.
In 40534: