Make WordPress Core


Ignore:
Timestamp:
09/06/2022 10:09:49 PM (3 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/term/getTermBy.php

    r52836 r54090  
    197197        global $wpdb;
    198198
    199         $term_id = $this->factory->term->create(
     199        $term_id = self::factory()->term->create(
    200200            array(
    201201                'name'     => 'burrito',
     
    212212     */
    213213    public function test_query_should_contain_limit_clause() {
    214         $term_id = $this->factory->term->create(
     214        $term_id = self::factory()->term->create(
    215215            array(
    216216                'name'     => 'burrito',
     
    243243        register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true ) );
    244244
    245         $term_id = $this->factory->term->create(
     245        $term_id = self::factory()->term->create(
    246246            array(
    247247                'name'     => '0',
     
    260260        register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true ) );
    261261
    262         $term_id = $this->factory->term->create(
     262        $term_id = self::factory()->term->create(
    263263            array(
    264264                'taxonomy' => 'wptests_tax',
Note: See TracChangeset for help on using the changeset viewer.