Opened 8 months ago
Closed 8 months ago
#133 closed enhancement (wontfix)
Add WP_DOING_TESTS constant to bootstrap
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Ajax | Keywords: | has-patch |
| Cc: | nacin |
Description
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:
http://core.trac.wordpress.org/ticket/21993
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.

Closing, see #WP21993