Make WordPress Core


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

    r54068 r54088  
    727727        public function test_use_block_editor_for_post() {
    728728                $this->assertFalse( use_block_editor_for_post( -1 ) );
    729                 $bogus_post_id = $this->factory()->post->create(
     729                $bogus_post_id = self::factory()->post->create(
    730730                        array(
    731731                                'post_type' => 'bogus',
     
    740740                        )
    741741                );
    742                 $restless_post_id = $this->factory()->post->create(
     742                $restless_post_id = self::factory()->post->create(
    743743                        array(
    744744                                'post_type' => 'restless',
     
    747747                $this->assertFalse( use_block_editor_for_post( $restless_post_id ) );
    748748
    749                 $generic_post_id = $this->factory()->post->create();
     749                $generic_post_id = self::factory()->post->create();
    750750
    751751                add_filter( 'use_block_editor_for_post', '__return_false' );
Note: See TracChangeset for help on using the changeset viewer.