Changeset 9231 for trunk/tests/phpunit/testcases/groups/cache.php
- Timestamp:
- 12/15/2014 08:38:11 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/testcases/groups/cache.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/groups/cache.php
r9156 r9231 201 201 $this->assertEquals( 2, count( groups_get_group_admins( $g ) ) ); 202 202 } 203 204 /** 205 * @group groups_get_total_group_count 206 * @group counts 207 */ 208 public function test_groups_get_total_group_count_should_respect_cached_value_of_0() { 209 global $wpdb; 210 211 // prime cache 212 // no groups are created by default, so count is zero 213 groups_get_total_group_count(); 214 $first_query_count = $wpdb->num_queries; 215 216 // run function again 217 groups_get_total_group_count(); 218 219 // check if function references cache or hits the DB by comparing query count 220 $this->assertEquals( $first_query_count, $wpdb->num_queries ); 221 } 203 222 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)