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/query/search.php

    r52389 r54090  
    267267         */
    268268        public function test_s_zero() {
    269                 $p1 = $this->factory->post->create(
     269                $p1 = self::factory()->post->create(
    270270                        array(
    271271                                'post_status'  => 'publish',
    … …  
    276276                );
    277277
    278                 $p2 = $this->factory->post->create(
     278                $p2 = self::factory()->post->create(
    279279                        array(
    280280                                'post_status'  => 'publish',
Note: See TracChangeset for help on using the changeset viewer.