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/l10n/wpLocaleSwitcher.php

    r53874 r54088  
    327327        $site_locale = get_locale();
    328328
    329         $user_id = $this->factory()->user->create(
     329        $user_id = self::factory()->user->create(
    330330            array(
    331331                'role'   => 'administrator',
     
    379379        $site_locale = get_locale();
    380380
    381         $user_id = $this->factory()->user->create(
     381        $user_id = self::factory()->user->create(
    382382            array(
    383383                'role'   => 'administrator',
     
    431431        $site_locale = get_locale();
    432432
    433         $user_id = $this->factory()->user->create(
     433        $user_id = self::factory()->user->create(
    434434            array(
    435435                'role'   => 'administrator',
Note: See TracChangeset for help on using the changeset viewer.