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/date/getFeedBuildDate.php

    r52010 r54090  
    5656        $this->assertFalse( get_feed_build_date( DATE_RFC3339 ), 'False when unable to determine valid time' );
    5757
    58         $this->factory->post->create(
     58        self::factory()->post->create(
    5959            array(
    6060                'post_date' => $datetime->format( 'Y-m-d H:i:s' ),
     
    6969        );
    7070
    71         $post_id_broken = $this->factory->post->create();
     71        $post_id_broken = self::factory()->post->create();
    7272        $post_broken    = get_post( $post_id_broken );
    7373
Note: See TracChangeset for help on using the changeset viewer.