Make WordPress Core


Ignore:
Timestamp:
09/06/2022 10:09:49 PM (22 months 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/multisite/wpInstallDefaults.php

    r51860 r54090  
    1414         */
    1515        public function test_option_should_not_be_empty_by_default() {
    16             $blog_id = $this->factory->blog->create();
     16            $blog_id = self::factory()->blog->create();
    1717
    1818            switch_to_blog( $blog_id );
     
    4040            update_site_option( 'first_comment', '' );
    4141
    42             $blog_id = $this->factory->blog->create();
     42            $blog_id = self::factory()->blog->create();
    4343
    4444            switch_to_blog( $blog_id );
     
    6666            update_site_option( 'first_comment', 'Some comment content' );
    6767
    68             $blog_id = $this->factory->blog->create();
     68            $blog_id = self::factory()->blog->create();
    6969
    7070            switch_to_blog( $blog_id );
Note: See TracChangeset for help on using the changeset viewer.