Index: tests/phpunit/tests/functions.php
===================================================================
--- tests/phpunit/tests/functions.php	(revisão 36743)
+++ tests/phpunit/tests/functions.php	(cópia de trabalho)
@@ -716,5 +716,66 @@
 		$GLOBALS['previousday'] = '17.09.15';
 		the_date( 'Y', 'before ', ' after', false );
 		$this->assertEquals( '', ob_get_clean() );
+	}	
+
+	/**	 
+	 * @ticket 35993
+	 */
+	private function _xml_rpc_request_fixture($title = '', $category = '') {
+		$str_title = !empty($title)?"<title>$title</title>":'';
+		$str_category = !empty($title)?"<category>$category</category>":'';
+
+		$XML_RPC = <<<RPC
+			<?xml version="1.0"?>
+			<methodResponse>
+			  <params>
+			    <param>
+			      $str_title
+			      $str_category
+			    </param>
+			  </params>
+			</methodResponse>
+RPC;
+		return $XML_RPC;
 	}
+
+
+	/**
+	 * @ticket 35993
+	 */
+	function test_xmlrpc_getposttitle() {
+		$title = "This is the title";
+		$xml_rpc_with_title = $this->_xml_rpc_request_fixture($title);
+		$this->assertEquals($title, xmlrpc_getposttitle($xml_rpc_with_title), "The title doesn't match with $title");
+
+		global $post_default_title;
+		$post_default_title = "This is the default title";
+		$xml_rpc_with_out_title = $this->_xml_rpc_request_fixture;
+		$this->assertEquals($post_default_title, xmlrpc_getposttitle($xml_rpc_with_out_title), "The title doesn't match with $post_default_title");
+	}
+
+	/**
+	 * @ticket 35993
+	 */
+	function test_xmlrpc_getpostcategory() {
+		$category = "Foo";
+		$xml_rpc_with_category = $this->_xml_rpc_request_fixture('x title', $category);
+		$this->assertEquals(array($category), xmlrpc_getpostcategory($xml_rpc_with_category), "The category doesn't match");
+
+		global $post_default_category;
+		$post_default_category = array("Default category");
+		$xml_rpc_with_out_category = $this->_xml_rpc_request_fixture;
+		$this->assertEquals($post_default_category, xmlrpc_getpostcategory($xml_rpc_with_out_category), "The category doesn't match");
+	}
+
+	/**
+	 * @ticket 35993
+	 */
+	function test_xmlrpc_removepostdata() {
+		$xml_rpc = $this->_xml_rpc_request_fixture('Foo', 'X Category');
+		$xml_rpc_without_post_data = xmlrpc_removepostdata($xml_rpc);
+
+		$this->assertEquals(0, preg_match( '/<title>(.+?)<\/title>/is', $xml_rpc_without_post_data, $matchcat), "The title shouldn't exists after the xmlrpc_removepostdata call");
+		$this->assertEquals(0, preg_match( '/<category>(.+?)<\/category>/is', $xml_rpc_without_post_data, $matchcat), "No category should exist after the xmlrpc_removepostdata call");		
+	}
 }
