Changeset 34828 for trunk/tests/phpunit/includes/testcase.php
- Timestamp:
- 10/05/2015 03:05:26 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r34810 r34828 14 14 protected static $hooks_saved = array(); 15 15 protected static $ignore_files; 16 17 protected $db_version;18 16 19 17 /** … … 59 57 60 58 add_filter( 'wp_mail', array( $this, 'set_wp_mail_globals' ) ); 61 62 /*63 * During multisite tests, WP_INSTALLING forces `get_option()` to miss the cache, which causes problems64 * with our query-counting cache tests. As a workaround in the case of tests that require checking65 * 'db_version' (such as any test that uses the Term Meta API), we filter 'pre_option_db_version' and66 * avoid hitting the database.67 *68 * See #31130.69 */70 $this->db_version = get_option( 'db_version' );71 if ( is_multisite() ) {72 add_filter( 'pre_option_db_version', array( $this, 'db_version' ) );73 }74 59 } 75 60 … … 636 621 637 622 /** 638 * Return the current database version without hitting the database.639 *640 * This is used to bypass cache problems with some multisite tests. See #31130.641 *642 * @todo Don't do this anymore once #31130 is fixed.643 *644 * @since 4.4.0645 */646 public function db_version() {647 return $this->db_version;648 }649 650 /**651 623 * Utility method that resets permalinks and flushes rewrites. 652 624 *
Note: See TracChangeset
for help on using the changeset viewer.