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/getTheModifiedDate.php

    r50291 r54090  
    2121            'post_date_gmt' => '2016-01-21 15:34:36',
    2222        );
    23         $post_id  = $this->factory->post->create( $details );
     23        $post_id  = self::factory()->post->create( $details );
    2424        $format   = 'Y-m-d';
    2525        $expected = '2016-01-21';
     
    4040            'post_date_gmt' => '2016-01-21 15:34:36',
    4141        );
    42         $post_id = $this->factory->post->create( $details );
     42        $post_id = self::factory()->post->create( $details );
    4343        $post    = get_post( $post_id );
    4444
     
    112112            'post_date_gmt' => '2016-01-21 15:34:36',
    113113        );
    114         $post_id  = $this->factory->post->create( $details );
     114        $post_id  = self::factory()->post->create( $details );
    115115        $format   = 'G';
    116116        $expected = 1453390476;
     
    131131            'post_date_gmt' => '2016-01-21 15:34:36',
    132132        );
    133         $post_id = $this->factory->post->create( $details );
     133        $post_id = self::factory()->post->create( $details );
    134134        $post    = get_post( $post_id );
    135135
Note: See TracChangeset for help on using the changeset viewer.