Changeset 34719 for trunk/tests/phpunit/includes/testcase.php
- Timestamp:
- 09/30/2015 01:08:49 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r34638 r34719 56 56 57 57 add_filter( 'wp_mail', array( $this, 'set_wp_mail_globals' ) ); 58 59 /* 60 * During multisite tests, WP_INSTALLING forces `get_option()` to miss the cache, which causes problems 61 * with our query-counting cache tests. As a workaround in the case of tests that require checking 62 * 'db_version' (such as any test that uses the Term Meta API), we filter 'pre_option_db_version' and 63 * avoid hitting the database. 64 * 65 * See #31130. 66 */ 67 if ( is_multisite() ) { 68 $this->db_version = get_option( 'db_version' ); 69 add_filter( 'pre_option_db_version', array( $this, 'db_version' ) ); 70 } 58 71 } 59 72 … … 618 631 } 619 632 } 633 634 /** 635 * Return the current database version without hitting the database. 636 * 637 * This is used to bypass cache problems with some multisite tests. See #31130. 638 * 639 * @todo Don't do this anymore once #31130 is fixed. 640 * 641 * @since 4.4.0 642 */ 643 public function db_version() { 644 return $this->db_version; 645 } 620 646 }
Note: See TracChangeset
for help on using the changeset viewer.