Changeset 846 in tests for trunk/wp-testlib/testcase-ajax.php
- Timestamp:
- 07/02/2012 12:52:09 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-testlib/testcase-ajax.php
r835 r846 52 52 53 53 /** 54 * Constructor.55 * Register all of the ajax actions56 */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 /**65 54 * Set up the test fixture. 66 55 * Override wp_die(), pretend to be ajax, and suppres E_WARNINGs … … 68 57 public function setUp() { 69 58 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 70 65 add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 ); 71 66 if ( !defined( 'DOING_AJAX' ) )
Note: See TracChangeset
for help on using the changeset viewer.