Make WordPress Core


Ignore:
Timestamp:
09/06/2022 10:09:49 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use the factory method instead of the property.

This replaces all references to the WP_UnitTestCase_Base::$factory property with static function calls to the WP_UnitTestCase_Base::factory() method.

This is a consistency improvement for the test suite.

Follow up to [35225], [35242], [49603], [54087], [54088].

Props jrf.
See #55652.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/taxonomy.php

    r54052 r54090  
    682682            )
    683683        );
    684         $t = $this->factory->term->create_and_get(
    685             array(
    686                 'taxonomy' => 'wptests_tax',
    687             )
    688         );
    689 
    690         $p = $this->factory->post->create();
     684        $t = self::factory()->term->create_and_get(
     685            array(
     686                'taxonomy' => 'wptests_tax',
     687            )
     688        );
     689
     690        $p = self::factory()->post->create();
    691691        wp_set_object_terms( $p, $t->slug, 'wptests_tax' );
    692692
Note: See TracChangeset for help on using the changeset viewer.