Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/21/2016 06:00:05 PM (8 years ago)
Author:
r-a-y
Message:

Groups: In bp_groups_set_group_type(), allow an array of group types to be set.

See #7210.

File:
1 edited

Legend:

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

    r11046 r11142  
    264264        $this->assertEquals( array( 'foo' ), $type );
    265265    }
     266
     267    public function test_bp_groups_set_group_type_should_set_multiple_types_when_passing_array_of_types() {
     268        $g = $this->factory->group->create( array( 'creator_id' => self::$u1 ) );
     269        bp_groups_register_group_type( 'foo' );
     270        bp_groups_register_group_type( 'bar' );
     271
     272        // Set multiple group types.
     273        $types = array( 'foo', 'bar' );
     274        bp_groups_set_group_type( $g, $types );
     275
     276        // Assert!
     277        $this->assertEqualSets( $types, bp_groups_get_group_type( $g, false ) );
     278    }
    266279}
Note: See TracChangeset for help on using the changeset viewer.