Make WordPress Core


Ignore:
Timestamp:
10/17/2022 04:53:54 PM (20 months ago)
Author:
SergeyBiryukov
Message:

Users: Revert use of shared objects for current user.

Reverts [50790].

Props oztaser, ravipatel, dd32, costdev, SergeyBiryukov, tykoted, cu121, xknown.
Merges [54397] to the 6.0 branch.
Fixes #54984.

Location:
branches/6.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.0

  • branches/6.0/tests/phpunit/tests/pluggable.php

    r53231 r54544  
    340340    }
    341341
    342     /**
    343      * @ticket 28020
    344      */
    345     public function test_get_user_by_should_return_same_instance_as_wp_get_current_user() {
    346         // Create a test user.
    347         $new_user = self::factory()->user->create( array( 'role' => 'subscriber' ) );
    348 
    349         // Set the test user as the current user.
    350         $current_user = wp_set_current_user( $new_user );
    351 
    352         // Get the test user using get_user_by().
    353         $from_get_user_by = get_user_by( 'id', $new_user );
    354 
    355         $this->assertSame( $current_user, $from_get_user_by );
    356     }
    357342}
Note: See TracChangeset for help on using the changeset viewer.