Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/03/2017 07:44:10 PM (7 years ago)
Author:
boonebgorges
Message:

Use static factory method throughout PHPUnit tests.

See #7620.

File:
1 edited

Legend:

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

    r11091 r11737  
    3131     */
    3232    public function test_private_group_where_logged_in_user_has_not_requested_membership_but_has_been_invited() {
    33         $users = $this->factory->user->create_many( 2 );
    34         $g = $this->factory->group->create( array( 'status' => 'private' ) );
     33        $users = self::factory()->user->create_many( 2 );
     34        $g = self::factory()->group->create( array( 'status' => 'private' ) );
    3535
    3636        $this->set_current_user( $users[0] );
     
    5757     */
    5858    public function test_private_group_where_logged_in_user_has_not_requested_membership_and_has_not_been_invited() {
    59         $u = $this->factory->user->create();
    60         $g = $this->factory->group->create( array( 'status' => 'private' ) );
     59        $u = self::factory()->user->create();
     60        $g = self::factory()->group->create( array( 'status' => 'private' ) );
    6161
    6262        $this->set_current_user( $u );
     
    7777     */
    7878    public function test_private_group_visited_by_a_non_logged_in_user() {
    79         $g = $this->factory->group->create( array( 'status' => 'private' ) );
     79        $g = self::factory()->group->create( array( 'status' => 'private' ) );
    8080
    8181        if ( bp_has_groups( array( 'include' => array( $g ) ) ) ) {
     
    9494     */
    9595    public function test_private_group_where_loggedin_user_has_requested_membership() {
    96         $u = $this->factory->user->create();
    97         $g = $this->factory->group->create( array( 'status' => 'private' ) );
     96        $u = self::factory()->user->create();
     97        $g = self::factory()->group->create( array( 'status' => 'private' ) );
    9898
    9999        $this->set_current_user( $u );
     
    116116     */
    117117    public function test_hidden_group() {
    118         $u = $this->factory->user->create();
    119         $g = $this->factory->group->create( array( 'status' => 'hidden' ) );
     118        $u = self::factory()->user->create();
     119        $g = self::factory()->group->create( array( 'status' => 'hidden' ) );
    120120
    121121        $this->set_current_user( $u );
     
    133133     */
    134134    public function test_group_parameter_should_be_obeyed() {
    135         $u = $this->factory->user->create();
    136         $groups = $this->factory->group->create_many( 2, array( 'status' => 'private' ) );
     135        $u = self::factory()->user->create();
     136        $groups = self::factory()->group->create_many( 2, array( 'status' => 'private' ) );
    137137
    138138        $this->set_current_user( $u );
Note: See TracChangeset for help on using the changeset viewer.