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/activity/template.php

    r11091 r11737  
    1010    public function test_user_can_delete() {
    1111        $bp = buddypress();
    12         $u = $this->factory->user->create();
     12        $u = self::factory()->user->create();
    1313        $original_user = bp_loggedin_user_id();
    1414        $this->set_current_user( $u );
    1515
    16         $a = $this->factory->activity->create( array(
     16        $a = self::factory()->activity->create( array(
    1717            'type' => 'activity_update',
    1818            'user_id' => $u,
     
    2020
    2121        // User can delete his own items
    22         $activity = $this->factory->activity->get_object_by_id( $a );
     22        $activity = self::factory()->activity->get_object_by_id( $a );
    2323        $this->assertTrue( bp_activity_user_can_delete( $activity ) );
    2424
     
    2828
    2929        // Miscellaneous user can't delete
    30         $misc_user = $this->factory->user->create( array( 'role' => 'subscriber' ) );
     30        $misc_user = self::factory()->user->create( array( 'role' => 'subscriber' ) );
    3131        $this->set_current_user( $misc_user );
    3232        $this->assertFalse( bp_activity_user_can_delete( $activity ) );
     
    5252        // save the current user and override logged-in user
    5353        $old_user = get_current_user_id();
    54         $u = $this->factory->user->create();
     54        $u = self::factory()->user->create();
    5555        $this->set_current_user( $u );
    5656
    5757        // create an activity update for the user
    58         $this->factory->activity->create( array(
     58        self::factory()->activity->create( array(
    5959            'component' => buddypress()->activity->id,
    6060            'type' => 'activity_update',
     
    8181     */
    8282    public function test_bp_has_activities_favorites_action_filter() {
    83         $user_id = $this->factory->user->create( array( 'role' => 'subscriber' ) );
    84 
    85         $now = time();
    86 
    87         $a1 = $this->factory->activity->create( array(
     83        $user_id = self::factory()->user->create( array( 'role' => 'subscriber' ) );
     84
     85        $now = time();
     86
     87        $a1 = self::factory()->activity->create( array(
    8888            'type' => 'activity_update',
    8989            'recorded_time' => date( 'Y-m-d H:i:s', $now ),
    9090        ) );
    9191
    92         $a2 = $this->factory->activity->create( array(
     92        $a2 = self::factory()->activity->create( array(
    9393            'type' => 'joined_group',
    9494            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
     
    141141     */
    142142    function test_bp_has_activities_just_me_scope_with_no_user_id() {
    143         $u1 = $this->factory->user->create();
    144         $u2 = $this->factory->user->create();
     143        $u1 = self::factory()->user->create();
     144        $u2 = self::factory()->user->create();
    145145
    146146        // save the current user and override logged-in user
     
    151151
    152152        // activity item
    153         $a1 = $this->factory->activity->create( array(
     153        $a1 = self::factory()->activity->create( array(
    154154            'user_id'   => $u1,
    155155            'component' => 'activity',
     
    160160        // misc activity items
    161161
    162         $this->factory->activity->create( array(
     162        self::factory()->activity->create( array(
    163163            'user_id'   => $u2,
    164164            'component' => 'activity',
     
    166166            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    167167        ) );
    168         $this->factory->activity->create( array(
     168        self::factory()->activity->create( array(
    169169            'user_id'   => $u2,
    170170            'component' => 'groups',
     
    197197     */
    198198    function test_bp_has_activities_mentions_scope() {
    199         $u1 = $this->factory->user->create();
    200         $u2 = $this->factory->user->create();
     199        $u1 = self::factory()->user->create();
     200        $u2 = self::factory()->user->create();
    201201
    202202        $now = time();
     
    204204        // mentioned activity item
    205205        $mention_username = '@' . bp_activity_get_user_mentionname( $u1 );
    206         $a1 = $this->factory->activity->create( array(
     206        $a1 = self::factory()->activity->create( array(
    207207            'user_id' => $u2,
    208208            'type'    => 'activity_update',
     
    212212
    213213        // misc activity items
    214         $this->factory->activity->create( array(
     214        self::factory()->activity->create( array(
    215215            'user_id'   => $u1,
    216216            'component' => 'blogs',
     
    219219            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    220220        ) );
    221         $this->factory->activity->create( array(
     221        self::factory()->activity->create( array(
    222222            'user_id'   => $u2,
    223223            'component' => 'activity',
     
    225225            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    226226        ) );
    227         $this->factory->activity->create( array(
     227        self::factory()->activity->create( array(
    228228            'user_id'   => $u2,
    229229            'component' => 'groups',
     
    254254     */
    255255    function test_bp_has_activities_friends_and_mentions_scope() {
    256         $u1 = $this->factory->user->create();
    257         $u2 = $this->factory->user->create();
    258         $u3 = $this->factory->user->create();
     256        $u1 = self::factory()->user->create();
     257        $u2 = self::factory()->user->create();
     258        $u3 = self::factory()->user->create();
    259259
    260260        // user 1 becomes friends with user 2
     
    264264
    265265        // friend status update
    266         $a1 = $this->factory->activity->create( array(
     266        $a1 = self::factory()->activity->create( array(
    267267            'user_id' => $u2,
    268268            'type' => 'activity_update',
     
    272272        // mentioned item by non-friend
    273273        $mention_username = '@' . bp_activity_get_user_mentionname( $u1 );
    274         $a2 = $this->factory->activity->create( array(
     274        $a2 = self::factory()->activity->create( array(
    275275            'user_id'   => $u3,
    276276            'component' => 'activity',
     
    281281
    282282        // misc activity items
    283         $this->factory->activity->create( array(
     283        self::factory()->activity->create( array(
    284284            'user_id'   => $u1,
    285285            'component' => 'blogs',
     
    288288            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    289289        ) );
    290         $this->factory->activity->create( array(
     290        self::factory()->activity->create( array(
    291291            'user_id'   => $u3,
    292292            'component' => 'activity',
     
    294294            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    295295        ) );
    296         $this->factory->activity->create( array(
     296        self::factory()->activity->create( array(
    297297            'user_id'   => $u3,
    298298            'component' => 'groups',
     
    323323     */
    324324    function test_bp_has_activities_groups_and_friends_scope() {
    325         $u1 = $this->factory->user->create();
    326         $u2 = $this->factory->user->create();
    327         $u3 = $this->factory->user->create();
     325        $u1 = self::factory()->user->create();
     326        $u2 = self::factory()->user->create();
     327        $u3 = self::factory()->user->create();
    328328
    329329        // user 1 becomes friends with user 2
     
    331331
    332332        // user 1 joins a group
    333         $g1 = $this->factory->group->create( array( 'creator_id' => $u1 ) );
    334         $g2 = $this->factory->group->create( array( 'creator_id' => $u1 ) );
     333        $g1 = self::factory()->group->create( array( 'creator_id' => $u1 ) );
     334        $g2 = self::factory()->group->create( array( 'creator_id' => $u1 ) );
    335335
    336336        $now = time();
    337337
    338338        // friend status update
    339         $a1 = $this->factory->activity->create( array(
     339        $a1 = self::factory()->activity->create( array(
    340340            'user_id' => $u2,
    341341            'type' => 'activity_update',
     
    344344
    345345        // group activity
    346         $a2 = $this->factory->activity->create( array(
     346        $a2 = self::factory()->activity->create( array(
    347347            'user_id'   => $u3,
    348348            'component' => 'groups',
     
    353353
    354354        // misc activity items
    355         $this->factory->activity->create( array(
     355        self::factory()->activity->create( array(
    356356            'user_id'   => $u3,
    357357            'component' => 'blogs',
     
    360360            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    361361        ) );
    362         $this->factory->activity->create( array(
     362        self::factory()->activity->create( array(
    363363            'user_id'   => $u3,
    364364            'component' => 'activity',
     
    370370        global $wpdb, $bp;
    371371        $max_group_id = $wpdb->get_var( "SELECT id FROM {$bp->groups->table_name} ORDER BY id DESC LIMIT 1" );
    372         $this->factory->activity->create( array(
     372        self::factory()->activity->create( array(
    373373            'user_id'   => $u3,
    374374            'component' => 'groups',
     
    399399     */
    400400    function test_bp_has_activities_scope_friends_no_items() {
    401         $u1 = $this->factory->user->create();
     401        $u1 = self::factory()->user->create();
    402402
    403403        $now = time();
    404404
    405405        // Create a random activity
    406         $this->factory->activity->create( array(
     406        self::factory()->activity->create( array(
    407407            'user_id' => $u1,
    408408            'type' => 'activity_update',
     
    432432     */
    433433    function test_bp_has_activities_scope_favorites_no_items() {
    434         $u1 = $this->factory->user->create();
     434        $u1 = self::factory()->user->create();
    435435
    436436        $now = time();
    437437
    438438        // Create a random activity
    439         $this->factory->activity->create( array(
     439        self::factory()->activity->create( array(
    440440            'user_id' => $u1,
    441441            'type' => 'activity_update',
     
    465465     */
    466466    function test_bp_has_activities_scope_groups_no_items() {
    467         $u1 = $this->factory->user->create();
     467        $u1 = self::factory()->user->create();
    468468
    469469        $now = time();
    470470
    471471        // Create a random activity
    472         $this->factory->activity->create( array(
     472        self::factory()->activity->create( array(
    473473            'user_id' => $u1,
    474474            'type' => 'activity_update',
     
    498498     */
    499499    function test_bp_has_activities_scope_mentions_no_items() {
    500         $u1 = $this->factory->user->create();
     500        $u1 = self::factory()->user->create();
    501501
    502502        $now = time();
    503503
    504504        // Create a random activity
    505         $this->factory->activity->create( array(
     505        self::factory()->activity->create( array(
    506506            'user_id' => $u1,
    507507            'type' => 'activity_update',
     
    530530     */
    531531    public function test_bp_has_activities_scope_friends_should_respect_id_order_when_record_dates_are_same() {
    532         $u1 = $this->factory->user->create();
    533         $u2 = $this->factory->user->create();
     532        $u1 = self::factory()->user->create();
     533        $u2 = self::factory()->user->create();
    534534
    535535        friends_add_friend( $u1, $u2, true );
    536536
    537537        // Friend's very fast status updates.
    538         $a1 = $this->factory->activity->create( array(
     538        $a1 = self::factory()->activity->create( array(
    539539            'user_id' => $u2,
    540540            'type' => 'activity_update',
    541541            'recorded_time' => date( 'Y-m-d H:i:s', 1451944920 ),
    542542        ) );
    543         $a2 = $this->factory->activity->create( array(
     543        $a2 = self::factory()->activity->create( array(
    544544            'user_id' => $u2,
    545545            'type' => 'activity_update',
     
    569569     */
    570570    public function test_bp_has_activities_scope_groups_should_respect_id_order_when_record_dates_are_same() {
    571         $u1 = $this->factory->user->create();
    572         $u2 = $this->factory->user->create();
    573         $u3 = $this->factory->user->create();
    574 
    575         $g1 = $this->factory->group->create( array( 'creator_id' => $u1 ) );
     571        $u1 = self::factory()->user->create();
     572        $u2 = self::factory()->user->create();
     573        $u3 = self::factory()->user->create();
     574
     575        $g1 = self::factory()->group->create( array( 'creator_id' => $u1 ) );
    576576
    577577        // Two user join first user's group same time
    578         $a1 = $this->factory->activity->create( array(
     578        $a1 = self::factory()->activity->create( array(
    579579            'user_id'   => $u2,
    580580            'component' => 'groups',
     
    583583            'recorded_time' => date( 'Y-m-d H:i:s', 1451944920 ),
    584584        ) );
    585         $a2 = $this->factory->activity->create( array(
     585        $a2 = self::factory()->activity->create( array(
    586586            'user_id'   => $u3,
    587587            'component' => 'groups',
     
    613613     */
    614614    function test_bp_has_activities_with_filter_query_nested_conditions() {
    615         $u1 = $this->factory->user->create();
    616         $u2 = $this->factory->user->create();
    617         $u3 = $this->factory->user->create();
    618 
    619         $now = time();
    620 
    621         $a1 = $this->factory->activity->create( array(
     615        $u1 = self::factory()->user->create();
     616        $u2 = self::factory()->user->create();
     617        $u3 = self::factory()->user->create();
     618
     619        $now = time();
     620
     621        $a1 = self::factory()->activity->create( array(
    622622            'user_id'   => $u3,
    623623            'component' => 'blogs',
     
    626626            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    627627        ) );
    628         $a2 = $this->factory->activity->create( array(
     628        $a2 = self::factory()->activity->create( array(
    629629            'user_id'   => $u2,
    630630            'component' => 'activity',
     
    634634
    635635        // misc activity items
    636         $this->factory->activity->create( array(
     636        self::factory()->activity->create( array(
    637637            'user_id'   => $u3,
    638638            'component' => 'activity',
     
    640640            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    641641        ) );
    642         $this->factory->activity->create( array(
     642        self::factory()->activity->create( array(
    643643            'user_id'   => $u3,
    644644            'component' => 'groups',
     
    683683     */
    684684    function test_bp_has_activities_with_filter_query_compare_not_in_operator() {
    685         $u1 = $this->factory->user->create();
    686         $u2 = $this->factory->user->create();
    687         $u3 = $this->factory->user->create();
     685        $u1 = self::factory()->user->create();
     686        $u2 = self::factory()->user->create();
     687        $u3 = self::factory()->user->create();
    688688
    689689        $now = time();
    690690
    691691        // misc activity items
    692         $a1 = $this->factory->activity->create( array(
     692        $a1 = self::factory()->activity->create( array(
    693693            'user_id'   => $u3,
    694694            'component' => 'blogs',
     
    697697            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    698698        ) );
    699         $a2 = $this->factory->activity->create( array(
     699        $a2 = self::factory()->activity->create( array(
    700700            'user_id'   => $u2,
    701701            'component' => 'activity',
     
    703703            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    704704        ) );
    705         $a3 = $this->factory->activity->create( array(
     705        $a3 = self::factory()->activity->create( array(
    706706            'user_id'   => $u3,
    707707            'component' => 'activity',
     
    709709            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    710710        ) );
    711         $a4 = $this->factory->activity->create( array(
     711        $a4 = self::factory()->activity->create( array(
    712712            'user_id'   => $u3,
    713713            'component' => 'groups',
     
    741741     */
    742742    function test_bp_has_activities_with_filter_query_compare_between_operator() {
    743         $u1 = $this->factory->user->create();
     743        $u1 = self::factory()->user->create();
    744744
    745745        $now = time();
    746746
    747747        // misc activity items
    748         $a1 = $this->factory->activity->create( array(
     748        $a1 = self::factory()->activity->create( array(
    749749            'user_id'   => $u1,
    750750            'component' => 'blogs',
     
    753753            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    754754        ) );
    755         $a2 = $this->factory->activity->create( array(
     755        $a2 = self::factory()->activity->create( array(
    756756            'user_id'   => $u1,
    757757            'component' => 'activity',
     
    759759            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    760760        ) );
    761         $a3 = $this->factory->activity->create( array(
     761        $a3 = self::factory()->activity->create( array(
    762762            'user_id'   => $u1,
    763763            'component' => 'activity',
     
    765765            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    766766        ) );
    767         $a4 = $this->factory->activity->create( array(
     767        $a4 = self::factory()->activity->create( array(
    768768            'user_id'   => $u1,
    769769            'component' => 'groups',
     
    797797     */
    798798    function test_bp_has_activities_with_filter_query_compare_arithmetic_comparisons() {
    799         $u1 = $this->factory->user->create();
     799        $u1 = self::factory()->user->create();
    800800
    801801        $now = time();
    802802
    803803        // misc activity items
    804         $a1 = $this->factory->activity->create( array(
     804        $a1 = self::factory()->activity->create( array(
    805805            'user_id'   => $u1,
    806806            'component' => 'activity',
     
    809809            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    810810        ) );
    811         $a2 = $this->factory->activity->create( array(
     811        $a2 = self::factory()->activity->create( array(
    812812            'user_id'   => $u1,
    813813            'component' => 'activity',
     
    816816            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    817817        ) );
    818         $a3 = $this->factory->activity->create( array(
     818        $a3 = self::factory()->activity->create( array(
    819819            'user_id'   => $u1,
    820820            'component' => 'activity',
     
    823823            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    824824        ) );
    825         $a4 = $this->factory->activity->create( array(
     825        $a4 = self::factory()->activity->create( array(
    826826            'user_id'   => $u1,
    827827            'component' => 'activity',
     
    913913     */
    914914    function test_bp_has_activities_with_filter_query_compare_regex() {
    915         $u1 = $this->factory->user->create();
     915        $u1 = self::factory()->user->create();
    916916
    917917        $now = time();
    918918
    919919        // misc activity items
    920         $a1 = $this->factory->activity->create( array(
     920        $a1 = self::factory()->activity->create( array(
    921921            'user_id'   => $u1,
    922922            'component' => 'blogs',
     
    925925            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    926926        ) );
    927         $a2 = $this->factory->activity->create( array(
     927        $a2 = self::factory()->activity->create( array(
    928928            'user_id'   => $u1,
    929929            'component' => 'blogs',
     
    931931            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    932932        ) );
    933         $a3 = $this->factory->activity->create( array(
     933        $a3 = self::factory()->activity->create( array(
    934934            'user_id'   => $u1,
    935935            'component' => 'activity',
     
    937937            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
    938938        ) );
    939         $a4 = $this->factory->activity->create( array(
     939        $a4 = self::factory()->activity->create( array(
    940940            'user_id'   => $u1,
    941941            'component' => 'groups',
     
    10031003        $reset_current_action = $bp->current_action;
    10041004
    1005         $u1 = $this->factory->user->create();
    1006         $u2 = $this->factory->user->create();
    1007         $u3 = $this->factory->user->create();
     1005        $u1 = self::factory()->user->create();
     1006        $u2 = self::factory()->user->create();
     1007        $u3 = self::factory()->user->create();
    10081008
    10091009        $this->set_current_user( $u1 );
    10101010
    1011         $g = $this->factory->group->create( array(
     1011        $g = self::factory()->group->create( array(
    10121012            'status' => 'private',
    10131013        ) );
     
    10161016        groups_join_group( $g, $u3 );
    10171017
    1018         $a1 = $this->factory->activity->create( array(
     1018        $a1 = self::factory()->activity->create( array(
    10191019            'component' => $bp->groups->id,
    10201020            'item_id'   => $g,
     
    10241024        ) );
    10251025
    1026         $a2 = $this->factory->activity->create( array(
     1026        $a2 = self::factory()->activity->create( array(
    10271027            'component' => $bp->groups->id,
    10281028            'item_id'   => $g,
     
    10571057        $reset_current_action = $bp->current_action;
    10581058
    1059         $u1 = $this->factory->user->create();
    1060         $u2 = $this->factory->user->create();
    1061         $u3 = $this->factory->user->create();
     1059        $u1 = self::factory()->user->create();
     1060        $u2 = self::factory()->user->create();
     1061        $u3 = self::factory()->user->create();
    10621062
    10631063        $this->set_current_user( $u1 );
    10641064
    1065         $g = $this->factory->group->create( array(
     1065        $g = self::factory()->group->create( array(
    10661066            'status' => 'hidden',
    10671067        ) );
     
    10701070        groups_join_group( $g, $u3 );
    10711071
    1072         $a1 = $this->factory->activity->create( array(
     1072        $a1 = self::factory()->activity->create( array(
    10731073            'component' => $bp->groups->id,
    10741074            'item_id'   => $g,
     
    10781078        ) );
    10791079
    1080         $a2 = $this->factory->activity->create( array(
     1080        $a2 = self::factory()->activity->create( array(
    10811081            'component' => $bp->groups->id,
    10821082            'item_id'   => $g,
     
    11051105     */
    11061106    function test_bp_has_activities_with_meta_query() {
    1107         $a1 = $this->factory->activity->create();
    1108         $a2 = $this->factory->activity->create();
     1107        $a1 = self::factory()->activity->create();
     1108        $a2 = self::factory()->activity->create();
    11091109        bp_activity_update_meta( $a1, 'foo', 'bar' );
    11101110
     
    11291129    public function test_bp_has_activities_with_display_comments_false() {
    11301130        $now = time();
    1131         $a1 = $this->factory->activity->create( array(
     1131        $a1 = self::factory()->activity->create( array(
    11321132            'content' => 'Life Rules',
    11331133            'recorded_time' => date( 'Y-m-d H:i:s', $now ),
    11341134        ) );
    1135         $a2 = $this->factory->activity->create( array(
     1135        $a2 = self::factory()->activity->create( array(
    11361136            'content' => 'Life Drools',
    11371137            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
     
    11591159    public function test_bp_has_activities_with_display_comments_0() {
    11601160        $now = time();
    1161         $a1 = $this->factory->activity->create( array(
     1161        $a1 = self::factory()->activity->create( array(
    11621162            'content' => 'Life Rules',
    11631163            'recorded_time' => date( 'Y-m-d H:i:s', $now ),
    11641164        ) );
    1165         $a2 = $this->factory->activity->create( array(
     1165        $a2 = self::factory()->activity->create( array(
    11661166            'content' => 'Life Drools',
    11671167            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
     
    11891189    public function test_bp_has_activities_with_display_comments_0_querystring() {
    11901190        $now = time();
    1191         $a1 = $this->factory->activity->create( array(
     1191        $a1 = self::factory()->activity->create( array(
    11921192            'content' => 'Life Rules',
    11931193            'recorded_time' => date( 'Y-m-d H:i:s', $now ),
    11941194        ) );
    1195         $a2 = $this->factory->activity->create( array(
     1195        $a2 = self::factory()->activity->create( array(
    11961196            'content' => 'Life Drools',
    11971197            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
     
    12171217    public function test_bp_has_activities_with_display_comments_none_querystring() {
    12181218        $now = time();
    1219         $a1 = $this->factory->activity->create( array(
     1219        $a1 = self::factory()->activity->create( array(
    12201220            'content' => 'Life Rules',
    12211221            'recorded_time' => date( 'Y-m-d H:i:s', $now ),
    12221222        ) );
    1223         $a2 = $this->factory->activity->create( array(
     1223        $a2 = self::factory()->activity->create( array(
    12241224            'content' => 'Life Drools',
    12251225            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
     
    12451245    public function test_bp_has_activities_with_update_meta_cache_false() {
    12461246        $now = time();
    1247         $a1 = $this->factory->activity->create( array(
     1247        $a1 = self::factory()->activity->create( array(
    12481248            'content' => 'Life Rules',
    12491249            'recorded_time' => date( 'Y-m-d H:i:s', $now ),
    12501250        ) );
    1251         $a2 = $this->factory->activity->create( array(
     1251        $a2 = self::factory()->activity->create( array(
    12521252            'content' => 'Life Drools',
    12531253            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
     
    12721272    public function test_bp_has_activities_with_update_meta_cache_true() {
    12731273        $now = time();
    1274         $a1 = $this->factory->activity->create( array(
     1274        $a1 = self::factory()->activity->create( array(
    12751275            'content' => 'Life Rules',
    12761276            'recorded_time' => date( 'Y-m-d H:i:s', $now ),
    12771277        ) );
    1278         $a2 = $this->factory->activity->create( array(
     1278        $a2 = self::factory()->activity->create( array(
    12791279            'content' => 'Life Drools',
    12801280            'recorded_time' => date( 'Y-m-d H:i:s', $now - 100 ),
     
    13001300        add_filter( 'bp_disable_blogforum_comments', '__return_false' );
    13011301
    1302         $u = $this->factory->user->create();
    1303 
    1304         $now = time();
    1305         $a1 = $this->factory->activity->create( array(
     1302        $u = self::factory()->user->create();
     1303
     1304        $now = time();
     1305        $a1 = self::factory()->activity->create( array(
    13061306            'content' => 'Life Rules',
    13071307            'component' => 'blogs',
     
    13101310            'user_id' => $u,
    13111311        ) );
    1312         $a2 = $this->factory->activity->create( array(
     1312        $a2 = self::factory()->activity->create( array(
    13131313            'content' => 'Life Drools',
    13141314            'component' => 'blogs',
     
    13271327        ) );
    13281328
    1329         $a4 = $this->factory->activity->create( array(
     1329        $a4 = self::factory()->activity->create( array(
    13301330            'content' => 'Life Rulez',
    13311331            'component' => 'activity',
     
    15131513     */
    15141514    public function test_bp_activity_has_more_items_no_count_total_false() {
    1515         $a1 = $this->factory->activity->create();
    1516         $a2 = $this->factory->activity->create();
     1515        $a1 = self::factory()->activity->create();
     1516        $a2 = self::factory()->activity->create();
    15171517
    15181518        $args = array(
     
    15311531     */
    15321532    public function test_bp_activity_has_more_items_no_count_total_true() {
    1533         $a1 = $this->factory->activity->create();
    1534         $a2 = $this->factory->activity->create();
    1535         $a3 = $this->factory->activity->create();
    1536         $a4 = $this->factory->activity->create();
     1533        $a1 = self::factory()->activity->create();
     1534        $a2 = self::factory()->activity->create();
     1535        $a3 = self::factory()->activity->create();
     1536        $a4 = self::factory()->activity->create();
    15371537
    15381538        $args = array(
     
    15521552     */
    15531553    public function test_bp_activity_has_more_items_count_total_false() {
    1554         $a1 = $this->factory->activity->create();
    1555         $a2 = $this->factory->activity->create();
    1556         $a3 = $this->factory->activity->create();
    1557         $a4 = $this->factory->activity->create();
     1554        $a1 = self::factory()->activity->create();
     1555        $a2 = self::factory()->activity->create();
     1556        $a3 = self::factory()->activity->create();
     1557        $a4 = self::factory()->activity->create();
    15581558
    15591559        $args = array(
     
    15721572     */
    15731573    public function test_bp_activity_has_more_items_count_total_true() {
    1574         $a1 = $this->factory->activity->create();
    1575         $a2 = $this->factory->activity->create();
    1576         $a3 = $this->factory->activity->create();
    1577         $a4 = $this->factory->activity->create();
     1574        $a1 = self::factory()->activity->create();
     1575        $a2 = self::factory()->activity->create();
     1576        $a3 = self::factory()->activity->create();
     1577        $a4 = self::factory()->activity->create();
    15781578
    15791579        $args = array(
     
    16001600        }
    16011601
    1602         $a1 = $this->factory->activity->create();
    1603         $a2 = $this->factory->activity->create( array(
     1602        $a1 = self::factory()->activity->create();
     1603        $a2 = self::factory()->activity->create( array(
    16041604            'recorded_time' => '2001-01-01 12:00'
    16051605        ) );
    1606         $a3 = $this->factory->activity->create( array(
     1606        $a3 = self::factory()->activity->create( array(
    16071607            'recorded_time' => '2005-01-01 12:00'
    16081608        ) );
Note: See TracChangeset for help on using the changeset viewer.