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/groups/cache.php

    r11091 r11737  
    1010     */
    1111    public function test_bp_groups_update_meta_cache() {
    12         $g1 = $this->factory->group->create();
    13         $g2 = $this->factory->group->create();
     12        $g1 = self::factory()->group->create();
     13        $g2 = self::factory()->group->create();
    1414
    1515        $time = bp_core_current_time();
     
    7171     */
    7272    public function test_bp_groups_delete_group_cache_on_metadata_add() {
    73         $g = $this->factory->group->create();
     73        $g = self::factory()->group->create();
    7474
    7575        // Prime cache
     
    8989     */
    9090    public function test_bp_groups_delete_group_cache_on_metadata_change() {
    91         $g = $this->factory->group->create();
     91        $g = self::factory()->group->create();
    9292
    9393        // Prime cache
     
    106106     */
    107107    public function test_bp_groups_prefetch_activity_object_data_all_cached() {
    108         $g = $this->factory->group->create();
     108        $g = self::factory()->group->create();
    109109
    110110        // Prime cache
     
    130130     */
    131131    public function test_bp_groups_prefetch_activity_object_data_some_cached() {
    132         $g1 = $this->factory->group->create();
    133         $g2 = $this->factory->group->create();
     132        $g1 = self::factory()->group->create();
     133        $g2 = self::factory()->group->create();
    134134
    135135        // Prime cache
     
    160160     */
    161161    public function test_groups_get_group_admins_cache() {
    162         $u1 = $this->factory->user->create();
    163         $u2 = $this->factory->user->create();
    164         $g = $this->factory->group->create( array( 'creator_id' => $u1 ) );
     162        $u1 = self::factory()->user->create();
     163        $u2 = self::factory()->user->create();
     164        $g = self::factory()->group->create( array( 'creator_id' => $u1 ) );
    165165
    166166        // User 2 joins the group
     
    185185     */
    186186    public function test_groups_get_group_mods_cache() {
    187         $u1 = $this->factory->user->create();
    188         $u2 = $this->factory->user->create();
    189         $g = $this->factory->group->create( array( 'creator_id' => $u1 ) );
     187        $u1 = self::factory()->user->create();
     188        $u2 = self::factory()->user->create();
     189        $g = self::factory()->group->create( array( 'creator_id' => $u1 ) );
    190190
    191191        // User 2 joins the group
     
    207207     */
    208208    public function test_groups_get_group_mods_cache_on_member_save() {
    209         $u1 = $this->factory->user->create();
    210         $u2 = $this->factory->user->create();
    211         $g = $this->factory->group->create( array( 'creator_id' => $u1 ) );
     209        $u1 = self::factory()->user->create();
     210        $u2 = self::factory()->user->create();
     211        $g = self::factory()->group->create( array( 'creator_id' => $u1 ) );
    212212
    213213        // prime cache
     
    225225     */
    226226    public function test_groups_get_group_admins_cache_on_member_save() {
    227         $u1 = $this->factory->user->create();
    228         $u2 = $this->factory->user->create();
    229         $g = $this->factory->group->create( array( 'creator_id' => $u1 ) );
     227        $u1 = self::factory()->user->create();
     228        $u2 = self::factory()->user->create();
     229        $g = self::factory()->group->create( array( 'creator_id' => $u1 ) );
    230230
    231231        // prime cache
Note: See TracChangeset for help on using the changeset viewer.