From 9bffa403dd3148db654e1f8823fa82c80a3de07b Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 29 Sep 2015 04:27:57 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/xmlrpc/mw/editPost.php | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/phpunit/tests/xmlrpc/mw/editPost.php b/tests/phpunit/tests/xmlrpc/mw/editPost.php index a147990d58..1cadb0caf0 100644 --- a/tests/phpunit/tests/xmlrpc/mw/editPost.php +++ b/tests/phpunit/tests/xmlrpc/mw/editPost.php @@ -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 ); + } }