Changeset 9231 for trunk/tests/phpunit/testcases/blogs/cache.php
- Timestamp:
- 12/15/2014 08:38:11 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/testcases/blogs/cache.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/blogs/cache.php
r9139 r9231 232 232 $this->set_current_user( $old_user ); 233 233 } 234 235 /** 236 * @group bp_blogs_total_blogs 237 * @group counts 238 */ 239 public function test_bp_blogs_total_count_should_respect_cached_value_of_0() { 240 if ( ! is_multisite() ) { 241 return; 242 } 243 244 global $wpdb; 245 246 // prime cache 247 // no blogs are created by default, so count is zero 248 bp_blogs_total_blogs(); 249 $first_query_count = $wpdb->num_queries; 250 251 // run function again 252 bp_blogs_total_blogs(); 253 254 // check if function references cache or hits the DB by comparing query count 255 $this->assertEquals( $first_query_count, $wpdb->num_queries ); 256 } 234 257 }
Note: See TracChangeset
for help on using the changeset viewer.