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/messages/star.php

    r11044 r11737  
    1111     */
    1212    public function test_is_message_starred() {
    13         $u1 = $this->factory->user->create();
    14         $u2 = $this->factory->user->create();
     13        $u1 = self::factory()->user->create();
     14        $u2 = self::factory()->user->create();
    1515
    1616        // create the thread
    17         $message_1 = $this->factory->message->create_and_get( array(
     17        $message_1 = self::factory()->message->create_and_get( array(
    1818            'sender_id'  => $u1,
    1919            'recipients' => array( $u2 ),
     
    2222
    2323        // create a reply
    24         $message_2 = $this->factory->message->create_and_get( array(
     24        $message_2 = self::factory()->message->create_and_get( array(
    2525            'thread_id'  => $message_1->thread_id,
    2626            'sender_id'  => $u2,
     
    5959     */
    6060    public function test_star_set_action_bulk_unstar() {
    61         $u1 = $this->factory->user->create();
    62         $u2 = $this->factory->user->create();
     61        $u1 = self::factory()->user->create();
     62        $u2 = self::factory()->user->create();
    6363
    6464        // create the thread
    65         $message_1 = $this->factory->message->create_and_get( array(
     65        $message_1 = self::factory()->message->create_and_get( array(
    6666            'sender_id'  => $u1,
    6767            'recipients' => array( $u2 ),
     
    7070
    7171        // create a reply
    72         $message_2 = $this->factory->message->create_and_get( array(
     72        $message_2 = self::factory()->message->create_and_get( array(
    7373            'thread_id'  => $message_1->thread_id,
    7474            'sender_id'  => $u2,
     
    113113    public function test_get_starred_threads_should_not_include_deleted_thread() {
    114114        $old_current_user = get_current_user_id();
    115         $u1 = $this->factory->user->create();
    116         $u2 = $this->factory->user->create();
     115        $u1 = self::factory()->user->create();
     116        $u2 = self::factory()->user->create();
    117117
    118118        // create three threads
    119         $message_1 = $this->factory->message->create_and_get( array(
     119        $message_1 = self::factory()->message->create_and_get( array(
    120120            'sender_id'  => $u1,
    121121            'recipients' => array( $u2 ),
    122122            'subject'    => 'A',
    123123        ) );
    124         $message_2 = $this->factory->message->create_and_get( array(
     124        $message_2 = self::factory()->message->create_and_get( array(
    125125            'sender_id'  => $u1,
    126126            'recipients' => array( $u2 ),
    127127            'subject'    => 'B',
    128128        ) );
    129         $message_3 = $this->factory->message->create_and_get( array(
     129        $message_3 = self::factory()->message->create_and_get( array(
    130130            'sender_id'  => $u1,
    131131            'recipients' => array( $u2 ),
Note: See TracChangeset for help on using the changeset viewer.