XML-RPC: add a unit test for mw.editPost.

See #16980.


git-svn-id: https://develop.svn.wordpress.org/trunk@34682 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-09-29 04:27:57 +00:00
parent 948ab018d2
commit 9bffa403dd

View File

@ -255,4 +255,27 @@ class Tests_XMLRPC_mw_editPost extends WP_XMLRPC_UnitTestCase {
$this->assertTrue( $result );
$this->assertEquals( $date_string, $fetched_post->post_date );
}
/**
* @ticket 16980
*/
function test_empty_not_null() {
$editor_id = $this->make_user_by_role( 'editor' );
$post_id = $this->factory->post->create( array(
'post_title' => 'Title',
'post_author' => $editor_id,
'tags_input' => 'taco'
) );
$tags1 = get_the_tags( $post_id );
$this->assertNotEmpty( $tags1 );
$this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', array(
'mt_keywords' => ''
) ) );
$tags2 = get_the_tags( $post_id );
$this->assertEmpty( $tags2 );
}
}