mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 21:08:44 +01:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@41970 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3bcd5075f5
commit
a77ccfad80
@ -59,8 +59,6 @@ abstract class WP_Ajax_UnitTestCase extends WP_UnitTestCase {
|
||||
);
|
||||
|
||||
public static function setUpBeforeClass() {
|
||||
add_filter( 'wp_doing_ajax', '__return_true' );
|
||||
|
||||
remove_action( 'admin_init', '_maybe_update_core' );
|
||||
remove_action( 'admin_init', '_maybe_update_plugins' );
|
||||
remove_action( 'admin_init', '_maybe_update_themes' );
|
||||
@ -82,6 +80,7 @@ abstract class WP_Ajax_UnitTestCase extends WP_UnitTestCase {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
add_filter( 'wp_doing_ajax', '__return_true' );
|
||||
add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 );
|
||||
|
||||
set_current_screen( 'ajax' );
|
||||
|
Loading…
x
Reference in New Issue
Block a user