- Timestamp:
- 09/09/2016 03:54:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/groups/class-bp-groups-group.php
r11072 r11074 567 567 /** 568 568 * @group cache 569 * @group group_types 570 * @ticket BP5451 571 * @ticket BP6643 572 */ 573 public function test_get_query_caches_should_be_busted_by_group_term_change() { 574 global $wpdb; 575 576 bp_groups_register_group_type( 'foo' ); 577 bp_groups_register_group_type( 'bar' ); 578 579 $groups = $this->factory->group->create_many( 2 ); 580 bp_groups_set_group_type( $groups[0], 'foo' ); 581 bp_groups_set_group_type( $groups[1], 'bar' ); 582 583 $found1 = BP_Groups_Group::get( array( 584 'group_type' => 'foo', 585 ) ); 586 587 $this->assertEqualSets( array( $groups[0] ), wp_list_pluck( $found1['groups'], 'id' ) ); 588 589 bp_groups_set_group_type( $groups[1], 'foo' ); 590 591 $found2 = BP_Groups_Group::get( array( 592 'group_type' => 'foo', 593 ) ); 594 595 $this->assertEqualSets( array( $groups[0], $groups[1] ), wp_list_pluck( $found2['groups'], 'id' ) ); 596 } 597 598 /** 599 * @group cache 600 * @group group_types 601 * @ticket BP5451 602 * @ticket BP6643 603 */ 604 public function test_get_query_caches_should_be_busted_by_group_term_removal() { 605 global $wpdb; 606 607 bp_groups_register_group_type( 'foo' ); 608 609 $groups = $this->factory->group->create_many( 2 ); 610 bp_groups_set_group_type( $groups[0], 'foo' ); 611 bp_groups_set_group_type( $groups[1], 'foo' ); 612 613 $found1 = BP_Groups_Group::get( array( 614 'group_type' => 'foo', 615 ) ); 616 617 $this->assertEqualSets( array( $groups[0], $groups[1] ), wp_list_pluck( $found1['groups'], 'id' ) ); 618 619 bp_groups_remove_group_type( $groups[1], 'foo' ); 620 621 $found2 = BP_Groups_Group::get( array( 622 'group_type' => 'foo', 623 ) ); 624 625 $this->assertEqualSets( array( $groups[0] ), wp_list_pluck( $found2['groups'], 'id' ) ); 626 } 627 628 /** 629 * @group cache 569 630 * @ticket BP5451 570 631 * @ticket BP6643
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)