mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Improve the efficiency of is_user_member_of_blog() by removing its use of get_blogs_of_user(). Adds additional tests.
Fixes #32472 Props BinaryKitten, sammybeats, johnbillion git-svn-id: https://develop.svn.wordpress.org/trunk@33771 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -366,6 +366,11 @@ class Tests_User extends WP_UnitTestCase {
|
||||
function test_is_user_member_of_blog() {
|
||||
$old_current = get_current_user_id();
|
||||
|
||||
$this->assertSame( 0, $old_current );
|
||||
|
||||
// test for "get current user" when not logged in
|
||||
$this->assertFalse( is_user_member_of_blog() );
|
||||
|
||||
$user_id = $this->factory->user->create( array( 'role' => 'subscriber' ) );
|
||||
wp_set_current_user( $user_id );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user