Ticket #30017: 30017.diff
File 30017.diff, 876 bytes (added by , 8 years ago) |
---|
-
tests/phpunit/includes/testcase-ajax.php
17 17 abstract class WP_Ajax_UnitTestCase extends WP_UnitTestCase { 18 18 19 19 /** 20 * Whether the admin_init action has been called. 21 * 22 * @since 4.2.0 23 * 24 * @var bool 25 */ 26 protected static $did_admin_init = false; 27 28 /** 20 29 * Last AJAX response. This is set via echo -or- wp_die. 21 30 * @var type 22 31 */ … … 171 180 $_REQUEST = array_merge( $_POST, $_GET ); 172 181 173 182 // Call the hooks 174 do_action( 'admin_init' ); 183 if ( ! self::$did_admin_init ) { 184 do_action( 'admin_init' ); 185 self::$did_admin_init = true; 186 } 187 175 188 do_action( 'wp_ajax_' . $_REQUEST['action'], null ); 176 189 177 190 // Save the output