Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/03/2017 07:44:10 PM (3 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/messages/cache.php

    r11044 r11737  
    1010     */
    1111    public function test_bp_messages_update_meta_cache() {
    12         $u1 = $this->factory->user->create();
    13         $u2 = $this->factory->user->create();
     12        $u1 = self::factory()->user->create();
     13        $u2 = self::factory()->user->create();
    1414
    1515        // create the thread
    16         $message_1 = $this->factory->message->create_and_get( array(
     16        $message_1 = self::factory()->message->create_and_get( array(
    1717            'sender_id'  => $u1,
    1818            'recipients' => array( $u2 ),
     
    2121
    2222        // create a reply
    23         $message_2 = $this->factory->message->create_and_get( array(
     23        $message_2 = self::factory()->message->create_and_get( array(
    2424            'thread_id'  => $message_1->thread_id,
    2525            'sender_id'  => $u2,
     
    8383     */
    8484    public function test_bp_messages_metadata_cache_in_message_loop() {
    85         $u1 = $this->factory->user->create();
    86         $u2 = $this->factory->user->create();
     85        $u1 = self::factory()->user->create();
     86        $u2 = self::factory()->user->create();
    8787
    8888        // create the message and thread
    89         $m = $this->factory->message->create_and_get( array(
     89        $m = self::factory()->message->create_and_get( array(
    9090            'sender_id'  => $u1,
    9191            'recipients' => array( $u2 ),
     
    112112        $this->old_current_user = get_current_user_id();
    113113
    114         $u1 = $this->factory->user->create();
    115         $u2 = $this->factory->user->create();
     114        $u1 = self::factory()->user->create();
     115        $u2 = self::factory()->user->create();
    116116
    117117        // create the thread
    118         $message_1 = $this->factory->message->create_and_get( array(
     118        $message_1 = self::factory()->message->create_and_get( array(
    119119            'sender_id'  => $u1,
    120120            'recipients' => array( $u2 ),
     
    123123
    124124        // create a reply
    125         $message_2 = $this->factory->message->create_and_get( array(
     125        $message_2 = self::factory()->message->create_and_get( array(
    126126            'thread_id'  => $message_1->thread_id,
    127127            'sender_id'  => $u2,
Note: See TracChangeset for help on using the changeset viewer.