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/blogs/class-bp-blogs-blog.php

    r9980 r11737  
    1313        $old_user = get_current_user_id();
    1414
    15         $u = $this->factory->user->create();
     15        $u = self::factory()->user->create();
    1616        $this->set_current_user( $u );
    17         $b = $this->factory->blog->create( array(
     17        $b = self::factory()->blog->create( array(
    1818            'title' => 'The Foo Bar Blog',
    1919            'user_id' => $u,
     
    4040        $old_user = get_current_user_id();
    4141
    42         $u = $this->factory->user->create();
     42        $u = self::factory()->user->create();
    4343        $this->set_current_user( $u );
    44         $b = $this->factory->blog->create( array(
     44        $b = self::factory()->blog->create( array(
    4545            'title' => 'The Foo Bar Blog',
    4646            'domain' => __METHOD__,
     
    6767        $old_user = get_current_user_id();
    6868
    69         $u = $this->factory->user->create();
     69        $u = self::factory()->user->create();
    7070        $this->set_current_user( $u );
    71         $b = $this->factory->blog->create( array(
     71        $b = self::factory()->blog->create( array(
    7272            'title' => 'The Foo Bar Blog',
    7373            'user_id' => $u,
     
    9595        $old_user = get_current_user_id();
    9696
    97         $u = $this->factory->user->create();
     97        $u = self::factory()->user->create();
    9898        $this->set_current_user( $u );
    99         $b = $this->factory->blog->create( array(
     99        $b = self::factory()->blog->create( array(
    100100            'title' => 'Foo Bar Blog',
    101101            'user_id' => $u,
     
    123123        $old_user = get_current_user_id();
    124124
    125         $u = $this->factory->user->create();
     125        $u = self::factory()->user->create();
    126126        $this->set_current_user( $u );
    127127        $bs = array(
    128             'foobar' => $this->factory->blog->create( array(
     128            'foobar' => self::factory()->blog->create( array(
    129129                'title' => 'Foo Bar Blog',
    130130                'user_id' => $u,
    131131                'path' => '/path' . rand() . time() . '/',
    132132            ) ),
    133             'barfoo' => $this->factory->blog->create( array(
     133            'barfoo' => self::factory()->blog->create( array(
    134134                'title' => 'Bar foo Blog',
    135135                'user_id' => $u,
Note: See TracChangeset for help on using the changeset viewer.