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/query/conditionals.php

    r53429 r54090  
    979979        $this->set_permalink_structure( '/%postname%/' );
    980980
    981         $attachment_id = $this->factory->post->create(
     981        $attachment_id = self::factory()->post->create(
    982982            array(
    983983                'post_type' => 'attachment',
     
    985985        );
    986986
    987         $post_id = $this->factory->post->create(
     987        $post_id = self::factory()->post->create(
    988988            array(
    989989                'post_title' => get_post( $attachment_id )->post_title,
Note: See TracChangeset for help on using the changeset viewer.