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/comment/commentsOpen.php

    r52223 r54090  
    1818     */
    1919    public function test_post_exist_status_open() {
    20         $post = $this->factory->post->create_and_get();
     20        $post = self::factory()->post->create_and_get();
    2121        $this->assertTrue( comments_open( $post ) );
    2222    }
     
    2626     */
    2727    public function test_post_exist_status_closed() {
    28         $post                 = $this->factory->post->create_and_get();
     28        $post                 = self::factory()->post->create_and_get();
    2929        $post->comment_status = 'closed';
    3030
Note: See TracChangeset for help on using the changeset viewer.