diff --git tests/phpunit/testcases/groups/class-bp-groups-group.php tests/phpunit/testcases/groups/class-bp-groups-group.php
index 489fd3c..d650529 100644
|
|
class BP_Tests_BP_Groups_Group_TestCases extends BP_UnitTestCase { |
820 | 820 | |
821 | 821 | $this->assertFalse( wp_cache_get( $g, 'bp_groups' ) ); |
822 | 822 | } |
| 823 | |
823 | 824 | /** |
824 | 825 | * @group get_group_extras |
825 | 826 | */ |
… |
… |
class BP_Tests_BP_Groups_Group_TestCases extends BP_UnitTestCase { |
1029 | 1030 | |
1030 | 1031 | $this->set_current_user( $old_user ); |
1031 | 1032 | } |
| 1033 | |
| 1034 | /** |
| 1035 | * @group get_group_extras |
| 1036 | */ |
| 1037 | public function test_get_group_extras_for_specific_member() { |
| 1038 | $u = $this->factory->user->create(); |
| 1039 | $g = $this->factory->group->create(); |
| 1040 | $this->add_user_to_group( $u, $g ); |
| 1041 | |
| 1042 | $paged_groups = array(); |
| 1043 | $paged_groups[] = new stdClass; |
| 1044 | $paged_groups[0]->id = $g; |
| 1045 | |
| 1046 | $group_ids = array( $g ); |
| 1047 | |
| 1048 | $expected = array(); |
| 1049 | foreach ( $paged_groups as $key => $value ) { |
| 1050 | $expected[ $key ] = new stdClass; |
| 1051 | $expected[ $key ]->id = $value->id; |
| 1052 | $expected[ $key ]->is_member = '1'; |
| 1053 | $expected[ $key ]->is_invited = '0'; |
| 1054 | $expected[ $key ]->is_pending = '0'; |
| 1055 | $expected[ $key ]->is_banned = false; |
| 1056 | } |
| 1057 | |
| 1058 | $this->assertEquals( $expected, BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, false, $u ) ); |
| 1059 | } |
1032 | 1060 | } |
1033 | 1061 | |
1034 | 1062 | /** |