Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/03/2017 07:44:10 PM (4 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/core/class-bp-button.php

    r11117 r11737  
    1010     */
    1111    public function test_block_self_own_profile() {
    12         $u = $this->factory->user->create();
     12        $u = self::factory()->user->create();
    1313        $this->set_current_user( $u );
    1414
     
    2828     */
    2929    public function test_block_self_others_profile() {
    30         $u1 = $this->factory->user->create();
    31         $this->set_current_user( $u1 );
    32 
    33         $u2 = $this->factory->user->create();
     30        $u1 = self::factory()->user->create();
     31        $this->set_current_user( $u1 );
     32
     33        $u2 = self::factory()->user->create();
    3434        $this->go_to( bp_core_get_user_domain( $u2 ) );
    3535
     
    4848    public function test_block_self_inside_members_loop() {
    4949        $now = time();
    50         $u1 = $this->factory->user->create( array(
     50        $u1 = self::factory()->user->create( array(
    5151            'last_activity' => date( 'Y-m-d H:i:s', $now ),
    5252        ) );
    53         $u2 = $this->factory->user->create( array(
     53        $u2 = self::factory()->user->create( array(
    5454            'last_activity' => date( 'Y-m-d H:i:s', $now - 100 ),
    5555        ) );
     
    8888    public function test_block_self_false_inside_members_loop() {
    8989        $now = time();
    90         $u1 = $this->factory->user->create( array(
     90        $u1 = self::factory()->user->create( array(
    9191            'last_activity' => date( 'Y-m-d H:i:s', $now ),
    9292        ) );
    93         $u2 = $this->factory->user->create( array(
     93        $u2 = self::factory()->user->create( array(
    9494            'last_activity' => date( 'Y-m-d H:i:s', $now - 100 ),
    9595        ) );
     
    128128    public function test_block_self_inside_members_loop_on_my_profile_page() {
    129129        $now = time();
    130         $u1 = $this->factory->user->create( array(
     130        $u1 = self::factory()->user->create( array(
    131131            'last_activity' => date( 'Y-m-d H:i:s', $now ),
    132132        ) );
    133         $u2 = $this->factory->user->create( array(
     133        $u2 = self::factory()->user->create( array(
    134134            'last_activity' => date( 'Y-m-d H:i:s', $now - 100 ),
    135135        ) );
Note: See TracChangeset for help on using the changeset viewer.