Index: wp-testcase/test-xmlrpc-api/test_wp_getTaxonomies.php
===================================================================
--- wp-testcase/test-xmlrpc-api/test_wp_getTaxonomies.php	(revision 0)
+++ wp-testcase/test-xmlrpc-api/test_wp_getTaxonomies.php	(revision 0)
@@ -0,0 +1,52 @@
+<?php
+include_once(ABSPATH . 'wp-admin/includes/admin.php');
+include_once(ABSPATH . WPINC . '/class-IXR.php');
+include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
+
+class TestXMLRPCServer_wp_getTaxonomies extends WPTestCase {
+	var $user_ids = array();
+
+	function setUp() {
+		parent::setUp();
+		// keep track of users we create
+		$this->user_ids = array();
+		$this->term_ids = array();
+		$this->_flush_roles();
+
+		$this->orig_users = get_users_of_blog();
+		add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+
+		$this->_make_user( 'subscriber', 'subscriber', 'subscriber' );
+		$this->_make_user( 'contributor', 'contributor', 'contributor' );
+		$this->_make_user( 'author', 'author', 'author' );
+		$this->_make_user( 'editor', 'editor', 'editor' );
+
+		$this->myxmlrpcserver = new wp_xmlrpc_server();
+	}
+
+	function tearDown() {
+		parent::tearDown();
+		// delete any users that were created during tests
+		foreach ( $this->user_ids as $id )
+			wp_delete_user($id);
+
+		remove_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+	}
+
+	function _flush_roles() {
+		// we want to make sure we're testing against the db, not just in-memory data
+		// this will flush everything and reload it from the db
+		unset( $GLOBALS['wp_user_roles'] );
+	}
+
+	function test_invalid_username_password() {
+		$result = $this->myxmlrpcserver->wp_getTaxonomies( array( 1, 'username', 'password' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+	}
+
+	function test_taxonomy_validated() {
+		$result = $this->myxmlrpcserver->wp_getTaxonomies( array( 1, 'editor', 'editor', 'category' ) );
+		$this->assertNotInstanceOf( 'IXR_Error', $result );
+	}
+}
\ No newline at end of file
Index: wp-testcase/test-xmlrpc-api/test_wp_getTerm.php
===================================================================
--- wp-testcase/test-xmlrpc-api/test_wp_getTerm.php	(revision 0)
+++ wp-testcase/test-xmlrpc-api/test_wp_getTerm.php	(revision 0)
@@ -0,0 +1,96 @@
+<?php
+include_once(ABSPATH . 'wp-admin/includes/admin.php');
+include_once(ABSPATH . WPINC . '/class-IXR.php');
+include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
+
+class TestXMLRPCServer_wp_getTerm extends WPTestCase {
+	var $user_ids = array();
+	var $term;
+
+	function setUp() {
+		parent::setUp();
+		// keep track of users we create
+		$this->user_ids = array();
+		$this->term_ids = array();
+		$this->_flush_roles();
+
+		$this->orig_users = get_users_of_blog();
+		add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+
+		$this->_make_user( 'subscriber', 'subscriber', 'subscriber' );
+		$this->_make_user( 'contributor', 'contributor', 'contributor' );
+		$this->_make_user( 'author', 'author', 'author' );
+		$this->_make_user( 'editor', 'editor', 'editor' );
+
+		$this->term = wp_insert_term( 'term' , 'category' );
+
+		$this->myxmlrpcserver = new wp_xmlrpc_server();
+	}
+
+	function tearDown() {
+		parent::tearDown();
+		// delete any users that were created during tests
+		foreach ( $this->user_ids as $id )
+			wp_delete_user($id);
+
+		wp_delete_term( $this->term['term_id'], 'category' );
+
+		remove_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+	}
+
+	function _flush_roles() {
+		// we want to make sure we're testing against the db, not just in-memory data
+		// this will flush everything and reload it from the db
+		unset( $GLOBALS['wp_user_roles'] );
+	}
+
+	function test_invalid_username_password() {
+		$result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'username', 'password' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+	}
+
+	function test_empty_taxonomy() {
+		$result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'subscriber', 'subscriber' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
+	}
+
+	function test_invalid_taxonomy() {
+		$result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'subscriber', 'subscriber', 'not_existing' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
+	}
+
+	function test_incapable_user() {
+		$result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'subscriber', 'subscriber', 'category', $this->term['term_id'] ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 401, $result->code );
+		$this->assertEquals( __( 'You are not allowed to assign terms in this taxonomy.' ), $result->message );
+	}
+
+
+	function test_empty_term() {
+		$result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', '' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 500, $result->code );
+		$this->assertEquals( __('Empty Term'), $result->message );
+	}
+
+	function test_invalid_term() {
+		$result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', 9999 ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 404, $result->code );
+		$this->assertEquals( __('Invalid term ID.'), $result->message );
+	}
+
+	function test_term_validated() {
+		$result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', $this->term['term_id'] ) );
+		$this->assertNotInstanceOf( 'IXR_Error', $result );
+
+		$term = (array)get_term( $this->term['term_id'], 'category' );
+		$this->assertEquals( $result, $term );
+	}
+}
\ No newline at end of file
Index: wp-testcase/test-xmlrpc-api/test_wp_deleteTerm.php
===================================================================
--- wp-testcase/test-xmlrpc-api/test_wp_deleteTerm.php	(revision 0)
+++ wp-testcase/test-xmlrpc-api/test_wp_deleteTerm.php	(revision 0)
@@ -0,0 +1,92 @@
+<?php
+include_once(ABSPATH . 'wp-admin/includes/admin.php');
+include_once(ABSPATH . WPINC . '/class-IXR.php');
+include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
+
+class TestXMLRPCServer_wp_deleteTerm extends WPTestCase {
+	var $user_ids = array();
+	var $term;
+
+	function setUp() {
+		parent::setUp();
+		// keep track of users we create
+		$this->user_ids = array();
+		$this->term_ids = array();
+		$this->_flush_roles();
+
+		$this->orig_users = get_users_of_blog();
+		add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+
+		$this->_make_user( 'subscriber', 'subscriber', 'subscriber' );
+		$this->_make_user( 'contributor', 'contributor', 'contributor' );
+		$this->_make_user( 'author', 'author', 'author' );
+		$this->_make_user( 'editor', 'editor', 'editor' );
+
+		$this->term = wp_insert_term( 'term' , 'category' );
+
+		$this->myxmlrpcserver = new wp_xmlrpc_server();
+	}
+
+	function tearDown() {
+		parent::tearDown();
+		// delete any users that were created during tests
+		foreach ( $this->user_ids as $id )
+			wp_delete_user($id);
+
+		wp_delete_term( $this->term['term_id'], 'category' );
+
+		remove_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+	}
+
+	function _flush_roles() {
+		// we want to make sure we're testing against the db, not just in-memory data
+		// this will flush everything and reload it from the db
+		unset( $GLOBALS['wp_user_roles'] );
+	}
+
+	function test_invalid_username_password() {
+		$result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'username', 'password' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+	}
+
+	function test_empty_taxonomy() {
+		$result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
+	}
+
+	function test_invalid_taxonomy() {
+		$result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', 'not_existing' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
+	}
+
+	function test_incapable_user() {
+		$result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', 'category', $this->term['term_id'] ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 401, $result->code );
+		$this->assertEquals( __( 'You are not allowed to delete terms in this taxonomy.' ), $result->message );
+	}
+
+	function test_empty_term() {
+		$result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', '' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 500, $result->code );
+		$this->assertEquals( __('Empty Term'), $result->message );
+	}
+
+	function test_invalid_term() {
+		$result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', 9999 ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 404, $result->code );
+		$this->assertEquals( __('Invalid term ID.'), $result->message );
+	}
+
+	function test_term_deleted() {
+		$result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', $this->term['term_id'] ) );
+		$this->assertNotInstanceOf( 'IXR_Error', $result );
+	}
+}
\ No newline at end of file
Index: wp-testcase/test-xmlrpc-api/test_wp_getTerms.php
===================================================================
--- wp-testcase/test-xmlrpc-api/test_wp_getTerms.php	(revision 0)
+++ wp-testcase/test-xmlrpc-api/test_wp_getTerms.php	(revision 0)
@@ -0,0 +1,79 @@
+<?php
+include_once(ABSPATH . 'wp-admin/includes/admin.php');
+include_once(ABSPATH . WPINC . '/class-IXR.php');
+include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
+
+class TestXMLRPCServer_wp_getTerms extends WPTestCase {
+	var $user_ids = array();
+	var $term;
+
+	function setUp() {
+		parent::setUp();
+		// keep track of users we create
+		$this->user_ids = array();
+		$this->term_ids = array();
+		$this->_flush_roles();
+
+		$this->orig_users = get_users_of_blog();
+		add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+
+		$this->_make_user( 'subscriber', 'subscriber', 'subscriber' );
+		$this->_make_user( 'contributor', 'contributor', 'contributor' );
+		$this->_make_user( 'author', 'author', 'author' );
+		$this->_make_user( 'editor', 'editor', 'editor' );
+
+		$this->term = wp_insert_term( 'term' , 'category' );
+
+		$this->myxmlrpcserver = new wp_xmlrpc_server();
+	}
+
+	function tearDown() {
+		parent::tearDown();
+		// delete any users that were created during tests
+		foreach ( $this->user_ids as $id )
+			wp_delete_user($id);
+
+		wp_delete_term( $this->term['term_id'], 'category' );
+
+		remove_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+	}
+
+	function _flush_roles() {
+		// we want to make sure we're testing against the db, not just in-memory data
+		// this will flush everything and reload it from the db
+		unset( $GLOBALS['wp_user_roles'] );
+	}
+
+	function test_invalid_username_password() {
+		$result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'username', 'password' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+	}
+
+	function test_empty_taxonomy() {
+		$result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'subscriber', 'subscriber' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
+	}
+
+	function test_invalid_taxonomy() {
+		$result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'subscriber', 'subscriber', 'not_existing' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
+	}
+
+	function test_incapable_user() {
+		$result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'subscriber', 'subscriber', 'category' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 401, $result->code );
+		$this->assertEquals( __( 'You are not allowed to assign terms in this taxonomy.' ), $result->message );
+	}
+
+
+	function test_terms_validated() {
+		$result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $this->term['term_id'] ) );
+		$this->assertNotInstanceOf( 'IXR_Error', $result );
+	}
+}
\ No newline at end of file
Index: wp-testcase/test-xmlrpc-api/test_wp_editTerm.php
===================================================================
--- wp-testcase/test-xmlrpc-api/test_wp_editTerm.php	(revision 0)
+++ wp-testcase/test-xmlrpc-api/test_wp_editTerm.php	(revision 0)
@@ -0,0 +1,142 @@
+<?php
+include_once(ABSPATH . 'wp-admin/includes/admin.php');
+include_once(ABSPATH . WPINC . '/class-IXR.php');
+include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
+
+class TestXMLRPCServer_wp_editTerm extends WPTestCase {
+	var $user_ids = array();
+	var $term_ids = array();
+
+	var $parent_term;
+	var $child_term;
+	var $post_tag;
+
+	function setUp() {
+		parent::setUp();
+		// keep track of users we create
+		$this->user_ids = array();
+		$this->_flush_roles();
+
+		$this->orig_users = get_users_of_blog();
+		add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+
+		$this->_make_user( 'subscriber', 'subscriber', 'subscriber' );
+		$this->_make_user( 'contributor', 'contributor', 'contributor' );
+		$this->_make_user( 'author', 'author', 'author' );
+		$this->_make_user( 'editor', 'editor', 'editor' );
+
+		$this->parent_term = wp_insert_term( 'parent' , 'category' );
+		$this->child_term = wp_insert_term( 'child' , 'category' );
+		$this->post_tag = wp_insert_term( 'test' , 'post_tag' );
+
+		$this->myxmlrpcserver = new wp_xmlrpc_server();
+	}
+
+	function tearDown() {
+		parent::tearDown();
+		// delete any users that were created during tests
+		foreach ($this->user_ids as $id)
+			wp_delete_user($id);
+
+		wp_delete_term( $this->parent_term['term_id'], 'category' );
+		wp_delete_term( $this->child_term['term_id'], 'category' );
+		wp_delete_term( $this->post_tag['term_id'], 'post_tag' );
+
+		remove_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+	}
+
+	function _flush_roles() {
+		// we want to make sure we're testing against the db, not just in-memory data
+		// this will flush everything and reload it from the db
+		unset( $GLOBALS['wp_user_roles'] );
+	}
+
+
+	function test_invalid_username_password() {
+		$result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'username', 'password' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+	}
+
+	function test_empty_taxonomy() {
+		$result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
+	}
+
+	function test_invalid_taxonomy() {
+		$result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', $this->parent_term['term_id'], array( 'taxonomy' => 'not_existing' ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
+	}
+
+	function test_incapable_user() {
+		$result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', $this->parent_term['term_id'], array( 'taxonomy' => 'category' ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 401, $result->code );
+		$this->assertEquals( __( 'You are not allowed to edit terms in this taxonomy.' ), $result->message );
+	}
+
+	function test_term_not_exists() {
+		$result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', 9999, array( 'taxonomy' => 'category' ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 404, $result->code );
+		$this->assertEquals(  __( 'Invalid term ID.' ), $result->message );
+	}
+
+	function test_empty_term() {
+		$result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', '', array( 'taxonomy' => 'category' ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 500, $result->code );
+		$this->assertEquals( __('Empty Term'), $result->message );
+	}
+
+	function test_empty_term_name() {
+		$result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->parent_term['term_id'], array( 'taxonomy' => 'category', 'name' => '' ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'The term name cannot be empty.' ), $result->message );
+	}
+
+	function test_parent_for_nonhierarchical() {
+		$result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->post_tag['term_id'], array( 'taxonomy' => 'post_tag', 'parent' => $this->parent_term['term_id'] ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'This taxonomy is not hierarchical.' ), $result->message );
+	}
+
+	function test_parent_empty() {
+		$result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->child_term['term_id'], array( 'taxonomy' => 'category', 'parent' => '', 'name' => 'test' ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 500, $result->code );
+		$this->assertEquals( __('Empty Term'), $result->message );
+	}
+
+	function test_parent_invalid() {
+		$result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->child_term['term_id'], array( 'taxonomy' => 'category', 'parent' => 'dasda', 'name' => 'test' ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 500, $result->code );
+	}
+
+	function test_parent_not_existing() {
+		$result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->child_term['term_id'], array( 'taxonomy' => 'category', 'parent' => 9999, 'name' => 'test' ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'Parent term does not exist.' ), $result->message );
+	}
+
+	function test_parent_duplicate_slug() {
+		$result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->child_term['term_id'], array( 'taxonomy' => 'category', 'slug' => 'parent' ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 500, $result->code );
+		$this->assertEquals( htmlspecialchars( sprintf( __('The slug &#8220;%s&#8221; is already in use by another term'), 'parent' ) ), $result->message );
+	}
+
+	function test_edit_all_fields() {
+		$fields = array( 'taxonomy' => 'category', 'name' => 'Child 2', 'parent' => $this->parent_term['term_id'], 'description' => 'Child term', 'slug' => 'child_2' );
+		$result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->child_term['term_id'], $fields ) );
+		$this->assertNotInstanceOf( 'IXR_Error', $result );
+	}
+}
\ No newline at end of file
Index: wp-testcase/test-xmlrpc-api/test_wp_getTaxonomy.php
===================================================================
--- wp-testcase/test-xmlrpc-api/test_wp_getTaxonomy.php	(revision 0)
+++ wp-testcase/test-xmlrpc-api/test_wp_getTaxonomy.php	(revision 0)
@@ -0,0 +1,74 @@
+<?php
+include_once(ABSPATH . 'wp-admin/includes/admin.php');
+include_once(ABSPATH . WPINC . '/class-IXR.php');
+include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
+
+class TestXMLRPCServer_wp_getTaxonomy extends WPTestCase {
+	var $user_ids = array();
+
+	function setUp() {
+		parent::setUp();
+		// keep track of users we create
+		$this->user_ids = array();
+		$this->term_ids = array();
+		$this->_flush_roles();
+
+		$this->orig_users = get_users_of_blog();
+		add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+
+		$this->_make_user( 'subscriber', 'subscriber', 'subscriber' );
+		$this->_make_user( 'contributor', 'contributor', 'contributor' );
+		$this->_make_user( 'author', 'author', 'author' );
+		$this->_make_user( 'editor', 'editor', 'editor' );
+
+		$this->myxmlrpcserver = new wp_xmlrpc_server();
+	}
+
+	function tearDown() {
+		parent::tearDown();
+		// delete any users that were created during tests
+		foreach ( $this->user_ids as $id )
+			wp_delete_user($id);
+
+		remove_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+	}
+
+	function _flush_roles() {
+		// we want to make sure we're testing against the db, not just in-memory data
+		// this will flush everything and reload it from the db
+		unset( $GLOBALS['wp_user_roles'] );
+	}
+
+	function test_invalid_username_password() {
+		$result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'username', 'password' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+	}
+
+	function test_empty_taxonomy() {
+		$result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'subscriber', 'subscriber' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
+	}
+
+	function test_invalid_taxonomy() {
+		$result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'subscriber', 'subscriber', 'not_existing' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
+	}
+
+	function test_incapable_user() {
+		$result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'subscriber', 'subscriber', 'category' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 401, $result->code );
+		$this->assertEquals( __( 'You are not allowed to assign terms in this taxonomy.' ), $result->message );
+	}
+
+
+	function test_taxonomy_validated() {
+		$result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', 'category' ) );
+		$this->assertNotInstanceOf( 'IXR_Error', $result );
+	}
+}
\ No newline at end of file
Index: wp-testcase/test-xmlrpc-api/test_wp_newTerm.php
===================================================================
--- wp-testcase/test-xmlrpc-api/test_wp_newTerm.php	(revision 0)
+++ wp-testcase/test-xmlrpc-api/test_wp_newTerm.php	(revision 0)
@@ -0,0 +1,129 @@
+<?php
+include_once(ABSPATH . 'wp-admin/includes/admin.php');
+include_once(ABSPATH . WPINC . '/class-IXR.php');
+include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
+
+class TestXMLRPCServer_wp_newTerm extends WPTestCase {
+	var $user_ids = array();
+	var $term_ids = array();
+	var $parent_term;
+
+	function setUp() {
+		parent::setUp();
+		// keep track of users we create
+		$this->user_ids = array();
+		$this->term_ids = array();
+		$this->_flush_roles();
+
+		$this->orig_users = get_users_of_blog();
+		add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+
+		$this->_make_user( 'subscriber', 'subscriber', 'subscriber' );
+		$this->_make_user( 'contributor', 'contributor', 'contributor' );
+		$this->_make_user( 'author', 'author', 'author' );
+		$this->_make_user( 'editor', 'editor', 'editor' );
+
+		$this->parent_term = wp_insert_term( 'parent' , 'category' );
+
+		$this->myxmlrpcserver = new wp_xmlrpc_server();
+	}
+
+	function tearDown() {
+		parent::tearDown();
+		// delete any users that were created during tests
+		foreach ( $this->user_ids as $id )
+			wp_delete_user($id);
+
+		wp_delete_term( $this->parent_term['term_id'], 'category' );
+		foreach ( $this->term_ids as $term_id )
+			wp_delete_term( $term_id, 'category' );
+
+		remove_filter( 'pre_option_enable_xmlrpc', '__return_true' );
+	}
+
+	function _flush_roles() {
+		// we want to make sure we're testing against the db, not just in-memory data
+		// this will flush everything and reload it from the db
+		unset( $GLOBALS['wp_user_roles'] );
+	}
+
+	function test_invalid_username_password() {
+		$result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'username', 'password' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+	}
+
+	function test_empty_taxonomy() {
+		$result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'subscriber', 'subscriber' ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
+	}
+
+	function test_invalid_taxonomy() {
+		$result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'subscriber', 'subscriber', array( 'taxonomy' => 'not_existing' ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'Invalid taxonomy.' ), $result->message );
+	}
+
+	function test_incapable_user() {
+		$result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'subscriber', 'subscriber', array( 'taxonomy' => 'category' ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 401, $result->code );
+		$this->assertEquals( __( 'You are not allowed to create terms in this taxonomy.' ), $result->message );
+	}
+
+	function test_empty_term() {
+		$result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'name' => '' ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'The term name cannot be empty.' ), $result->message );
+	}
+
+	function test_parent_for_nonhierarchical() {
+		$result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'post_tag', 'parent' => $this->parent_term['term_id'], 'name' => 'test' ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'This taxonomy is not hierarchical.' ), $result->message );
+	}
+
+	function test_parent_invalid() {
+		$result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => 'dasda', 'name' => 'test' ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 500, $result->code );
+	}
+
+	function test_parent_not_existing() {
+		$result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => 9999, 'name' => 'test' ) ) );
+		$this->assertInstanceOf( 'IXR_Error', $result );
+		$this->assertEquals( 403, $result->code );
+		$this->assertEquals( __( 'Parent term does not exist.' ), $result->message );
+	}
+
+
+	function test_add_term() {
+		$result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'name' => 'test' ) ) );
+		$this->assertNotInstanceOf( 'IXR_Error', $result );
+		$this->assertStringMatchesFormat( '%d', $result );
+
+		$term_ids[] = $result;
+	}
+
+	function test_add_term_with_parent() {
+		$result  = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'category', 'parent' => $this->parent_term['term_id'], 'name' => 'test' ) ) );
+		$this->assertNotInstanceOf( 'IXR_Error', $result );
+		$this->assertStringMatchesFormat( '%d', $result );
+
+		$term_ids[] = $result;
+	}
+
+	function test_add_term_with_all() {
+		$taxonomy = array( 'taxonomy' => 'category', 'parent' => $this->parent_term['term_id'], 'name' => 'test_all', 'description' => 'Test all', 'slug' => 'test_all' );
+		$result  = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', $taxonomy ) );
+		$this->assertNotInstanceOf( 'IXR_Error', $result );
+		$this->assertStringMatchesFormat( '%d', $result );
+
+		$term_ids[] = $result;
+	}
+}
\ No newline at end of file
