Changeset 11739 for trunk/tests/phpunit/includes/testcase.php
- Timestamp:
- 11/03/2017 09:11:52 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/includes/testcase.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r11736 r11739 26 26 protected $deactivated_components = array(); 27 27 28 /** 29 * Cribbed from WP so that the self::factory() call comes from this class. 30 * 31 * @since 3.0.0 32 */ 28 33 public static function setUpBeforeClass() { 34 global $wpdb; 29 35 30 36 // Fake WP mail globals, to avoid errors … … 32 38 add_filter( 'wp_mail_from', array( 'BP_UnitTestCase', 'tearDown_wp_mail' ) ); 33 39 34 parent::setUpBeforeClass(); 40 $c = self::get_called_class(); 41 if ( ! method_exists( $c, 'wpSetUpBeforeClass' ) ) { 42 self::commit_transaction(); 43 return; 44 } 45 46 call_user_func( array( $c, 'wpSetUpBeforeClass' ), self::factory() ); 47 48 self::commit_transaction(); 35 49 } 36 50 … … 92 106 } 93 107 $this->deactivated_components = array(); 108 } 109 110 /** 111 * Multisite-agnostic way to delete a user from the database. 112 * 113 * @since 3.0.0 114 */ 115 public static function delete_user( $user_id ) { 116 $deleted = parent::delete_user( $user_id ); 117 118 // When called in tearDownAfterClass(), BP's cleanup functions may no longer be hooked. 119 if ( bp_is_active( 'activity' ) ) { 120 bp_activity_remove_all_user_data( $user_id ); 121 } 122 123 return $deleted; 94 124 } 95 125
Note: See TracChangeset
for help on using the changeset viewer.