Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/03/2014 06:14:06 PM (9 years ago)
Author:
djpaul
Message:

Unit Tests, Groups: update the group factory to set the group's creator_id if one was not passed to the factory.

This is a quicker way of updating hundreds of unit tests where we've previously had a bug that was creating Groups without a valid group creator being set. See #5983 for related changes.

A few tests are counting the number of users in specific circumstances, so those eight tests have been individually updated so that they pass a valid creator_id without us having to refactor the entire test.

The test_group_has_no_members test has also been removed as it is impossible for a group to have no members. This test used to work because of this bug.

File:
1 edited

Legend:

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

    r9047 r9120  
    132132     */
    133133    public function test_bp_group_has_members_vanilla() {
    134         $g = $this->factory->group->create();
    135134        $u1 = $this->create_user();
    136135        $u2 = $this->create_user();
     136        $g  = $this->factory->group->create( array(
     137            'creator_id' => $u1,
     138        ) );
    137139
    138140        $this->add_user_to_group( $u1, $g );
Note: See TracChangeset for help on using the changeset viewer.