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/ajax/CustomizeMenus.php

    r53571 r54088  
    707707
    708708        // Bad nonce.
    709         wp_set_current_user( $this->factory()->user->create( array( 'role' => 'subscriber' ) ) );
     709        wp_set_current_user( self::factory()->user->create( array( 'role' => 'subscriber' ) ) );
    710710        $_POST                = wp_slash(
    711711            array(
     
    720720
    721721        // Missing params.
    722         wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) );
     722        wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
    723723        $_POST                = wp_slash(
    724724            array(
Note: See TracChangeset for help on using the changeset viewer.