Make WordPress Core


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

    r53863 r54090  
    721721         * Set up a comment for testing.
    722722         */
    723         $post = $this->factory->post->create(
     723        $post = self::factory()->post->create(
    724724            array(
    725725                'post_author' => self::$user_id,
     
    727727        );
    728728
    729         $comment = $this->factory->comment->create(
     729        $comment = self::factory()->comment->create(
    730730            array(
    731731                'comment_post_ID' => $post,
Note: See TracChangeset for help on using the changeset viewer.