WordPress.org

Make WordPress Core

Ticket #22320: NewGetRecentPostsTest.patch

File NewGetRecentPostsTest.patch, 640 bytes (added by redsweater, 6 years ago)

New unit test confirming the fixed behavior for the getRecentPosts call.

  • xmlrpc/mw/getRecentPosts.php

     
    2929                $this->assertEquals( 403, $result->code );
    3030        }
    3131
     32        function test_no_editing_privileges() {
     33                $this->make_user_by_role( 'subscriber' );
     34
     35                $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'subscriber', 'subscriber' ) );
     36                $this->assertInstanceOf( 'IXR_Error', $result );
     37                $this->assertEquals( 401, $result->code );
     38        }
     39       
    3240        function test_no_editable_posts() {
    3341                wp_delete_post( $this->post_id );
    3442