Changeset 7274 for trunk/tests/testcases/groups/class-bp-groups-group.php
- Timestamp:
- 07/16/2013 07:31:01 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/testcases/groups/class-bp-groups-group.php
r7134 r7274 62 62 /** 63 63 * @group get 64 * @group group_meta_query 64 65 */ 65 66 public function test_get_with_meta_query() { … … 82 83 /** 83 84 * @group get 85 * @group group_meta_query 84 86 */ 85 87 public function test_get_empty_meta_query() { … … 253 255 $found = wp_parse_id_list( wp_list_pluck( $groups['groups'], 'id' ) ); 254 256 $this->assertEquals( array( $g2, $g4, $g3, $g1 ), $found ); 257 } 258 259 /** 260 * @group get 261 * @group group_meta_query 262 * @ticket BP5099 263 */ 264 public function test_meta_query_and_total_groups() { 265 $g1 = $this->factory->group->create( array( 266 'name' => 'A Group', 267 'date_created' => bp_core_current_time(), 268 ) ); 269 $g2 = $this->factory->group->create( array( 270 'name' => 'D Group', 271 'date_created' => gmdate( 'Y-m-d H:i:s', $time - 100 ), 272 ) ); 273 $g3 = $this->factory->group->create( array( 274 'name' => 'B Group', 275 'date_created' => gmdate( 'Y-m-d H:i:s', $time - 100000 ), 276 ) ); 277 $g4 = $this->factory->group->create( array( 278 'name' => 'C Group', 279 'date_created' => gmdate( 'Y-m-d H:i:s', $time - 1000 ), 280 ) ); 281 282 // mark one group with the metakey 'supergroup' 283 groups_update_groupmeta( $g1, 'supergroup', 1 ); 284 285 // fetch groups with our 'supergroup' metakey 286 $groups = BP_Groups_Group::get( array( 287 'meta_query' => array( 288 array( 289 'key' => 'supergroup', 290 'compare' => 'EXISTS', 291 ) 292 ) 293 ) ); 294 295 // group total should match 1 296 $this->assertEquals( '1', $groups['total'] ); 255 297 } 256 298
Note: See TracChangeset
for help on using the changeset viewer.