WordPress.org

Make WordPress Core

#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

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.

Attachments (1)

bootstrap.diff (375 bytes) - added by alexkingorg 19 months ago.

Download all attachments as: .zip

Change History (2)

alexkingorg19 months ago

comment:1 bpetty19 months 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.