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/wpWidgetCustomHtml.php

    r52248 r54088  
    173173
    174174        wp_set_current_user(
    175             $this->factory()->user->create(
     175            self::factory()->user->create(
    176176                array(
    177177                    'role' => 'administrator',
     
    242242     */
    243243    public function test_enqueue_admin_scripts_when_logged_in_and_syntax_highlighting_on() {
    244         $user = $this->factory()->user->create();
     244        $user = self::factory()->user->create();
    245245        wp_set_current_user( $user );
    246246        wp_get_current_user()->syntax_highlighting = 'true';
     
    263263     */
    264264    public function test_enqueue_admin_scripts_when_logged_in_and_syntax_highlighting_off() {
    265         $user = $this->factory()->user->create();
     265        $user = self::factory()->user->create();
    266266        wp_set_current_user( $user );
    267267        update_user_meta( $user, 'syntax_highlighting', 'false' );
Note: See TracChangeset for help on using the changeset viewer.