Make WordPress Core


Ignore:
Timestamp:
09/06/2022 10:09:49 PM (2 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/privacy/wpPrivacySendErasureFulfillmentNotification.php

    r51568 r54090  
    132132     */
    133133    public function test_should_send_email_with_privacy_policy() {
    134         $privacy_policy = $this->factory->post->create(
     134        $privacy_policy = self::factory()->post->create(
    135135            array(
    136136                'post_type'   => 'page',
     
    308308     */
    309309    public function test_should_not_send_email_when_not_user_request() {
    310         $post_id = $this->factory->post->create(
     310        $post_id = self::factory()->post->create(
    311311            array(
    312312                'post_type' => 'post', // Should be 'user_request'.
Note: See TracChangeset for help on using the changeset viewer.