Users: Revert use of shared objects for current user.

Reverts [50790].

Props oztaser, ravipatel, dd32, costdev, SergeyBiryukov, tykoted, cu121, xknown.
Fixes #54984.



git-svn-id: https://develop.svn.wordpress.org/trunk@54397 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Wilson
2022-10-06 04:36:46 +00:00
parent aac3784618
commit e5a0d1364d
3 changed files with 0 additions and 43 deletions
@@ -1,24 +0,0 @@
<?php
/**
* @group pluggable
* @covers ::get_user_by
*/
class Tests_Pluggable_GetUserBy extends WP_UnitTestCase {
/**
* @ticket 28020
*/
public function test_get_user_by_should_return_same_instance_as_wp_get_current_user() {
// Create a test user.
$new_user = self::factory()->user->create( array( 'role' => 'subscriber' ) );
// Set the test user as the current user.
$current_user = wp_set_current_user( $new_user );
// Get the test user using get_user_by().
$from_get_user_by = get_user_by( 'id', $new_user );
$this->assertSame( $current_user, $from_get_user_by );
}
}