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

    r52248 r54088  
    117117        global $wp_customize;
    118118        wp_set_current_user(
    119             $this->factory()->user->create(
     119            self::factory()->user->create(
    120120                array(
    121121                    'role' => 'administrator',
     
    160160        $this->assertFalse( $widget->is_attachment_with_mime_type( -123, 'image' ) );
    161161
    162         $post_id = $this->factory()->post->create();
     162        $post_id = self::factory()->post->create();
    163163        $this->assertFalse( $widget->is_attachment_with_mime_type( $post_id, 'image' ) );
    164164        $this->assertFalse( $widget->is_attachment_with_mime_type( $attachment_id, 'video' ) );
Note: See TracChangeset for help on using the changeset viewer.