Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/24/2014 04:35:52 AM (11 years ago)
Author:
imath
Message:

Move the 'new_member' activity type into the Members component

Since BuddyPress 1.1, the 'new_member' type was attached to the xProfile component. In version 2.2, we are moving it into the Members one. Once the user will have upgraded to this version, every existing 'new_member' activity items will have their component updated to the 'members' one and each time a new member will register, the 'new_member' activity will be attached to the members component.

Props boonebgorges, DJPaul

Fixes #5807

File:
1 edited

Legend:

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

    r9139 r9273  
    294294    /**
    295295     * @group activity_action
    296      * @group bp_xprofile_format_activity_action_new_member
    297      */
    298     public function test_bp_xprofile_format_activity_action_new_member_xprofile_on() {
    299         $active = bp_is_active( 'xprofile' );
    300         buddypress()->active_components['xprofile'] = '1';
    301 
    302         $u = $this->factory->user->create();
    303         $a = $this->factory->activity->create( array(
    304             'component' => buddypress()->profile->id,
    305             'type' => 'new_member',
    306             'user_id' => $u,
    307         ) );
    308 
    309         $expected = sprintf( __( '%s became a registered member', 'buddypress' ), bp_core_get_userlink( $u ) );
    310 
    311         $a_obj = new BP_Activity_Activity( $a );
    312 
    313         $this->assertSame( $expected, $a_obj->action );
    314 
    315         if ( ! $active ) {
    316             unset( buddypress()->active_components['xprofile'] );
    317         }
    318     }
    319 
    320     /**
    321      * @group activity_action
    322      * @group bp_xprofile_format_activity_action_new_member
    323      */
    324     public function test_bp_xprofile_format_activity_action_new_member_xprofile_off() {
    325         $active = bp_is_active( 'xprofile' );
    326         unset( buddypress()->active_components['xprofile'] );
    327 
    328         $u = $this->factory->user->create();
    329         $a = $this->factory->activity->create( array(
    330             'component' => buddypress()->profile->id,
    331             'type' => 'new_member',
    332             'user_id' => $u,
    333         ) );
    334 
    335         $expected = sprintf( __( '%s became a registered member', 'buddypress' ), bp_core_get_userlink( $u ) );
    336 
    337         $a_obj = new BP_Activity_Activity( $a );
    338 
    339         $this->assertSame( $expected, $a_obj->action );
    340 
    341         if ( $active ) {
    342             buddypress()->active_components['xprofile'] = '1';
    343         }
    344     }
    345 
    346     /**
    347      * @group activity_action
    348296     * @group bp_xprofile_format_activity_action_updated_profile
    349297     */
Note: See TracChangeset for help on using the changeset viewer.