Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#133 closed enhancement (wontfix)

Add WP_DOING_TESTS constant to bootstrap

Reported by: alexkingorg Owned by:
Milestone: Priority: normal
Component: Ajax Keywords: has-patch
Cc: nacin


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.

Attachments (1)

bootstrap.diff (375 bytes) - added by alexkingorg 5 years ago.

Download all attachments as: .zip

Change History (2)

#1 @bpetty
5 years ago

  • Component changed from General to Ajax
  • Resolution set to wontfix
  • Status changed from new to closed

Closing, see #WP21993

Note: See TracTickets for help on using tickets.