Make WordPress Core


Ignore:
Timestamp:
09/06/2022 10:09:49 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use the factory method instead of the property.

This replaces all references to the WP_UnitTestCase_Base::$factory property with static function calls to the WP_UnitTestCase_Base::factory() method.

This is a consistency improvement for the test suite.

Follow up to [35225], [35242], [49603], [54087], [54088].

Props jrf.
See #55652.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/general/wpGetDocumentTitle.php

    r53815 r54090  
    102102        update_option(
    103103            'page_on_front',
    104             $this->factory->post->create(
     104            self::factory()->post->create(
    105105                array(
    106106                    'post_title' => 'front-page',
     
    129129
    130130    public function test_home_title() {
    131         $blog_page_id = $this->factory->post->create(
     131        $blog_page_id = self::factory()->post->create(
    132132            array(
    133133                'post_title' => 'blog-page',
     
    206206        );
    207207
    208         $this->factory->post->create(
     208        self::factory()->post->create(
    209209            array(
    210210                'post_type' => 'cpt',
Note: See TracChangeset for help on using the changeset viewer.