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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54090 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2022-09-06 22:09:49 +00:00
parent 563e24ced1
commit ff56396bf3
52 changed files with 598 additions and 598 deletions

View File

@@ -720,13 +720,13 @@ class Tests_Comment extends WP_UnitTestCase {
/**
* Set up a comment for testing.
*/
$post = $this->factory->post->create(
$post = self::factory()->post->create(
array(
'post_author' => self::$user_id,
)
);
$comment = $this->factory->comment->create(
$comment = self::factory()->comment->create(
array(
'comment_post_ID' => $post,
)