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/customize/custom-css-setting.php

    r52010 r54088  
    121121
    122122        $original_css      = 'body { color: black; }';
    123         $post_id           = $this->factory()->post->create(
     123        $post_id           = self::factory()->post->create(
    124124            array(
    125125                'post_title'   => $this->setting->stylesheet,
     
    131131        );
    132132        $twentyten_css     = 'body { color: red; }';
    133         $twentyten_post_id = $this->factory()->post->create(
     133        $twentyten_post_id = self::factory()->post->create(
    134134            array(
    135135                'post_title'   => 'twentyten',
     
    274274        $this->assertSame( '/*default*//*filtered*/', $this->setting->value() );
    275275
    276         $this->factory()->post->create(
     276        self::factory()->post->create(
    277277            array(
    278278                'post_title'   => $this->setting->stylesheet,
     
    311311    public function test_update_filter() {
    312312        $original_css = 'body { color:red; }';
    313         $post_id      = $this->factory()->post->create(
     313        $post_id      = self::factory()->post->create(
    314314            array(
    315315                'post_title'   => $this->setting->stylesheet,
Note: See TracChangeset for help on using the changeset viewer.