Add WP_DOING_TESTS constant to bootstrap
|Reported by:||alexkingorg||Owned by:|
In order to test some of the AJAX functions, I need to be able to call them from within the unit testing framework. They invoke WP_Ajax_Response::send() which sends headers and cause the tests to fail. I've proposed a patch to this:
This ticket is for the matching change to bootstrap.php to add the WP_DOING_TESTS constant.
Please confirm this is acceptable and I'll commit this change, or let me know a preferred alternate approach and I'll revise the patches accordingly.
I considered and rejecting using existing constants such as DIR_TESTDATA and WP_TESTS_FORCE_KNOWN_BUGS - seemed better to me to have an explicit setting that reads clearly in the code.