- Timestamp:
- 09/09/2016 03:00:13 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/groups/class-bp-groups-group.php
r10937 r11071 397 397 /** 398 398 * @group get 399 */ 400 public function test_get_with_type_alphabetical() { 401 $time = time(); 402 $g1 = $this->factory->group->create( array( 403 'name' => 'A Group', 404 'date_created' => bp_core_current_time(), 405 ) ); 406 $g2 = $this->factory->group->create( array( 407 'name' => 'D Group', 408 'date_created' => gmdate( 'Y-m-d H:i:s', $time - 100 ), 409 ) ); 410 $g3 = $this->factory->group->create( array( 411 'name' => 'B Group', 412 'date_created' => gmdate( 'Y-m-d H:i:s', $time - 100000 ), 413 ) ); 414 $g4 = $this->factory->group->create( array( 415 'name' => 'C Group', 416 'date_created' => gmdate( 'Y-m-d H:i:s', $time - 1000 ), 417 ) ); 418 419 $groups = BP_Groups_Group::get( array( 'type' => 'alphabetical' ) ); 420 $found = wp_parse_id_list( wp_list_pluck( $groups['groups'], 'id' ) ); 421 $this->assertEquals( array( $g1, $g3, $g4, $g2 ), $found ); 422 } 423 424 /** 425 * @group get 399 426 * @group group_meta_query 400 427 * @ticket BP5099 … … 564 591 public function test_convert_orderby_to_order_by_term_last_activity() { 565 592 $c = new _BP_Groups_Group(); 566 $this->assertEquals( ' last_activity', _BP_Groups_Group::_convert_orderby_to_order_by_term( 'last_activity' ) );593 $this->assertEquals( 'gm_last_activity.meta_value', _BP_Groups_Group::_convert_orderby_to_order_by_term( 'last_activity' ) ); 567 594 } 568 595 … … 572 599 public function test_convert_orderby_to_order_by_term_total_member_count() { 573 600 $c = new _BP_Groups_Group(); 574 $this->assertEquals( 'CONVERT(gm 1.meta_value, SIGNED)', _BP_Groups_Group::_convert_orderby_to_order_by_term( 'total_member_count' ) );601 $this->assertEquals( 'CONVERT(gm_total_member_count.meta_value, SIGNED)', _BP_Groups_Group::_convert_orderby_to_order_by_term( 'total_member_count' ) ); 575 602 } 576 603
Note: See TracChangeset
for help on using the changeset viewer.