WordPress.org

Make WordPress Core

Changeset 594 in tests


Ignore:
Timestamp:
03/29/12 12:57:20 (2 years ago)
Author:
westi
Message:

XMLRPC: Add a mw_editPost test case for the inability to change post_type using this api.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test-xmlrpc-api/test_mw_editPost.php

    r593 r594  
    170170        $this->assertEquals( $post3['description'], $out->post_content ); 
    171171        $this->assertEquals( $post4['mt_excerpt'], $out->post_excerpt ); 
    172  
    173172    } 
    174173 
     174    // Not allowed since [19914] 
     175    function test_change_post_type() { 
     176        $contributor_id = get_user_by( 'login', 'contributor' )->ID; 
     177        $post = array( 'post_title' => 'Title', 'post_author' => $contributor_id ); 
     178        $post_id = wp_insert_post( $post ); 
     179 
     180        $post2 = array( 'post_type' => 'page' ); 
     181        $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'contributor', 'contributor', $post2 ) ); 
     182        $this->assertInstanceOf( 'IXR_Error', $result ); 
     183        $this->assertEquals( $result->code, 401 ); 
     184    } 
    175185} 
Note: See TracChangeset for help on using the changeset viewer.