Make WordPress Core


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

    r53489 r54090  
    1414
    1515        // Create a user with a different display_name.
    16         $u = $this->factory->user->create(
     16        $u = self::factory()->user->create(
    1717            array(
    1818                'user_login'   => 'foo',
     
    3838
    3939        // Create a user with a different display_name.
    40         $u = $this->factory->user->create(
     40        $u = self::factory()->user->create(
    4141            array(
    4242                'user_login'   => 'foo',
     
    6464
    6565        // Create a user with a different display_name.
    66         $u = $this->factory->user->create(
     66        $u = self::factory()->user->create(
    6767            array(
    6868                'user_login'   => 'foo',
     
    9090
    9191        // Create a user with a different display_name.
    92         $u = $this->factory->user->create(
     92        $u = self::factory()->user->create(
    9393            array(
    9494                'user_login'   => 'foo',
Note: See TracChangeset for help on using the changeset viewer.