Changeset 35311 for trunk/tests/phpunit/includes/testcase-ajax.php
- Timestamp:
- 10/21/2015 03:17:36 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase-ajax.php
r35242 r35311 27 27 * @var type 28 28 */ 29 protected $_core_actions_get = array( 'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed_cache' ); 29 protected static $_core_actions_get = array( 30 'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed-cache', 31 'autocomplete-user', 'dashboard-widgets', 'logged-in', 32 ); 30 33 31 34 /** … … 39 42 * @var type 40 43 */ 41 protected $_core_actions_post = array(44 protected static $_core_actions_post = array( 42 45 'oembed_cache', 'image-editor', 'delete-comment', 'delete-tag', 'delete-link', 43 46 'delete-meta', 'delete-post', 'trash-post', 'untrash-post', 'delete-page', 'dim-comment', … … 48 51 'sample-permalink', 'inline-save', 'inline-save-tax', 'find_posts', 'widgets-order', 49 52 'save-widget', 'set-post-thumbnail', 'date_format', 'time_format', 'wp-fullscreen-save-post', 50 'wp-remove-post-lock', 'dismiss-wp-pointer', 'heartbeat', 'nopriv_heartbeat', 53 'wp-remove-post-lock', 'dismiss-wp-pointer', 'heartbeat', 'nopriv_heartbeat', 'get-revision-diffs', 54 'save-user-color-scheme', 'update-widget', 'query-themes', 'parse-embed', 'set-attachment-thumbnail', 55 'parse-media-shortcode', 'destroy-sessions', 'install-plugin', 'update-plugin', 'press-this-save-post', 56 'press-this-add-category', 'crop-image', 'generate-password', 51 57 ); 58 59 public static function setUpBeforeClass() { 60 if ( ! defined( 'DOING_AJAX' ) ) { 61 define( 'DOING_AJAX', true ); 62 } 63 64 remove_action( 'admin_init', '_maybe_update_core' ); 65 remove_action( 'admin_init', '_maybe_update_plugins' ); 66 remove_action( 'admin_init', '_maybe_update_themes' ); 67 68 // Register the core actions 69 foreach ( array_merge( self::$_core_actions_get, self::$_core_actions_post ) as $action ) { 70 if ( function_exists( 'wp_ajax_' . str_replace( '-', '_', $action ) ) ) { 71 add_action( 'wp_ajax_' . $action, 'wp_ajax_' . str_replace( '-', '_', $action ), 1 ); 72 } 73 } 74 75 parent::setUpBeforeClass(); 76 } 52 77 53 78 /** … … 58 83 parent::setUp(); 59 84 60 // Register the core actions61 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 65 85 add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 ); 66 if ( !defined( 'DOING_AJAX' ) ) 67 define( 'DOING_AJAX', true ); 86 68 87 set_current_screen( 'ajax' ); 69 88
Note: See TracChangeset
for help on using the changeset viewer.