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/image/functions.php

    r54086 r54090  
    659659        }
    660660
    661         $attachment_id = $this->factory->attachment->create_object(
     661        $attachment_id = self::factory()->attachment->create_object(
    662662            $test_file,
    663663            0,
     
    736736        }
    737737
    738         $attachment_id = $this->factory->attachment->create_object(
     738        $attachment_id = self::factory()->attachment->create_object(
    739739            $test_file,
    740740            0,
     
    809809        }
    810810
    811         $attachment_id = $this->factory->attachment->create_object(
     811        $attachment_id = self::factory()->attachment->create_object(
    812812            $test_file,
    813813            0,
     
    883883        }
    884884
    885         $attachment_id = $this->factory->attachment->create_object(
     885        $attachment_id = self::factory()->attachment->create_object(
    886886            $pdf_path,
    887887            0,
Note: See TracChangeset for help on using the changeset viewer.