Changeset 7112 for trunk/tests/testcases/groups/class-bp-groups-group.php
- Timestamp:
- 05/27/2013 11:27:08 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/testcases/groups/class-bp-groups-group.php
r7090 r7112 214 214 } 215 215 216 /** 217 * @group get 218 */ 219 public function test_get_with_type_popular() { 220 $g1 = $this->factory->group->create( array( 221 'name' => 'A Group', 222 'date_created' => bp_core_current_time(), 223 ) ); 224 $g2 = $this->factory->group->create( array( 225 'name' => 'D Group', 226 'date_created' => gmdate( 'Y-m-d H:i:s', $time - 100 ), 227 ) ); 228 $g3 = $this->factory->group->create( array( 229 'name' => 'B Group', 230 'date_created' => gmdate( 'Y-m-d H:i:s', $time - 100000 ), 231 ) ); 232 $g4 = $this->factory->group->create( array( 233 'name' => 'C Group', 234 'date_created' => gmdate( 'Y-m-d H:i:s', $time - 1000 ), 235 ) ); 236 237 groups_update_groupmeta( $g1, 'total_member_count', 1 ); 238 groups_update_groupmeta( $g2, 'total_member_count', 4 ); 239 groups_update_groupmeta( $g3, 'total_member_count', 2 ); 240 groups_update_groupmeta( $g4, 'total_member_count', 3 ); 241 242 $groups = BP_Groups_Group::get( array( 'type' => 'popular' ) ); 243 $found = wp_parse_id_list( wp_list_pluck( $groups['groups'], 'id' ) ); 244 $this->assertEquals( array( $g2, $g4, $g3, $g1 ), $found ); 245 } 246 216 247 /** convert_type_to_order_orderby() **********************************/ 217 248 … … 303 334 * @group convert_orderby_to_order_by_term 304 335 */ 305 public function test_convert_orderby_to_order_by_term_total_ group_members() {336 public function test_convert_orderby_to_order_by_term_total_member_count() { 306 337 $c = new _BP_Groups_Group(); 307 $this->assertEquals( 'CONVERT(gm1.meta_value, SIGNED)', _BP_Groups_Group::_convert_orderby_to_order_by_term( 'total_ group_members' ) );338 $this->assertEquals( 'CONVERT(gm1.meta_value, SIGNED)', _BP_Groups_Group::_convert_orderby_to_order_by_term( 'total_member_count' ) ); 308 339 } 309 340
Note: See TracChangeset
for help on using the changeset viewer.