mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 06:37:06 +00:00
Use @expectedDeprecated. see #25282, [25408].
git-svn-id: https://develop.svn.wordpress.org/trunk@25409 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
class Tests_User_Capabilities extends WP_UnitTestCase {
|
||||
protected $user_ids = array();
|
||||
protected $deprecated_functions = array( 'set_current_user' );
|
||||
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
@@ -649,27 +648,6 @@ class Tests_User_Capabilities extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
function test_current_user_can_for_blog() {
|
||||
$user = new WP_User( $this->factory->user->create( array( 'role' => 'administrator' ) ) );
|
||||
$old_uid = get_current_user_id();
|
||||
set_current_user( $user->ID );
|
||||
|
||||
$this->assertTrue( current_user_can_for_blog( get_current_blog_id(), 'edit_posts' ) );
|
||||
$this->assertFalse( current_user_can_for_blog( get_current_blog_id(), 'foo_the_bar' ) );
|
||||
if ( ! is_multisite() ) {
|
||||
$this->assertTrue( current_user_can_for_blog( 12345, 'edit_posts' ) );
|
||||
return;
|
||||
}
|
||||
|
||||
$this->assertFalse( current_user_can_for_blog( 12345, 'edit_posts' ) );
|
||||
|
||||
$blog_id = $this->factory->blog->create( array( 'user_id' => $user->ID ) );
|
||||
$this->assertTrue( current_user_can_for_blog( $blog_id, 'edit_posts' ) );
|
||||
$this->assertFalse( current_user_can_for_blog( $blog_id, 'foo_the_bar' ) );
|
||||
|
||||
set_current_user( $old_uid );
|
||||
}
|
||||
|
||||
function test_wp_set_current_user() {
|
||||
$user = new WP_User( $this->factory->user->create( array( 'role' => 'administrator' ) ) );
|
||||
$old_uid = get_current_user_id();
|
||||
wp_set_current_user( $user->ID );
|
||||
|
||||
Reference in New Issue
Block a user