Make WordPress Core


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

    r52836 r54090  
    245245                global $wpdb;
    246246
    247                 $term_id = $this->factory->term->create(
     247                $term_id = self::factory()->term->create(
    248248                        array(
    249249                                'slug'     => 'burrito',
    … …  
    276276                global $wpdb;
    277277
    278                 $term_id = $this->factory->term->create(
     278                $term_id = self::factory()->term->create(
    279279                        array(
    280280                                'slug'     => 'burrito',
    … …  
    314314                global $wpdb;
    315315
    316                 $term_id = $this->factory->term->create(
     316                $term_id = self::factory()->term->create(
    317317                        array(
    318318                                'name'     => 'Burrito',
    … …  
    343343                global $wpdb;
    344344
    345                 $term_id = $this->factory->term->create(
     345                $term_id = self::factory()->term->create(
    346346                        array(
    347347                                'name'     => 'Burrito',
    … …  
    378378                global $wpdb;
    379379
    380                 $term_id = $this->factory->term->create(
     380                $term_id = self::factory()->term->create(
    381381                        array(
    382382                                'name'     => 'Burrito',
    … …  
    421421                global $wpdb;
    422422
    423                 $term_id = $this->factory->term->create(
     423                $term_id = self::factory()->term->create(
    424424                        array(
    425425                                'name'     => 'Burrito',
Note: See TracChangeset for help on using the changeset viewer.