Changeset 50790 for trunk/tests/phpunit/tests/pluggable.php
- Timestamp:
- 04/26/2021 01:02:34 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/pluggable.php
r47938 r50790 325 325 } 326 326 327 /** 328 * @ticket 28020 329 */ 330 public function test_get_user_by_should_return_same_instance_as_wp_get_current_user() { 331 // Create a test user 332 $new_user = self::factory()->user->create( array( 'role' => 'subscriber' ) ); 333 334 // Set the test user as the current user 335 $current_user = wp_set_current_user( $new_user ); 336 337 // Get the test user using get_user_by() 338 $from_get_user_by = get_user_by( 'id', $new_user ); 339 340 $this->assertSame( $current_user, $from_get_user_by ); 341 } 327 342 }
Note: See TracChangeset
for help on using the changeset viewer.