Changeset 10545 for trunk/tests/phpunit/includes/testcase.php
- Timestamp:
- 02/07/2016 04:55:04 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/includes/testcase.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r10297 r10545 50 50 // Clean up after autocommits. 51 51 add_action( 'bp_blogs_recorded_existing_blogs', array( $this, 'set_autocommit_flag' ) ); 52 53 // Make sure Activity actions are reset before each test 54 $this->reset_bp_activity_actions(); 55 56 // Make sure all Post types activities globals are reset before each test 57 $this->reset_bp_activity_post_types_globals(); 52 58 } 53 59 … … 96 102 97 103 parent::clean_up_global_scope(); 104 } 105 106 protected function reset_bp_activity_actions() { 107 buddypress()->activity->actions = new stdClass(); 108 109 /** 110 * Populate the global with default activity actions only 111 * before each test. 112 */ 113 do_action( 'bp_register_activity_actions' ); 114 } 115 116 protected function reset_bp_activity_post_types_globals() { 117 global $wp_post_types; 118 119 // Remove all remaining tracking arguments to each post type 120 foreach ( $wp_post_types as $post_type => $post_type_arg ) { 121 if ( post_type_supports( $post_type, 'buddypress-activity' ) ) { 122 remove_post_type_support( $post_type, 'buddypress-activity' ); 123 } 124 125 if ( isset( $post_type_arg->bp_activity ) ) { 126 unset( $post_type_arg->bp_activity ); 127 } 128 } 129 130 buddypress()->activity->track = array(); 98 131 } 99 132
Note: See TracChangeset
for help on using the changeset viewer.