WordPress.org

Make WordPress Core

Changeset 908 in tests


Ignore:
Timestamp:
07/18/12 22:35:42 (22 months ago)
Author:
maxcutler
Message:

XMLRPC: Added test for missing post fields, see WP#21308.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/xmlrpc/wp/getPost.php

    r904 r908  
    116116        $this->assertEquals( $post_modified_gmt, $result['post_modified_gmt']->getTimestamp() ); 
    117117    } 
     118 
     119    /** 
     120     * @ticket 21308 
     121     */ 
     122    function test_valid_page() { 
     123        $this->make_user_by_role( 'editor' ); 
     124 
     125        $parent_page_id = $this->factory->post->create( array( 'post_type' => 'page' ) ); 
     126        $child_page_id = $this->factory->post->create( array( 
     127            'post_type' => 'page', 
     128            'post_parent' => $parent_page_id, 
     129            'menu_order' => 2 
     130        ) ); 
     131 
     132        $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'editor', 'editor', $child_page_id ) ); 
     133        $this->assertNotInstanceOf( 'IXR_Error', $result ); 
     134 
     135        $this->assertInternalType( 'string', $result['post_id'] ); 
     136        $this->assertInternalType( 'string', $result['post_parent'] ); 
     137        $this->assertInternalType( 'int', $result['menu_order'] ); 
     138        $this->assertInternalType( 'string', $result['guid'] ); 
     139        $this->assertInternalType( 'string', $result['post_mime_type'] ); 
     140 
     141        $this->assertEquals( 'page', $result['post_type'] ); 
     142        $this->assertEquals( $parent_page_id, $result['post_parent'] ); 
     143        $this->assertEquals( 2, $result['menu_order'] ); 
     144    } 
    118145} 
Note: See TracChangeset for help on using the changeset viewer.