Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/20/2022 05:59:15 PM (2 years ago)
Author:
imath
Message:

Make sure member has a type before trying to remove one

Avoid a PHP Type error if the member has no member types and the Administrator (or more probably a plugin) tries to remove it.

Props sx1001

See #8639 (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/members/types.php

    r12729 r13239  
    345345
    346346    /**
     347     * @ticket BP8639
     348     */
     349    public function test_bp_remove_member_type_should_return_false_when_user_has_no_member_type() {
     350        $u1 = self::factory()->user->create();
     351        bp_register_member_type( 'random' );
     352
     353        $this->assertFalse( bp_remove_member_type( $u1, 'random' ) );
     354    }
     355
     356    /**
    347357     * @group BP6138
    348358     */
Note: See TracChangeset for help on using the changeset viewer.