Make WordPress Core

Changeset 846 in tests for trunk/wp-testlib/testcase-ajax.php


Ignore:
Timestamp:
07/02/2012 12:52:09 AM (13 years ago)
Author:
kurtpayne
Message:

Run ajax tests in separate processes so DOING_AJAX doesn't interfere with other tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-testlib/testcase-ajax.php

    r835 r846  
    5252
    5353    /**
    54      * Constructor.
    55      * Register all of the ajax actions
    56      */
    57     public function __construct() {
    58         parent::__construct();
    59         foreach ( array_merge( $this->_core_actions_get, $this->_core_actions_post ) as $action )
    60             if ( function_exists( 'wp_ajax_' . str_replace( '-', '_', $action ) ) )
    61                 add_action( 'wp_ajax_' . $action, 'wp_ajax_' . str_replace( '-', '_', $action ), 1 );
    62     }
    63 
    64     /**
    6554     * Set up the test fixture.
    6655     * Override wp_die(), pretend to be ajax, and suppres E_WARNINGs
     
    6857    public function setUp() {
    6958        parent::setUp();
     59
     60        // Register the core actions
     61        foreach ( array_merge( $this->_core_actions_get, $this->_core_actions_post ) as $action )
     62            if ( function_exists( 'wp_ajax_' . str_replace( '-', '_', $action ) ) )
     63                add_action( 'wp_ajax_' . $action, 'wp_ajax_' . str_replace( '-', '_', $action ), 1 );
     64
    7065        add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 );
    7166        if ( !defined( 'DOING_AJAX' ) )
Note: See TracChangeset for help on using the changeset viewer.