diff --git tests/phpunit/testcases/groups/class-bp-groups-group.php tests/phpunit/testcases/groups/class-bp-groups-group.php
index 826fa83..2eac63d 100644
|
|
class BP_Tests_BP_Groups_Group_TestCases extends BP_UnitTestCase { |
136 | 136 | |
137 | 137 | /** |
138 | 138 | * @group get |
| 139 | * @group group_meta_query |
| 140 | * @ticket BP5824 |
| 141 | */ |
| 142 | public function test_get_with_meta_query_multiple_keys_with_same_value() { |
| 143 | $now = time(); |
| 144 | $g1 = $this->factory->group->create( array( |
| 145 | 'last_activity' => date( 'Y-m-d H:i:s', $now - 60*60 ), |
| 146 | ) ); |
| 147 | $g2 = $this->factory->group->create( array( |
| 148 | 'last_activity' => date( 'Y-m-d H:i:s', $now - 60*60*2 ), |
| 149 | ) ); |
| 150 | groups_update_groupmeta( $g1, 'foo', 'bar' ); |
| 151 | groups_update_groupmeta( $g2, 'foo2', 'bar' ); |
| 152 | |
| 153 | $groups = BP_Groups_Group::get( array( |
| 154 | 'meta_query' => array( |
| 155 | 'relation' => 'OR', |
| 156 | array( |
| 157 | 'key' => 'foo', |
| 158 | 'value' => 'bar', |
| 159 | ), |
| 160 | array( |
| 161 | 'key' => 'baz', |
| 162 | 'value' => 'barry', |
| 163 | ), |
| 164 | ), |
| 165 | ) ); |
| 166 | $ids = wp_list_pluck( $groups['groups'], 'id' ); |
| 167 | $this->assertEquals( $ids, array( $g1 ) ); |
| 168 | $this->assertEquals( 1, $groups['total'] ); |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * @group get |
139 | 173 | */ |
140 | 174 | public function test_get_normal_search() { |
141 | 175 | $g1 = $this->factory->group->create( array( |