[wp-unit-tests] [WordPress Unit Tests] #133: Add WP_DOING_TESTS constant to bootstrap

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 25 21:09:26 UTC 2012


#133: Add WP_DOING_TESTS constant to bootstrap
-------------------------+-------------------------
 Reporter:  alexkingorg  |       Type:  enhancement
   Status:  new          |   Priority:  normal
Milestone:               |  Component:  General
 Keywords:  has-patch    |
-------------------------+-------------------------
 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.

-- 
Ticket URL: <http://unit-tests.trac.wordpress.org/ticket/133>
WordPress Unit Tests <http://unit-tests.trac.wordpress.org>
My example project


More information about the wp-unit-tests mailing list