Ticket #6012: 6012.unit-tests.patch
File 6012.unit-tests.patch, 1.5 KB (added by , 10 years ago) |
---|
-
tests/phpunit/testcases/blogs/functions.php
619 619 620 620 return ! empty( $a['activities'] ); 621 621 } 622 623 /** 624 * @group counts 625 */ 626 public function test_get_total_blog_count_zero_cache() { 627 if ( ! is_multisite() ) { 628 return; 629 } 630 631 global $wpdb; 632 633 // prime cache 634 // no blogs are created 635 bp_blogs_total_blogs(); 636 $first_query = $wpdb->num_queries; 637 638 // check again 639 // see if we check the cached count or if we hit the DB 640 bp_blogs_total_blogs(); 641 $second_query = $wpdb->num_queries; 642 643 $this->assertEquals( $first_query, $second_query ); 644 } 622 645 } -
tests/phpunit/testcases/groups/functions.php
647 647 groups_accept_invite( $u2, $g ); 648 648 $this->assertEquals( 0, groups_get_invite_count_for_user( $u2 ) ); 649 649 } 650 651 /** 652 * @group counts 653 */ 654 public function test_get_total_group_count_zero_cache() { 655 global $wpdb; 656 657 // prime cache 658 // no groups are created 659 groups_get_total_group_count(); 660 $first_query = $wpdb->num_queries; 661 662 // check again 663 // see if we check the cached count or if we hit the DB 664 groups_get_total_group_count(); 665 $second_query = $wpdb->num_queries; 666 667 $this->assertEquals( $first_query, $second_query ); 668 } 650 669 }