WordPress.org

Make WordPress Core

Ticket #21993: ajax-send-unit-test-compat.diff

File ajax-send-unit-test-compat.diff, 641 bytes (added by alexkingorg, 19 months ago)

Don't send headers if running unit tests

  • wordpress/wp-includes/class-wp-ajax-response.php

     
    126126         * @since 2.1.0 
    127127         */ 
    128128        function send() { 
     129                if ( defined( 'WP_DOING_TESTS' ) && WP_DOING_TESTS ) { 
     130                        return; 
     131                } 
    129132                header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ) ); 
    130133                echo "<?xml version='1.0' encoding='" . get_option( 'blog_charset' ) . "' standalone='yes'?><wp_ajax>"; 
    131134                foreach ( (array) $this->responses as $response )