Skip to:
Content

BuddyPress.org


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

    r11076 r11737  
    1010     */
    1111    public function test_bp_activity_update_meta_cache() {
    12         $a1 = $this->factory->activity->create();
    13         $a2 = $this->factory->activity->create();
     12        $a1 = self::factory()->activity->create();
     13        $a2 = self::factory()->activity->create();
    1414
    1515        // Set up some data
     
    5959     */
    6060    public function test_bp_activity_clear_cache_for_activity() {
    61         $u = $this->factory->user->create();
    62 
    63         $a = $this->factory->activity->create( array(
     61        $u = self::factory()->user->create();
     62
     63        $a = self::factory()->activity->create( array(
    6464            'component'     => buddypress()->activity->id,
    6565            'type'          => 'activity_update',
     
    9292        global $wpdb;
    9393
    94         $u = $this->factory->user->create();
    95         $a = $this->factory->activity->create( array(
     94        $u = self::factory()->user->create();
     95        $a = self::factory()->activity->create( array(
    9696            'component'     => buddypress()->activity->id,
    9797            'type'          => 'activity_update',
     
    123123        global $wpdb;
    124124
    125         $u = $this->factory->user->create();
    126         $a = $this->factory->activity->create( array(
     125        $u = self::factory()->user->create();
     126        $a = self::factory()->activity->create( array(
    127127            'component'     => buddypress()->activity->id,
    128128            'type'          => 'activity_update',
     
    162162        global $wpdb;
    163163
    164         $u = $this->factory->user->create();
    165         $a1 = $this->factory->activity->create( array(
     164        $u = self::factory()->user->create();
     165        $a1 = self::factory()->activity->create( array(
    166166            'component'     => buddypress()->activity->id,
    167167            'type'          => 'activity_update',
     
    179179
    180180        // Bust the cache.
    181         $a2 = $this->factory->activity->create( array(
     181        $a2 = self::factory()->activity->create( array(
    182182            'component'     => buddypress()->activity->id,
    183183            'type'          => 'activity_update',
     
    204204        global $wpdb;
    205205
    206         $u = $this->factory->user->create();
    207         $a = $this->factory->activity->create( array(
     206        $u = self::factory()->user->create();
     207        $a = self::factory()->activity->create( array(
    208208            'component'     => buddypress()->activity->id,
    209209            'type'          => 'activity_update',
     
    221221
    222222        // Bust the cache.
    223         $this->factory->activity->create( array(
     223        self::factory()->activity->create( array(
    224224            'id'            => $a,
    225225            'component'     => buddypress()->activity->id,
     
    244244        global $wpdb;
    245245
    246         $u = $this->factory->user->create();
    247         $a = $this->factory->activity->create( array(
     246        $u = self::factory()->user->create();
     247        $a = self::factory()->activity->create( array(
    248248            'component'     => buddypress()->activity->id,
    249249            'type'          => 'activity_update',
     
    281281        global $wpdb;
    282282
    283         $activities = $this->factory->activity->create_many( 2 );
     283        $activities = self::factory()->activity->create_many( 2 );
    284284        bp_activity_add_meta( $activities[0], 'foo', 'bar' );
    285285
     
    309309        global $wpdb;
    310310
    311         $activities = $this->factory->activity->create_many( 2 );
     311        $activities = self::factory()->activity->create_many( 2 );
    312312        bp_activity_add_meta( $activities[0], 'foo', 'bar' );
    313313        bp_activity_add_meta( $activities[1], 'foo', 'baz' );
     
    338338        global $wpdb;
    339339
    340         $activities = $this->factory->activity->create_many( 2 );
     340        $activities = self::factory()->activity->create_many( 2 );
    341341        bp_activity_add_meta( $activities[0], 'foo', 'bar' );
    342342        bp_activity_add_meta( $activities[1], 'foo', 'bar' );
Note: See TracChangeset for help on using the changeset viewer.