WordPress.org

Make WordPress Core

Changeset 41970


Ignore:
Timestamp:
10/23/2017 05:10:25 AM (2 years ago)
Author:
peterwilsoncc
Message:

Build/Test tools: Move wp_doing_ajax defintion from class setup to test setup.

Moves defintion of ajax request in WP_Ajax_UnitTestCase to setUp() method to account for hooks being reset as part of tearDown().

Props matthias.thiel for report.
Fixes #41561.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/testcase-ajax.php

    r41293 r41970  
    6060
    6161    public static function setUpBeforeClass() {
    62         add_filter( 'wp_doing_ajax', '__return_true' );     
    63 
    6462        remove_action( 'admin_init', '_maybe_update_core' );
    6563        remove_action( 'admin_init', '_maybe_update_plugins' );
     
    8381        parent::setUp();
    8482
     83        add_filter( 'wp_doing_ajax', '__return_true' );
    8584        add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 );
    8685
Note: See TracChangeset for help on using the changeset viewer.