diff --git tests/phpunit/includes/testcase-xmlrpc.php tests/phpunit/includes/testcase-xmlrpc.php
index bf0f22a..5f80e83 100644
--- tests/phpunit/includes/testcase-xmlrpc.php
+++ tests/phpunit/includes/testcase-xmlrpc.php
@@ -5,27 +5,60 @@ include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
 
 class WP_XMLRPC_UnitTestCase extends WP_UnitTestCase {
 	protected $myxmlrpcserver;
+	protected $username;
+	protected $password;
+	protected $role;
+	protected $user_id;
+	protected $mocked_auth = false;
 
 	function setUp() {
 		parent::setUp();
 
 		add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
 
+		add_filter( 'authenticate', array( $this, 'mock_authenticate' ), 10, 3 );
 		$this->myxmlrpcserver = new wp_xmlrpc_server();
 	}
 
 	function tearDown() {
+		remove_filter( 'authenticate', array( $this, 'mock_authenticate' ), 10, 3 );
+
+		if ( $this->mocked_auth ) {
+			add_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 );
+			add_filter( 'authenticate', 'wp_authenticate_spam_check', 99 );
+		}
+
 		remove_filter( 'pre_option_enable_xmlrpc', '__return_true' );
 		$this->remove_added_uploads();
 
 		parent::tearDown();
 	}
 
+	public function mock_authenticate( $user, $username, $password ) {
+		if ( $username === $this->username && $password === $this->password ) {
+			$user = new WP_User( $this->user_id );
+
+			// Don't let WP do its native authentication checks.
+			remove_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 );
+			remove_filter( 'authenticate', 'wp_authenticate_spam_check', 99 );
+
+			$this->mocked_auth = true;
+		}
+
+		return $user;
+	}
+
 	protected function make_user_by_role( $role ) {
-		return $this->factory->user->create( array(
+		$this->user_id = $this->factory->user->create( array(
 			'user_login' => $role,
 			'user_pass'  => $role,
 			'role'       => $role
 		));
+
+		$this->username = $role;
+		$this->password = $role;
+		$this->role = $role;
+
+		return $this->user_id;
 	}
 }
