Make WordPress Core


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

    r54088 r54090  
    455455        add_filter( 'pre_wp_unique_post_slug', array( $this, 'filter_pre_wp_unique_post_slug' ), 10, 6 );
    456456
    457         $post_id = $this->factory->post->create(
     457        $post_id = self::factory()->post->create(
    458458            array(
    459459                'title'       => 'An example',
Note: See TracChangeset for help on using the changeset viewer.