Ticket #41561: 41561.diff
File 41561.diff, 2.7 KB (added by , 8 years ago) |
---|
-
tests/phpunit/includes/testcase-ajax.php
59 59 ); 60 60 61 61 public static function setUpBeforeClass() { 62 if ( ! defined( 'DOING_AJAX' ) ) { 63 define( 'DOING_AJAX', true ); 64 } 62 add_filter( 'wp_doing_ajax', '__return_true' ); 65 63 66 64 remove_action( 'admin_init', '_maybe_update_core' ); 67 65 remove_action( 'admin_init', '_maybe_update_plugins' ); -
tests/phpunit/tests/ajax/Response.php
23 23 parent::setUp(); 24 24 25 25 add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 ); 26 if ( !defined( 'DOING_AJAX' ) ) 27 define( 'DOING_AJAX', true ); 26 add_filter( 'wp_doing_ajax', '__return_true' ); 28 27 29 28 // Suppress warnings from "Cannot modify header information - headers already sent by" 30 29 $this->_error_level = error_reporting(); -
tests/phpunit/tests/customize/manager.php
1544 1544 * @group ajax 1545 1545 */ 1546 1546 function test_doing_ajax() { 1547 if ( ! defined( 'DOING_AJAX' ) ) { 1548 define( 'DOING_AJAX', true ); 1549 } 1547 add_filter( 'wp_doing_ajax', '__return_true' ); 1550 1548 1551 1549 $manager = $this->manager; 1552 1550 $this->assertTrue( $manager->doing_ajax() ); … … 1560 1558 * Test ! WP_Customize_Manager::doing_ajax(). 1561 1559 */ 1562 1560 function test_not_doing_ajax() { 1563 if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { 1561 $doing_ajax = wp_doing_ajax(); 1562 if ( $doing_ajax ) { 1564 1563 $this->markTestSkipped( 'Cannot test when DOING_AJAX' ); 1565 1564 } 1566 1565 -
tests/phpunit/tests/customize/selective-refresh-ajax.php
37 37 function setUp() { 38 38 parent::setUp(); 39 39 40 // Define DOING_AJAX so that wp_die() will be used instead of die(). 41 if ( ! defined( 'DOING_AJAX' ) ) { 42 define( 'DOING_AJAX', true ); 43 } 40 // Define wp_doing_ajax so that wp_die() will be used instead of die(). 41 add_filter( 'wp_doing_ajax', '__return_true' ); 44 42 add_filter( 'wp_die_ajax_handler', array( $this, 'get_wp_die_handler' ), 1, 1 ); 45 43 46 44 require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' );