Opened 6 years ago
Last modified 6 years ago
#45132 new enhancement
Explore better implementation of Autosaves Controller unit tests
Reported by: | danielbachhuber | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | needs-patch |
Focuses: | rest-api | Cc: |
Description
In [43768], we had to introduce an edge case where tests/rest-api/rest-autosaves-controller.php
is run last in the test suite because the definition of DOING_AUTOSAVE
pollutes the test suite.
We can't remove DOING_AUTOSAVE
, but we could potentially avoid defining it during a test suite run. Or maybe there are other ideas we can explore.
"Done" for this issue would be a solution where tests/rest-api/rest-autosaves-controller.php
can be tested as a part of the standard test suite execution order, not last.
Change History (4)
#2
@
6 years ago
A possible solution for this and other similar cases would be to introduce a helper function, perhaps is_testing()
similar to is_admin()
. We already have WP_RUN_CORE_TESTS
defined when PHPUnit is running, but better to have something filterable :)
In 43769: