Skip to:
Content

BuddyPress.org

Changeset 9118


Ignore:
Timestamp:
11/03/2014 04:36:52 PM (6 years ago)
Author:
djpaul
Message:

Unit Tests, Groups: test group creation for authenticated vs anonymous user.

These will fail until I get a subsequent commit in; I wanted these in first so we can easily see if the fix works as expected.

See #5983

File:
1 edited

Legend:

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

    r8958 r9118  
    66 */
    77class BP_Tests_Groups_Functions extends BP_UnitTestCase {
     8    protected $old_current_user_id = 0;
     9
     10
     11    public function test_creating_new_group_as_authenticated_user() {
     12        $this->old_current_user_id = get_current_user_id();
     13
     14        $u = $this->create_user();
     15        wp_set_current_user( $u );
     16
     17        $this->factory->group->create();
     18    }
     19
     20    public function test_creating_new_group_as_anonymous_user() {
     21        $g = $this->factory->group->create();
     22        $this->assertFalse( $g );
     23    }
     24
    825    /**
    926     * @group total_group_count
Note: See TracChangeset for help on using the changeset viewer.