Make WordPress Core


Ignore:
Timestamp:
09/06/2022 10:03:10 PM (21 months 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/widgets/wpWidgetText.php

    r52010 r54088  
    8282        global $wp_customize;
    8383        wp_set_current_user(
    84             $this->factory()->user->create(
     84            self::factory()->user->create(
    8585                array(
    8686                    'role' => 'administrator',
     
    316316    public function test_widget_shortcodes() {
    317317        global $post;
    318         $post_id = $this->factory()->post->create();
     318        $post_id = self::factory()->post->create();
    319319        $post    = get_post( $post_id );
    320320
     
    717717
    718718        wp_set_current_user(
    719             $this->factory()->user->create(
     719            self::factory()->user->create(
    720720                array(
    721721                    'role' => 'administrator',
Note: See TracChangeset for help on using the changeset viewer.