Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/03/2017 07:44:10 PM (4 years ago)
Author:
boonebgorges
Message:

Use static factory method throughout PHPUnit tests.

See #7620.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/groups/activity.php

    r11557 r11737  
    1111     */
    1212    public function test_bp_groups_format_activity_action_created_group() {
    13         $u = $this->factory->user->create();
    14         $g = $this->factory->group->create();
    15         $a = $this->factory->activity->create( array(
     13        $u = self::factory()->user->create();
     14        $g = self::factory()->group->create();
     15        $a = self::factory()->activity->create( array(
    1616            'component' => buddypress()->groups->id,
    1717            'type' => 'created_group',
     
    3333     */
    3434    public function test_bp_groups_format_activity_action_joined_group() {
    35         $u = $this->factory->user->create();
    36         $g = $this->factory->group->create();
    37         $a = $this->factory->activity->create( array(
     35        $u = self::factory()->user->create();
     36        $g = self::factory()->group->create();
     37        $a = self::factory()->activity->create( array(
    3838            'component' => buddypress()->groups->id,
    3939            'type' => 'joined_group',
     
    5555     */
    5656    public function test_bp_groups_format_activity_action_group_details_updated_with_no_change() {
    57         $group = $this->factory->group->create_and_get();
     57        $group = self::factory()->group->create_and_get();
    5858        groups_edit_base_group_details( array(
    5959                'group_id'       => $group->id,
     
    7878     */
    7979    public function test_bp_groups_format_activity_action_group_details_updated_with_notify_members_false() {
    80         $group = $this->factory->group->create_and_get();
     80        $group = self::factory()->group->create_and_get();
    8181        groups_edit_base_group_details( array(
    8282            'group_id'       => $group->id,
     
    102102    public function test_bp_groups_format_activity_action_group_details_updated_with_updated_name() {
    103103        $old_user = get_current_user_id();
    104         $u = $this->factory->user->create();
    105         $this->set_current_user( $u );
    106 
    107         $group = $this->factory->group->create_and_get();
     104        $u = self::factory()->user->create();
     105        $this->set_current_user( $u );
     106
     107        $group = self::factory()->group->create_and_get();
    108108        groups_edit_base_group_details( array(
    109109            'group_id'       => $group->id,
     
    134134    public function test_bp_groups_format_activity_action_group_details_updated_with_updated_description() {
    135135        $old_user = get_current_user_id();
    136         $u = $this->factory->user->create();
    137         $this->set_current_user( $u );
    138 
    139         $group = $this->factory->group->create_and_get();
     136        $u = self::factory()->user->create();
     137        $this->set_current_user( $u );
     138
     139        $group = self::factory()->group->create_and_get();
    140140        groups_edit_base_group_details( array(
    141141            'group_id'       => $group->id,
     
    166166    public function test_bp_groups_format_activity_action_group_details_updated_with_updated_slug() {
    167167        $old_user = get_current_user_id();
    168         $u = $this->factory->user->create();
    169         $this->set_current_user( $u );
    170 
    171         $group = $this->factory->group->create_and_get();
     168        $u = self::factory()->user->create();
     169        $this->set_current_user( $u );
     170
     171        $group = self::factory()->group->create_and_get();
    172172        groups_edit_base_group_details( array(
    173173            'group_id'       => $group->id,
     
    199199    public function test_bp_groups_format_activity_action_group_details_updated_with_updated_name_and_description() {
    200200        $old_user = get_current_user_id();
    201         $u = $this->factory->user->create();
    202         $this->set_current_user( $u );
    203 
    204         $group = $this->factory->group->create_and_get();
     201        $u = self::factory()->user->create();
     202        $this->set_current_user( $u );
     203
     204        $group = self::factory()->group->create_and_get();
    205205        groups_edit_base_group_details( array(
    206206            'group_id'       => $group->id,
Note: See TracChangeset for help on using the changeset viewer.