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/post/nav-menu.php

    r53510 r54088  
    746746     */
    747747    public function test_wp_delete_customize_changeset_dependent_auto_drafts() {
    748         $auto_draft_post_id = $this->factory()->post->create(
     748        $auto_draft_post_id = self::factory()->post->create(
    749749            array(
    750750                'post_status' => 'auto-draft',
    751751            )
    752752        );
    753         $draft_post_id      = $this->factory()->post->create(
     753        $draft_post_id      = self::factory()->post->create(
    754754            array(
    755755                'post_status' => 'draft',
    756756            )
    757757        );
    758         $private_post_id    = $this->factory()->post->create(
     758        $private_post_id    = self::factory()->post->create(
    759759            array(
    760760                'post_status' => 'private',
Note: See TracChangeset for help on using the changeset viewer.