Changeset 53955 for trunk/tests/phpunit/tests/site-health.php
- Timestamp:
- 08/29/2022 04:52:12 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/site-health.php
r52010 r53955 108 108 ); 109 109 } 110 111 /** 112 * @group ms-excluded 113 * @ticket 56040 114 */ 115 public function test_object_cache_default_thresholds() { 116 $wp_site_health = new WP_Site_Health(); 117 118 $this->assertFalse( 119 $wp_site_health->should_suggest_persistent_object_cache() 120 ); 121 } 122 123 124 /** 125 * @group ms-required 126 * @ticket 56040 127 */ 128 public function test_object_cache_default_thresholds_on_multisite() { 129 $wp_site_health = new WP_Site_Health(); 130 $this->assertTrue( 131 $wp_site_health->should_suggest_persistent_object_cache() 132 ); 133 } 134 135 /** 136 * @ticket 56040 137 */ 138 public function test_object_cache_thresholds_check_can_be_bypassed() { 139 $wp_site_health = new WP_Site_Health(); 140 add_filter( 'site_status_should_suggest_persistent_object_cache', '__return_true' ); 141 142 $this->assertTrue( 143 $wp_site_health->should_suggest_persistent_object_cache() 144 ); 145 } 146 147 /** 148 * @dataProvider thresholds 149 * @ticket 56040 150 */ 151 public function test_object_cache_thresholds( $threshold, $count ) { 152 $wp_site_health = new WP_Site_Health(); 153 add_filter( 154 'site_status_persistent_object_cache_thresholds', 155 function ( $thresholds ) use ( $threshold, $count ) { 156 return array_merge( $thresholds, array( $threshold => $count ) ); 157 } 158 ); 159 160 $this->assertTrue( 161 $wp_site_health->should_suggest_persistent_object_cache() 162 ); 163 } 164 165 /** 166 * Data provider. 167 * 168 * @ticket 56040 169 */ 170 public function thresholds() { 171 return array( 172 array( 'comments_count', 0 ), 173 array( 'posts_count', 0 ), 174 array( 'terms_count', 1 ), 175 array( 'options_count', 100 ), 176 array( 'users_count', 0 ), 177 array( 'alloptions_count', 100 ), 178 array( 'alloptions_bytes', 1000 ), 179 ); 180 } 110 181 }
Note: See TracChangeset
for help on using the changeset viewer.