Make WordPress Core


Ignore:
Timestamp:
09/29/2015 04:27:57 AM (9 years ago)
Author:
wonderboymusic
Message:

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

See #16980.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/xmlrpc/mw/editPost.php

    r34681 r34682  
    256256        $this->assertEquals( $date_string, $fetched_post->post_date );
    257257    }
     258
     259    /**
     260     * @ticket 16980
     261     */
     262    function test_empty_not_null() {
     263        $editor_id = $this->make_user_by_role( 'editor' );
     264
     265        $post_id = $this->factory->post->create( array(
     266            'post_title' => 'Title',
     267            'post_author' => $editor_id,
     268            'tags_input' => 'taco'
     269        ) );
     270
     271        $tags1 = get_the_tags( $post_id );
     272        $this->assertNotEmpty( $tags1 );
     273
     274        $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', array(
     275            'mt_keywords' => ''
     276        ) ) );
     277
     278        $tags2 = get_the_tags( $post_id );
     279        $this->assertEmpty( $tags2 );
     280    }
    258281}
Note: See TracChangeset for help on using the changeset viewer.