mirror of
git://develop.git.wordpress.org/
synced 2025-03-22 04:49:49 +01:00
Tests: Restore the original user role in the (add|remove)_user_role
hooks test.
This makes sure the test does not unintentionally affect other tests. Follow-up to [52823]. Fixes #54164. git-svn-id: https://develop.svn.wordpress.org/trunk@52824 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
864ab55b33
commit
34d98887a2
@ -1641,8 +1641,9 @@ class Tests_User_Capabilities extends WP_UnitTestCase {
|
||||
add_action( 'add_user_role', array( $add_user_role, 'action' ) );
|
||||
|
||||
$user->set_role( 'editor' );
|
||||
$this->assertSame( 1, $remove_user_role->get_call_count() );
|
||||
$this->assertSame( 1, $add_user_role->get_call_count() );
|
||||
$user->set_role( 'administrator' );
|
||||
$this->assertSame( 2, $remove_user_role->get_call_count() );
|
||||
$this->assertSame( 2, $add_user_role->get_call_count() );
|
||||
}
|
||||
|
||||
public function test_current_user_can_for_blog() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user