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:
Andrew Nacin
2013-09-12 18:37:32 +00:00
parent d5d476974e
commit 4c8f1e263a
11 changed files with 93 additions and 61 deletions
-22
View File
@@ -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 );