Changeset 9984
- Timestamp:
- 07/02/2015 12:54:20 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r9981 r9984 16 16 */ 17 17 protected $autocommitted = false; 18 19 /** 20 * A list of components that have been deactivated during a test. 21 * 22 * @since BuddyPress (2.4.0) 23 * 24 * @var array 25 */ 26 protected $deactivated_components = array(); 18 27 19 28 public static function setUpBeforeClass() { … … 68 77 69 78 $this->commit_transaction(); 79 80 // Reactivate any components that have been deactivated. 81 foreach ( $this->deactivated_components as $component ) { 82 buddypress()->active_components[ $component ] = 1; 83 } 84 $this->deactivated_components = array(); 70 85 } 71 86 … … 465 480 $this->autocommitted = true; 466 481 } 482 483 /** 484 * Deactivate a component for the duration of a test. 485 * 486 * @since BuddyPress (2.4.0) 487 * 488 * @param string $component Component name. 489 */ 490 public function deactivate_component( $component ) { 491 $is_active = isset( buddypress()->active_components[ $component ] ); 492 493 if ( ! isset( $component ) ) { 494 return false; 495 } 496 497 unset( buddypress()->active_components[ $component ] ); 498 $this->deactivated_components[] = $component; 499 } 467 500 }
Note: See TracChangeset
for help on using the changeset viewer.