Make WordPress Core


Ignore:
Timestamp:
09/06/2022 10:03:10 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Tests: Correctly use the factory method.

This replaces all non-static calls to the WP_UnitTestCase_Base::factory() method with static function calls, since the method is declared as static.

This is a consistency improvement for the test suite.

Follow up to [35225], [35242], [49603], [54087].

Props jrf.
See #55652.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment/checkComment.php

    r53863 r54088  
    139139     */
    140140    public function test_should_return_true_when_comment_previously_approved_is_enabled_and_user_has_previously_approved_comments_with_different_email() {
    141         $subscriber_id = $this->factory()->user->create(
     141        $subscriber_id = self::factory()->user->create(
    142142            array(
    143143                'role'  => 'subscriber',
     
    171171     */
    172172    public function test_should_return_false_when_comment_previously_approved_is_enabled_and_user_does_not_have_a_previously_approved_comment_with_any_email() {
    173         $subscriber_id = $this->factory()->user->create(
     173        $subscriber_id = self::factory()->user->create(
    174174            array(
    175175                'role'  => 'subscriber',
Note: See TracChangeset for help on using the changeset viewer.